forked from bitcoin/bips
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bitcoin#513 from shaolinfry/bip-uavb
BIP 8: Version bits with optional guaranteed lock-in
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<pre> | ||
BIP: 8 | ||
Title: Version bits with optional guaranteed lock-in | ||
Author: Shaolin Fry <shaolinfry@protonmail.ch> | ||
Comments-Summary: No comments yet. | ||
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0008 | ||
Status: Draft | ||
Type: Informational | ||
Created: 2017-02-01 | ||
License: BSD-3-Clause | ||
CC0-1.0 | ||
</pre> | ||
|
||
==Abstract== | ||
|
||
This document specifies an extension to [[bip-0009.mediawiki|BIP9]] that introduces an additional activation parameter to guarantee activation of backward-compatible changes (further called "soft forks"). | ||
|
||
==Motivation== | ||
|
||
BIP9 introduced a mechanism for doing parallel soft forking deployments based on repurposing the block nVersion field. Activation is dependent on near unanimous hashrate signalling which may be impractical and is also subject to veto by a small minority of non-signalling hashrate. | ||
|
||
This specification provides a way to optionally guarantee lock-in at the end of the [[bip-0009.mediawiki|BIP9]] timeout, and therefore activation, while still allowing a hashrate super majority to trigger activation earlier. | ||
|
||
==Specification== | ||
|
||
This specification adds a new per-chain deployment parameter to the [[bip-0009.mediawiki|BIP9]] specification as follows: | ||
|
||
# The '''lockinontimeout''' boolean if set to true, will transition state to '''LOCKED_IN''' at timeout if not already '''LOCKED_IN''' or '''ACTIVE'''. | ||
===State transitions=== | ||
|
||
<img src="bip-uaversionbits/states.png" align="middle"></img> | ||
|
||
The state transition workflow is exactly the same as in [[bip-0009.mediawiki|BIP9]] with an additional rule: During the STARTED state if the '''lockinontimeout''' is set to true, the state will transition to LOCKED_IN when '''timeout''' is reached. | ||
|
||
case STARTED: | ||
// BIP9 specification follows | ||
if (GetMedianTimePast(block.parent) >= timeout) { | ||
return (fLockInOnTimeout == true) ? THRESHOLD_LOCKED_IN : THRESHOLD_FAILED | ||
} | ||
int count = 0; | ||
walk = block; | ||
for (i = 0; i < 2016; i++) { | ||
walk = walk.parent; | ||
if (walk.nVersion & 0xE0000000 == 0x20000000 && (walk.nVersion >> bit) & 1 == 1) { | ||
count++; | ||
} | ||
} | ||
if (count >= threshold) { | ||
return LOCKED_IN; | ||
} | ||
return STARTED; | ||
=== Reference implementation === | ||
|
||
https://github.com/bitcoin/bitcoin/compare/master...shaolinfry:bip-uaversionbits | ||
|
||
==Backwards compatibility== | ||
|
||
If '''lockinontimeout''' boolean is set to false this BIP is compatible with nodes that implement BIP9. If '''lockinontimeout''' boolean is set to true, nodes that only implement BIP9 will not activate the soft fork if hashpower threshold is not reached by '''timeout''', however, those nodes will still accept the blocks generated by activated nodes. | ||
|
||
==Deployments== | ||
|
||
A living list of deployment proposals can be found [[bip-0008/assignments.mediawiki|here]]. | ||
|
||
==References== | ||
|
||
[[bip-0009.mediawiki|BIP9]] | ||
|
||
[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-February/013643.html Mailing list discussion] | ||
|
||
==Copyright== | ||
|
||
This document is dual licensed as BSD 3-clause, and Creative Commons CC0 1.0 Universal. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
==Deployments== | ||
|
||
List of deployments. | ||
|
||
State can be defined, active, failed. Dates are in UTC. | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.