Page MenuHomePhabricator

[ecash-lib] Add `HdNode` for HD wallets
ClosedPublic

Authored by tobias_ruck on Thu, Jan 30, 16:00.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC0992b4fdbcf9: [ecash-lib] Add `HdNode` for HD wallets
Summary

Hierarchical deterministic wallets (BIP32) are the standard way to handle wallets in eCash.

This allows users to take a seed derived from a mnemonic and derive the private key of a given path.

Depends on D17612.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Similar question as with D17612

There's a good deal of empirical history with https://github.com/bitcoinjs/bip32/

Could you give a few sentences about the approach used here and how it differs from the legacy lib?

modules/ecash-lib/src/io/bytes.ts
12 ↗(On Diff #52451)
This revision now requires changes to proceed.Thu, Jan 30, 18:16

Could you give a few sentences about the approach used here and how it differs from the legacy lib?

This one is more of a 1-to-1 translation of bip32, compared to bip39 which I did a lot of improvements for.

The main differences are:

  • Cleaner code (no usage of variables like I, IL, IR, __Q and __D)
  • Re-uses our Ecc instance, so that no dependency like tiny-secp256k1 has to be installed, just a normal Ecc instance. This is significant because this way you only have to get one library to work (ecash-lib), which is tightly integrated and not two or more.
This revision is now accepted and ready to land.Thu, Jan 30, 23:23
This revision was automatically updated to reflect the committed changes.