Skip to content

Commit d582d0b

Browse files
committed
BIP341: document simplified bip9 states
1 parent 0f95720 commit d582d0b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

bip-0341.mediawiki

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,37 @@ This BIP is deployed concurrently with [[bip-0342.mediawiki|BIP342]].
298298

299299
For Bitcoin signet, these BIPs are always active.
300300

301-
For Bitcoin mainnet, these BIPs will be deployed by "version bits" with the name "taproot" and bit 2, using BIP9 modified to use a lower threshold, and with an additional ''min_activation_height'' parameter and changing the state transition logic for LOCKED_IN to the following:
301+
For Bitcoin mainnet, these BIPs will be deployed by "version bits" with the name "taproot" and bit 2, using [[bip-0009.mediawiki|BIP9]] modified to use a lower threshold, with an additional ''min_activation_height'' parameter and replacing the state transition logic for the DEFINED, STARTED and LOCKED_IN states as follows:
302+
303+
case DEFINED:
304+
if (GetMedianTimePast(block.parent) >= starttime) {
305+
return STARTED;
306+
}
307+
return DEFINED;
308+
309+
case STARTED:
310+
int count = 0;
311+
walk = block;
312+
for (i = 0; i < 2016; i++) {
313+
walk = walk.parent;
314+
if (walk.nVersion & 0xE0000000 == 0x20000000 && (walk.nVersion >> bit) & 1 == 1) {
315+
count++;
316+
}
317+
}
318+
if (count >= threshold) {
319+
return LOCKED_IN;
320+
} else if (GetMedianTimePast(block.parent) >= timeout) {
321+
return FAILED;
322+
}
323+
return STARTED;
302324
303325
case LOCKED_IN:
304326
if (block.nHeight < min_activation_height) {
305327
return LOCKED_IN;
306328
}
307329
return ACTIVE;
308330
309-
For Bitcoin mainnet, the BIP9 starttime is epoch timestamp 1619222400 (midnight 24 April 2021 UTC), BIP9 timeout is epoch timestamp 1628640000 (midnight 11 August 2021 UTC), the threshold is 1815 blocks (90%) instead of 1916 blocks (95%), and the min_activation_height is block 709632 (expected approximately 12 November 2021).
331+
For Bitcoin mainnet, the starttime is epoch timestamp 1619222400 (midnight 24 April 2021 UTC), timeout is epoch timestamp 1628640000 (midnight 11 August 2021 UTC), the threshold is 1815 blocks (90%) instead of 1916 blocks (95%), and the min_activation_height is block 709632 (expected approximately 12 November 2021).
310332

311333
== Backwards compatibility ==
312334
As a soft fork, older software will continue to operate without modification.

0 commit comments

Comments
 (0)