{"number":84,"title":"Derivation scheme for P2WPKH based accounts","authors":["Pavol Rusnak"],"status":"Deployed","type":"Specification","layer":"Applications","created":"2017-12-28","license":"CC0-1.0","requires":[],"replaces":[],"replacedBy":[],"discussion":[],"comments":"https://github.com/bitcoin/bips/wiki/Comments:BIP-0084","abstract":"This BIP defines the derivation scheme for HD wallets using the P2WPKH ( BIP 173 ) serialization format for segregated witness transactions.","eli5":"Specifies the standard key path for HD wallets that use native SegWit addresses (those starting with 'bc1q'). Agreeing on this path means a user can restore the same seed phrase in different wallet apps and find the same addresses and funds.","categories":["wallets","hd-wallets","derivation"],"filename":"bip-0084.mediawiki","githubUrl":"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki","format":"mediawiki","readingMinutes":2,"inbound":3,"revisions":12,"impact":76,"core":false,"references":[32,43,44,49,141,173],"lastModified":"2025-10-08","html":"<h2 id=\"abstract\">Abstract</h2>\n<p>This BIP defines the derivation scheme for HD wallets using the P2WPKH (<a href=\"/bip/173\">BIP 173</a>) serialization format for segregated witness transactions.</p>\n<h2 id=\"motivation\">Motivation</h2>\n<p>With the usage of P2WPKH transactions it is necessary to have a common derivation scheme. It allows the user to use different HD wallets with the same masterseed and/or a single account seamlessly.</p>\n<p>Thus the user needs to create dedicated segregated witness accounts, which ensures that only wallets compatible with this BIP will detect the accounts and handle them appropriately.</p>\n<h3 id=\"considerations\">Considerations</h3>\n<p>We use the same rationale as described in Considerations section of <a href=\"/bip/49\">BIP 49</a>.</p>\n<h2 id=\"specifications\">Specifications</h2>\n<p>This BIP defines the two needed steps to derive multiple deterministic addresses based on a <a href=\"/bip/32\">BIP 32</a> root account.</p>\n<h3 id=\"public-key-derivation\">Public key derivation</h3>\n<p>To derive a public key from the root account, this BIP uses the same account-structure as defined in <a href=\"/bip/44\">BIP 44</a> and <a href=\"/bip/49\">BIP 49</a>, but only uses a different purpose value to indicate the different transaction serialization method.</p>\n<pre><code>m / purpose' / coin_type' / account' / change / address_index</code></pre>\n<p>For the <code>purpose</code>-path level it uses <code>84'</code>. The rest of the levels are used as defined in BIP44 or BIP49.</p>\n<h3 id=\"address-derivation\">Address derivation</h3>\n<p>To derive the P2WPKH address from the above calculated public key, we use the encapsulation defined in <a href=\"/bip/141#p2wpkh\">BIP 141</a>:</p>\n<p>witness:      <signature> <pubkey>     scriptSig:    (empty)     scriptPubKey: 0 <20-byte-key-hash>                   (0x0014{20-byte-key-hash})</p>\n<h3 id=\"extended-key-version\">Extended Key Version</h3>\n<p>When serializing extended keys, this scheme uses alternate version bytes. Extended public keys use <code>0x04b24746</code> to produce a \"zpub\" prefix, and private keys use <code>0x04b2430c</code> to produce a \"zprv\" prefix. Testnet uses <code>0x045f1cf6</code> \"vpub\" and <code>0x045f18bc</code> \"vprv.\"</p>\n<p>Additional registered version bytes are listed in <a href=\"https://github.com/satoshilabs/slips/blob/master/slip-0132.md\">SLIP-0132</a>.</p>\n<h2 id=\"backwards-compatibility\">Backwards Compatibility</h2>\n<p>This BIP is not backwards compatible by design as described under <a href=\"#considerations\">considerations</a>. An incompatible wallet will not discover accounts at all and the user will notice that something is wrong.</p>\n<h2 id=\"test-vectors\">Test vectors</h2>\n<pre><code>  mnemonic = abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\n  rootpriv = zprvAWgYBBk7JR8Gjrh4UJQ2uJdG1r3WNRRfURiABBE3RvMXYSrRJL62XuezvGdPvG6GFBZduosCc1YP5wixPox7zhZLfiUm8aunE96BBa4Kei5\n  rootpub  = zpub6jftahH18ngZxLmXaKw3GSZzZsszmt9WqedkyZdezFtWRFBZqsQH5hyUmb4pCEeZGmVfQuP5bedXTB8is6fTv19U1GQRyQUKQGUTzyHACMF\n\n  // Account 0, root = m/84'/0'/0'\n  xpriv = zprvAdG4iTXWBoARxkkzNpNh8r6Qag3irQB8PzEMkAFeTRXxHpbF9z4QgEvBRmfvqWvGp42t42nvgGpNgYSJA9iefm1yYNZKEm7z6qUWCroSQnE\n  xpub  = zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs\n\n  // Account 0, first receiving address = m/84'/0'/0'/0/0\n  privkey = KyZpNDKnfs94vbrwhJneDi77V6jF64PWPF8x5cdJb8ifgg2DUc9d\n  pubkey  = 0330d54fd0dd420a6e5f8d3624f5f3482cae350f79d5f0753bf5beef9c2d91af3c\n  address = bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu\n\n  // Account 0, second receiving address = m/84'/0'/0'/0/1\n  privkey = Kxpf5b8p3qX56DKEe5NqWbNUP9MnqoRFzZwHRtsFqhzuvUJsYZCy\n  pubkey  = 03e775fd51f0dfb8cd865d9ff1cca2a158cf651fe997fdc9fee9c1d3b5e995ea77\n  address = bc1qnjg0jd8228aq7egyzacy8cys3knf9xvrerkf9g\n\n  // Account 0, first change address = m/84'/0'/0'/1/0\n  privkey = KxuoxufJL5csa1Wieb2kp29VNdn92Us8CoaUG3aGtPtcF3AzeXvF\n  pubkey  = 03025324888e429ab8e3dbaf1f7802648b9cd01e9b418485c5fa4c1b9b5700e1a6\n  address = bc1q8c6fshw2dlwun7ekn9qwf37cu2rn755upcp6el</code></pre>\n<h2 id=\"reference\">Reference</h2>\n<ul><li>\n<a href=\"/bip/32\">BIP32 - Hierarchical Deterministic Wallets</a>\n</li></ul>\n<ul><li>\n<a href=\"/bip/43\">BIP43 - Purpose Field for Deterministic Wallets</a>\n</li></ul>\n<ul><li>\n<a href=\"/bip/44\">BIP44 - Multi-Account Hierarchy for Deterministic Wallets</a>\n</li></ul>\n<ul><li>\n<a href=\"/bip/49\">BIP49 - Derivation scheme for P2WPKH-nested-in-P2SH based accounts</a>\n</li></ul>\n<ul><li>\n<a href=\"/bip/141\">BIP141 - Segregated Witness (Consensus layer)</a>\n</li></ul>\n<ul><li>\n<a href=\"/bip/173\">BIP173 - Base32 address format for native v0-16 witness outputs</a>\n</li></ul>","toc":[{"id":"abstract","title":"Abstract","level":2},{"id":"motivation","title":"Motivation","level":2},{"id":"considerations","title":"Considerations","level":3},{"id":"specifications","title":"Specifications","level":2},{"id":"public-key-derivation","title":"Public key derivation","level":3},{"id":"address-derivation","title":"Address derivation","level":3},{"id":"extended-key-version","title":"Extended Key Version","level":3},{"id":"backwards-compatibility","title":"Backwards Compatibility","level":2},{"id":"test-vectors","title":"Test vectors","level":2},{"id":"reference","title":"Reference","level":2}],"history":{"totalCommits":12,"firstCommit":"2017-12-28T18:19:10+01:00","lastUpdated":"2025-10-08T14:59:36-07:00","events":[{"sha":"24e96e870fffaa257b465ce1f0370c14aac588e8","date":"2025-10-08T14:59:36-07:00","author":"Murch","message":"process: Created ↦ Assigned","url":"https://github.com/bitcoin/bips/commit/24e96e870fffaa257b465ce1f0370c14aac588e8","kind":"edit"},{"sha":"5207ef92a52d0b8902895b0dbb40823a4d698ec9","date":"2025-04-11T20:08:17-07:00","author":"Murch","message":"process: Author ↦ Authors","url":"https://github.com/bitcoin/bips/commit/5207ef92a52d0b8902895b0dbb40823a4d698ec9","kind":"edit"},{"sha":"a233bde4af52c6a11269e2e6dd9707abce441ffe","date":"2025-04-11T18:19:21-07:00","author":"Murch","message":"process: Standards Track ↦ Specification","url":"https://github.com/bitcoin/bips/commit/a233bde4af52c6a11269e2e6dd9707abce441ffe","kind":"edit"},{"sha":"5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","date":"2025-04-11T18:08:44-07:00","author":"Murch","message":"process: Final/Active ↦ Deployed","url":"https://github.com/bitcoin/bips/commit/5d3ceb37734f80b2ec206fc94245e3bfd6d5b0f0","kind":"status"},{"sha":"81231dad91551fb0c6ffd0bbaa6c103bb162c1dc","date":"2024-12-04T18:57:43+01:00","author":"Anurag Lint","message":"Fix link in BIP-84 (#1708)","url":"https://github.com/bitcoin/bips/commit/81231dad91551fb0c6ffd0bbaa6c103bb162c1dc","kind":"edit"},{"sha":"5658236e6c9d9b39e99022674817925b18ea29d9","date":"2024-03-18T23:48:22+01:00","author":"Pavol Rusnak","message":"BIP-00{43,49,84}: move to Standards Track","url":"https://github.com/bitcoin/bips/commit/5658236e6c9d9b39e99022674817925b18ea29d9","kind":"rename"},{"sha":"24204e1d3c4167d154b33eee35c598f54eeeee46","date":"2023-04-10T16:22:24+02:00","author":"Vojtěch Strnad","message":"Mark BIP84 as Final","url":"https://github.com/bitcoin/bips/commit/24204e1d3c4167d154b33eee35c598f54eeeee46","kind":"status"},{"sha":"937b8716c35a271e33432d0c6a8d47e3d446b7d3","date":"2019-02-14T17:35:51-06:00","author":"Clark Moody","message":"Link to SLIP-0132","url":"https://github.com/bitcoin/bips/commit/937b8716c35a271e33432d0c6a8d47e3d446b7d3","kind":"edit"},{"sha":"afd7c775fb88f78e745462278bd9c3bfdebcd69c","date":"2019-02-14T12:27:14-06:00","author":"Clark Moody","message":"Add testnet version bytes","url":"https://github.com/bitcoin/bips/commit/afd7c775fb88f78e745462278bd9c3bfdebcd69c","kind":"edit"},{"sha":"499f5a7e887ae7766eaa37d1dcd2c0068c4eb8fd","date":"2019-02-13T18:31:19-06:00","author":"Clark Moody","message":"Add version bytes section","url":"https://github.com/bitcoin/bips/commit/499f5a7e887ae7766eaa37d1dcd2c0068c4eb8fd","kind":"edit"},{"sha":"e9650f74e4ba047dda10d0ed4614a616c6358eb0","date":"2018-01-01T22:11:51+01:00","author":"Pavol Rusnak","message":"bip-0084: add extended public keys to test vectors","url":"https://github.com/bitcoin/bips/commit/e9650f74e4ba047dda10d0ed4614a616c6358eb0","kind":"edit"},{"sha":"2382e31f12a8ea292eaa3904439c6653fe0eb036","date":"2017-12-28T18:19:10+01:00","author":"Pavol Rusnak","message":"BIP-0084: Derivation scheme for P2WPKH based accounts","url":"https://github.com/bitcoin/bips/commit/2382e31f12a8ea292eaa3904439c6653fe0eb036","kind":"edit"}]}}