Struct btc_transaction_utils::p2wpk::InputSigner
[−]
[src]
pub struct InputSigner { /* fields omitted */ }
An input signer.
Methods
impl InputSigner
[src]
pub fn new(public_key: PublicKey, network: Network) -> InputSigner
[src]
Creates an input signer for the given public key and network.
pub fn secp256k1_context(&self) -> &Secp256k1
[src]
Returns a reference to the secp256k1 engine, used to execute all signature operations.
pub fn secp256k1_context_mut(&mut self) -> &mut Secp256k1
[src]
Returns a mutable reference to the secp256k1 engine, used to execute all signature operations.
pub fn signature_hash<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V
) -> Sha256dHash
[src]
&mut self,
txin: TxInRef<'a>,
value: V
) -> Sha256dHash
Computes the BIP-143
compliant sighash for a SIGHASH_ALL
signature for the given input.
pub fn sign_input<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V,
secret_key: &SecretKey
) -> Result<InputSignature, Error>
[src]
&mut self,
txin: TxInRef<'a>,
value: V,
secret_key: &SecretKey
) -> Result<InputSignature, Error>
Computes the BIP-143
compliant signature for the given input.
Under the hood this method signs sighash
for the given input with the
given secret key.
pub fn verify_input<'a, 'b, 'c, V, S>(
&self,
txin: TxInRef<'a>,
value: V,
public_key: &PublicKey,
signature: S
) -> Result<(), Error> where
V: Into<UnspentTxOutValue<'b>>,
S: Into<InputSignatureRef<'c>>,
[src]
&self,
txin: TxInRef<'a>,
value: V,
public_key: &PublicKey,
signature: S
) -> Result<(), Error> where
V: Into<UnspentTxOutValue<'b>>,
S: Into<InputSignatureRef<'c>>,
Checks correctness of the signature for the given input.
pub fn spend_input(&self, input: &mut TxIn, signature: InputSignature)
[src]
Collects the witness data for the given transaction input. Thus, the input becomes spent.