summaryrefslogtreecommitdiff
path: root/bip-0008.mediawiki
blob: b5e46a66f89f86fe9322bf3c82e8fe0c2b0148a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<pre>
  BIP: 8
  Title: Version bits with 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 is the same as [[bip-0009.mediawiki|BIP9]] except there is no FAILED condition. The state transition from '''STARTED''' to '''LOCKED_IN''' will occur under two condition:

The first is when the threshold  of blocks signalling is reached as per BIP9. The second is if the timeout is still '''STARTED'''.

===State transitions===

<img src="bip-0008/states.png" align="middle"></img>

During the STARTED state if the '''lockinontimeout''' is set to true, the state will transition to LOCKED_IN when '''timeout''' is reached.

        case STARTED:
            // BIP8/9 specification follows
            if (GetMedianTimePast(block.parent) >= timeout) {
                // implementation detail: if flag set, BIP8 workflow, else BIP9 workflow.
                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==

BIP8 and BIP9 deployments should not share concurrent active deployment bits. Nodes that only implement BIP9 will not activate a BIP8 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.