Skip to main content
Examples use API client signing.

Signing request types

To sign transactions you build yourself or messages you format yourself, use raw signing.

Wallet

Create a wallet with networkType: "NETWORK_TYPE_BITCOIN". Fund it with BTC for the transfer and fees. Available unspent transaction outputs (UTXOs) cover both; inputs spent by pending transactions are unavailable.

Send BTC

This Bitcoin Mainnet example sends 0.0001 BTC.
amount is an integer string in satoshi: 1 BTC = 100,000,000 satoshi. MPCVault selects the transaction inputs and creates change when needed. Optional networkFee sets an integer fee rate in satoshi per virtual byte (sat/vB). Omit it or set it to "0" to use MPCVault’s default rate. The total fee depends on the transaction size.

Sign and track

Sign the request. The returned txHash is the Bitcoin transaction ID (txid). Query a Bitcoin Mainnet node with getrawtransaction:
Confirmed-transaction lookup by txid requires txindex=1; otherwise add the containing block hash as the third parameter or use a Bitcoin indexer.
  • Match the recipient in result.vout[].scriptPubKey.address and its value to the request. This RPC reports output values in BTC.
  • Wait until result.confirmations reaches your application’s required depth. A mempool transaction is unconfirmed; a missing result alone does not establish failure.