MultiOracleTrie

Struct MultiOracleTrie 

Source
pub struct MultiOracleTrie { /* private fields */ }
Expand description

Data structure used to store adaptor signature information for numerical outcome DLC with t of n oracles where at least t oracles need to sign the same outcome for the contract to be able to close.

Implementations§

Source§

impl MultiOracleTrie

Source

pub fn dump(&self) -> MultiOracleTrieDump

Dump the trie information.

Source

pub fn from_dump(dump: MultiOracleTrieDump) -> MultiOracleTrie

Recover a MultiOracleTrie from a dump.

Source

pub fn look_up( &self, paths: &[(usize, Vec<usize>)], ) -> Option<(RangeInfo, Vec<(usize, Vec<usize>)>)>

Lookup for nodes whose path is either equal or a prefix of path.

Source

pub fn new( oracle_numeric_infos: &OracleNumericInfo, threshold: usize, ) -> Result<Self, Error>

Creates a new MultiOracleTrie

Trait Implementations§

Source§

impl Clone for MultiOracleTrie

Source§

fn clone(&self) -> MultiOracleTrie

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> DlcTrie<'a, MultiOracleTrieIter<'a>> for MultiOracleTrie

Source§

fn generate( &mut self, adaptor_index_start: usize, outcomes: &[RangePayout], ) -> Result<Vec<TrieIterInfo>, Error>

Generate the trie using the provided outcomes and oracle information, calling the provided callback with the CET index and adaptor point for each adaptor signature.
Source§

fn iter(&'a self) -> MultiOracleTrieIter<'a>

Returns an iterator to this trie.
Source§

fn generate_verify( &'a mut self, secp: &Secp256k1<All>, fund_pubkey: &PublicKey, funding_script_pubkey: &Script, fund_output_value: Amount, outcomes: &[RangePayout], cets: &[Transaction], precomputed_points: &[Vec<Vec<PublicKey>>], adaptor_sigs: &[EcdsaAdaptorSignature], adaptor_index_start: usize, ) -> Result<usize, Error>

Generate the trie while verifying the provided adaptor signatures.
Source§

fn generate_sign( &'a mut self, secp: &Secp256k1<All>, fund_privkey: &SecretKey, funding_script_pubkey: &Script, fund_output_value: Amount, outcomes: &[RangePayout], cets: &[Transaction], precomputed_points: &[Vec<Vec<PublicKey>>], adaptor_index_start: usize, ) -> Result<Vec<EcdsaAdaptorSignature>, Error>

Generate the trie while creating the set of adaptor signatures.
Source§

fn verify( &'a self, secp: &Secp256k1<All>, fund_pubkey: &PublicKey, funding_script_pubkey: &Script, fund_output_value: Amount, adaptor_sigs: &[EcdsaAdaptorSignature], cets: &[Transaction], precomputed_points: &[Vec<Vec<PublicKey>>], ) -> Result<usize, Error>

Verify that the provided signatures are valid with respect to the information stored in the trie.
Source§

fn sign( &'a self, secp: &Secp256k1<All>, fund_privkey: &SecretKey, funding_script_pubkey: &Script, fund_output_value: Amount, cets: &[Transaction], precomputed_points: &[Vec<Vec<PublicKey>>], ) -> Result<Vec<EcdsaAdaptorSignature>, Error>

Produce the set of adaptor signatures for the trie.

Auto Trait Implementations§

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> 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V