Skip to content

pool: put the height in the job builder's coinbase too - #60

Merged
Bitflash-sh merged 1 commit into
mainfrom
coinbase-height-pool
Jul 30, 2026
Merged

pool: put the height in the job builder's coinbase too#60
Bitflash-sh merged 1 commit into
mainfrom
coinbase-height-pool

Conversation

@Bitflash-sh

Copy link
Copy Markdown
Owner

#59 put the block height in the coinbase and said two coinbases at different heights could no longer be identical. That was not true yet: it changed BitcoinMiner and missed RebuildJob in rpc.cpp, which builds its own coinbase and produces real blocks — a pool operator's template gets mined and submitted like any other.

Same one-line change, same reason, #58.

Both paths now put the height first. Neither validates it, so this still changes only what a node produces and needs no coordination.

#59 changed BitcoinMiner and stopped there. RebuildJob in rpc.cpp builds
its own coinbase for the pool operator's job template, and that template is
mined and submitted like any other block, so it had the same hole: nothing
in the transaction belonged to the block, and a repeated combination of
difficulty, counter and key produces a byte-identical coinbase.

The claim in #59 that two coinbases at different heights can no longer be
identical only becomes true with this.
@Bitflash-sh
Bitflash-sh merged commit 1c1ef07 into main Jul 30, 2026
@Bitflash-sh
Bitflash-sh deleted the coinbase-height-pool branch July 30, 2026 21:31
Bitflash-sh added a commit that referenced this pull request Jul 31, 2026
Six changes since 1.2.7, and the reason not to sit on this is #58:
coinbase transactions were not unique, two of them overwrote older ones
on the main chain, and 100 BTF stopped being reachable. Nothing in how
they were built had changed since, so it could happen again at any time.
The height now goes into the coinbase on both paths that build one
(#59, #60), which makes a repeat impossible without any coordination.

Also in: a node now notices a peer it can no longer hear and stays
audible to peers that check the same way (#55); it announces its height
in the handshake and says out loud when it falls behind the network
(#56); script evaluation has ceilings on operation count and stack depth
(#57); the tail of the chain is verified at startup and a bad tip is
backed out of instead of being mined on (#61); and the wallet now
believes the chain about what it has already spent, which is what a
restored backup gets wrong (#62).
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