Overview
This guide shows you how to sign Bitcoin transactions using Dynamic’s Node SDK. Bitcoin uses PSBTs (Partially Signed Bitcoin Transactions) for signing. You create a PSBT, pass it tosignTransaction() as a base64 string, and receive the signed PSBT back.
Prerequisites
Step 1: Install Dependencies
Step 2: Create and Sign a PSBT
The approach for signing transactions depends on how you created your wallet:With Automatic Backup (Recommended)
If you created your wallet withbackUpToClientShareService: true, you can sign directly without retrieving key shares:
With Manual Backup
If you created your wallet withbackUpToClientShareService: false, you must retrieve and provide external key shares:
- If your wallet was created without a password, omit the
passwordparameter - If your wallet was created with a password, you must provide it for all operations
- The password parameter is always optional in the API, but required if the wallet is password-protected