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
Mutably borrows from an owned value. Read more
Returns the “default value” for a type. Read more
Function implements commitment procedure according to LNPBP-2.
LNPBP-2 Specification extract:
- The provided script MUST be parsed with Miniscript parser; if the parser fails the procedure MUST fail.
- 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.
- if a public key hash is met (
- 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.
- 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
type Container = LockscriptContainer
type Container = LockscriptContainer
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
Performs the conversion.
Performs the conversion.
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
type Inner = LockScript
type Inner = LockScript
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
Auto Trait Implementations
impl RefUnwindSafe for LockscriptCommitment
impl Send for LockscriptCommitment
impl Sync for LockscriptCommitment
impl Unpin for LockscriptCommitment
impl UnwindSafe for LockscriptCommitment
Blanket Implementations
Mutably borrows from an owned value. Read more