pub struct MultisigAddress(/* private fields */);Expand description
A canonical address for an M-of-N Falcon-512 committee.
Format: "ms" + hex(SHA3-256(M_byte || N_byte || sorted_pk_0 || ... || sorted_pk_N)[0..20])
The "ms" prefix distinguishes multisig addresses from single-key addresses
at the protocol level.
§Stability
The derivation algorithm is stable and will not change in patch or minor releases. A breaking change to the derivation algorithm will be accompanied by a major version bump and a new prefix.
Implementations§
Source§impl MultisigAddress
impl MultisigAddress
Sourcepub fn derive(public_keys: &[PublicKey], required: usize, total: usize) -> Self
pub fn derive(public_keys: &[PublicKey], required: usize, total: usize) -> Self
Derive the canonical multisig address.
§Parameters
public_keys: The N committee member public keys, in any order. Keys are sorted before hashing, so order does not affect the result.required: M — the required signature count.total: N — the total committee size. Must equalpublic_keys.len().
Sourcepub fn from_string(s: String) -> Self
pub fn from_string(s: String) -> Self
Construct a MultisigAddress from a raw string.
No validation is performed. This is intended for deserializing addresses
that were previously produced by MultisigAddress::derive.
Trait Implementations§
Source§impl AsRef<str> for MultisigAddress
impl AsRef<str> for MultisigAddress
Source§impl Clone for MultisigAddress
impl Clone for MultisigAddress
Source§fn clone(&self) -> MultisigAddress
fn clone(&self) -> MultisigAddress
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultisigAddress
impl Debug for MultisigAddress
Source§impl<'de> Deserialize<'de> for MultisigAddress
impl<'de> Deserialize<'de> for MultisigAddress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MultisigAddress
impl Display for MultisigAddress
Source§impl Hash for MultisigAddress
impl Hash for MultisigAddress
Source§impl PartialEq for MultisigAddress
impl PartialEq for MultisigAddress
Source§impl Serialize for MultisigAddress
impl Serialize for MultisigAddress
impl Eq for MultisigAddress
impl StructuralPartialEq for MultisigAddress
Auto Trait Implementations§
impl Freeze for MultisigAddress
impl RefUnwindSafe for MultisigAddress
impl Send for MultisigAddress
impl Sync for MultisigAddress
impl Unpin for MultisigAddress
impl UnsafeUnpin for MultisigAddress
impl UnwindSafe for MultisigAddress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more