Skip to content

Commit 8eeceda

Browse files
authored
Merge pull request bitcoin#513 from shaolinfry/bip-uavb
BIP 8: Version bits with optional guaranteed lock-in
2 parents fadf89a + 43e6486 commit 8eeceda

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

README.mediawiki

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Those proposing changes should consider that ultimately consent may rest with th
2727
| Luke Dashjr
2828
| Process
2929
| Active
30+
|-
31+
| [[bip-0008.mediawiki|8]]
32+
|
33+
| Version bits with optional guaranteed lock-in
34+
| Shaolin Fry
35+
| Informational
36+
| Draft
3037
|- style="background-color: #cfffcf"
3138
| [[bip-0009.mediawiki|9]]
3239
|

bip-0008.mediawiki

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<pre>
2+
BIP: 8
3+
Title: Version bits with optional guaranteed lock-in
4+
Author: Shaolin Fry <[email protected]>
5+
Comments-Summary: No comments yet.
6+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0008
7+
Status: Draft
8+
Type: Informational
9+
Created: 2017-02-01
10+
License: BSD-3-Clause
11+
CC0-1.0
12+
</pre>
13+
14+
==Abstract==
15+
16+
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").
17+
18+
==Motivation==
19+
20+
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.
21+
22+
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.
23+
24+
==Specification==
25+
26+
This specification adds a new per-chain deployment parameter to the [[bip-0009.mediawiki|BIP9]] specification as follows:
27+
28+
# The '''lockinontimeout''' boolean if set to true, will transition state to '''LOCKED_IN''' at timeout if not already '''LOCKED_IN''' or '''ACTIVE'''.
29+
30+
===State transitions===
31+
32+
<img src="bip-uaversionbits/states.png" align="middle"></img>
33+
34+
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.
35+
36+
case STARTED:
37+
// BIP9 specification follows
38+
if (GetMedianTimePast(block.parent) >= timeout) {
39+
return (fLockInOnTimeout == true) ? THRESHOLD_LOCKED_IN : THRESHOLD_FAILED
40+
}
41+
int count = 0;
42+
walk = block;
43+
for (i = 0; i < 2016; i++) {
44+
walk = walk.parent;
45+
if (walk.nVersion & 0xE0000000 == 0x20000000 && (walk.nVersion >> bit) & 1 == 1) {
46+
count++;
47+
}
48+
}
49+
if (count >= threshold) {
50+
return LOCKED_IN;
51+
}
52+
return STARTED;
53+
54+
=== Reference implementation ===
55+
56+
https://github.com/bitcoin/bitcoin/compare/master...shaolinfry:bip-uaversionbits
57+
58+
==Backwards compatibility==
59+
60+
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.
61+
62+
==Deployments==
63+
64+
A living list of deployment proposals can be found [[bip-0008/assignments.mediawiki|here]].
65+
66+
==References==
67+
68+
[[bip-0009.mediawiki|BIP9]]
69+
70+
[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-February/013643.html Mailing list discussion]
71+
72+
==Copyright==
73+
74+
This document is dual licensed as BSD 3-clause, and Creative Commons CC0 1.0 Universal.
75+

bip-0008/assignments.mediawiki

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
==Deployments==
2+
3+
List of deployments.
4+
5+
State can be defined, active, failed. Dates are in UTC.
6+

bip-0008/states.png

62.4 KB
Loading

0 commit comments

Comments
 (0)