BIP 0034: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Jgarzik (talk | contribs)
Add BIP 34 text
 
934 (talk | contribs)
Update BIP text with latest version from https://github.com/bitcoin/bips/blob/19c429ee2831d898/bip-0034.mediawiki
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{bip}}
{{bip}}
{{BipMoved|bip-0034.mediawiki}}


<pre>
<pre>
   BIP: 34
   BIP: 34
  Layer: Consensus (soft fork)
   Title: Block v2, Height in Coinbase
   Title: Block v2, Height in Coinbase
   Author: Gavin Andresen <gavinandresen@gmail.com>
   Author: Gavin Andresen <gavinandresen@gmail.com>
   Status: Draft
  Comments-Summary: No comments yet.
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0034
   Status: Final
   Type: Standards Track
   Type: Standards Track
   Created: 2012-07-06
   Created: 2012-07-06
Line 12: Line 16:
==Abstract==
==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 nonce is added to newly produced coinbase transactions, and blocks are updated to version 2.
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.


==Motivation==
==Motivation==
Line 22: Line 26:


# Treat transactions with a version greater than 1 as non-standard (official Satoshi client will not mine or relay them).
# Treat transactions with a version greater than 1 as non-standard (official Satoshi client will not mine or relay them).
# Add height as the first item in the coinbase transaction's scriptSig, and increase block version to 2. The format of the height is "serialized CScript" -- first byte is number of bytes in the number (will be 0x03 on main net for the next 300 or so years), following bytes are little-endian representation of the number.
# Add 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).
# If 750 of the last 1,000 blocks are version 2 or greater, reject invalid version 2 blocks. (testnet3: 51 of last 100)
# 75% rule: If 750 of the last 1,000 blocks are version 2 or greater, reject invalid version 2 blocks. (testnet3: 51 of last 100)
# "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)
# 95% 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)


==Backward compatibility==
==Backward compatibility==
Line 32: Line 36:
==Implementation==
==Implementation==


https://github.com/bitcoin/bitcoin/pull/1525 and https://github.com/bitcoin/bitcoin/pull/1526
https://github.com/bitcoin/bitcoin/pull/1526


[[Category:Developer]]
==Result==
[[Category:Technical]]
 
[[Category:BIP|D]]
Block number 227,835 (timestamp 2013-03-24 15:49:13 GMT) was the last version 1 block.

Latest revision as of 21:27, 12 February 2021

This page describes a BIP (Bitcoin Improvement Proposal).
Please see BIP 2 for more information about BIPs and creating them. Please do not just create a wiki page.

Please do not modify this page. This is a mirror of the BIP from the source Git repository here.

  BIP: 34
  Layer: Consensus (soft fork)
  Title: Block v2, Height in Coinbase
  Author: Gavin Andresen <gavinandresen@gmail.com>
  Comments-Summary: No comments yet.
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0034
  Status: Final
  Type: Standards Track
  Created: 2012-07-06

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.

Motivation

  1. Clarify and exercise the mechanism whereby the bitcoin network collectively consents to upgrade transaction or block binary structures, rules and behaviors.
  2. Enforce block and transaction uniqueness, and assist unconnected block validation.

Specification

  1. Treat transactions with a version greater than 1 as non-standard (official Satoshi client will not mine or relay them).
  2. Add 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 223-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).
  3. 75% rule: If 750 of the last 1,000 blocks are version 2 or greater, reject invalid version 2 blocks. (testnet3: 51 of last 100)
  4. 95% 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)

Backward compatibility

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.

Implementation

https://github.com/bitcoin/bitcoin/pull/1526

Result

Block number 227,835 (timestamp 2013-03-24 15:49:13 GMT) was the last version 1 block.