Skip to main content

Overview

This comprehensive example demonstrates all available functions in the Dynamic BTC SDK, showing the actual API usage patterns and how to handle common operations.
The SDK supports both Bitcoin Mainnet and Testnet. Use BitcoinNetwork.MAINNET for production and BitcoinNetwork.TESTNET for development and testing.

Complete Example Code

Key API Patterns

1. Wallet Creation

2. Message Signing (BIP-322)

3. Transaction Signing (PSBT)

4. Derive Address

5. Get All Wallets

6. Export Private Key

Available Functions

The BTC SDK provides the following main functions:
  • createWalletAccount() - Create new Bitcoin wallet
  • importPrivateKey() - Import existing private key (WIF format)
  • getBitcoinWallets() - Get all Bitcoin wallets
  • deriveAccountAddress() - Derive Bitcoin address from a public key
  • signMessage() - Sign messages using BIP-322
  • signTransaction() - Sign PSBTs
  • exportPrivateKey() - Export wallet private key in WIF format
  • offlineExportPrivateKey() - Export private key from key shares offline

Error Handling

Always implement proper error handling:

Environment Setup

Make sure you have these environment variables:

Dependencies

Install required packages:

Next Steps

Last modified on July 22, 2026