urbit / urbit-key-generation

Key derivation and HD wallet generation functions for Urbit
MIT License
15 stars 8 forks source link

Derive bitcoin wallet #92

Closed pkova closed 3 years ago

pkova commented 3 years ago

As per the bounty at https://grants.urbit.org/bounties/794126751-bitcoin-key-derivation.

pkova commented 3 years ago

Also, the wallet output references the UP8 HD Wallet spec at https://github.com/urbit/urbit-key-generation/blob/master/test/assets/wallet0.json#L7 (located here) which is not going the be accurate after this change. Do we need a new spec for this?

galenwp commented 3 years ago

exciting

jtobin commented 3 years ago

Two things come to mind:

After mulling it over, I think it's probably fine to just add the functionality here, i.e. without updating the spec, since this library doesn't strictly claim to be a precise no-more-and-no-less implementation of UP8.

If we do want to make a bitcoin branch a permanent fixture of the UP8 wallet, so that all proper UP8 wallet implementations must handle a bitcoin branch, then that can just be handled as a separate matter.

jalehman commented 3 years ago

@jtobin it appears you've already given this a look, so formally requesting your review just to get this moving towards a merge.

pkova commented 3 years ago

My initial mental model regarding this was that we just generate a single bitcoin address like we do for the ethereum stuff. In actuality we're gonna need a real bip32 HD wallet here, but luckily we're dealing with HD wallets already as per the UP8 spec.

Changed the derivation path to the more appropriate m/84'/0'/0' for this reason.