MultiOracleTrieWithDiff

Struct MultiOracleTrieWithDiff 

Source
pub struct MultiOracleTrieWithDiff {
    pub multi_trie: MultiTrie<RangeInfo>,
    pub oracle_numeric_infos: OracleNumericInfo,
}
Expand description

Data structure used to store adaptor signature information for numerical outcome DLC with multiple oracles where some difference between the outcomes of each oracle can be supported.

Fields§

§multi_trie: MultiTrie<RangeInfo>

The underlying trie of trie

§oracle_numeric_infos: OracleNumericInfo

Information on the numeric representation used by each oracle.

Implementations§

Source§

impl MultiOracleTrieWithDiff

Source

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

Create a new MultiOracleTrieWithDiff

Source§

impl MultiOracleTrieWithDiff

Source

pub fn dump(&self) -> MultiOracleTrieWithDiffDump

Dump the content of the trie for the purpose of serialization.

Source

pub fn from_dump(dump: MultiOracleTrieWithDiffDump) -> MultiOracleTrieWithDiff

Restore a trie from a dump.

Trait Implementations§

Source§

impl Clone for MultiOracleTrieWithDiff

Source§

fn clone(&self) -> MultiOracleTrieWithDiff

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, MultiOracleTrieWithDiffIter<'a>> for MultiOracleTrieWithDiff

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) -> MultiOracleTrieWithDiffIter<'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