Skip to main content

Proof

Struct Proof 

Source
pub struct Proof {
Show 17 fields pub version: u32, pub prev_out: OutPoint, pub block_header: Header, pub block_height: u32, pub anchor_tx: Transaction, pub tx_merkle_proof: TxMerkleProof, pub asset: Asset, pub inclusion_proof: TaprootProof, pub exclusion_proofs: Vec<TaprootProof>, pub split_root_proof: Option<TaprootProof>, pub meta_reveal: Option<MetaReveal>, pub additional_inputs: Vec<File>, pub challenge_witness: Option<Witness>, pub genesis_reveal: Option<GenesisReveal>, pub group_key_reveal: Option<GroupKeyReveal>, pub alt_leaves: Vec<Asset>, pub unknown_odd_types: BTreeMap<u64, Vec<u8>>,
}

Fields§

§version: u32

Version is the version of the state transition proof.

§prev_out: OutPoint

PrevOut is the previous on-chain outpoint of the asset. This outpoint is that of the first on-chain input. Outpoints which correspond to the other inputs can be found in AdditionalInputs.

§block_header: Header

BlockHeader is the current block header committing to the on-chain transaction attempting an asset state transition.

§block_height: u32

BlockHeight is the height of the current block committing to the on-chain transaction attempting an asset state transition.

§anchor_tx: Transaction

AnchorTx is the on-chain transaction attempting the asset state transition.

§tx_merkle_proof: TxMerkleProof

TxMerkleProof is the merkle proof for AnchorTx used to prove its inclusion within BlockHeader.

§asset: Asset

Asset is the resulting asset after its state transition.

§inclusion_proof: TaprootProof

InclusionProof is the TaprootProof proving the new inclusion of the resulting asset within AnchorTx.

§exclusion_proofs: Vec<TaprootProof>

ExclusionProofs is the set of TaprootProofs proving the exclusion of the resulting asset from all other Taproot outputs within AnchorTx.

§split_root_proof: Option<TaprootProof>

SplitRootProof is an optional TaprootProof needed if this asset is the result of a split. SplitRootProof proves inclusion of the root asset of the split.

§meta_reveal: Option<MetaReveal>

MetaReveal is the data that was revealed to prove the derivation of the meta data hash contained in the genesis asset.

NOTE: This field is optional, and can only be specified if the asset above is a genesis asset. If specified, then verifiers should also verify the hashes match up.

§additional_inputs: Vec<File>

AdditionalInputs is a nested full proof for any additional inputs found within the resulting asset.

§challenge_witness: Option<Witness>

ChallengeWitness is an optional virtual transaction witness that serves as an ownership proof for the asset. If this is non-nil, then it is a valid transfer witness for a 1-input, 1-output virtual transaction that spends the asset in this proof and sends it to the NUMS key, to prove that the creator of the proof is able to produce a valid signature to spend the asset.

§genesis_reveal: Option<GenesisReveal>

GenesisReveal is the Genesis information for an asset, that must be provided for minting proofs, and must be empty for non-minting proofs. This allows for derivation of the asset ID. If the asset is part of an asset group, the Genesis information is also used for re-derivation of the asset group key.

§group_key_reveal: Option<GroupKeyReveal>

GroupKeyReveal contains the data required to derive the final tweaked group key for an asset group.

NOTE: This field is mandatory for the group anchor (i.e., the initial minting tranche of an asset group). Subsequent minting tranches require only a valid signature for the previously revealed group key.

§alt_leaves: Vec<Asset>

AltLeaves represent data used to construct an Asset commitment, that was inserted in the output anchor Tap commitment. These data-carrying leaves are used for a purpose distinct from representing individual Taproot Assets.

§unknown_odd_types: BTreeMap<u64, Vec<u8>>

UnknownOddTypes is a map of unknown odd types that were encountered during decoding. This map is used to preserve unknown types that we don’t know of yet, so we can still encode them back when serializing. This enables forward compatibility with future versions of the protocol as it allows new odd (optional) types to be added without breaking old clients that don’t yet fully understand them.

Implementations§

Source§

impl Proof

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Decodes a Proof from a TLV byte slice.

Trait Implementations§

Source§

impl Clone for Proof

Source§

fn clone(&self) -> Proof

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Proof

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Proof

Source§

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 Eq for Proof

Source§

impl PartialEq for Proof

Source§

fn eq(&self, other: &Proof) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Proof

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Proof

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl Send for Proof

§

impl Sync for Proof

§

impl Unpin for Proof

§

impl UnsafeUnpin for Proof

§

impl UnwindSafe for Proof

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.