{"number":34,"title":"Block v2, Height in Coinbase","authors":["Gavin Andresen"],"status":"Deployed","type":"Specification","layer":"Consensus (soft fork)","created":"2012-07-06","requires":[],"replaces":[],"replacedBy":[],"discussion":[],"abstract":"Bitcoin blocks and transactions are versioned binary structures. Both currently use version 1. This BIP introduces an upgrade path for versioned transactions and blocks. A unique value is added to newly produced coinbase transactions, and blocks are updated to version 2.","eli5":"Upgraded blocks to version 2 and required each block's coinbase transaction (the one paying the miner) to include the block's height. This makes every coinbase unique, preventing duplicate transactions, and set a pattern for rolling out later upgrades.","categories":["consensus","blocks","validation"],"filename":"bip-0034.mediawiki","githubUrl":"https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki","format":"mediawiki","readingMinutes":1,"inbound":4,"revisions":16,"impact":85,"core":false,"references":[],"lastModified":"2025-10-08","html":"<h2 id=\"abstract\">Abstract</h2>\n<p>Bitcoin blocks and transactions are versioned binary structures. Both currently use version 1. This BIP introduces an upgrade path for versioned transactions and blocks. A unique value is added to newly produced coinbase transactions, and blocks are updated to version 2.</p>\n<h2 id=\"motivation\">Motivation</h2>\n<ol><li>\nClarify and exercise the mechanism whereby the bitcoin network collectively consents to upgrade transaction or block binary structures, rules and behaviors.\n</li></ol>\n<ol><li>\nEnforce block and transaction uniqueness, and assist unconnected block validation.\n</li></ol>\n<h2 id=\"specification\">Specification</h2>\n<ol><li>\nTreat transactions with a version greater than 1 as non-standard (official Satoshi client will not mine or relay them).\n</li></ol>\n<ol><li>\nAdd height as the first item in the coinbase transaction's scriptSig, and increase block version to 2. The format of the height is \"minimally encoded serialized CScript\" -- first byte is number of bytes in the number (will be 0x03 on main net for the next 150 or so years with 2<sup>23</sup>-1 blocks), following bytes are little-endian representation of the number (including a sign bit).  Height is the height of the mined block in the block chain, where the genesis block is height zero (0).\n</li></ol>\n<ol><li>\n75% rule: If 750 of the last 1,000 blocks are version 2 or greater, reject invalid version 2 blocks. (testnet3: 51 of last 100)\n</li></ol>\n<ol><li>\n95% rule (\"Point of no return\"): If 950 of the last 1,000 blocks are version 2 or greater, reject all version 1 blocks. (testnet3: 75 of last 100)\n</li></ol>\n<h2 id=\"backward-compatibility\">Backward compatibility</h2>\n<p>All older clients are compatible with this change. Users and merchants should not be impacted. Miners are strongly recommended to upgrade to version 2 blocks. Once 95% of the miners have upgraded to version 2, the remainder will be orphaned if they fail to upgrade.</p>\n<h2 id=\"implementation\">Implementation</h2>\n<p><a href=\"https://github.com/bitcoin/bitcoin/pull/1526\">https://github.com/bitcoin/bitcoin/pull/1526</a></p>\n<h2 id=\"result\">Result</h2>\n<p>Block number 227,835 (timestamp 2013-03-24 15:49:13 GMT) was the last version 1 block.</p>","toc":[{"id":"abstract","title":"Abstract","level":2},{"id":"motivation","title":"Motivation","level":2},{"id":"specification","title":"Specification","level":2},{"id":"backward-compatibility","title":"Backward compatibility","level":2},{"id":"implementation","title":"Implementation","level":2},{"id":"result","title":"Result","level":2}],"history":{"totalCommits":16,"firstCommit":"2012-07-06T20:06:10+02: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":"59730dec4fb641a41589aa1b91d3c452f13e0e36","date":"2025-04-11T20:05:13-07:00","author":"Murch","message":"process: Remove Comments-URI and -Summary","url":"https://github.com/bitcoin/bips/commit/59730dec4fb641a41589aa1b91d3c452f13e0e36","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":"08844fd6eff55e756c453c6d2e16de40e8f80e73","date":"2020-11-18T12:17:04-08:00","author":"Greg-Griffith","message":"BIP34 specifies it requires minimal encoding.","url":"https://github.com/bitcoin/bips/commit/08844fd6eff55e756c453c6d2e16de40e8f80e73","kind":"edit"},{"sha":"959fecc15bdad070afa63455468b1dba54655fa6","date":"2016-11-30T09:47:31+00:00","author":"Luke Dashjr","message":"Promote BIP 2 Draft->Active, and implement it","url":"https://github.com/bitcoin/bips/commit/959fecc15bdad070afa63455468b1dba54655fa6","kind":"status"},{"sha":"72f18918a8ae655212ea2700b30f0dc4d758b843","date":"2016-11-30T09:45:33+00:00","author":"Luke Dashjr","message":"Promote BIP 123 Draft->Active, and implement it","url":"https://github.com/bitcoin/bips/commit/72f18918a8ae655212ea2700b30f0dc4d758b843","kind":"status"},{"sha":"2d909ad98a999a77bfcf8393a60166f1eabd22a4","date":"2016-02-05T02:13:31+08:00","author":"Johnson Lau","message":"BIP34 correction","url":"https://github.com/bitcoin/bips/commit/2d909ad98a999a77bfcf8393a60166f1eabd22a4","kind":"edit"},{"sha":"f31f7d43473fadcfafbc886b15e8c488654839c2","date":"2016-02-01T20:14:22+00:00","author":"Luke Dashjr","message":"Promote Accepted->Final BIPs 11, 14, 21, 22, 23, 31, 32, 34, 35, 37, 65","url":"https://github.com/bitcoin/bips/commit/f31f7d43473fadcfafbc886b15e8c488654839c2","kind":"status"},{"sha":"e6cf789167ab9d22f6807cea02c48017613aab94","date":"2014-11-11T10:15:58-05:00","author":"Gavin Andresen","message":"Added Result section, noting last v=1 block","url":"https://github.com/bitcoin/bips/commit/e6cf789167ab9d22f6807cea02c48017613aab94","kind":"edit"},{"sha":"d9e890a8f27e46806238e298a346397871fd7e87","date":"2013-10-21T02:18:47-04:00","author":"Peter Todd","message":"Fix formatting","url":"https://github.com/bitcoin/bips/commit/d9e890a8f27e46806238e298a346397871fd7e87","kind":"edit"},{"sha":"981d619665a1cbbad1c0758c8ebb73cdc3c6b828","date":"2013-10-21T00:53:42-04:00","author":"Peter Todd","message":"Archive Revision as of 14:58, 18 January 2013","url":"https://github.com/bitcoin/bips/commit/981d619665a1cbbad1c0758c8ebb73cdc3c6b828","kind":"edit"},{"sha":"1f64d2b06d628dffdc297be9a8afbb9da4e6b6ca","date":"2013-10-21T00:32:10-04:00","author":"Peter Todd","message":"Rename to mediawiki extension","url":"https://github.com/bitcoin/bips/commit/1f64d2b06d628dffdc297be9a8afbb9da4e6b6ca","kind":"rename"},{"sha":"e81db32a42e95de3abe33a055c61548f2d59a536","date":"2012-08-27T22:54:22+01:00","author":"Amir Taaki","message":"BIP 34 -> Accepted","url":"https://github.com/bitcoin/bips/commit/e81db32a42e95de3abe33a055c61548f2d59a536","kind":"edit"},{"sha":"61aeaf653b18f35189d9f7178ab1710b25a6257f","date":"2012-07-06T20:06:10+02:00","author":"Amir Taaki","message":"BIP 34 - heights in block coinbase tx inputs.","url":"https://github.com/bitcoin/bips/commit/61aeaf653b18f35189d9f7178ab1710b25a6257f","kind":"edit"}]}}