obsidiansystems / ledger-app-nervos

MIT License
10 stars 10 forks source link

[LEDGERJS] incorrect public key hash #159

Closed katat closed 4 years ago

katat commented 4 years ago

I noticed the addresses returned the ledgerjs are different from the other existing applications. After looking through the ledgerjs code, I think it could be due to the incorrect use of Uint8Array.from: https://github.com/obsidiansystems/ledgerjs/blob/nervos/packages/hw-app-ckb/src/Ckb.js#L67

Uint8Array.from("ckb-default-hash")

The result uint8 array actually contains the values:

[
  0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0,
  0, 0, 0, 0
]

Instead of the encoded values for ckb-default-hash

[99, 107, 98, 45, 100, 101, 102, 97, 117, 108, 116, 45, 104, 97, 115, 104]
mikereinhart commented 4 years ago

This should be fixed in https://github.com/obsidiansystems/ledgerjs/pull/25!