APIs

Developer Docs

signPsbt API method

May 16, 2025

Disclaimer: Leather does not broadcast PSBTs or manage the finalization process. Developers must handle PSBT completion and broadcasting responsibly.

Request the signature and broadcast of a Partially Signed Bitcoin Transaction (PSBT) using the user's selected Leather account.

Method name

signPsbt

Parameters

  • hex: Hex of the PSBT payload for signing

  • allowedSighash: Sighash types allowed (optional)

  • signAtIndex: Index or indices of inputs to sign (optional)

  • network: Network for signing (e.g. testnet, mainnet)

  • account: Index of account (optional, defaults to active)

  • broadcast: Whether to broadcast the signed tx (default: false)

Examples

Sign PSBT

const response = await window.LeatherProvider.request('signPsbt', {
  hex: 'your_psbt_hex_here',
  network: 'testnet',
  broadcast: true
});

Broadcast PSBT manually

import * as btc from '@scure/btc-signer';
const tx = btc.Transaction.fromPSBT(hexToBytes(response.result.hex));
tx.finalize();
await broadcast(tx.hex);

Use case

Use signPsbt for secure, collaborative signing workflows in Bitcoin apps, including multisig coordination, Taproot interactions, and hardware wallet integrations.

Sandbox

Try the signPsbt method in this CodeSandbox environment: 👉 Debug PSBT Signing