Skip to main content
With Privy, you can create Bitcoin segwit and taproot wallets and sign over transactions and any other arbitrary input. See the Tier 2 section for more details.

Signing transaction inputs

Bitcoin uses the UTXO model, where each transaction consumes one or more inputs and produces one or more outputs. To sign a transaction using Privy, use Privy’s raw sign functionality to sign each input hash, and then add the signature(s) to the transaction.

Segwit

Segwit (SegWit v0) wallets use the ECDSA signing algorithm with the secp256k1 curve. Use Privy’s raw sign functionality to sign each input UTXO for your Bitcoin segwit transaction.

Example

The following is an example using the scure/btc-signer library to sign a segwit transaction input.

Taproot

Taproot (SegWit v1) wallets use the Schnorr signing algorithm (BIP-340) with the secp256k1 curve. Privy automatically applies the BIP-341 key tweak when signing with a taproot wallet, so the resulting signature is valid for key-path spends against the wallet’s P2TR output.
Privy’s taproot support uses key-path spending only. The applied tweak assumes no custom Merkle roots or scripts, so script-path spends (e.g., custom Tapscript trees) are not supported at this time.

Example

The following is an example using the scure/btc-signer library to sign a taproot transaction input. Note that taproot uses preimageWitnessV1 for the BIP-341 sighash and attaches the 64-byte Schnorr signature as tapKeySig (rather than partialSig as with segwit).