diff options
| author | Bitflash <btf01@proton.me> | 2026-07-30 18:22:45 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-30 18:22:45 -0300 |
| commit | 50eeb9c9d620895c0d63664d610ea4cfe7b81a34 (patch) | |
| tree | 398a34af243fc9a5b3d97a71b01a6ba075e6ef87 /src/net.cpp | |
| parent | 10f248876aaa77e840dcb0d9585aba2fde712130 (diff) | |
mine: put the block height in the coinbase, so two can never be identical (#59)
Nothing in a coinbase belonged to the block it was in. The transaction was a
function of three things: the difficulty, a counter, and the payout key.
nBits holds still for long stretches, and bnExtraNonce is a local that
restarts at zero whenever the miner does, so the same combination comes
round again and produces a byte-identical transaction with the same txid.
Two blocks then name the same transaction. The index keeps whichever
arrived last, and the outputs of the first stop being reachable, with
nothing logged and nothing shown.
It has already happened twice on the main chain -- coinbase c9e56f7131 at
heights 841 and 859, e635f4441f at 845 and 860 -- and 100 BTF are gone
because of it. #58 has the full account.
Putting the height first makes two coinbases at different heights unequal
by construction, whatever the counter and the key do afterwards.
Nothing validates coinbase content today, so this changes only what this
node produces: blocks stay acceptable to every node already on the network,
with no coordination and no activation height. Requiring the height, and
enforcing BIP30 on top of it, is the separate coordinated step that this
one has to come before.
Verified by mining with the patch: the coinbase reads 5104ffff0f1f0101 --
OP_1 for height 1, then nBits, then the counter -- and the scriptSig is 8
bytes against the 100-byte ceiling in CheckTransaction.
Diffstat (limited to 'src/net.cpp')
0 files changed, 0 insertions, 0 deletions