pub enum TapretNodePartner {
LeftNode(TapNodeHash),
RightLeaf(LeafScript),
RightBranch(TapretRightBranch),
}
Expand description
Information proving step of a tapret path in determined way within a given tap tree.
The structure hosts proofs that the right-side partner at the taproot script tree node does not contain an alternative OP-RETURN commitment script.
Variants§
LeftNode(TapNodeHash)
Tapret commitment is on the right side of the tree; i.e the node hashing partner can’t contain an alternative commitment.
RightLeaf(LeafScript)
Single script spending path was present before tapret commitment, which becomes a second leaf at level 1.
RightBranch(TapretRightBranch)
Multiple script spending paths were present; or a single script spending path should be hidden from revealing the script in the proof.
To prove that the 1-st level branch is not a script leafs containing an alternative OP_RETURN commitment we have to reveal the presence of two level 2 structures underneath.
Implementations§
Source§impl TapretNodePartner
impl TapretNodePartner
Sourcepub fn right_branch(a: TapNodeHash, b: TapNodeHash) -> TapretNodePartner
pub fn right_branch(a: TapNodeHash, b: TapNodeHash) -> TapretNodePartner
Constructs right-side tapret branch proof structuring a
and b
children node hashes in the correct consensus order (i.e.
lexicographically).
Sourcepub fn check_no_commitment(&self) -> bool
pub fn check_no_commitment(&self) -> bool
Checks that the sibling data does not contain another tapret commitment.
The check ensures that if the sibling data are present, their first 31
bytes are not equal to TAPRET_SCRIPT_COMMITMENT_PREFIX
, and if
the sibling is another node, the hash of its first child in the proof
is smaller than the hash of the other.
Sourcepub fn check_ordering(&self, other_node: TapNodeHash) -> bool
pub fn check_ordering(&self, other_node: TapNodeHash) -> bool
Checks that the sibling has a correct ordering regarding some other node.
Sourcepub fn tap_node_hash(&self) -> TapNodeHash
pub fn tap_node_hash(&self) -> TapNodeHash
Computes node hash of the partner node defined by this proof.
Trait Implementations§
Source§impl Clone for TapretNodePartner
impl Clone for TapretNodePartner
Source§fn clone(&self) -> TapretNodePartner
fn clone(&self) -> TapretNodePartner
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TapretNodePartner
impl Debug for TapretNodePartner
Source§impl<'de> Deserialize<'de> for TapretNodePartner
impl<'de> Deserialize<'de> for TapretNodePartner
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>,
Source§impl Display for TapretNodePartner
impl Display for TapretNodePartner
Source§impl From<LeafScript> for TapretNodePartner
impl From<LeafScript> for TapretNodePartner
Source§fn from(v: LeafScript) -> Self
fn from(v: LeafScript) -> Self
Source§impl Hash for TapretNodePartner
impl Hash for TapretNodePartner
Source§impl Ord for TapretNodePartner
impl Ord for TapretNodePartner
Source§fn cmp(&self, other: &TapretNodePartner) -> Ordering
fn cmp(&self, other: &TapretNodePartner) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TapretNodePartner
impl PartialEq for TapretNodePartner
Source§impl PartialOrd for TapretNodePartner
impl PartialOrd for TapretNodePartner
Source§impl Serialize for TapretNodePartner
impl Serialize for TapretNodePartner
Source§impl StrictDecode for TapretNodePartner
impl StrictDecode for TapretNodePartner
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for TapretNodePartner
impl StrictDumb for TapretNodePartner
fn strict_dumb() -> Self
Source§impl StrictEncode for TapretNodePartner
impl StrictEncode for TapretNodePartner
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSum for TapretNodePartner
impl StrictSum for TapretNodePartner
const ALL_VARIANTS: &'static [(u8, &'static str)]
fn variant_name(&self) -> &'static str
fn strict_check_variants()
fn variant_name_by_tag(tag: u8) -> Option<VariantName>
fn variant_ord(&self) -> u8
Source§impl StrictType for TapretNodePartner
impl StrictType for TapretNodePartner
const STRICT_LIB_NAME: &'static str = LIB_NAME_BPCORE
fn strict_name() -> Option<TypeName>
Source§impl StrictUnion for TapretNodePartner
impl StrictUnion for TapretNodePartner
fn strict_type_info() -> TypeInfo<Self>
impl Eq for TapretNodePartner
impl StructuralPartialEq for TapretNodePartner
Auto Trait Implementations§
impl Freeze for TapretNodePartner
impl RefUnwindSafe for TapretNodePartner
impl Send for TapretNodePartner
impl Sync for TapretNodePartner
impl Unpin for TapretNodePartner
impl UnwindSafe for TapretNodePartner
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
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
key
and return true
if they are equal.