-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BIP341: speedy trial activation parameters #1104
Changes from all commits
a516c13
0f95720
d582d0b
ce5f89f
93d1b15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -294,7 +294,43 @@ Examples of preimage for sighashing for each of the sighash modes. | |||||||||
|
||||||||||
== Deployment == | ||||||||||
|
||||||||||
TODO | ||||||||||
This BIP is deployed concurrently with [[bip-0342.mediawiki|BIP342]]. | ||||||||||
|
||||||||||
For Bitcoin signet, these BIPs are always active. | ||||||||||
|
||||||||||
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: | ||||||||||
|
||||||||||
case DEFINED: | ||||||||||
if (GetMedianTimePast(block.parent) >= starttime) { | ||||||||||
return STARTED; | ||||||||||
} | ||||||||||
return DEFINED; | ||||||||||
|
||||||||||
case STARTED: | ||||||||||
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; | ||||||||||
} else if (GetMedianTimePast(block.parent) >= timeout) { | ||||||||||
return FAILED; | ||||||||||
} | ||||||||||
return STARTED; | ||||||||||
|
||||||||||
case LOCKED_IN: | ||||||||||
if (block.nHeight < min_activation_height) { | ||||||||||
return LOCKED_IN; | ||||||||||
} | ||||||||||
return ACTIVE; | ||||||||||
|
||||||||||
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). | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified the datetime conversions but agree with @jnewbery that the wording is ambiguous. >> Time.at(1619222400).to_time.utc
=> 2021-04-24 00:00:00 UTC
>> Time.at(1628640000).to_time.utc
=> 2021-08-11 00:00:00 UTC
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The base value of 2016 isn't currently mentioned in BIP341.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's actually incidental that it lines up with difficulty, can be configured differently if needed. 1815/0.9 = 2016.66, 1814/0.9 = 2015.55 so 2016 is directly implied as the threshold block. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, but explicit would be better. It's only indirectly referred to in the code example. |
||||||||||
|
||||||||||
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. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (The same observations apply for this testnet3 sentence.) |
||||||||||
|
||||||||||
== Backwards compatibility == | ||||||||||
As a soft fork, older software will continue to operate without modification. | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Procedurally, should mention bip340 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bip340 on itself can not be deployed because it doesn't describe consensus rules. It is deployed only as part of bip341 and 342.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, make sense