Skip to main content

Overview

This guide shows you how to work with imported Bitcoin wallets for common operations. Once you’ve imported a private key, you can perform various wallet operations directly.

Prerequisites

Step 1: Check Wallet Balance

Check the Bitcoin balance of your imported wallet using a block explorer API:

Step 2: Get UTXOs for Your Wallet

Before sending transactions, you need to fetch available UTXOs:

Step 3: Sign Transactions with Imported Wallet

Use your imported wallet to sign Bitcoin transactions. walletMetadata is the object that importPrivateKey returned. Store it when you import the wallet and load it here, because signing needs its derivation path and address type. bitcoinjs-lib v7 uses bigint for satoshi amounts.

Step 4: Sign Messages with Imported Wallet

Sign messages for authentication or data integrity:

Complete Example: Sign and Send from Imported Wallet

List All Bitcoin Wallets

Get all Bitcoin wallets associated with your account:
In @dynamic-labs-wallet/node-btc 1.1.52, getBitcoinWallets() can fail with a 404 error, because it requests the project’s users list. The wallets it returns also don’t include the full walletMetadata, so keep the walletMetadata you stored when you created or imported each wallet for signing.

Best Practices

  1. Balance Checking: Verify sufficient balance before sending transactions
  2. UTXO Management: Select UTXOs efficiently to minimize fees
  3. Fee Estimation: Use current fee rates from mempool APIs
  4. Error Handling: Implement proper error handling for all wallet operations
  5. Security: Never expose sensitive information in server-side code
  6. Network Selection: Use testnet for development and testing

Fee Estimation

Estimate appropriate fees before sending:

Next Steps

Last modified on October 27, 2026