Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Dynamic’s Node SDK provides comprehensive support for Bitcoin blockchain operations, including wallet creation, transaction signing (PSBT), message signing (BIP-322), and key management. The SDK implements Multi-Party Computation (MPC) for enhanced security.Key Features
- MPC Wallet Creation: Create secure Bitcoin wallets with threshold signature schemes
- Multiple Address Types: Support for Legacy, SegWit, Native SegWit, and Taproot addresses
- Transaction Signing: Sign PSBTs (Partially Signed Bitcoin Transactions) without exposing private keys
- Message Signing: Sign messages using BIP-322 standard
- Key Import/Export: Import existing private keys (WIF format) and export wallet data
- Multiple Security Models: Choose between different threshold signature schemes
Available Threshold Signature Schemes
TWO_OF_TWO: Maximum security - requires both server and Dynamic infrastructureTWO_OF_THREE: Balanced security and availability - requires 2 out of 3 shares
Quick Start
Core Functions
Wallet Management
createWalletAccount()- Create new Bitcoin walletimportPrivateKey()- Import existing private key (WIF format)getBitcoinWallets()- Get all Bitcoin walletsderiveAccountAddress()- Derive Bitcoin address from a public key
Signing Operations
signMessage()- Sign messages using BIP-322signTransaction()- Sign PSBTs (Partially Signed Bitcoin Transactions)
Key Management
exportPrivateKey()- Export wallet private key in WIF formatofflineExportPrivateKey()- Export private key from key shares offline
Backup and Recovery
storeEncryptedBackupByWallet()- Store encrypted backuprecoverEncryptedBackupByWallet()- Recover encrypted backuprefreshWalletAccountShares()- Refresh wallet shares
Guides
- Create BTC Wallet - Step-by-step wallet creation
- Import Private Keys - Import existing BTC keys
- Sign Transactions - Sign Bitcoin PSBTs
- Sign Messages - Sign messages with your wallet
- Use Imported Wallets - Work with imported wallets
- Complete Example - Full working example
Prerequisites
Before using the BTC SDK, ensure you have:- Dynamic Project Setup: Set up your Dynamic project
- Environment Configuration: Configure your environment ID and auth token
- BTC Chain Enabled: Enable Bitcoin chain in your Dynamic dashboard
- Dependencies Installed: Install required packages
Installation
Environment Variables
Bitcoin-Specific Concepts
Address Types
Bitcoin supports multiple address types, each with different features:| Address Type | Prefix | Description |
|---|---|---|
| Legacy (P2PKH) | 1... | Original Bitcoin address format |
| SegWit (P2SH) | 3... | Backwards-compatible SegWit |
| Native SegWit (P2WPKH) | bc1q... | Modern, lower fees |
| Taproot (P2TR) | bc1p... | Latest, privacy-enhanced, Schnorr signatures |
Native Unit
Bitcoin uses satoshis as its smallest unit:1 BTC = 100,000,000 satoshis.
Transaction Format
Bitcoin transactions use PSBT (Partially Signed Bitcoin Transactions) for signing. ThesignTransaction() method accepts a PSBT as a base64 string and returns the signed PSBT.
Message Signing
The SDK uses BIP-322 for message signing, which provides a standardized way to sign messages that works across all address types.WIF Format
Private keys are imported and exported in WIF (Wallet Import Format), a base58-encoded format that includes the network and compression flag.Security Considerations
- MPC Architecture: Private keys are never stored in plain text
- Threshold Signing: Multiple parties must collaborate to sign transactions
- Key Share Backup: Use
backUpToClientShareService: truefor secure storage - Password Protection: Implement strong passwords for additional security layers
Network Support
The SDK currently supports Bitcoin Mainnet only. Testnet support is planned for a future release.