BlockchainCommons / GordianSeedTool-iOS

Cryptographic Seed Manager for iOS
Other
38 stars 9 forks source link

Named for common derivations #34

Closed ChristopherA closed 2 years ago

ChristopherA commented 3 years ago

PNG image 6

I think we need to support a larger list of common derivations here soon, in particular Singlesig Segwit, plus a custom option for any derivation.

Internally, when we see a derivation we know name of, there should be a field in view & print that says what kind of derivation is if we know it. Similarly, some also have alternative to our keyset format and use SLIP-10(?) prefixes like zpub.

wolfmcnally commented 3 years ago

Get me a list of the derivations you want to support for MVP, please.

ChristopherA commented 3 years ago

This is what I have so far. Looking for best way to describe other more rare uses: singlesig legacy bitcoin-core usage, singlesig electrum usage, BIP45, etc.

In general, we want to support the [fingerprint/m/path/to/key]xpub… form, but when we know that the SLIP-132 prefix (zpub, etc.) show that separately (i.e. use the xpub form in the keyset, but the slip-132 version without the [fingerprint/m/path/to/key] prefix is also show. If there is no SLIP-132 version, only keyset version xpub/xprv.

Name BIP Public Key Private Key Address Encoding BIP32 Path
Singlesig Legacy Mainnet BIP44 0x0488b21e - xpub 0x0488ade4 - xprv P2PKH or P2SH m/44'/0'
Singlesig Nested Segwit Mainet BIP49 0x049d7cb2 - ypub 0x049d7878 - yprv P2WPKH in P2SH m/49'/0'
Singlesig Native Segwit 84 0x04b24746 - zpub 0x04b2430c - zprv P2WPKH m/84'/0'
Singlesig Legacy Testnet BIP44 0x043587cf - tpub 0x04358394 - tprv P2PKH or P2SH m/44'/1'
Singlesig Nested Singlesig Testnet BIP49 0x044a5262 - upub 0x044a4e28 - uprv P2WPKH in P2SH m/49'/1'
Singlesig Native Segwit Testnet BIP84 0x045f1cf6 - vpub 0x045f18bc - vprv P2WPKH m/84'/1'

There also is no official BIP48, but this is what we know:

Name BIP32 Path
Multisig Nested Segwit Mainnet m/48'/0'/0'/1'
Multisig Native Segwit Mainet m/48'/0'/0'/2'
Multisig Legacy Mainnet m/48'/0'/0'/3'

I've heard that there is a use for m/48'/0'/0'/0' maybe for bitcoin core multisig, but I'm confused.

@Fonta1n3 — any thoughts of important other paths? Or better names for the list of common derivations?

wolfmcnally commented 3 years ago

This is all good information, but I think we need to reduce it to a specific feature description, i.e.: exactly which of these derivations do we want to support for MVP (or do we definitely support all of them), which are the most common and therefore need to be most-easily accessible, and what information do we need to provide users so they know what to pick for their application? How do we keep users from choosing the wrong one? I'm not asking for UX design, more a series of most-common use-cases and constraints.

ChristopherA commented 2 years ago

This is related to #134.

@shannona Can you confirm that we are using the right names for the common derivations in all the right places? Including places like (i) notes? Document in the repo which we have chosen to support as "named", and close this and #134 as appropriate.

shannona commented 2 years ago

There aren't a lot of places where we talk about actual derivations, but I've filed #150 to suggest the "What is Key Derivation?" text talk about an actual in-use derivation. I think that's it for the actual app.

shannona commented 2 years ago

Added some docs here: https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/key-derivations.md