Skip to main content
Convenience function that combines get_sighash and append_signature for cases where the private key is available in memory.

Signature

Parameters

pczt
Pczt
required
The PCZT to sign
input_index
number
required
Index of the transparent input (0-based)
private_key
string
required
32-byte secp256k1 private key (hex)

Returns

Updated PCZT with the signature added.

Example

When to Use

Use this function when:
  • Private key is available in memory
  • Testing or development
  • Simple single-party transactions
For hardware wallets or HSMs, use get_sighash + append_signature instead.

See Also