|

A hidden Bitcoin node database just shrank by 40 GB, but only if runners rebuild it

Infographic comparing an old 66 GB Bitcoin Core txindex with a compact 26 GB txindex in one contributor

Bitcoin Core has merged a redesign of its non-compulsory transaction index that lower about 40 GB from the database in a single contributor’s mainnet take a look at. Operators utilizing -txindex retain their present indexes by an improve; capturing the total saving requires recreating the database.

Pull request #35531, merged into Bitcoin Core’s grasp department on Aug. 15, diminished the writer’s rebuilt mainnet txindex from about 66 GB to 26 GB. The roughly 61% discount is confined to this non-compulsory index. Bitcoin’s blockchain and the remainder of a node’s information listing stay exterior the measurement.

Infographic comparing an old 66 GB Bitcoin Core txindex with a compact 26 GB txindex in one contributor's mainnet benchmark, showing 40 GB saved and rebuild time falling from 1 hour 50 minutes to 1 hour 19 minutes.

The code is merged upstream. Stable binaries observe a separate launch course of, and Bitcoin Core’s release index leaves the primary model containing the change unspecified. Operators will want the migration notes for the discharge that ships it.

Related Reading

Bitcoin Core considers dropping encrypted routing support as poor node health exposes users to eclipse attacks


How the smaller index works

Bitcoin Core’s -txindex possibility maintains a database for retrieving transactions by their full transaction ID. The outdated format saved every 32-byte transaction ID as a database key alongside transaction disk-position information.

The redesign shops a a lot shorter lookup key: a five-byte prefix derived from a salted SipHash, adopted by a six-byte suffix encoding the block sequence and transaction offset. The full transaction ID continues to be checked earlier than Bitcoin Core returns a match.

That verification step protects towards collisions created by the shorter prefix. Bitcoin Core scans entries sharing the prefix, locates candidate blocks by its block index, reads the candidate transactions from disk and compares their full IDs. Bitcoin Optech’s technical summary described collisions as additional learn and verification work, with full-ID checks stopping false transaction matches.

Performance held regular within the writer’s take a look at. Lookups took about 0.2 milliseconds. The mainnet rebuild completed in 1 hour 19 minutes versus 1 hour 50 minutes with the prior format. Hardware, storage, chain top and software program model can all change these outcomes.

Related Reading

Bitcoin has 185 blocks left before BIP-110 rules begin rejecting blocks


Existing txindex databases stay readable after an improve, avoiding a direct compelled rebuild. Their legacy entries additionally maintain the bigger footprint, so realizing the total 40 GB benchmark saving requires recreating the index.

A later downgrade carries a second migration price. Bitcoin Core’s merged release-note fragment says earlier releases can’t learn entries written within the compact format. Returning to an older launch after rebuilding would set off one other txindex rebuild within the outdated format.

Related Reading

Four unpatched bugs, a 5-year quantum clock, and a miner standoff are pushing Bitcoin to a critical crossroad


The operator payoff is substantial inside its slim scope: a a lot smaller non-compulsory index and a sooner rebuild within the contributor’s take a look at. Capturing it requires deliberate recreation of the database, plus one other rebuild if a rollback turns into mandatory.

Release-specific notes ought to management the precise recreation and downgrade process as soon as the change reaches a steady Bitcoin Core binary.

The submit A hidden Bitcoin node database just shrank by 40 GB, but only if runners rebuild it appeared first on CryptoSlate.

Similar Posts