Bitcoin Core Update Shrinks Optional Transaction Index by 40 GB
A recent update to Bitcoin Core has led to a significant reduction in the size of the optional transaction index, also known as txindex. The database shrank by approximately 40 GB, from around 66 GB to 26 GB, according to a contributor's mainnet test.
The redesign of the txindex is part of pull request #35531, which was merged into Bitcoin Core's master branch on August 15th. This change is specific to nodes that use the -txindex option and maintains a database for retrieving transactions by their full transaction ID.
Unlike other parts of the node's data directory, including the blockchain, the reduced size only applies to this optional index. The new format uses a shorter lookup key, derived from a salted SipHash, followed by a six-byte suffix encoding the block sequence and transaction offset.
The verification step protects against collisions created by the shorter prefix, which would otherwise lead to extra read and verification work. In the contributor's test, lookups took about 0.2 milliseconds, with a rebuild time of around 1 hour 19 minutes versus 1 hour 50 minutes with the prior format.
However, capturing the full savings requires recreating the index through an upgrade, as existing txindex databases remain readable after an update but keep their larger footprint. A later downgrade also carries a second migration cost, requiring another rebuild in the old format.