pub struct TapretProof {
pub path_proof: TapretPathProof,
pub internal_pk: InternalPk,
}
Expand description
Information proving tapret determinism for a given tapret commitment. Used both in the commitment procedure for PSBTs and in client-side-validation of the commitment.
Fields§
§path_proof: TapretPathProof
A merkle path to the commitment inside the taproot script tree. For
each node it also must hold information about the sibling in form of
TapretNodePartner
.
internal_pk: InternalPk
The internal key used by the taproot output.
We need to keep this information client-side since it can’t be retrieved from the mined transaction.
Implementations§
Source§impl TapretProof
impl TapretProof
Sourcepub fn original_pubkey_script(&self) -> ScriptPubkey
pub fn original_pubkey_script(&self) -> ScriptPubkey
Restores original scripPubkey before deterministic bitcoin commitment applied.
Sourcepub fn verify(
&self,
msg: &Commitment,
tx: &Tx,
) -> Result<(), ConvolveVerifyError>
pub fn verify( &self, msg: &Commitment, tx: &Tx, ) -> Result<(), ConvolveVerifyError>
Verifies tapret commitment agains the proof.
Trait Implementations§
Source§impl Clone for TapretProof
impl Clone for TapretProof
Source§fn clone(&self) -> TapretProof
fn clone(&self) -> TapretProof
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 ConvolveCommit<Commitment, TapretProof, TapretFirst> for InternalPk
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for InternalPk
Source§type Commitment = OutputPk
type Commitment = OutputPk
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<(OutputPk, TapretProof), Self::CommitError>
fn convolve_commit( &self, supplement: &TapretPathProof, msg: &Commitment, ) -> Result<(OutputPk, TapretProof), Self::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 ScriptPubkey
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for ScriptPubkey
Source§type Commitment = ScriptPubkey
type Commitment = ScriptPubkey
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<(ScriptPubkey, TapretProof), Self::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(ScriptPubkey, TapretProof), Self::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 Tx
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for Tx
Source§type Commitment = Tx
type Commitment = Tx
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<(Tx, TapretProof), Self::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(Tx, TapretProof), Self::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), Self::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(TxOut, TapretProof), Self::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, InternalPk, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, InternalPk, 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, _: &OutputPk) -> InternalPk
fn restore_original(&self, _: &OutputPk) -> InternalPk
Restores the original source before the commitment from the supplement
(the
self
) and commitment.Source§fn extract_supplement(&self) -> &Self::Suppl
fn extract_supplement(&self) -> &Self::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, ScriptPubkey, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, ScriptPubkey, 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, _: &ScriptPubkey) -> ScriptPubkey
fn restore_original(&self, _: &ScriptPubkey) -> ScriptPubkey
Restores the original source before the commitment from the supplement
(the
self
) and commitment.Source§fn extract_supplement(&self) -> &Self::Suppl
fn extract_supplement(&self) -> &Self::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, Tx, TapretFirst> for TapretProof
impl ConvolveCommitProof<Commitment, Tx, 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: &Tx) -> Tx
fn restore_original(&self, commitment: &Tx) -> Tx
Restores the original source before the commitment from the supplement
(the
self
) and commitment.Source§fn extract_supplement(&self) -> &Self::Suppl
fn extract_supplement(&self) -> &Self::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) -> &Self::Suppl
fn extract_supplement(&self) -> &Self::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 TapretProof
impl Debug for TapretProof
Source§impl<'de> Deserialize<'de> for TapretProof
impl<'de> Deserialize<'de> for TapretProof
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 Hash for TapretProof
impl Hash for TapretProof
Source§impl Ord for TapretProof
impl Ord for TapretProof
Source§fn cmp(&self, other: &TapretProof) -> Ordering
fn cmp(&self, other: &TapretProof) -> 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 TapretProof
impl PartialEq for TapretProof
Source§impl PartialOrd for TapretProof
impl PartialOrd for TapretProof
Source§impl Serialize for TapretProof
impl Serialize for TapretProof
Source§impl StrictDecode for TapretProof
impl StrictDecode for TapretProof
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDeserialize for TapretProof
impl StrictDeserialize for TapretProof
fn from_strict_serialized<const MAX: usize>( ast_data: Confined<Vec<u8>, 0, MAX>, ) -> Result<Self, DeserializeError>
fn strict_deserialize<const MAX: usize>( read: impl Read, ) -> Result<Self, DeserializeError>
fn strict_deserialize_from_file<const MAX: usize>( path: impl AsRef<Path>, ) -> Result<Self, DeserializeError>
Source§impl StrictDumb for TapretProof
impl StrictDumb for TapretProof
fn strict_dumb() -> Self
Source§impl StrictEncode for TapretProof
impl StrictEncode for TapretProof
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSerialize for TapretProof
impl StrictSerialize for TapretProof
fn strict_serialized_len<const MAX: usize>(&self) -> Result<usize, Error>
fn to_strict_serialized<const MAX: usize>( &self, ) -> Result<Confined<Vec<u8>, 0, MAX>, SerializeError>
fn strict_serialize<const MAX: usize>( &self, write: impl Write, ) -> Result<(), Error>
fn strict_serialize_to_file<const MAX: usize>( &self, path: impl AsRef<Path>, ) -> Result<(), SerializeError>
Source§impl StrictStruct for TapretProof
impl StrictStruct for TapretProof
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for TapretProof
impl StrictType for TapretProof
const STRICT_LIB_NAME: &'static str = LIB_NAME_BPCORE
fn strict_name() -> Option<TypeName>
impl Eq for TapretProof
impl StrictProduct for TapretProof
impl StructuralPartialEq for TapretProof
Auto Trait Implementations§
impl Freeze for TapretProof
impl RefUnwindSafe for TapretProof
impl Send for TapretProof
impl Sync for TapretProof
impl Unpin for TapretProof
impl UnwindSafe for TapretProof
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<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.