pub struct OffboardForfeitContext<'a, V> { /* private fields */ }Implementations§
Source§impl<'a, V> OffboardForfeitContext<'a, V>
Construction and validation work with any VTXO representation: they
only need the number of inputs, so the client can validate a prepared
offboard tx with bare wallet vtxos. Only signing and finishing need
the full form; those methods are bounded on AsRef<Vtxo<Full>> below.
impl<'a, V> OffboardForfeitContext<'a, V>
Construction and validation work with any VTXO representation: they
only need the number of inputs, so the client can validate a prepared
offboard tx with bare wallet vtxos. Only signing and finishing need
the full form; those methods are bounded on AsRef<Vtxo<Full>> below.
Sourcepub fn new(input_vtxos: &'a [V], offboard_tx: &'a Transaction) -> Self
pub fn new(input_vtxos: &'a [V], offboard_tx: &'a Transaction) -> Self
Create a new OffboardForfeitContext with given input VTXOs and offboard tx
Number of input VTXOs must not be zero.
Sourcepub fn validate_offboard_tx(
&self,
req: &OffboardRequest,
) -> Result<(), InvalidOffboardTxError>
pub fn validate_offboard_tx( &self, req: &OffboardRequest, ) -> Result<(), InvalidOffboardTxError>
Validate offboard tx matches offboard request
Source§impl<'a, V> OffboardForfeitContext<'a, V>
impl<'a, V> OffboardForfeitContext<'a, V>
Sourcepub fn user_sign_forfeits(
&self,
keys: &[impl Borrow<Keypair>],
server_nonces: &[PublicNonce],
) -> OffboardForfeitSignatures
pub fn user_sign_forfeits( &self, keys: &[impl Borrow<Keypair>], server_nonces: &[PublicNonce], ) -> OffboardForfeitSignatures
Sign forfeit transactions for all input VTXOs
Provide the keys for the VTXO pubkeys in order of the input VTXOs.
Panics if wrong number of keys or nonces, or if Self::validate_offboard_tx would have returned an error. The caller should call that method first.
Sourcepub fn finish(
&self,
server_key: &Keypair,
connector_key: &Keypair,
server_pub_nonces: &[PublicNonce],
server_sec_nonces: Vec<SecretNonce>,
user_pub_nonces: &[PublicNonce],
user_partial_sigs: &[PartialSignature],
) -> Result<OffboardForfeitResult, InvalidUserPartialSignatureError>
pub fn finish( &self, server_key: &Keypair, connector_key: &Keypair, server_pub_nonces: &[PublicNonce], server_sec_nonces: Vec<SecretNonce>, user_pub_nonces: &[PublicNonce], user_partial_sigs: &[PartialSignature], ) -> Result<OffboardForfeitResult, InvalidUserPartialSignatureError>
Check the user’s partial signatures and finalize the forfeit txs
Panics if wrong number of secret nonces or partial signatures, or if Self::validate_offboard_tx would have returned an error. The caller should call that method first.