pub struct Anchor<D>where
D: Proof,{
pub mpc_proof: MerkleProof,
pub dbc_proof: D,
}Expand description
Anchor is a data structure used in deterministic bitcoin commitments for keeping information about the proof of the commitment in connection to the transaction which contains the commitment, and multi-protocol merkle tree as defined by LNPBP-4.
Fields§
§mpc_proof: MerkleProofStructured multi-protocol LNPBP-4 data the transaction commits to.
dbc_proof: DProof of the DBC commitment.
Implementations§
Source§impl<D> Anchor<D>where
D: Proof,
impl<D> Anchor<D>where
D: Proof,
Sourcepub fn new(mpc_proof: MerkleProof, dbc_proof: D) -> Anchor<D>
pub fn new(mpc_proof: MerkleProof, dbc_proof: D) -> Anchor<D>
Constructs anchor for a given witness transaction id, MPC and DBC proofs.
Source§impl<D> Anchor<D>where
D: Proof,
impl<D> Anchor<D>where
D: Proof,
Sourcepub fn verify(
&self,
protocol_id: impl Into<ProtocolId>,
message: impl Into<Message>,
tx: &Transaction,
) -> Result<Commitment, VerifyError<<D as Proof>::Error>>
pub fn verify( &self, protocol_id: impl Into<ProtocolId>, message: impl Into<Message>, tx: &Transaction, ) -> Result<Commitment, VerifyError<<D as Proof>::Error>>
Verifies that the transaction commits to the anchor and the anchor commits to the given message under the given protocol.
Sourcepub fn convolve(
&self,
protocol_id: impl Into<ProtocolId>,
message: impl Into<Message>,
) -> Result<Commitment, InvalidProof>
pub fn convolve( &self, protocol_id: impl Into<ProtocolId>, message: impl Into<Message>, ) -> Result<Commitment, InvalidProof>
Verifies that the anchor commits to the given message under the given protocol.
Trait Implementations§
Source§impl<'de, D> Deserialize<'de> for Anchor<D>where
D: Proof + Deserialize<'de>,
impl<'de, D> Deserialize<'de> for Anchor<D>where
D: Proof + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Anchor<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Anchor<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<D> Ord for Anchor<D>
impl<D> Ord for Anchor<D>
Source§impl<D> PartialOrd for Anchor<D>where
D: PartialOrd + Proof,
impl<D> PartialOrd for Anchor<D>where
D: PartialOrd + Proof,
Source§impl<D> Serialize for Anchor<D>
impl<D> Serialize for Anchor<D>
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<D> StrictDecode for Anchor<D>where
D: Proof,
impl<D> StrictDecode for Anchor<D>where
D: Proof,
fn strict_decode(reader: &mut impl TypedRead) -> Result<Anchor<D>, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl<D> StrictDumb for Anchor<D>where
D: Proof,
impl<D> StrictDumb for Anchor<D>where
D: Proof,
fn strict_dumb() -> Anchor<D>
Source§impl<D> StrictEncode for Anchor<D>where
D: Proof,
impl<D> StrictEncode for Anchor<D>where
D: Proof,
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl<D> StrictStruct for Anchor<D>where
D: Proof,
impl<D> StrictStruct for Anchor<D>where
D: Proof,
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl<D> StrictType for Anchor<D>where
D: Proof,
impl<D> StrictType for Anchor<D>where
D: Proof,
const STRICT_LIB_NAME: &'static str = LIB_NAME_BPCORE
fn strict_name() -> Option<TypeName>
impl<D> Eq for Anchor<D>
impl<D> StrictProduct for Anchor<D>where
D: Proof,
impl<D> StructuralPartialEq for Anchor<D>where
D: Proof,
Auto Trait Implementations§
impl<D> Freeze for Anchor<D>where
D: Freeze,
impl<D> RefUnwindSafe for Anchor<D>where
D: RefUnwindSafe,
impl<D> Send for Anchor<D>where
D: Send,
impl<D> Sync for Anchor<D>where
D: Sync,
impl<D> Unpin for Anchor<D>where
D: Unpin,
impl<D> UnwindSafe for Anchor<D>where
D: UnwindSafe,
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.