pub struct BoardBuilder<S: BuilderState> {
pub user_pubkey: PublicKey,
pub expiry_height: BlockHeight,
pub server_pubkey: PublicKey,
pub exit_delta: BlockDelta,
/* private fields */
}Expand description
A request for the server to cosign an board vtxo.
An object of this type is created by the user, sent to the server who will cosign the request and return his partial signature (along with public nonce) back to the user so that the user can finish the request and create a Vtxo.
Currently you can only create VTXOs with VtxoPolicy::Pubkey.
Fields§
§user_pubkey: PublicKey§expiry_height: BlockHeight§server_pubkey: PublicKey§exit_delta: BlockDeltaImplementations§
Source§impl<S: BuilderState> BoardBuilder<S>
impl<S: BuilderState> BoardBuilder<S>
Sourcepub fn funding_script_pubkey(&self) -> ScriptBuf
pub fn funding_script_pubkey(&self) -> ScriptBuf
The scriptPubkey to send the board funds to.
Source§impl BoardBuilder<Preparing>
impl BoardBuilder<Preparing>
Sourcepub fn new(
user_pubkey: PublicKey,
expiry_height: BlockHeight,
server_pubkey: PublicKey,
exit_delta: BlockDelta,
) -> BoardBuilder<Preparing>
pub fn new( user_pubkey: PublicKey, expiry_height: BlockHeight, server_pubkey: PublicKey, exit_delta: BlockDelta, ) -> BoardBuilder<Preparing>
Create a new builder to construct a board vtxo.
See module-level documentation for an overview of the board flow.
Sourcepub fn set_funding_details(
self,
amount: Amount,
utxo: OutPoint,
) -> BoardBuilder<CanGenerateNonces>
pub fn set_funding_details( self, amount: Amount, utxo: OutPoint, ) -> BoardBuilder<CanGenerateNonces>
Set the UTXO where the board will be funded and the board amount.
Source§impl BoardBuilder<CanGenerateNonces>
impl BoardBuilder<CanGenerateNonces>
Sourcepub fn generate_user_nonces(self) -> BoardBuilder<CanFinish>
pub fn generate_user_nonces(self) -> BoardBuilder<CanFinish>
Generate user nonces.
Source§impl<S: CanSign> BoardBuilder<S>
impl<S: CanSign> BoardBuilder<S>
pub fn user_pub_nonce(&self) -> &PublicNonce
Source§impl BoardBuilder<ServerCanCosign>
impl BoardBuilder<ServerCanCosign>
Sourcepub fn new_for_cosign(
user_pubkey: PublicKey,
expiry_height: BlockHeight,
server_pubkey: PublicKey,
exit_delta: BlockDelta,
amount: Amount,
utxo: OutPoint,
user_pub_nonce: PublicNonce,
) -> BoardBuilder<ServerCanCosign>
pub fn new_for_cosign( user_pubkey: PublicKey, expiry_height: BlockHeight, server_pubkey: PublicKey, exit_delta: BlockDelta, amount: Amount, utxo: OutPoint, user_pub_nonce: PublicNonce, ) -> BoardBuilder<ServerCanCosign>
This constructor is to be used by the server with the information provided by the user.
Sourcepub fn server_cosign(&self, key: &Keypair) -> BoardCosignResponse
pub fn server_cosign(&self, key: &Keypair) -> BoardCosignResponse
This method is used by the server to cosign the board request.
Returns None if utxo or user_pub_nonce field is not provided.
Source§impl BoardBuilder<CanFinish>
impl BoardBuilder<CanFinish>
Sourcepub fn verify_cosign_response(
&self,
server_cosign: &BoardCosignResponse,
) -> bool
pub fn verify_cosign_response( &self, server_cosign: &BoardCosignResponse, ) -> bool
Validate the server’s partial signature.
Sourcepub fn build_vtxo(
self,
server_cosign: &BoardCosignResponse,
user_key: &Keypair,
) -> Result<Vtxo, IncorrectSigningKeyError>
pub fn build_vtxo( self, server_cosign: &BoardCosignResponse, user_key: &Keypair, ) -> Result<Vtxo, IncorrectSigningKeyError>
Finishes the board request and create a vtxo.