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: PublicKeyThe cosign pubkey used to cosign all nodes in the tree
Implementations§
Source§impl<T: BuilderState> SignedTreeBuilder<T>
impl<T: BuilderState> SignedTreeBuilder<T>
Sourcepub fn total_required_value(&self) -> Amount
pub fn total_required_value(&self) -> Amount
The total value required for the tree to be funded
Sourcepub fn funding_script_pubkey(&self) -> ScriptBuf
pub fn funding_script_pubkey(&self) -> ScriptBuf
The scriptPubkey to send the board funds to
Sourcepub fn funding_txout(&self) -> TxOut
pub fn funding_txout(&self) -> TxOut
The TxOut to create in the funding tx
Source§impl<T: CanSign> SignedTreeBuilder<T>
impl<T: CanSign> SignedTreeBuilder<T>
Sourcepub fn user_pub_nonces(&self) -> &[PublicNonce]
pub fn user_pub_nonces(&self) -> &[PublicNonce]
Get the user’s public nonces
Source§impl SignedTreeBuilder<Preparing>
impl SignedTreeBuilder<Preparing>
Sourcepub 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
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
Sourcepub 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>
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
Sourcepub fn set_utxo(self, utxo: OutPoint) -> SignedTreeBuilder<CanGenerateNonces>
pub fn set_utxo(self, utxo: OutPoint) -> SignedTreeBuilder<CanGenerateNonces>
Set the utxo from which the tree will be created
Source§impl SignedTreeBuilder<CanGenerateNonces>
impl SignedTreeBuilder<CanGenerateNonces>
Sourcepub fn generate_user_nonces(
self,
cosign_key: &Keypair,
) -> SignedTreeBuilder<CanFinish>
pub fn generate_user_nonces( self, cosign_key: &Keypair, ) -> SignedTreeBuilder<CanFinish>
Generate user nonces
Source§impl SignedTreeBuilder<ServerCanCosign>
impl SignedTreeBuilder<ServerCanCosign>
Sourcepub 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>
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
Sourcepub fn server_cosign(
&self,
server_cosign_key: &Keypair,
) -> SignedTreeCosignResponse
pub fn server_cosign( &self, server_cosign_key: &Keypair, ) -> SignedTreeCosignResponse
The server cosigns the tree nodes
Source§impl SignedTreeBuilder<CanFinish>
impl SignedTreeBuilder<CanFinish>
Sourcepub fn verify_cosign_response(
&self,
server_cosign: &SignedTreeCosignResponse,
) -> Result<(), CosignSignatureError>
pub fn verify_cosign_response( &self, server_cosign: &SignedTreeCosignResponse, ) -> Result<(), CosignSignatureError>
Validate the server’s partial signatures
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more