Dear list,

BIP54 proposes constraining the coinbase transaction nLockTime and nSequence 
fields. Although it's not that difficult for pools to adjust their software to 
set the correct values based on the known block height, it seems appropriate 
and convenient to have node software provide these values via the 
getblocktemplate RPC.

SegWit had its own BIP for adding fields, but that was a significantly bigger 
lift. My preference would be to just extend BIP54, as I've done below.

Feel free to respond on the list or here: 
https://github.com/bitcoin/bips/pull/2097

Current version of BIP54: 
https://github.com/bitcoin/bips/blob/master/bip-0054.md

Here's the proposed expansion:

-------
## Miner forward compatibility

[...]

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. 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 |
| `coinbase_version` | Yes | Number | coinbase `nVersion` 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].

The `coinbase_version` field specifies the value that SHOULD be used for the 
coinbase transaction's
`nVersion` field[^13].

-------

Footnotes:

[^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.
[^13]: **Why is `coinbase_version` included?**
  This BIP does not constrain the coinbase transaction's `nVersion`, but
  including it means `getblocktemplate` now covers all coinbase transaction
  fields that could potentially be constrained by a future soft fork. The
  coinbase input's prevout txid (32 zero bytes) and vout index (`0xffffffff`)
  are fixed by consensus, so they can be safely hardcoded in mining software.
  At the time of writing, there is no consensus constraint on transaction
  versions. Transaction version 2 is the latest version with defined
  semantics, as specified in [bip-0068][BIP68], but its relative lock-time
  rules do not apply to the coinbase input. Nonetheless, clients SHOULD use
  this value so that they don't need to be updated if a future soft fork
  constrains `nVersion`.

---

- Sjors Provoost



-- 
You received this message because you are subscribed to the Google Groups 
"Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/bitcoindev/1A3B8BFA-41A6-4D0F-BBE6-E791F9785A5E%40sprovoost.nl.

Reply via email to