A tool to help migrate Bitcoin wallets by transferring UTXOs one-to-one to new addresses derived from the destination wallet's xpub.
Each UTXO is sent to a unique receive address on the destination wallet. UTXOs are not consolidated, except when:
- They share the same address (automatic grouping)
- They are surrounded by
[]brackets in the UTXO file
Export your UTXO list as a CSV file. The expected format matches Sparrow's export:
Date (UTC),Output,Address,Label,Value
2024-12-14 06:40:21,7c87ca...:2,tb1qt35r...,label,0.00333454To consolidate specific UTXOs into one transaction, wrap them with brackets:
[
2024-12-14 06:40:21,7c87ca...:2,tb1qt35r...,,0.00333454
2024-12-14 06:40:21,af378d...:1,tb1q5ecv...,,0.00003000
]Fill in the following fields:
# Path to the exported UTXO CSV file
utxo_file = "your-utxos.csv"
# Network: mainnet or testnet
network = "testnet"
[source_wallet]
# Seed words of the wallet you are migrating from
seed = "word1 word2 ... word12"
# Optional BIP39 passphrase (leave empty or omit if none)
passphrase = ""
# Max addresses to derive when searching for UTXO private keys (default: 2000)
address_limit = 2000
[destination_wallet]
# xpub of the receiving wallet
xpub = "tpub..."
# Address type: segwit, taproot, legacy, or p2sh
type = "segwit"
# First address index to use (default: 0)
initial_index = 0
[transaction]
# Fee rate in sat/vb (minimum: 0.10, default: 1)
fee_rate = 1.03
# Random fee variation in basis points (default: 0)
fee_variation = 50Download the binary for your platform from the releases page. Place config.toml and your UTXO CSV file alongside the binary, then run it.
This produces two files:
raw-txs.txt— raw transaction hex (one per line)tx-report.txt— summary report with fees and amounts
npm install
npm run pkgAlways verify the generated transactions before broadcasting. For example, make sure the destination addresses are what you expect.
Important warning about legacy (P2PKH) wallets: since this program runs offline, it has to fully trust the UTXO CSV file and cannot check if the UTXO value is correct. This is not a problem for segwit (including taproot) UTXOs, because the values are signed, but for legacy UTXOs, you have to make sure the values are correct or part of the UTXO could be wasted in fees. Sparrow will export the CSV file with correct values, but keep in mind this warning if you're editing the CSV file!
This software comes with no warranty. You are solely responsible for verifying that the transactions are correct. Bugs could result in loss of funds.
This project is free to use, copy, and modify. The author is not responsible for any bugs or issues that may cause financial loss. Use at your own risk.