bitcoin

Understanding BIP84

I try to understand how the seed phrases root, master keys and BIP84 is working.Found this site: [https://bitcoiner.guide/seed/](https://bitcoiner.guide/seed/)

BIP39 is clear so far: I can create 12 (or more) words + passphrase which prdouces a hex seed.But there is also a BIP32 Root key, not sure how that is created but somehow it’s derived from the seed I guess.

In the next section **Derived Addresses** I use BIP84 and the inputs from [https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki). So I’m using 11x abandon and 1x about without any passphrase. The wiki shows these keys:

* rootpriv
* rootpub
* xpriv (Account Extended Private Key)
* xpub (Account Extended Public Key)

and of course the other derivated addresses, private and public keys using the path levels.

On the [bitcoiner.guide](https://bitcoiner.guide) the xpriv and xpub are called:

* Account Extended Private Key
* Account Extended Public Key

the rootpriv and rootpub values are not shown anywhere, but in addition it has these:

* BIP32 Extended Private Key
* BIP32 Extended Public Key

This is really confusing a bit, anyhow my questions are:

1. I don’t need to backup anything except the BIP39 Mnemonic and the optinal BIP39 passphrase, right? Except I’m using a 2/3 multi sig wallet. But my focus is BIP39 and BIP84
2. How are the derived addresses with this kind of path level m/84’/0’/0’/0/0 are used?Is the software (like Electrum, etc.) using automoaitcallly a new address for each transaction or do I need to increment the index in the path level manually?
3. If I create a BIP32 wallet in sparrow, it shows me both: a xpub and zpub key. That key is not shown, neither on the mediawiki page nor in the bitcoiner.gudie
Sparrow shows me this descriptor: wpkh(BIP392) – what is that?

Amirim

hello my name is amir; i love bitcoin and dogecoin 🎯

Related Articles

One Comment

  1. > prdouces a hex seed

    This is incorrect. BIP39 produces a 512-bit binary seed. Hexadecimal is nothing more than a format for humans to view a binary object
    https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki

    > BIP32 Root key

    https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki describes the seed as “a seed byte sequence S of a chosen length (between 128 and 512 bits; 256 bits is advised) from a (P)RNG”. BIP39 provides a 512-bit seed

    The seed is hashed to create a 512-bit “I”, which is split into master private key and master chain code, 256 bits each

    You’ve jumped into BIP84, but it appears that all your questions relate to the hierarchy in BIP32

    As well as the spec, linked above, see a different explanation here:
    https://walletsrecovery.org/
    Search down to “Explainer: Derivation Paths”

    > m/84’/0’/0’/0/0

    “m / purpose’ / coin_type’ / account’ / change / address_index”

    Most users will have 0 for coin type and 0 for account. Change is 0 for receiving addresses, 1 for change addresses. This prevents change addresses being affected by address gaps which can occur with receiving addresses. Index is 0, 1, 2, … for each key in each child key chain. Each child key is created by hashing the master key and derivation path. The index is the last element of the derivation path

    * m/84’/0’/0’/0/0 is hashed to create the first child key in the receiving chain
    * m/84’/0’/0’/1/0 is hashed to create the first child key in the change chain
    * m/84’/0’/0’/0/1 is hashed to create the second child key in the receiving chain

    and so on. Creation of child private key chains, child public key chains and addresses is automatic in the wallet app

    BIP84 is native SegWit. BIP32 behaves the same for BIP84 as for legacy P2PKH addresses, the address is a RIPEMD160 hash of a SHA256 hash of a public key. The human-readable format of a SegWit address is bech32 instead of base58. The format of a SegWit TXO is different. The format of the txinput scriptSig is different. That is, BIP84 changes TX input and output layouts, and changes human-read addresses, but the address itself is the same 20-byte RIPE160 hash as in a legacy transaction

    zpub is xpub for BIP84. No idea why Sparrow is displaying xpub as well

    > descriptor: wpkh(BIP392)

    Descriptors are being developed because derivation paths are inflexible, only allow each wallet to have one type of address derivation, and because BIP39/BIP32 wallets do not store the derivation path, making seed words not portable

    https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md

    No idea what sparrow means by wpkh(BIP392)

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button