Skip to content

bitcoind: prefer coinbasetxn when a template also has coinbasevalue - #103

Open
asilgulsar1 wants to merge 1 commit into
LayerTwo-Labs:mainfrom
asilgulsar1:coinbasetxn-wins
Open

asilgulsar1 wants to merge 1 commit into
LayerTwo-Labs:mainfrom
asilgulsar1:coinbasetxn-wins

Conversation

@asilgulsar1

Copy link
Copy Markdown

We run simplepool in solo mode for eCash.com (ECX, BIP300/301) behind the CUSF enforcer. These came out of a review of the solo path before we rely on it.

BIP22 allows a template to carry both coinbasevalue and coinbasetxn. bitcoind_parse_template took coinbasevalue whenever present and never stored coinbasetxn, so the pool built its own coinbase with only the witness commitment, dropping every BIP300/301 commitment output. Every block on such a template would be invalid on a drivechain chain. The enforcer sends only coinbasetxn today, so this is latent, but it is one field away. Now coinbasetxn always wins.

Test: test_parse_prefers_coinbasetxn.

Tested: make test passes on this branch alone, and the new test fails on main without the fix. This PR is independent of the five others opened alongside it, and all six merge together cleanly. Happy to add a CHANGELOG entry if you'd like one.

🤖 Generated with Claude Code

BIP22 allows a template to carry both. bitcoind_parse_template took
coinbasevalue whenever it was present and never stored coinbasetxn, so the
pool built its own coinbase with only the witness commitment: every BIP300/301
commitment output in the server's coinbase was dropped, and every block mined
on such a template is invalid on a drivechain chain. The server-provided
coinbase now always wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant