Skip to content

add coinbase_witness field to NewTemplate#198

Draft
plebhash wants to merge 1 commit into
stratum-mining:mainfrom
plebhash:2026-06-09-new-template-coinbase-witness
Draft

add coinbase_witness field to NewTemplate#198
plebhash wants to merge 1 commit into
stratum-mining:mainfrom
plebhash:2026-06-09-new-template-coinbase-witness

Conversation

@plebhash

@plebhash plebhash commented Jun 9, 2026

Copy link
Copy Markdown
Member

close #166

as discussed in #156 (TLDR: future-proofing Sv2 TDP wrt future/potential BIP141-related consensus changes)


note: this PR is similar to #15, which was opened in 2022 and closed in 2023 with pending review comments and no merging

so I'm trying to preemptively address some confusion points that were left as pending review comments on #15

- add `NewTemplate.coinbase_witness` to TDP as `B0_32`
- define conditional encoding:
  - empty when witness commitment output is omitted
  - exactly 32 bytes when witness commitment output is present
- codify BIP141 empty-block behavior (witness commitment optional)
- require clients to preserve TP-provided output ordering as
  `<client-added-outputs> || <NewTemplate.coinbase_tx_outputs>`
- clarify field purpose: serialize coinbase witness coherently with TP
  commitment output; no witness-commitment recomputation required
- update Protocol Overview BIP141 text to match the new rules
@plebhash plebhash force-pushed the 2026-06-09-new-template-coinbase-witness branch from 5faa219 to 1bd0189 Compare June 9, 2026 15:20
@coleFD

coleFD commented Jun 12, 2026

Copy link
Copy Markdown

ack

@Sjors

Sjors commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

ACK 1bd0189

I updated stratum-mining/sv2-tp#108 to match.

How do you want to go about deploying this? It's probably safest if you first update SRI to optionally handle this extra field. I could then release a new sv2-tp version that sets the field, and note in its release notes the minimum expected SRI release.

Or we could do something more graceful like bumping a protocol number?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add coinbase_witness to NewTemplate

3 participants