pub struct Commitment(/* private fields */);Expand description
Final LNPBP-4 commitment value.
Represents tagged hash of the merkle root of super::MerkleTree and
super::MerkleBlock.
Implementations§
Source§impl Commitment
impl Commitment
pub fn copy_from_slice(slice: &[u8]) -> Result<Commitment, FromSliceError>
Methods from Deref<Target = Array<u8, 32>>§
Trait Implementations§
Source§impl Borrow<[u8]> for Commitment
impl Borrow<[u8]> for Commitment
Source§impl Clone for Commitment
impl Clone for Commitment
Source§fn clone(&self) -> Commitment
fn clone(&self) -> Commitment
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 CommitmentId for Commitment
impl CommitmentId for Commitment
Source§impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for ScriptBuf
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for ScriptBuf
Source§type Commitment = ScriptBuf
type Commitment = ScriptBuf
Commitment type produced as a result of
Self::convolve_commit
procedure.Source§type CommitError = TapretKeyError
type CommitError = TapretKeyError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.Source§fn convolve_commit(
&self,
supplement: &TapretProof,
msg: &Commitment,
) -> Result<(ScriptBuf, TapretProof), <ScriptBuf as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(ScriptBuf, TapretProof), <ScriptBuf as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
Takes the
supplement to unparse the content of this container (self)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment to the message msg. Read moreSource§impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for Transaction
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for Transaction
Source§type Commitment = Transaction
type Commitment = Transaction
Commitment type produced as a result of
Self::convolve_commit
procedure.Source§type CommitError = TapretError
type CommitError = TapretError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.Source§fn convolve_commit(
&self,
supplement: &TapretProof,
msg: &Commitment,
) -> Result<(Transaction, TapretProof), <Transaction as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(Transaction, TapretProof), <Transaction as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
Takes the
supplement to unparse the content of this container (self)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment to the message msg. Read moreSource§impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for TxOut
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for TxOut
Source§type Commitment = TxOut
type Commitment = TxOut
Commitment type produced as a result of
Self::convolve_commit
procedure.Source§type CommitError = TapretKeyError
type CommitError = TapretKeyError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.Source§fn convolve_commit(
&self,
supplement: &TapretProof,
msg: &Commitment,
) -> Result<(TxOut, TapretProof), <TxOut as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(TxOut, TapretProof), <TxOut as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
Takes the
supplement to unparse the content of this container (self)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment to the message msg. Read moreSource§impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for XOnlyPublicKey
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for XOnlyPublicKey
Source§type Commitment = TweakedPublicKey
type Commitment = TweakedPublicKey
Commitment type produced as a result of
Self::convolve_commit
procedure.Source§type CommitError = TapretKeyError
type CommitError = TapretKeyError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.Source§fn convolve_commit(
&self,
supplement: &TapretPathProof,
msg: &Commitment,
) -> Result<(TweakedPublicKey, TapretProof), <XOnlyPublicKey as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
fn convolve_commit( &self, supplement: &TapretPathProof, msg: &Commitment, ) -> Result<(TweakedPublicKey, TapretProof), <XOnlyPublicKey as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
Takes the
supplement to unparse the content of this container (self)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment to the message msg. Read moreSource§impl ConvolveCommitProof<Commitment, ScriptBuf, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, ScriptBuf, TapretFirst> for TapretProof
Source§type Suppl = TapretProof
type Suppl = TapretProof
Supplement is a part of the proof data provided during commitment
procedure.
Source§fn restore_original(&self, _: &ScriptBuf) -> ScriptBuf
fn restore_original(&self, _: &ScriptBuf) -> ScriptBuf
Restores the original source before the commitment from the supplement
(the
self) and commitment.Source§fn extract_supplement(
&self,
) -> &<TapretProof as ConvolveCommitProof<Commitment, ScriptBuf, TapretFirst>>::Suppl
fn extract_supplement( &self, ) -> &<TapretProof as ConvolveCommitProof<Commitment, ScriptBuf, TapretFirst>>::Suppl
Extract supplement from the proof.
Source§fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
Verifies commitment using proof (the
self) against the message. Read moreSource§impl ConvolveCommitProof<Commitment, Transaction, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, Transaction, TapretFirst> for TapretProof
Source§type Suppl = TapretProof
type Suppl = TapretProof
Supplement is a part of the proof data provided during commitment
procedure.
Source§fn restore_original(&self, commitment: &Transaction) -> Transaction
fn restore_original(&self, commitment: &Transaction) -> Transaction
Restores the original source before the commitment from the supplement
(the
self) and commitment.Source§fn extract_supplement(
&self,
) -> &<TapretProof as ConvolveCommitProof<Commitment, Transaction, TapretFirst>>::Suppl
fn extract_supplement( &self, ) -> &<TapretProof as ConvolveCommitProof<Commitment, Transaction, TapretFirst>>::Suppl
Extract supplement from the proof.
Source§fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
Verifies commitment using proof (the
self) against the message. Read moreSource§impl ConvolveCommitProof<Commitment, TxOut, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, TxOut, TapretFirst> for TapretProof
Source§type Suppl = TapretProof
type Suppl = TapretProof
Supplement is a part of the proof data provided during commitment
procedure.
Source§fn restore_original(&self, commitment: &TxOut) -> TxOut
fn restore_original(&self, commitment: &TxOut) -> TxOut
Restores the original source before the commitment from the supplement
(the
self) and commitment.Source§fn extract_supplement(
&self,
) -> &<TapretProof as ConvolveCommitProof<Commitment, TxOut, TapretFirst>>::Suppl
fn extract_supplement( &self, ) -> &<TapretProof as ConvolveCommitProof<Commitment, TxOut, TapretFirst>>::Suppl
Extract supplement from the proof.
Source§fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
Verifies commitment using proof (the
self) against the message. Read moreSource§impl ConvolveCommitProof<Commitment, XOnlyPublicKey, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, XOnlyPublicKey, TapretFirst> for TapretProof
Source§type Suppl = TapretPathProof
type Suppl = TapretPathProof
Supplement is a part of the proof data provided during commitment
procedure.
Source§fn restore_original(&self, _: &TweakedPublicKey) -> XOnlyPublicKey
fn restore_original(&self, _: &TweakedPublicKey) -> XOnlyPublicKey
Restores the original source before the commitment from the supplement
(the
self) and commitment.Source§fn extract_supplement(
&self,
) -> &<TapretProof as ConvolveCommitProof<Commitment, XOnlyPublicKey, TapretFirst>>::Suppl
fn extract_supplement( &self, ) -> &<TapretProof as ConvolveCommitProof<Commitment, XOnlyPublicKey, TapretFirst>>::Suppl
Extract supplement from the proof.
Source§fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
fn verify(
&self,
msg: &Msg,
commitment: &<Source as ConvolveCommit<Msg, Self, Protocol>>::Commitment,
) -> Result<(), ConvolveVerifyError>where
Self: VerifyEq,
Verifies commitment using proof (the
self) against the message. Read moreSource§impl Debug for Commitment
impl Debug for Commitment
Source§impl Deref for Commitment
impl Deref for Commitment
Source§impl<'de> Deserialize<'de> for Commitment
impl<'de> Deserialize<'de> for Commitment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Commitment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Commitment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Commitment
impl Display for Commitment
Source§impl EmbedCommitProof<Commitment, ScriptBuf, OpretFirst> for OpretProof
impl EmbedCommitProof<Commitment, ScriptBuf, OpretFirst> for OpretProof
Source§fn restore_original_container(
&self,
commit_container: &ScriptBuf,
) -> Result<ScriptBuf, EmbedVerifyError<OpretError>>
fn restore_original_container( &self, commit_container: &ScriptBuf, ) -> Result<ScriptBuf, EmbedVerifyError<OpretError>>
Restores original container before the commitment from the proof data
and a container containing embedded commitment. Read more
Source§impl EmbedCommitProof<Commitment, Transaction, OpretFirst> for OpretProof
impl EmbedCommitProof<Commitment, Transaction, OpretFirst> for OpretProof
Source§fn restore_original_container(
&self,
commit_container: &Transaction,
) -> Result<Transaction, EmbedVerifyError<OpretError>>
fn restore_original_container( &self, commit_container: &Transaction, ) -> Result<Transaction, EmbedVerifyError<OpretError>>
Restores original container before the commitment from the proof data
and a container containing embedded commitment. Read more
Source§impl EmbedCommitProof<Commitment, TxOut, OpretFirst> for OpretProof
impl EmbedCommitProof<Commitment, TxOut, OpretFirst> for OpretProof
Source§fn restore_original_container(
&self,
commit_container: &TxOut,
) -> Result<TxOut, EmbedVerifyError<OpretError>>
fn restore_original_container( &self, commit_container: &TxOut, ) -> Result<TxOut, EmbedVerifyError<OpretError>>
Restores original container before the commitment from the proof data
and a container containing embedded commitment. Read more
Source§impl EmbedCommitVerify<Commitment, OpretFirst> for ScriptBuf
impl EmbedCommitVerify<Commitment, OpretFirst> for ScriptBuf
Source§type Proof = OpretProof
type Proof = OpretProof
The proof of the commitment produced as a result of
Self::embed_commit procedure. This proof is later used
for verification.Source§type CommitError = OpretError
type CommitError = OpretError
Error type that may be reported during
Self::embed_commit procedure.
It may also be returned from Self::verify (wrapped into
EmbedVerifyError in case the proof data are invalid and the
commitment can’t be re-created.Source§fn embed_commit(
&mut self,
msg: &Commitment,
) -> Result<<ScriptBuf as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <ScriptBuf as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
fn embed_commit( &mut self, msg: &Commitment, ) -> Result<<ScriptBuf as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <ScriptBuf as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
Creates a commitment to a message and embeds it into the provided
container (
self) by mutating it and returning commitment proof. Read moreSource§impl EmbedCommitVerify<Commitment, OpretFirst> for Transaction
impl EmbedCommitVerify<Commitment, OpretFirst> for Transaction
Source§type Proof = OpretProof
type Proof = OpretProof
The proof of the commitment produced as a result of
Self::embed_commit procedure. This proof is later used
for verification.Source§type CommitError = OpretError
type CommitError = OpretError
Error type that may be reported during
Self::embed_commit procedure.
It may also be returned from Self::verify (wrapped into
EmbedVerifyError in case the proof data are invalid and the
commitment can’t be re-created.Source§fn embed_commit(
&mut self,
msg: &Commitment,
) -> Result<<Transaction as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <Transaction as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
fn embed_commit( &mut self, msg: &Commitment, ) -> Result<<Transaction as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <Transaction as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
Creates a commitment to a message and embeds it into the provided
container (
self) by mutating it and returning commitment proof. Read moreSource§impl EmbedCommitVerify<Commitment, OpretFirst> for TxOut
impl EmbedCommitVerify<Commitment, OpretFirst> for TxOut
Source§type Proof = OpretProof
type Proof = OpretProof
The proof of the commitment produced as a result of
Self::embed_commit procedure. This proof is later used
for verification.Source§type CommitError = OpretError
type CommitError = OpretError
Error type that may be reported during
Self::embed_commit procedure.
It may also be returned from Self::verify (wrapped into
EmbedVerifyError in case the proof data are invalid and the
commitment can’t be re-created.Source§fn embed_commit(
&mut self,
msg: &Commitment,
) -> Result<<TxOut as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <TxOut as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
fn embed_commit( &mut self, msg: &Commitment, ) -> Result<<TxOut as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <TxOut as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
Creates a commitment to a message and embeds it into the provided
container (
self) by mutating it and returning commitment proof. Read moreSource§impl FromHex for Commitment
impl FromHex for Commitment
Source§fn from_byte_iter<I>(iter: I) -> Result<Commitment, Error>
fn from_byte_iter<I>(iter: I) -> Result<Commitment, Error>
Produce an object from a byte iterator
Source§impl FromStr for Commitment
impl FromStr for Commitment
Source§impl Hash for Commitment
impl Hash for Commitment
Source§impl Index<RangeFull> for Commitment
impl Index<RangeFull> for Commitment
Source§impl Index<RangeInclusive<usize>> for Commitment
impl Index<RangeInclusive<usize>> for Commitment
Source§type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
Source§fn index(
&self,
index: RangeInclusive<usize>,
) -> &<Commitment as Index<RangeInclusive<usize>>>::Output
fn index( &self, index: RangeInclusive<usize>, ) -> &<Commitment as Index<RangeInclusive<usize>>>::Output
Performs the indexing (
container[index]) operation. Read moreSource§impl Index<RangeToInclusive<usize>> for Commitment
impl Index<RangeToInclusive<usize>> for Commitment
Source§type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
type Output = <Array<u8, 32> as Index<RangeInclusive<usize>>>::Output
The returned type after indexing.
Source§fn index(
&self,
index: RangeToInclusive<usize>,
) -> &<Commitment as Index<RangeToInclusive<usize>>>::Output
fn index( &self, index: RangeToInclusive<usize>, ) -> &<Commitment as Index<RangeToInclusive<usize>>>::Output
Performs the indexing (
container[index]) operation. Read moreSource§impl Index<usize> for Commitment
impl Index<usize> for Commitment
Source§impl LowerHex for Commitment
impl LowerHex for Commitment
Source§impl Ord for Commitment
impl Ord for Commitment
Source§fn cmp(&self, other: &Commitment) -> Ordering
fn cmp(&self, other: &Commitment) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Commitment
impl PartialEq for Commitment
Source§impl PartialOrd for Commitment
impl PartialOrd for Commitment
Source§impl Serialize for Commitment
impl Serialize for Commitment
Source§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,
Serialize this value into the given Serde serializer. Read more
Source§impl StrictDecode for Commitment
impl StrictDecode for Commitment
fn strict_decode(reader: &mut impl TypedRead) -> Result<Commitment, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for Commitment
impl StrictDumb for Commitment
fn strict_dumb() -> Commitment
Source§impl StrictEncode for Commitment
impl StrictEncode for Commitment
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for Commitment
impl StrictTuple for Commitment
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Commitment
impl StrictType for Commitment
const STRICT_LIB_NAME: &'static str = LIB_NAME_COMMIT_VERIFY
fn strict_name() -> Option<TypeName>
Source§impl UpperHex for Commitment
impl UpperHex for Commitment
Source§impl Wrapper for Commitment
impl Wrapper for Commitment
Source§fn from_inner(inner: <Commitment as Wrapper>::Inner) -> Commitment
fn from_inner(inner: <Commitment as Wrapper>::Inner) -> Commitment
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &<Commitment as Wrapper>::Inner
fn as_inner(&self) -> &<Commitment as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
Source§fn into_inner(self) -> <Commitment as Wrapper>::Inner
fn into_inner(self) -> <Commitment as Wrapper>::Inner
Unwraps the wrapper returning the inner type
impl Copy for Commitment
impl Eq for Commitment
impl StrictProduct for Commitment
impl StructuralPartialEq for Commitment
Auto Trait Implementations§
impl Freeze for Commitment
impl RefUnwindSafe for Commitment
impl Send for Commitment
impl Sync for Commitment
impl Unpin for Commitment
impl UnwindSafe for Commitment
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<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
impl<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
Source§fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
Constructs a wrapper type around a byte array.
Source§fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
Constructs a byte array from the slice. Errors if the slice length
doesn’t match
LEN constant generic.Source§fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
Constructs a byte array from the slice. Expects the slice length
doesn’t match
LEN constant generic. Read moreSource§fn to_byte_array(&self) -> [u8; LEN]
fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.