SignedTreeBuilder

Struct SignedTreeBuilder 

Source
pub struct SignedTreeBuilder<S: BuilderState> {
    pub expiry_height: BlockHeight,
    pub server_pubkey: PublicKey,
    pub exit_delta: BlockDelta,
    pub cosign_pubkey: PublicKey,
    /* private fields */
}
Expand description

A builder for a single party to construct a VTXO tree

For more information, see the module documentation.

Fields§

§expiry_height: BlockHeight§server_pubkey: PublicKey§exit_delta: BlockDelta§cosign_pubkey: PublicKey

The cosign pubkey used to cosign all nodes in the tree

Implementations§

Source§

impl<T: BuilderState> SignedTreeBuilder<T>

Source

pub fn total_required_value(&self) -> Amount

The total value required for the tree to be funded

Source

pub fn funding_script_pubkey(&self) -> ScriptBuf

The scriptPubkey to send the board funds to

Source

pub fn funding_txout(&self) -> TxOut

The TxOut to create in the funding tx

Source§

impl<T: CanSign> SignedTreeBuilder<T>

Source

pub fn user_pub_nonces(&self) -> &[PublicNonce]

Get the user’s public nonces

Source§

impl SignedTreeBuilder<Preparing>

Source

pub fn construct_tree_spec( vtxos: impl IntoIterator<Item = VtxoRequest>, cosign_pubkey: PublicKey, expiry_height: BlockHeight, server_pubkey: PublicKey, server_cosign_pubkey: PublicKey, exit_delta: BlockDelta, ) -> VtxoTreeSpec

Construct the spec to be used in SignedTreeBuilder

Source

pub fn new( vtxos: impl IntoIterator<Item = VtxoRequest>, cosign_pubkey: PublicKey, expiry_height: BlockHeight, server_pubkey: PublicKey, server_cosign_pubkey: PublicKey, exit_delta: BlockDelta, ) -> SignedTreeBuilder<Preparing>

Create a new SignedTreeBuilder

Source

pub fn set_utxo(self, utxo: OutPoint) -> SignedTreeBuilder<CanGenerateNonces>

Set the utxo from which the tree will be created

Source§

impl SignedTreeBuilder<CanGenerateNonces>

Source

pub fn generate_user_nonces( self, cosign_key: &Keypair, ) -> SignedTreeBuilder<CanFinish>

Generate user nonces

Source§

impl SignedTreeBuilder<ServerCanCosign>

Source

pub fn new_for_cosign( vtxos: impl IntoIterator<Item = VtxoRequest>, cosign_pubkey: PublicKey, expiry_height: BlockHeight, server_pubkey: PublicKey, server_cosign_pubkey: PublicKey, exit_delta: BlockDelta, utxo: OutPoint, user_pub_nonces: Vec<PublicNonce>, ) -> SignedTreeBuilder<ServerCanCosign>

Create a new SignedTreeBuilder for the server to cosign

Source

pub fn server_cosign( &self, server_cosign_key: &Keypair, ) -> SignedTreeCosignResponse

The server cosigns the tree nodes

Source§

impl SignedTreeBuilder<CanFinish>

Source

pub fn verify_cosign_response( &self, server_cosign: &SignedTreeCosignResponse, ) -> Result<(), CosignSignatureError>

Validate the server’s partial signatures

Source

pub fn build_tree( self, server_cosign: &SignedTreeCosignResponse, cosign_key: &Keypair, ) -> Result<SignedVtxoTreeSpec, IncorrectSigningKeyError>

Auto Trait Implementations§

§

impl<S> Freeze for SignedTreeBuilder<S>

§

impl<S> RefUnwindSafe for SignedTreeBuilder<S>
where S: RefUnwindSafe,

§

impl<S> Send for SignedTreeBuilder<S>
where S: Send,

§

impl<S> Sync for SignedTreeBuilder<S>
where S: Sync,

§

impl<S> Unpin for SignedTreeBuilder<S>
where S: Unpin,

§

impl<S> UnwindSafe for SignedTreeBuilder<S>
where S: UnwindSafe,

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> 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, 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