0

I have seen the HWI scripts but I am trying to do this while keeping my Coldcard airgapped.

First I create a wallet in bitcoin core with private keys disabled.

I dump the wallet summary onto the coldcard SD card and it outputs:

# Coldcard Wallet Summary File

## Wallet operates on blockchain: Bitcoin Testnet

For BIP44, this is coin_type '1', and internally we use symbol XTN for this blockchain.

## Top-level, 'master' extended public key ('m/'):

tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY

Derived public keys, as may be needed for different systems:


## For Bitcoin Core: m/{account}'/{change}'/{idx}'

m => tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY

... first 5 receive addresses (account=0, change=0):

m/0'/0'/0' => mwokgDX6HQREsFgevxZwKDxmVfDjEqwPuC
m/0'/0'/1' => mwGmYgnd3MDjaTXfp5dgq5YxNtGjfRyTuT
m/0'/0'/2' => mntHLuyhXr6QsVsWstRs3XFHaMXD8AKuLo
m/0'/0'/3' => msU7yGFgbqTJF9n55jYB8e3Hxh4hi7vhhF
m/0'/0'/4' => mjdKAoMcyieEwcscdvrnKzqu4r6bnfQMj1


## For Bitcoin Core (Segregated Witness, P2PKH): m/{account}'/{change}'/{idx}'

m => tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY
# SLIP-132 style
m => vpub5SLqN2bLY4WeZixKds1JXa6Kn4sdmFU5yb6VgScU4mgMPuB7io2wF3FoLwWX4f5CMpbNPKC7b9VGCpmBDHVob4esrb2THH9VV4jmqZ4QqHz

... first 5 receive addresses (account=0, change=0):

m/0'/0'/0' => tb1qk2hk9sdh0akzyc99nx65a2erpuftcek3v4mret
m/0'/0'/1' => tb1q4nfn0gme6yr9fezwlrdzdycfpztswal0j4l38m
m/0'/0'/2' => tb1q2rgcg659h4fte2c6dzljzskyjz5qfftrfwcyv7
m/0'/0'/3' => tb1qsvv9dv4g7uepe5pk0tf3cp7hdgnmtx5hp626ap
m/0'/0'/4' => tb1q952xefka88ep3s8htxgnw0n60a4spqwfppm5mu


## For Electrum (not BIP44): m/{change}/{idx}

m => tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY

... first 5 receive addresses (account=0, change=0):

m/0/0 => mu7NuiLq1PsK7ncvE5cN3YPwU89wCjz4fC
m/0/1 => mvSCNC4w9wBRksZwQsLPL4pyNMbHB8rFKy
m/0/2 => mooEuT4TzKte4yvNxk4T7Du9K9vG1ZfjyK
m/0/3 => mpuSJdR1W3WLEH1FN3KN3Mxye9dBnnJYd6
m/0/4 => miwaFWAkjmAggdFGix4SGiSxaq4zzue78B


## For BIP44 / Electrum: m/44'/1'/{account}'/{change}/{idx}

m/44'/1' => tpubDALcajyQQtb5HRLZ8jAJhVhxbGVY7vSJWfxuYUknNMQDZzjQdWtge5GDNnqw5jB8wCDuDXp1tJQkFbZyE1YmYawBrJZiHeRWfXr7KBQoxUM

... first 5 receive addresses (account=0, change=0):

m/44'/1'/0'/0/0 => n2sEggcZ9vztixvwaEtf9aJPXTze4qcyEK
m/44'/1'/0'/0/1 => mix1rdoLEzR1n7pmfkRLJRL2eCVhoL9xD6
m/44'/1'/0'/0/2 => mwAy5FLgdKzGnjTwUbkpd7Fp97cRKNjY56
m/44'/1'/0'/0/3 => mi5RvZpkR9yKtxLiVwWqYXiHaYzjskSKgF
m/44'/1'/0'/0/4 => mujhjLQ9cpyqNjbv6NAPTUA6HWjBP64HZv


## For BIP49 (P2WPKH-nested-in-P2SH): m/49'/1'/{account}'/{change}/{idx}

m/49'/1' => tpubDBJSfnStqiS6NpVyZjTGpR27FQQG5x6nAKwycydndiNUcuexGYbc5aW5KE9bAKmTWRWQF6ihZySoZHRLZk3hCFGfjS3nUNgkrS29K3Aa635
# SLIP-132 style
m/49'/1' => upub5CS2EYcTgPrCZ8jmcU7JzEQEQNsGGhdDsMo1vEtz9nUwiKYZSMFq4wrq1aC3e6rTVbd5P6R9etZ7DF631nxQv6ma4pDD37a4TJEoPMWrETv

... first 5 receive addresses (account=0, change=0):

m/49'/1'/0'/0/0 => 2NFLZEZVQizq4j1RbPmrM4PDCBVBJT8yz8g
m/49'/1'/0'/0/1 => 2MtnK8YM3trNgW1SGKnHVLxUGQinHJ9gzJN
m/49'/1'/0'/0/2 => 2Muj9cwcCCm6r7qpLxUHe1mRz4D1ikmuGSu
m/49'/1'/0'/0/3 => 2NAwepU6eSdb1c6nnV13SJAqSJEYjbUeNGB
m/49'/1'/0'/0/4 => 2N7bVgw1d1jmipnFL95droVt5JgKvfw9cRr


## For BIP84 (Native Segwit P2PKH): m/84'/1'/{account}'/{change}/{idx}

m/84'/1' => tpubDAZhhJ9SaAKCt2gngU8aA2babxVAM93oBgo2wGknMUDmtLrzvLnynFuAYo4eME3MqWpcTM3DpGL9J45nQw7CA7VroAY8e7v9Zo6r7mddUMS
# SLIP-132 style
m/84'/1' => vpub5WXYZiyvZXGnue7hZZaEXw5Cvu6cUWZjoqAJ1vusFYi82rZqLocmPgv4GM4gpunHEL46LpLEMqnzqJN3agRvgCgMztPynmcwSPP9aYGfxLs

... first 5 receive addresses (account=0, change=0):

m/84'/1'/0'/0/0 => tb1qtymulkjmx26pvq6n45sly2gmttwc4g5vtgzxez
m/84'/1'/0'/0/1 => tb1q4gcq8et9qvjy3cffzqmhr2qtchhvdy9x6v08cd
m/84'/1'/0'/0/2 => tb1qnmw70uefcns626xu4umftmqx8n7wjusxej7k32
m/84'/1'/0'/0/3 => tb1qzdtj4cn6kj3lt3uha9my2skh0a99e0u59tw45r
m/84'/1'/0'/0/4 => tb1q27ysu4ut4v3wv4xsq55wvrlyn7n4xqjfsslz4h

I want to import the BIP84 tpub so I use the BIP84 tpub as provided above.

In bitcoin core I call:

bitcoin-cli getdescriptorinfo "wpkh([18734cbe/84h/1h/0h]tpubDAZhhJ9SaAKCt2gngU8aA2babxVAM93oBgo2wGknMUDmtLrzvLnynFuAYo4eME3MqWpcTM3DpGL9J45nQw7CA7VroAY8e7v9Zo6r7mddUMS
/0/*)"

responseString = {

  "descriptor": "wpkh([18734cbe/84'/1'/0']tpubDAZhhJ9SaAKCt2gngU8aA2babxVAM93oBgo2wGknMUDmtLrzvLnynFuAYo4eME3MqWpcTM3DpGL9J45nQw7CA7VroAY8e7v9Zo6r7mddUMS/0/*)#4c563hxu",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": false

}

bitcoin-cli -rpcwallet=BIP84 importmulti '[{ "desc": "wpkh([18734cbe/84'"'"'/1'"'"'/0'"'"']tpubDAZhhJ9SaAKCt2gngU8aA2babxVAM93oBgo2wGknMUDmtLrzvLnynFuAYo4eME3MqWpcTM3DpGL9J45nQw7CA7VroAY8e7v9Zo6r7mddUMS/0/*)#4c563hxu", "timestamp": "now", "range": [0, 99], "watchonly": true, "label": "Fully Noded Cold Storage", "keypool": true, "internal": false }]' '{"rescan": false}'

result = (
        {
        success = 1;
    }
)

I have tried many combinations but this most reflects the instructions I found here https://github.com/bitcoin-core/HWI/blob/master/docs/bitcoin-core-usage.md

When I call:

bitcoin-cli -rpcwallet=BIP84 getnewaddress "*", "bech32"
responseString = tb1qf3fvy6s4a6y659cmrp829z9g8743ne7zynrzdu

Which is not a correct address. Can anyone point out what I am doing wrong here?

EDIT:

bitcoin-cli -rpcwallet=BIP84 getaddressinfo "tb1qf3fvy6s4a6y659cmrp829z9g8743ne7zynrzdu"
{
  "address": "tb1qf3fvy6s4a6y659cmrp829z9g8743ne7zynrzdu",
  "scriptPubKey": "00144c52c26a15ee89aa171b184ea288a83fab19e7c2",
  "ismine": false,
  "solvable": true,
  "desc": "wpkh([18734cbe/84'/1'/0'/0/0]02e36718f3ef012d322e335dc85e8ef9fcd5b859b719800a111ac46ea67cf34b1f)#rj2ve2jp",
  "iswatchonly": true,
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "4c52c26a15ee89aa171b184ea288a83fab19e7c2",
  "pubkey": "02e36718f3ef012d322e335dc85e8ef9fcd5b859b719800a111ac46ea67cf34b1f",
  "label": "*,",
  "ischange": false,
  "timestamp": 0,
  "hdkeypath": "m/84'/1'/0'/0/0",
  "hdseedid": "0000000000000000000000000000000000000000",
  "hdmasterfingerprint": "18734cbe",
  "labels": [
    {
      "name": "*,",
      "purpose": "receive"
    }
  ]
}

I was using an outdated firmware for coldcard wallet so that may be the issue, will update it try again and revert.

  • I don't see anything obviously wrong with what you've done. I am very curious about the output of getaddressinfo tb1qf3fvy6s4a6y659cmrp829z9g8743ne7zynrzdu. What's the descriptor for that key? It should be m/84'/1'/0'/0/0 but perhaps it isn't? – Help11355 Jun 22 at 14:52
  • Have edited OP, also have gotten useful info from Coldcard wallet support (you?), will have another go and update the post later. – Fontaine Jun 23 at 0:23
0

Updating the ColdCard to the latest (unreleased) firmware shows the xpub that is compatible with my above code and works flawlessly with the above example.

The same ColdCard with the new dump summary outputs:

# Coldcard Wallet Summary File
## For wallet with master key fingerprint: 18734CBE

Wallet operates on blockchain: Bitcoin Testnet

For BIP44, this is coin_type '1', and internally we use
symbol XTN for this blockchain.

## IMPORTANT WARNING

Do **not** deposit to any address in this file unless you have a working
wallet system that is ready to handle the funds at that address!

## Top-level, 'master' extended public key ('m/'):

tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY

What follows are derived public keys and payment addresses, as may
be needed for different systems.


## For Bitcoin Core: m/{account}'/{change}'/{idx}'

First 5 receive addresses (account=0, change=0):

m/0'/0'/0' => tpubDCATeo6yFBpS7m1szppzMD7zkNcgECxMe8LBxePPEYoPzFmZGQp2pismcwtB4va9pXoGVMjRXGtqQHFKg1adNSy6GXGEnSYtdaeSww1Dkdg
m/0'/0'/0' => mwokgDX6HQREsFgevxZwKDxmVfDjEqwPuC

m/0'/0'/1' => tpubDCATeo6yFBpSAe4W2y8LkYvvzzQrJgyQS95Uys623N17e4Rnc33kkbv2LPkB45aWAUkdttapuEjQRK5pRLD6B1Z8dRRrBdwFBTAQGz5HMDe
m/0'/0'/1' => mwGmYgnd3MDjaTXfp5dgq5YxNtGjfRyTuT

m/0'/0'/2' => tpubDCATeo6yFBpSDMgwGGC9vQkadkkFFDgsSP67BrFpZ543PMgaLuof9EYmdvAxLeCyuG8B6XP6q1yywfaFGofdnmMTN9LooLzSeb93dH3tTQE
m/0'/0'/2' => mntHLuyhXr6QsVsWstRs3XFHaMXD8AKuLo

m/0'/0'/3' => tpubDCATeo6yFBpSGritemWBfB6SGxjzKXZdk9SKW2Kwpj4Qm6efgQjEV1nmj16ZAuxguYJWCvSeibnGpeSaNMb44MZnCJ9LajcHuSCis7Ect3n
m/0'/0'/3' => msU7yGFgbqTJF9n55jYB8e3Hxh4hi7vhhF

m/0'/0'/4' => tpubDCATeo6yFBpSJGFBLgD7UAmveDdpnCsjT6Dy1YZD5XsbUNyzc4aczhTF9956SZN6mREKDmeQFnkTtHfRTAvh6NQZoZ6oHMickZBu9GXkGRW
m/0'/0'/4' => mjdKAoMcyieEwcscdvrnKzqu4r6bnfQMj1


## For Bitcoin Core (Segregated Witness, P2PKH): m/{account}'/{change}'/{idx}'

First 5 receive addresses (account=0, change=0):

m/0'/0'/0' => tpubDCATeo6yFBpS7m1szppzMD7zkNcgECxMe8LBxePPEYoPzFmZGQp2pismcwtB4va9pXoGVMjRXGtqQHFKg1adNSy6GXGEnSYtdaeSww1Dkdg
m/0'/0'/0' => tb1qk2hk9sdh0akzyc99nx65a2erpuftcek3v4mret

m/0'/0'/1' => tpubDCATeo6yFBpSAe4W2y8LkYvvzzQrJgyQS95Uys623N17e4Rnc33kkbv2LPkB45aWAUkdttapuEjQRK5pRLD6B1Z8dRRrBdwFBTAQGz5HMDe
m/0'/0'/1' => tb1q4nfn0gme6yr9fezwlrdzdycfpztswal0j4l38m

m/0'/0'/2' => tpubDCATeo6yFBpSDMgwGGC9vQkadkkFFDgsSP67BrFpZ543PMgaLuof9EYmdvAxLeCyuG8B6XP6q1yywfaFGofdnmMTN9LooLzSeb93dH3tTQE
m/0'/0'/2' => tb1q2rgcg659h4fte2c6dzljzskyjz5qfftrfwcyv7

m/0'/0'/3' => tpubDCATeo6yFBpSGritemWBfB6SGxjzKXZdk9SKW2Kwpj4Qm6efgQjEV1nmj16ZAuxguYJWCvSeibnGpeSaNMb44MZnCJ9LajcHuSCis7Ect3n
m/0'/0'/3' => tb1qsvv9dv4g7uepe5pk0tf3cp7hdgnmtx5hp626ap

m/0'/0'/4' => tpubDCATeo6yFBpSJGFBLgD7UAmveDdpnCsjT6Dy1YZD5XsbUNyzc4aczhTF9956SZN6mREKDmeQFnkTtHfRTAvh6NQZoZ6oHMickZBu9GXkGRW
m/0'/0'/4' => tb1q952xefka88ep3s8htxgnw0n60a4spqwfppm5mu


## For Electrum (not BIP44): m/{change}/{idx}

First 5 receive addresses (account=0, change=0):

m => tpubD6NzVbkrYhZ4Y7XQkmZe9fchT8GBdsx9MSjEbnTPAhC1FPUHJLD9dcEudPWUayLGy1MtVqu73a2QfaUv3YB54yUNesAc8dShcUTUNmMhopY
m/0/0 => mu7NuiLq1PsK7ncvE5cN3YPwU89wCjz4fC
m/0/1 => mvSCNC4w9wBRksZwQsLPL4pyNMbHB8rFKy
m/0/2 => mooEuT4TzKte4yvNxk4T7Du9K9vG1ZfjyK
m/0/3 => mpuSJdR1W3WLEH1FN3KN3Mxye9dBnnJYd6
m/0/4 => miwaFWAkjmAggdFGix4SGiSxaq4zzue78B


## For BIP44 / Electrum: m/44'/1'/{account}'/{change}/{idx}

First 5 receive addresses (account=0, change=0):

m/44'/1'/0' => tpubDDZWqt7mxh5QsvFMmPtJcx1FGsXc5LXTaBFNfq9h8jF7UHhi4UWuVJLBT6qqGygoDzj3j1628QyzUwkK19FDGhKam2UXBLxNebBWNJVxn9z
m/44'/1'/0'/0/0 => n2sEggcZ9vztixvwaEtf9aJPXTze4qcyEK
m/44'/1'/0'/0/1 => mix1rdoLEzR1n7pmfkRLJRL2eCVhoL9xD6
m/44'/1'/0'/0/2 => mwAy5FLgdKzGnjTwUbkpd7Fp97cRKNjY56
m/44'/1'/0'/0/3 => mi5RvZpkR9yKtxLiVwWqYXiHaYzjskSKgF
m/44'/1'/0'/0/4 => mujhjLQ9cpyqNjbv6NAPTUA6HWjBP64HZv


## For BIP49 (P2WPKH-nested-in-P2SH): m/49'/1'/{account}'/{change}/{idx}

First 5 receive addresses (account=0, change=0):

m/49'/1'/0' => tpubDCKpfULue5a7s9eEYJR48AGYxTiQt3gFqJS7VLmYxFjEiw7zDGxYkxtFJsyJd6i5QPfDGvDF9YTZWXqXq47PmGmEf8FQedYZRtp6oJdR5Cu
m/49'/1'/0' => upub5DTQEEWUUkzE3Tt2b356Hyeg7SBR4oChYLH9nc2kUKqhpM1bP5cmkLF11E1m6so5PZmtQuuhETZsAVWEH727V8G8zWQqDNRs2m2ksa22a9V   ##SLIP-132##
m/49'/1'/0'/0/0 => 2NFLZEZVQizq4j1RbPmrM4PDCBVBJT8yz8g
m/49'/1'/0'/0/1 => 2MtnK8YM3trNgW1SGKnHVLxUGQinHJ9gzJN
m/49'/1'/0'/0/2 => 2Muj9cwcCCm6r7qpLxUHe1mRz4D1ikmuGSu
m/49'/1'/0'/0/3 => 2NAwepU6eSdb1c6nnV13SJAqSJEYjbUeNGB
m/49'/1'/0'/0/4 => 2N7bVgw1d1jmipnFL95droVt5JgKvfw9cRr


## For BIP84 (Native Segwit P2PKH): m/84'/1'/{account}'/{change}/{idx}

First 5 receive addresses (account=0, change=0):

m/84'/1'/0' => tpubDCQUid7gmQWq7GLdF6D7fN8RFvEocAUUSxE1Sy74aqtCBgZ8pbPCGSNKpA8nGR8HwN9agAHS4kgngs2Ey9VVFgPKz8cDvBHHZ9sCqAtUVQK
m/84'/1'/0' => vpub5YNKb3xAkmUR8smY8Ben3Gc3arrFjXzR56bGXdG9UvNYLCFyF4CyssPDXi8pk6sDLBP4ZdaScL9eE7JW8tpDmmZqBrU54pz5Rk9WJ11aUMc   ##SLIP-132##
m/84'/1'/0'/0/0 => tb1qtymulkjmx26pvq6n45sly2gmttwc4g5vtgzxez
m/84'/1'/0'/0/1 => tb1q4gcq8et9qvjy3cffzqmhr2qtchhvdy9x6v08cd
m/84'/1'/0'/0/2 => tb1qnmw70uefcns626xu4umftmqx8n7wjusxej7k32
m/84'/1'/0'/0/3 => tb1qzdtj4cn6kj3lt3uha9my2skh0a99e0u59tw45r
m/84'/1'/0'/0/4 => tb1q27ysu4ut4v3wv4xsq55wvrlyn7n4xqjfsslz4h

Then in Bitcoin Core using the updated fingerprint and tpub for BIP84:

bitcoin-cli getdescriptorinfo "wpkh([18734CBE/84h/1h/0h]tpubDCQUid7gmQWq7GLdF6D7fN8RFvEocAUUSxE1Sy74aqtCBgZ8pbPCGSNKpA8nGR8HwN9agAHS4kgngs2Ey9VVFgPKz8cDvBHHZ9sCqAtUVQK/0/*)"
responseString = {
  "descriptor": "wpkh([18734cbe/84'/1'/0']tpubDCQUid7gmQWq7GLdF6D7fN8RFvEocAUUSxE1Sy74aqtCBgZ8pbPCGSNKpA8nGR8HwN9agAHS4kgngs2Ey9VVFgPKz8cDvBHHZ9sCqAtUVQK/0/*)#8enle6r3",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": false
}
bitcoin-cli -rpcwallet=ColdCardUpdate importmulti '[{ "desc": "wpkh([18734cbe/84'"'"'/1'"'"'/0'"'"']tpubDCQUid7gmQWq7GLdF6D7fN8RFvEocAUUSxE1Sy74aqtCBgZ8pbPCGSNKpA8nGR8HwN9agAHS4kgngs2Ey9VVFgPKz8cDvBHHZ9sCqAtUVQK/0/*)#8enle6r3", "timestamp": "now", "range": [0, 99], "watchonly": true, "label": "Fully Noded Cold Storage", "keypool": true, "internal": false }]' '{"rescan": false}'
responseString = [
  {
    "success": true
  }

bitcoin-cli -rpcwallet=ColdCardUpdate getnewaddress "", "bech32"

responseString = tb1qtymulkjmx26pvq6n45sly2gmttwc4g5vtgzxez

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.