Skip to content

Commit 7251e64

Browse files
committed
add section for BIP141 on NewTemplate
1 parent 1f3cc6f commit 7251e64

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

03-Protocol-Overview.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ The presence or absence of these fields on a serialized Coinbase has important i
308308
- `NewExtendedMiningJob` of Mining Protocol
309309
- `DeclareMiningJob` of Job Declaration Protocol
310310
- `SubmitSolution` of Template Distribution Protocol
311+
- `NewTemplate` of Template Distribution Protocol
311312

312313
### 3.7.1 BIP141 on `NewExtendedMiningJob`
313314

@@ -339,4 +340,11 @@ On the Template Distribution Protocol's `SubmitSolution` there is one field affe
339340

340341
Differently from `NewExtendedMiningJob`, in case the Template's Coinbase is a SegWit transaction, BIP141 fields MUST NOT be stripped from `SubmitSolution`'s `coinbase_tx`.
341342

342-
That's because the Template Distribution Server would not be able to propagate a block without that data.
343+
That's because the Template Distribution Server would not be able to propagate a block without that data.
344+
345+
### 3.7.4. BIP141 on `NewTemplate`
346+
347+
On the Template Distribution Protocol's `NewTemplate` there is one field affected by BIP141:
348+
- `coinbase_tx_outputs`
349+
350+
In case of blocks containing SegWit transactions (and optionally blocks that don't as well), this field carries the `OP_RETURN` output with the witness commitment. The `witness reserved value` (Coinbase witness) used for calculating this witness commitment is assumed to be 32 bytes of `0x00`, as it currently holds no consensus-critical meaning. This [may change in future soft-forks](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#extensible-commitment-structure).

07-Template-Distribution-Protocol.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ The primary template-providing function. Note that the `coinbase_tx_outputs` byt
4747

4848
Please note that differently from `SetCustomMiningJob.coinbase_tx_outputs` and `AllocateMiningJobToken.Success.coinbase_tx_outputs`, `NewTemplate.coinbase_tx_outputs` MUST NOT be serialized as a CompactSize-prefixed array. This field must simply carry the ordered sequence of consensus‑serialized outputs, but the number of outputs MUST be inferred from `NewTemplate.coinbase_tx_outputs_count`. This is the equivalent of taking a CompactSize-prefixed array and dropping its (outer) prefix.
4949

50+
Please also note that in case the block contains SegWit transactions (and optionally blocks that don't as well), `NewTemplate.coinbase_tx_outputs` MUST carry the witness commitment. The `witness reserved value` (Coinbase witness) used for calculating this witness commitment is assumed to be 32 bytes of `0x00`, as it currently holds no consensus-critical meaning. This [may change in future soft-forks](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#extensible-commitment-structure).
51+
5052
## 7.3 `SetNewPrevHash` (Server -> Client)
5153

5254
Upon successful validation of a new best block, the server MUST immediately provide a `SetNewPrevHash` message.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This repository contains the Stratum V2 protocol specification.
2323
- [3.7.1. BIP141 on `NewExtendedMiningJob`](./03-Protocol-Overview.md#371-bip141-on-newextendedminingjob)
2424
- [3.7.2. BIP141 on `DeclareMiningJob`](./03-Protocol-Overview.md#372-bip141-on-declareminingjob)
2525
- [3.7.3. BIP141 on `SubmitSolution`](./03-Protocol-Overview.md#373-bip141-on-submitsolution)
26+
- [3.7.4. BIP141 on `NewTemplate`](./03-Protocol-Overview.md#374-bip141-on-newtemplate)
2627
- [4. Protocol Security](./04-Protocol-Security.md#4-protocol-security)
2728
- [4.1. Motivation for Authenticated Encryption with Associated Data](./04-Protocol-Security.md#41-motivation-for-authenticated-encryption-with-associated-data)
2829
- [4.2. Motivation for Using the Noise Protocol Framework](./04-Protocol-Security.md#42-motivation-for-using-the-noise-protocol-framework)

0 commit comments

Comments
 (0)