BOMBARCHIVE
Explore

A living reference collection. Written in the wiki, preserved in Git.

The archiveBitcoin

Bitcoin key pool

The Bitcoin key pool was a reserve of pre-generated private keys introduced into the reference Bitcoin wallet in October 2010 to reduce the danger of restoring an outdated wallet.dat backup. In an early non-deterministic wallet, making a new receiving address or a new change output could require a newly generated secret. A backup taken before that secret existed could not recover funds sent to it. The key pool made a bounded supply of future secrets available in advance; it was not a master seed, an unlimited recovery guarantee, or a Bitcoin consensus rule.

Before the pool: fresh change keys and stale backups

By Bitcoin v0.3.12, the wallet's CreateTransaction path generated a fresh key for change when needed. The same source carries a comment about the difficulty of rediscovering change after restoring an older backup. This is direct implementation evidence for that tagged code, not a claim that every previous wallet version handled change identically. The still-earlier v0.1.5 source had a different change-construction path; Pay-to-public-key and Bitcoin wallet randomness keep those implementation stages separate. v0.3.12 transaction creation — tagged source · v0.1.5 transaction construction — earlier source

The danger was especially counterintuitive when the user sent coins to themselves. Bitcoin spends whole transaction outputs. If an output worth 9,000 BTC funds a payment of 1 BTC, the remaining amount can go to a separate change output controlled by another key. A backup containing the old input key can know that the original output was spent but lack the change key. The money did not leave consensus accounting: the wallet lost the ability to spend an output. Bitcoin address explains why a wallet's displayed balance is not an account balance stored on-chain.

17 July 2010: a proposal before the celebrated loss

On 17 July 2010, Gavin Andresen raised the collision between privacy and backup safety in the public thread Privacy versus Safety: handling change. Reusing an old address for change could preserve recoverability but would weaken transaction privacy. He floated the alternative of pre-populating a wallet with 100 change addresses. Privacy versus Safety: handling change — original discussion · Preserved discussion with timestamps

Satoshi's reply that afternoon endorsed a queue of unused pre-made addresses, issued from the front and replaced at the back. He also raised a separate question: would restoring an older wallet allow the software to rescan already downloaded blocks for payments to its pre-generated keys? This was a contemporary proposed design, not yet evidence of a released, tested recovery workflow. The July discussion precedes the better-known August incident; the August report therefore should not be described as the invention of the key-pool idea. 17 July first-party exchange

10–11 August 2010: Stone Man's lost change

On 10 August 2010, a Bitcoin forum user posting as Stone Man reported moving 9,000 BTC into a client on a Debian live environment, backing up wallet.dat, sending 1 BTC to the same receiving address, rebooting the environment and restoring the older wallet. The wallet then showed only the 1 BTC payment rather than the bulk of the funds. The opening post says 8,900 BTC went to an unfamiliar address, but that figure is inconsistent with the 9,000-to-1 arithmetic. Stone Man's original thread — participant testimony

Other participants investigated instead of simply repeating the first number. On 11 August, Insti posted results attributed to Gavin Andresen's bitcointools, showing a transaction in block 73,272 with a 1 BTC self-payment and a separate 8,999 BTC change output. The same reply records a prior 9,000 BTC consolidation in block 73,261 and gives the change destination as 167ZWTT8n6s4ya8cGjqNNQjDwDGY31vmHg. That is a '''contemporary participant's published blockchain analysis''', stronger than an unexplained later retelling but still not a fresh byte-by-byte chain verification by BOMB. Original thread and transaction discussion · Reproduced contemporary replies

The reported loss illustrates the missing-key problem; it does not prove the final fate of every coin or authenticate the contents of the user's surviving backup. A Bitcoin output at an unfamiliar address is not, by itself, proof of theft. Lost sats concerns a broader set of unspendability questions and should not silently equate an inaccessible wallet key with a consensus-level burning mechanism.

9 October 2010: the implementation, before the release announcement

The Git mirror of Bitcoin's historical SVN repository preserves commit 10384941, author-dated 9 October 2010, with the subject key pool for safer wallet backup and a reference to SVN revision 163. It changes db.cpp, db.h, main.cpp, rpc.cpp and ui.cpp, among other files. That is a directly preserved source-change milestone; the imported Git timestamp need not be the exact time users obtained binaries.

Satoshi's forum announcement later on 9 October identified the feature with version 0.3.13.3, gave a default reserve of 100 keys configurable through -keypool=, and warned that he had only tested it moderately. He estimated roughly 1 KB per key and specifically cautioned against immediate use on a website server. He also said that the recovery side had not yet been fully addressed. Satoshi's 9 October statement — contemporary first-party testimony

Bitcoin 0.3.14 was announced separately on 21 October 2010, listing the key pool among the release changes. Treating 21 October as the first appearance would erase the 9 October source and 0.3.13.3 records. Equally, the earlier code commit is not proof that every user had upgraded by that date. Original 0.3.14 release discussion

What the 0.3.14 code actually did

The v0.3.14 wallet database stored each pool entry under a pool key with a numeric index. CKeyPool contained a timestamp and public key; the associated private key was separately stored in the wallet's normal key records. On loading the wallet, the code reconstructed a set of available pool indexes. The pool was therefore a queue of reserved keys already in the wallet, not a replacement for generating or storing private keys. v0.3.14 CKeyPool · v0.3.14 wallet load and pool logic

ReserveKeyFromKeyPool() topped up that set using GenerateNewKey() and -keypool, selecting the lowest available index as the oldest key. It filled to target size plus one before reserving, leaving the desired count of unissued keys in ordinary circumstances. KeepKey() retired a used entry; ReturnKey() restored an unused reservation to the available set. CReserveKey wrapped those operations so aborted transactions did not automatically consume a key. These are observable control paths, not a guarantee about every crash or disk-failure scenario. Source — reserve, keep, return · Source — reservation object

The integration was broader than the receiving-address button. The tagged source used the pool when providing keys for the wallet's GUI and getnewaddress RPC, when selecting a change key for an ordinary payment, and when constructing a new mining reward output. That matters to historical backup reconstruction: receiving addresses, transaction change and mining could all advance key use. GUI address · RPC address · Payment change · Mining reward

A subtle limit follows from the source: the ordinary pool-top-up logic runs when the wallet requests a reserved key. Installing new software did not retroactively place 100 future secrets inside an old backup. A backup created before the pool was first populated could remain exposed to the old problem. The 0.3.14 release discussion reflects this upgrade hazard. On-demand top-up — direct source · Contemporary upgrade discussion

The protection was finite

An ordinary non-deterministic pool did not make every later key recoverable. If the running wallet exhausted keys present in the saved backup and replenished its pool with additional random keys, the saved copy would know nothing about those new keys. An old backup could also lack unrelated account settings or transaction history even if it contained the required spending secrets. The source establishes the key-generation and reservation mechanism; the recovery claim depends on precisely which keys were saved and subsequently used.

A later backup could include the newly generated reserve. That was the virtue of the design, and its limit. Having the relevant key and displaying the relevant transaction after restoration were also different problems: Satoshi's 9 October post explicitly left the rescan/recovery procedure unresolved. Block and transaction verification cannot recreate an absent private key.

Wallet encryption and the 2011 reserve-key reset

The original key pool became relevant to a second wallet-security problem in November 2011. Bitcoin wallet encryption had shipped in Bitcoin 0.4.0 that September, but converting an existing wallet could leave readable plaintext private keys inside the Berkeley DB file. Those secrets included keys the wallet had already generated for its reserve. In the contemporary disclosure, Gavin Andresen warned that requesting one new address could still draw from the exposed pool; the patch had to invalidate the old pool and regenerate keys after rewriting the database. The Bitcoin-Qt 0.5.0 release on 21 November 2011 instructed users to request a new address before backing up the repaired file. Andresen's 12 November key-pool correction · Original recovery instructions

The issue was distinct from stale-backup loss. In 2010, the danger was a secret missing from a backup; in 2011, a secret thought to be encrypted could still be present in plaintext on disk. Deleting old pool entries from the wallet's active database view did not by itself erase their old bytes. Bitcoin wallet encryption follows the original code, reported exploit and corrective release.

Deterministic wallets changed the backup boundary

The next major architectural answer was a derivation scheme that regenerates many keys from one secret. Electrum's early 2011 source provides a directly dated implementation; BIP 32 specified hierarchical deterministic keys later. Bitcoin Core's 0.13.0 release in August 2016 announced that newly created wallets would use BIP 32 derivation, while existing wallets would continue traditional key generation. Its release notes explicitly warned that encrypting a wallet could create a new seed and require another backup. Thus the move to HD did not make backup practices timeless or automatically convert every older wallet. Bitcoin Core 0.13.0 release notes — first-party · Deterministic wallets

The pool itself survived the transition as an implementation mechanism. Bitcoin Core 0.15.0 increased the default pool from 100 to 1,000 keys, with release notes attributing this partly to more robust recovery and faster pool refills. That number marks a later version's default, not the October 2010 implementation and not a consensus protocol parameter. Bitcoin Core 0.15.0 release notes — first-party

Source status and unresolved work

The July and August forum threads are contemporary public discussions, but participant claims and reconstructed blockchain traces have different evidentiary weight. The 9 October commit and v0.3.14 source are direct implementation records. The 9 and 21 October posts are contemporary release statements. Later tagged release notes document subsequent wallet design; they cannot stand in for a full audit of historical binaries.

Open question
Independently re-parse block 73,272 and identify the exact transaction, outputs and subsequent spend history behind the Stone Man case without turning a participant's missing-key report into a provable statement about permanent loss.
Open question
Recover a cryptographically identifiable distribution of Bitcoin 0.3.13.3 to distinguish the first source integration from the first widely installed binary.
Open question
Trace version-specific rescan and backup-recovery behavior immediately after the October 2010 release, including the protection boundary for wallets upgraded from older backups.

See also