Bitcoin Core has merged a redesign of its non-obligatory transaction index that minimize about 40 GB from the database in a single contributor’s mainnet take a look at. Operators utilizing -txindex retain their current indexes by means of an improve; capturing the complete saving requires recreating the database.
Pull request #35531, merged into Bitcoin Core’s grasp department on Aug. 15, lowered the writer’s rebuilt mainnet txindex from about 66 GB to 26 GB. The roughly 61% discount is confined to this non-obligatory index. Bitcoin’s blockchain and the remainder of a node’s information listing stay exterior the measurement.

The code is merged upstream. Secure binaries observe a separate launch course of, and Bitcoin Core’s launch index leaves the primary model containing the change unspecified. Operators will want the migration notes for the discharge that ships it.
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 total transaction ID remains 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 means of its block index, reads the candidate transactions from disk and compares their full IDs. Bitcoin Optech’s technical abstract described collisions as additional learn and verification work, with full-ID checks stopping false transaction matches.
Efficiency 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 peak and software program model can all change these outcomes.
Current txindex databases stay readable after an improve, avoiding a direct pressured rebuild. Their legacy entries additionally maintain the bigger footprint, so realizing the complete 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 not 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.
The operator payoff is substantial inside its slender scope: a a lot smaller non-obligatory 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 crucial.
Launch-specific notes ought to management the precise recreation and downgrade process as soon as the change reaches a steady Bitcoin Core binary.

