Struct MultiSig
pub struct MultiSig { /* private fields */ }Expand description
Aggregated signature from members of a multisig committee.
§BCS
The BCS serialized form for this type is defined by the following ABNF:
multisig-aggregated-signature = (vector multisig-member-signature)
u16 ; bitmap
multisig-committeeThere is also a legacy encoding for this type defined as:
legacy-multisig-aggregated-signature = (vector multisig-member-signature)
roaring-bitmap ; bitmap
legacy-multisig-committee
roaring-bitmap = bytes ; where the contents of the bytes are valid
; according to the serialized spec for
; roaring bitmapsSee here for the specification for the serialized format of RoaringBitmaps.
Implementations§
§impl MultisigAggregatedSignature
impl MultisigAggregatedSignature
pub fn new_unchecked(
signatures: Vec<MultisigMemberSignature>,
bitmap: u16,
committee: MultisigCommittee,
) -> MultisigAggregatedSignature
pub fn new_unchecked( signatures: Vec<MultisigMemberSignature>, bitmap: u16, committee: MultisigCommittee, ) -> MultisigAggregatedSignature
Construct a MultisigAggregatedSignature from its raw parts without
validation.
Unlike Self::new, this performs no checks: the committee is not
validated, the bitmap is trusted as-is, and the signatures are not
cross-referenced against the committee. The resulting value may be
rejected by Self::validate or by on-chain verification.
The caller must ensure that:
signaturesappear in the same order as their corresponding members incommittee(e.g. for committee[pk1, pk2, pk3, pk4, pk5], valid signature orderings include[sig1, sig2, sig5]but not[sig2, sig1, sig5]);- each contributing member’s position is set in
bitmap; committeeitself satisfiesMultisigCommittee::validate.
Prefer Self::new when starting from [UserSignature]s; this
constructor is intended for deserialization paths and tests where the
inputs are already known to be well-formed.
pub fn new(
signatures: Vec<UserSignature>,
committee: MultisigCommittee,
) -> Result<MultisigAggregatedSignature, MultisigError>
pub fn new( signatures: Vec<UserSignature>, committee: MultisigCommittee, ) -> Result<MultisigAggregatedSignature, MultisigError>
Construct a MultisigAggregatedSignature from a list of
[UserSignature]s and a MultisigCommittee.
Compared to Self::new_unchecked, this:
- validates
committeeviaMultisigCommittee::validate; - converts each [
UserSignature] into aMultisigMemberSignature; - derives the
bitmapby locating each signature’s public key in the committee, rejecting duplicates and signatures from non-members; - rejects empty signature lists and lists longer than the committee;
- rejects
signaturesthat are not in committee order.
signatures must appear in the same order as their corresponding
members in committee: for committee [pk1, pk2, pk3, pk4, pk5],
[sig1, sig2, sig5] is accepted but [sig2, sig1, sig5] is rejected
with [MultisigError::SignaturesOutOfOrder].
pub fn validate(&self) -> Result<(), MultisigError>
pub fn validate(&self) -> Result<(), MultisigError>
Validates the structural integrity of this aggregated signature.
pub fn signatures(&self) -> &[MultisigMemberSignature]
pub fn signatures(&self) -> &[MultisigMemberSignature]
The list of signatures from committee members
pub fn bitmap(&self) -> u16
pub fn bitmap(&self) -> u16
The bitmap that indicates which committee members provided their signature.
pub fn indices(&self) -> Result<Vec<u8>, MultisigError>
pub fn indices(&self) -> Result<Vec<u8>, MultisigError>
The indices of the committee members that provided their signature,
derived from the bitmap.
For example, a bitmap of 0b10110 yields [1, 2, 4]. Returns
[MultisigError::InvalidBitmap] if the bitmap has bits set beyond the
maximum committee size.
pub fn committee(&self) -> &MultisigCommittee
pub fn committee(&self) -> &MultisigCommittee
The committee that authorizes this aggregated signature.
pub fn contains_signature_scheme(&self, scheme: SignatureScheme) -> bool
pub fn contains_signature_scheme(&self, scheme: SignatureScheme) -> bool
Returns true if any of the member signatures uses the given signature
scheme.
§impl MultisigAggregatedSignature
impl MultisigAggregatedSignature
pub fn from_bytes( bytes: impl AsRef<[u8]>, ) -> Result<MultisigAggregatedSignature, SignatureFromBytesError>
Trait Implementations§
§impl Arbitrary for MultisigAggregatedSignature
Available on crate feature proptest only.
impl Arbitrary for MultisigAggregatedSignature
proptest only.§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.§type Strategy = BoxedStrategy<MultisigAggregatedSignature>
type Strategy = BoxedStrategy<MultisigAggregatedSignature>
Strategy used to generate values of type Self.§fn arbitrary_with(
_args: <MultisigAggregatedSignature as Arbitrary>::Parameters,
) -> <MultisigAggregatedSignature as Arbitrary>::Strategy
fn arbitrary_with( _args: <MultisigAggregatedSignature as Arbitrary>::Parameters, ) -> <MultisigAggregatedSignature as Arbitrary>::Strategy
§impl AsRef<[u8]> for MultisigAggregatedSignature
This initialize the underlying bytes representation of
MultisigAggregatedSignature.
It encodes MultisigAggregatedSignature as the MultiSig flag (0x03)
concat with the bcs bytes of MultisigAggregatedSignature i.e. flag || bcs_bytes(multiSig).
impl AsRef<[u8]> for MultisigAggregatedSignature
This initialize the underlying bytes representation of
MultisigAggregatedSignature.
It encodes MultisigAggregatedSignature as the MultiSig flag (0x03)
concat with the bcs bytes of MultisigAggregatedSignature i.e. flag || bcs_bytes(multiSig).
Source§impl AuthenticatorTrait for MultiSig
impl AuthenticatorTrait for MultiSig
fn verify_claims<T>(
&self,
intent_message: &IntentMessage<T>,
multisig_address: IotaAddress,
verify_params: &VerifyParams,
) -> Result<(), IotaError>where
T: Serialize,
§impl Clone for MultisigAggregatedSignature
impl Clone for MultisigAggregatedSignature
§fn clone(&self) -> MultisigAggregatedSignature
fn clone(&self) -> MultisigAggregatedSignature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MultisigAggregatedSignature
impl Debug for MultisigAggregatedSignature
§impl<'de> Deserialize<'de> for MultisigAggregatedSignature
impl<'de> Deserialize<'de> for MultisigAggregatedSignature
§fn deserialize<D>(
deserializer: D,
) -> Result<MultisigAggregatedSignature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MultisigAggregatedSignature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl From<MultisigAggregatedSignature> for GenericSignature
impl From<MultisigAggregatedSignature> for GenericSignature
Source§fn from(v: MultiSig) -> GenericSignature
fn from(v: MultiSig) -> GenericSignature
§impl FromStr for MultisigAggregatedSignature
impl FromStr for MultisigAggregatedSignature
§impl Hash for MultisigAggregatedSignature
impl Hash for MultisigAggregatedSignature
§impl PartialEq for MultisigAggregatedSignature
impl PartialEq for MultisigAggregatedSignature
§impl Serialize for MultisigAggregatedSignature
impl Serialize for MultisigAggregatedSignature
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Eq for MultisigAggregatedSignature
Auto Trait Implementations§
impl !Freeze for MultisigAggregatedSignature
impl RefUnwindSafe for MultisigAggregatedSignature
impl Send for MultisigAggregatedSignature
impl Sync for MultisigAggregatedSignature
impl Unpin for MultisigAggregatedSignature
impl UnsafeUnpin for MultisigAggregatedSignature
impl UnwindSafe for MultisigAggregatedSignature
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for A
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> Base32Len for T
impl<T> Base32Len for T
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> ToBase32 for T
impl<T> ToBase32 for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)