cardano-addresses icon indicating copy to clipboard operation
cardano-addresses copied to clipboard

Bug - cardano-addresses and cardano-rosetta do not generate the same payment address when using the same derivation path

Open johnmathews opened this issue 3 years ago • 0 comments

Using the same utxo.prv file I expect cardano-addresses and cardano-rosetta to generate the same payment address. This is not the case. Is this a bug or have I made a mistake?

Steps to reproduce:

  1. phrase.prv cardano-address recovery-phrase generate --size 15 > phrase.prv
  2. phrase.prv -> root.xsk cat phrase.prv | cardano-address key from-recovery-phrase Shelley | tee root.xsk
  3. root.xsk -> utxo.prv cardano-address key child 1852H/1815H/0H/0/0 < root.xsk | tee utxo.prv
  4. utxo.prv -> addr.xvk cardano-address key public --with-chain-code < utxo.prv | tee addr.xvk
  5. addr.xvk -> payment addr cardano-address address payment --network-tag testnet < addr.xvk > payment.addr

Then using cardano-rosetta:

  1. Inspect utxo.prv to show the extended private key. cardano-address key inspect < utxo.prv
  2. Use this in the send-transaction-example.ts cardano-rosetta script (it replaces the private key in the example scripts).
  3. The public key derived by cardano-rosetta is the second half of the extended private key.
  4. cardano-rosetta calls /construction/derive using the public key and receives a valid payment address add1 which is not the same as payment.addr.

I think that add1 should be the same as payment.addr, but it is not. Have I misunderstood something?

johnmathews avatar Apr 09 '21 16:04 johnmathews