Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bip-0022.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,4 @@ Why should "sigops" be provided for transactions?

==See Also==
* [[bip-0023.mediawiki|BIP 23: getblocktemplate - Pooled Mining]]
* [[bip-0054.md#getblocktemplate-changes|BIP 54: getblocktemplate changes]]
31 changes: 30 additions & 1 deletion bip-0054.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,34 @@ that include 64-byte transactions.
The coinbase transaction is usually crafted by mining pool software. To the best of the authors'
knowledge, there does not exist an open source reference broadly in use today for such software.
We encourage mining pools to update their software to craft coinbase transactions that are
forward-compatible with the changes proposed in this BIP.
forward-compatible with the changes proposed in this BIP. This can be done by using the new
`getblocktemplate` fields described below, once node software supports it.

## getblocktemplate changes

The template Object of the `getblocktemplate` JSON-RPC call ([bip-0022][BIP22]) is extended with
the following keys:

| Key | Required | Type | Description |
|-----|----------|------|-------------|
| `coinbase_locktime` | Yes | Number | coinbase `nLockTime` value |
| `coinbase_sequence` | Yes | Number | coinbase `nSequence` value |

Types are JSON types as defined in [bip-0022][BIP22].

The `coinbase_locktime` field specifies the exact value that MUST be used for the coinbase
transaction's `nLockTime` field.

The `coinbase_sequence` field specifies a value that SHOULD be used for the coinbase transaction
input's `nSequence` field. If a different value is used, it MUST NOT be `0xffffffff`[^12].


## Reference implementation

An implementation of BIP54 for Bitcoin Core is available [here][inquisition-implem].

The `getblocktemplate` extension is implemented in [bitcoin/bitcoin#34419][GBT implem].

## Test vectors

Documented test vectors are available [here](./bip-0054/test_vectors/) for all mitigations
Expand Down Expand Up @@ -218,6 +240,11 @@ bip-0034 height commitment and the corresponding future block height.
coinbase transactions as not having duplicate past Consensus Cleanup activation would be consistent
for any implementation which enforces `nLockTime` from the genesis block, which is the behaviour
notably of Bitcoin Core but also of all other implementations the authors are aware of.
[^12]: **Why SHOULD for `coinbase_sequence`?**
The only consensus constraint on `nSequence` is to disallow `0xffffffff`.
The server could communicate this via a bit mask, but for simplicity it
provides the entire `nSequence` value. Clients SHOULD use this value, so
that future soft forks can safely add additional constraints.

[BIP30]: https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki
[BIP-XXXX]: https://github.com/TheBlueMatt/bips/blob/7f9670b643b7c943a0cc6d2197d3eabe661050c2/bip-XXXX.mediawiki
Expand All @@ -242,3 +269,5 @@ notably of Bitcoin Core but also of all other implementations the authors are aw
[Core 29.0]: https://bitcoincore.org/en/releases/29.0
[inquisition-implem]: https://github.com/darosior/bitcoin/tree/2509_inquisition_consensus_cleanup
[Core 30.0]: https://bitcoincore.org/en/releases/30.0
[BIP22]: https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki
[GBT implem]: https://github.com/bitcoin/bitcoin/pull/34419