[][src]Trait lnpbp::single_use_seals::SingleUseSeal

pub trait SingleUseSeal {
    type Witness;
    type Definition;
    type Error: Error;
    fn close(&self, over: &Message) -> Result<Self::Witness, Self::Error>;
fn verify(
        &self,
        msg: &Message,
        witness: &Self::Witness
    ) -> Result<bool, Self::Error>; }

Single-use-seal trait: implement for a data structure that will hold a single-use-seal definition and will contain a business logic for closing seal over some message and verification of the seal against the message and witness.

NB: It is recommended that single-use-seal instances to be instantiated not by a constructor, but by a factory, i.e. "seal medium": data type implementing either SealMedium or [AsyncSealMedium] traits.

Associated Types

type Witness

Associated type for the witness produced by the single-use-seal close procedure

type Definition

Type that contains seal definition

type Error: Error

Closing and verification errors

Loading content...

Required methods

fn close(&self, over: &Message) -> Result<Self::Witness, Self::Error>

NB: Closing of the seal MUST not change the internal state of the seal itself; all the data produced by the process must be placed into the returned Witness type

fn verify(
    &self,
    msg: &Message,
    witness: &Self::Witness
) -> Result<bool, Self::Error>

Loading content...

Implementors

impl<'a, RESOLVER> SingleUseSeal for TxoutSeal<'a, RESOLVER> where
    RESOLVER: TxResolve
[src]

type Witness = Witness

type Definition = OutPoint

type Error = Error

Loading content...