https://github.com/peli-pro/coldcard_address_generator
.
.
.
.
.
.
This litte script will take your coldcard zpub-key and generate a list of receive and change addresses that you can store somewhere for indipendent verification of the addresses wasabi wallet or electrum creates for you (only native segwit / BIP84).
This script is only a litte wrapper around a BIP84 library that can be found here: https://github.com/Anderson-Juhasc/bip84
BEFORE YOU TRUST THIS SCRIPT PLEASE DOUBLE CHECK THAT IT WORKS CORRECTLY, SEE THE LAST SECTION !!!!!
Insert a SD-Card in your Cold-Card
Settings -> Blockchain -> Choose Bitcoin or Testnet: Bitcoin
then
Advanced -> MicroSD Card ->Dump summary
this will create the file public.txt on your sd card.
Open public.txt and get your zpub from the last section with the header:
## For BIP84 (Native Segwit P2PKH): m/84'/0'/{account}'/{change}/{idx}
you need the zpub from the second line (this line ends with ##SLIP-132##
)
(##SLIP-132##
ist not part of the zpub, do not copy it)
You will need to install node.js and git on your system
sudo apt install nodejs npm git
git clone https://github.com/Anderson-Juhasc/bip84.git
npm install bip84 --save
if the last command fails you might have to do: sudo npm install bip84 --save
Install node.js from: https://nodejs.org/en/
Install git from: https://git-scm.com/
Open an elevated command prompt with admin rights:
git clone https://github.com/Anderson-Juhasc/bip84.git
npm install bip84 --save
git clone https://github.com/peli-pro/coldcard_bip84_address_generator.git
then copy generate_bip84_addresses.js
from the coldcard_bip84_address_generator
folder into the bip84
folder.
Run the following command in the the bip84 folder (replace <replace this with your zpub>
with your zpub from the last step)
node generate_bip84_addresses.js <replace this with your zpub>
Example:
node generate_bip84_addresses.js zpub6rRmr7DviwWPPQFZYgpL7cniK2PCiMSMnMDaKTe37nBFHhKuD9uWeUZbrsoib7PChrvmNiw5uoAyamAFmioZx3uo2BVTKHi6YCRJUhZGHAz
This will generate the first 50 receive and change addresses.
Switch your Coldcard to testnet and export the public.txt.
For testnet the required key starts with vpub. Use this key as your zpub.
Testnet addresses should be corret for electrum.
It seems Wasabi wallet uses a different path for generating testnet addresses, so it might bei that they don't match
Please verify yourself that this script generates correct addresses.
- Compare the generated addresses with
- the addresses in your public.txt
- the addresses generated by Wasabi Wallet or Electrum
- Use https://iancoleman.io/bip39/ and generate a NEW mnemonic (DO NOT expose your own mnemonic!).
- make the following settings:
Coin: Bitcoin or Bitcoin Testnet
Derivation Path: choose BIP84
External/Internal: 0
(0 generates receive addresses and 1 generates change addresses)
This will generate a bunch of addresses- Use
Account Extended Public Key
as the zpub value and run this script - Compare the addresses
- Change
External/Internal
to 1 for change addresses - Compare with the change addresses
Why can't you use Ian Colemans BIP39 tool directly?
Because it will only generate the addresses from the mnemonic/private seed or the zprv key (which is pretty dangerous and you could loose your funds). Please don't do it. You bought a coldcard to not expose your private seed to anybody!