Struct dbc::lockscript::LockscriptCommitment[][src]

pub struct LockscriptCommitment(_);
Expand description

LockScript containing public keys which sum is commit to some message according to LNPBP-2

Trait Implementations

Performs the conversion.

Performs the conversion.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Function implements commitment procedure according to LNPBP-2.

LNPBP-2 Specification extract:
  1. The provided script MUST be parsed with Miniscript parser; if the parser fails the procedure MUST fail.
  2. Iterate over all branches of the abstract syntax tree generated by the Miniscript parser, running the following algorithm for each node:
    • if a public key hash is met (pk_h Miniscript command) and it can’t be resolved against known public keys or other public keys extracted from the script, fail the procedure;
    • if a public key is found (pk) add it to the list of the collected public keys;
    • for all other types of Miniscript commands iterate over their branches.
  3. Select unique public keys (i.e. if some public key is repeated in different parts of the script/in different script branches, pick a single instance of it). Compressed and uncompressed versions of the same public key must be treaded as the same public key under this procedure.
  4. If no public keys were found fail the procedure; return the collected keys otherwise.

NB: SUBJECT TO CHANGE UPON RELEASE By “miniscript” we mean usage of rust-miniscript library at commit a5ba1219feb8b5a289c8f12176d632635eb8a959 which may be found on https://github.com/LNP-BP/rust-miniscript/commit/a5ba1219feb8b5a289c8f12176d632635eb8a959

External container type that will be used to host commitment to a message Read more

Error type that may be reported during `EmbedCommitVerify::embed_commit`` procedure Read more

Verifies commitment against the message; default implementation just takes original container, repeats the commitment to the message and check it against the self. Read more

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Formats the value using the given formatter.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Formats the value using the given formatter.

Inner type wrapped by the current newtype

Instantiates wrapper type with the inner data

Returns reference to the inner representation for the wrapper type

Returns a mutable reference to the inner representation for the wrapper type Read more

Unwraps the wrapper returning the inner type

Clones inner data of the wrapped type and return them

Copies the wrapped type

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Outputs the hash in hexadecimal form

Outputs the hash in hexadecimal form

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.