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

pub struct LockscriptCommitment(_);

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

Trait Implementations

impl AsMut<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment[src]

impl AsRef<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment[src]

impl Borrow<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment[src]

impl BorrowMut<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment[src]

impl Clone for LockscriptCommitment[src]

impl Debug for LockscriptCommitment[src]

impl Default for LockscriptCommitment[src]

impl Deref for LockscriptCommitment[src]

type Target = Self::Inner

The resulting type after dereferencing.

impl DerefMut for LockscriptCommitment[src]

impl Display for LockscriptCommitment[src]

impl<MSG> EmbedCommitVerify<MSG> for LockscriptCommitment where
    MSG: AsRef<[u8]>, 
[src]

type Container = LockscriptContainer

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

type Error = Error

Error type that may be reported during [commit_embed] procedure

pub fn embed_commit(
    container: &mut Self::Container,
    msg: &MSG
) -> Result<Self, Self::Error>
[src]

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

impl Eq for LockscriptCommitment[src]

impl From<LockScript> for LockscriptCommitment[src]

impl Hash for LockscriptCommitment[src]

impl LowerHex for LockscriptCommitment[src]

impl Ord for LockscriptCommitment[src]

impl PartialEq<LockscriptCommitment> for LockscriptCommitment[src]

impl PartialOrd<LockscriptCommitment> for LockscriptCommitment[src]

impl StructuralEq for LockscriptCommitment[src]

impl StructuralPartialEq for LockscriptCommitment[src]

impl UpperHex for LockscriptCommitment[src]

impl Wrapper for LockscriptCommitment[src]

type Inner = LockScript

Inner type wrapped by the current newtype

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToHex for T where
    T: LowerHex
[src]

pub fn to_hex(&self) -> String[src]

Outputs the hash in hexadecimal form

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.