Repository navigation
Add full bodies for 8 stale blocks recovered from public btcd peers - #158
Conversation
Fill existing header-only entries with original serialized block data downloaded over Bitcoin P2P on 2026-09-26, preserving witness data.
|
Brilliant @john-a-zoidburg, thanks again! |
|
Does the BTCNodes public snapshot API contain most btcd peers? As in, is it worth concerted effort to query btcd nodes for other blocks? |
|
I tried all of the publicly connectable btcd nodes that I could easily find, however there could definitely be more. The bigger win might come from nodes that do not have open inbound connections, and only make their own outbound connections. I was thinking we could set up a custom modified bitcoin core build which would sit and wait for btcd nodes to connect to it, and then request known state blocks. |
Yeah, clever idea! |
|
There's the |
|
Prototype P2P network stale block collector - john-a-zoidburg/bitcoin#1 |
|
Looks good to me! Thanks again for all these. |
Summary
Adds complete serialized bodies for eight existing stale-block headers, spanning June 2016 to April 2026: 10,423,119 bytes and 16,614 transactions, including coinbases and applicable witness data.
The change adds eight
.binfiles underblocks/. Each starts with the byte-identical header already recorded instale-blocks.csv; the CSV is unchanged.Provenance and recovery
The bodies were downloaded on September 26, 2026 UTC from public Bitcoin P2P endpoints identifying themselves as btcd peers. Peers were discovered through saved captures of the BTCNodes public snapshot API. Standard
getdatarequests for the already-known hashes returned the full blocks, usingMSG_WITNESS_BLOCKwhere supported. The contributed files preserve those response bytes unchanged.btcd was a useful recovery target because its block-serving path fetches stored blocks by hash without Bitcoin Core's stale-block age restriction. Core only serves blocks outside its active chain if they have passed script validation and are within 30 days of its best header, measured by both timestamp and proof-equivalent work. This restriction applies even when Core still has the older data on disk. btcd can therefore serve much older stale blocks when it still retains them, as these recoveries demonstrate.
Validation
ci/sanity-check.py,ci/check-with-bitcoind.pyandgit diff --check. The Core check used Bitcoin Core 31.1 with P2P disabled: 1,395 block files checked without rejection. Six pre-existing headers have unknown parents; all eight contributed blocks were checked.Validation scope: the additional checks reconstructed the required input state; they did not replay the full historical chainstate. For one input in 946239, availability was corroborated by current unspent observations from a local Esplora index and Blockstream Esplora, rather than an authenticated canonical spend.
Checks ran offline or on isolated instances with P2P disabled. No block or transaction was broadcast.
Transaction observations
The recovered bodies contain 12 ordinary transactions absent from the canonical-chain indexes checked during analysis: one in 497373, one in 921987 and ten in 946239. Ten directly conflict with confirmed transactions; the other two depend on those conflicting transactions.
Conversely, one transaction in 488710 confirmed 2,283 blocks later, at height 490993. Its exact bytes were verified in the later canonical block, illustrating why a short lookahead can misclassify a transaction as absent from the surviving chain.