Skip to content

Commit 40b10c8

Browse files
authored
Merge pull request bitcoin#1104 from ajtowns/202103-bip341-speedy-trial-mtp
BIP341: speedy trial activation parameters
2 parents b966bd3 + 93d1b15 commit 40b10c8

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

bip-0341.mediawiki

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,43 @@ The test vectors used in the [https://github.com/bitcoin/bitcoin/blob/3820090bd6
292292

293293
== Deployment ==
294294

295-
TODO
295+
This BIP is deployed concurrently with [[bip-0342.mediawiki|BIP342]].
296+
297+
For Bitcoin signet, these BIPs are always active.
298+
299+
For Bitcoin mainnet and testnet3, 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:
300+
301+
case DEFINED:
302+
if (GetMedianTimePast(block.parent) >= starttime) {
303+
return STARTED;
304+
}
305+
return DEFINED;
306+
307+
case STARTED:
308+
int count = 0;
309+
walk = block;
310+
for (i = 0; i < 2016; i++) {
311+
walk = walk.parent;
312+
if ((walk.nVersion & 0xE0000000) == 0x20000000 && ((walk.nVersion >> bit) & 1) == 1) {
313+
count++;
314+
}
315+
}
316+
if (count >= threshold) {
317+
return LOCKED_IN;
318+
} else if (GetMedianTimePast(block.parent) >= timeout) {
319+
return FAILED;
320+
}
321+
return STARTED;
322+
323+
case LOCKED_IN:
324+
if (block.nHeight < min_activation_height) {
325+
return LOCKED_IN;
326+
}
327+
return ACTIVE;
328+
329+
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).
330+
331+
For Bitcoin testnet3, the starttime is epoch timestamp 1619222400 (midnight 24 April 2021 UTC), timeout is epoch timestamp 1628640000 (midnight 11 August 2021 UTC), the threshold is 1512 blocks (75%), and the min_activation_height is block 0.
296332

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

bip-0342.mediawiki

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ In addition to changing the semantics of a number of opcodes, there are also som
133133

134134
<references />
135135

136+
==Deployment==
137+
138+
This proposal is deployed identically to Taproot ([[bip-0341.mediawiki|BIP341]]).
139+
136140
==Examples==
137141

138142
The Taproot ([[bip-0341.mediawiki|BIP341]]) test vectors also contain examples for Tapscript execution.

0 commit comments

Comments
 (0)