Author

Topic: Bitcoin Core ImportMulti for BIP44 addresses (Read 155 times)

full member
Activity: 193
Merit: 121
Just digging around
I see, thanks for the explanation, I believe I understand now. Will try to get the BIP44 tpub out of the ColdCard!

staff
Activity: 3458
Merit: 6793
Just writing some code
What you are doing wrong is that changing those paths does not actually change how Bitcoin Core derives keys. The path that you have changed is telling Bitcoin Core what the derivation path the following tpub came from. It cannot verify this information nor does it use it to derive anything. It just uses it as a prefix to the path it actually derives at. So it is still deriving the keys at m/84h/... but it thinks they are at m/44h/... The coldcard is deriving the keys at m/44h/... and finding that the key it derives does not match the key that was given by the psbt for that path.

In order to actually use BIP 44, you need to get the tpub for the bip 44 path, not make changes to the descriptor like you are currently.
full member
Activity: 193
Merit: 121
Just digging around
Hi Guys,

I created a watch only wallet and using the ColdCard generated importmulti command to generate Bech32 addresses. All good.

Unfortunately ColdCard is not producing/has BIP44 address commands as an option Sad hence I have to do it manually.

I have the XPUB and I run the getdescriptorinfo to get the hashes than importmulti (Testnet).

Problem is:
Generated addresses seem to be incorrect Sad, ColdCard refuses to sign "BIP32 path doesn't match actual address".

What I changed from original BIP84 ColdCard generated text is in red.
I use pkh instead of wpkh and use 44h instead of 84h.

Any idea how should I import an XPUB to get BIP44 addresses (or better yet what am I doing wrong below)?

Thanks



Modified 44 Main

getdescriptorinfo "pkh([c09dbfcb/44h/1h/0h]tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/0/*)"
{
  "descriptor": "pkh([c09dbfcb/44'/1'/0']tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/0/*)#xmx56jg3",
  "checksum": "42etqglj",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": false
}

Modified 44 Change

getdescriptorinfo "pkh([c09dbfcb/44h/1h/0h]tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/1/*)"
{
  "descriptor": "pkh([c09dbfcb/44'/1'/0']tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/1/*)#h0r488cf",
  "checksum": "y7u2aa02",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": false
}

importmulti '[{"range": [0, 199], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "pkh([c09dbfcb/44h/1h/0h]tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/0/*)#42etqglj", "internal": false}, {"range": [0, 199], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "pkh([c09dbfcb/44h/1h/0h]tpubDDrejUjS6BXjB2MQBpzxVqED68xiooU7bSHB1qavnUHA5M1gnoNxy8k6UubVoGLgSM28bnTnexc NDg874eVpDVUaPDKyKtA8sD1DZwuhKar/1/*)#y7u2aa02", "internal": true}]'
[
  {
    "success": true
  },
  {
    "success": true
  }
]

Jump to: