Bitcoin wallet randomness concerns the unpredictable input used to create the private keys that authorize Bitcoin spending. A key can be represented by a very large number without being difficult to guess: its security also depends on how that number was chosen. Early Bitcoin combined OpenSSL's random-number generator with operating-system observations and user-interface events, including mouse movement. Later wallet designs changed where fresh randomness enters the system, particularly when deterministic wallets made one recoverable seed the ancestor of many keys.
2009: key generation through OpenSSL
The surviving v0.1.5 Bitcoin source delegates elliptic-curve key creation to OpenSSL. In key.h, CKey::MakeNewKey() calls EC_KEY_generate_key and throws an error if it fails. In main.cpp, GenerateNewKey() invokes that method and writes the resulting public and private key to the wallet database. The interface's New Bitcoin Address control calls GenerateNewKey() and then formats the public key as a receiving address. Original key generation — direct source · Original wallet key storage — direct source · Original receiving-address handler — direct source
These were individually generated wallet keys, not children deterministically calculated from a written-down recovery phrase. A file backup that preceded creation of another key might omit it. The October 2010 key-pool improvement and the later history of deterministic recovery are traced at Deterministic wallets; backup coverage and key unpredictability are related security problems, but they are different problems.
The same v0.1.5 source also includes a general GetRand(nMax) helper in util.cpp. It obtains a random 64-bit value from OpenSSL's RAND_bytes and rejects values outside a multiple of nMax before applying the modulus, avoiding the straightforward modulo-bias mistake. This helper is evidence of a separate random-number use; the actual wallet-key-generation path above calls EC_KEY_generate_key. Original random helper — direct source
Protecting a private key after generation is a separate security task. Bitcoin wallet encryption traces the September 2011 native-encryption release and November correction for plaintext key remnants in Berkeley DB. That incident did not establish a failure of the underlying random-number generator or elliptic-curve key generation. Contemporary correction notice
Startup: screen, performance counter and system observations
The original util.cpp defines an OpenSSL initialization object whose constructor calls RAND_screen() and then RandAddSeed(true). The source comment describes the first call as seeding from a screen scrape and other hardware sources. The second routine calls Windows QueryPerformanceCounter and adds the counter to OpenSSL with RAND_add. Original initialization and seeding code — direct source
RandAddSeed also attempts to read the Windows performance-data registry key. On success it hashes the returned bytes with SHA-256 and mixes the result into the generator, supplying an estimated entropy amount capped at the hash's size. The performance-data collection is conditional: the code tests the Windows API result before using the retrieved material. When invoked without the forced flag, the performance-data portion is rate-limited to roughly once every five minutes, while the counter is still mixed on each call. Original performance-data path — direct source
This is a Windows-oriented implementation record from a preserved early source tag. It is not a complete accounting of OpenSSL's own platform-specific entropy behavior, nor direct evidence of the bytes produced on a running 2009 machine. A comment that describes a source as random is a statement about the designer's intention, not a measurement of that source's unpredictability.
Mouse movement really was in Bitcoin's original wallet
There is a surprisingly concrete answer to whether the original wallet drew randomness from mouse motion: yes, as supplemental input to OpenSSL, not as a direct formula for the private key.
The CMainFrame::OnMouseEvents handler in ui.cpp calls RandAddSeed() and then passes the event's m_x and m_y coordinates separately to OpenSSL RAND_add. Its generated interface wiring in uibase.cpp connects this handler to wxEVT_MOTION as well as mouse-button, double-click, enter/leave and wheel events on the main frame. This was not merely an unused function named after the mouse: the event registration is present in the same tagged tree. Original handler — direct source · Original event bindings — direct source
Each coordinate is passed with the literal third argument 0.25. The historical OpenSSL RAND_add interface expresses that argument as an estimate in bytes of entropy, not bits. Thus the calls nominate 0.25 byte (two bits) for each coordinate, or 0.5 byte (four bits) across the two calls. That is the code's estimate for its generator's accounting, not a measurement that four fresh unpredictable bits arrived on every mouse event. Original numeric arguments · Historical OpenSSL RAND_add documentation
A mouse follows a continuous path, can remain still, and can emit correlated or repetitive positions. Cryptographic unpredictability is not the same thing as an irregular-looking drawing. RFC 4086, published in June 2005, already observed that mouse and keystroke events could provide hard-to-guess data but that repetition, timing resolution and adversarial influence restricted their value. The original Bitcoin handler passes coordinates and mixes a performance counter; it does not itself compute or prove a statistical entropy rate for the resulting stream. RFC 4086 §3.5 — contemporary security guidance
When wallets began deriving many keys from one secret
Bitcoin's 9 October 2010 source change introduced a reserve key pool before the better-known 21 October 0.3.14 release announcement. It generated private keys in advance so a wallet.dat backup might already contain secrets the client would use later for receiving addresses, change or mining. Pooling did not add entropy, improve the unpredictability of each generated key, or create an endlessly recoverable master seed. The distinction between key generation and backup coverage is documented at Bitcoin key pool and Deterministic wallets. 9 October source change · 9 October first-party description
Subsequent deterministic schemes changed the security boundary. Instead of generating an unrelated secret for every address, software derives many spending keys from a seed. The seed must still be unpredictable when created; deterministic derivation cannot rescue a weak starting secret. Electrum's early November 2011 commits show an instructive revision: its first implementation derived keys from user-supplied text, but a 6 November change introduced generation of a random 128-bit seed, reducing dependence on users inventing sufficiently unpredictable phrases. This is versioned code evidence, not proof of what every first-week user ran. Initial Electrum source · Random-seed revision
BIP 39, assigned 10 September 2013, makes the same separation explicit. Its mnemonic scheme encodes 128–256 bits of generated entropy, adds a checksum, and maps the bits to words. A word list is a human backup format, not a mechanism that makes a human-chosen sentence random. BIP 39 is also distinct from BIP 32's hierarchical key derivation. BIP 39 specification — first-party · BIP 32 specification — first-party
Browser-generated paper keys: similar mouse input, different software
The maintained Bitaddress.org changelog dates its addition of a PaperWallet tab and additional mouse-motion input to 2 October 2011. It separately records a 9 January 2012 feature that performed SHA-256 on user-entered text to create a private key, and a 29 July 2012 dedicated Brain Wallet tab. The project thus documented both supplemental user-motion input and a human-phrase-derived key mechanism. Neither date establishes how unpredictable any particular user's mouse movement or phrase actually was. These are first-party version notes, not equivalent to the source-level evidence above for Bitcoin's v0.1.5 wallet. Bitaddress.org maintained changelog
The same version history lists 24 October 2013 for adding BIP 38 passphrase-protected paper wallets. That format encrypts a key record, and can wrap an independently generated key, rather than requiring a user-chosen phrase to serve as the original key source. Its EC-multiply mode has a separate two-party key-generation construction. The comparison explains why the words mouse entropy, brainwallet and encrypted paper wallet should not be treated as interchangeable security claims. BIP 38 — two modes · First-party version history
The modern Bitcoin Core boundary
The original source does not describe present-day Bitcoin Core. On 31 October 2018, Pieter Wuille opened an explicit built-in RNG design discussion distinguishing strong randomness for private keys, seeds and encryption keys from faster randomness for less sensitive uses. That discussion is a design record, not by itself evidence that every proposal was implemented at once.
In the Bitcoin Core v31.0 tagged source, CKey::MakeNewKey repeatedly calls GetStrongRandBytes until a candidate secret key passes the secp256k1 validity check. The corresponding random.h describes a global RNG state and specifies that strong generation mixes operating-system entropy, terminating if that source fails. The matching random.cpp implements OS-specific paths and also mixes other inputs. The explicit modern source therefore provides a stronger reference than projecting the 2009 Windows/OpenSSL calls forward unchanged. v31.0 private-key generation — direct source · v31.0 RNG contract — direct source · v31.0 implementation — direct source
This describes Bitcoin Core at one source revision. Other hardware wallets, browser tools, paper-wallet generators and Ordinals wallets have their own key-generation implementations. A familiar address format, a valid signature or a successfully confirmed transaction cannot demonstrate the unpredictability of the private key that authorized it.
Implications for inscriptions and Bitmap
Ordinals associates an inscription with a sat and tracks its location using Bitcoin transactions. Bitmap recognises District and Parcel claims and applications commonly display the current holding address. Neither application-layer interpretation repairs weak key generation. If someone can predict a wallet's private key, they may be able to sign a valid spend of its outputs, including outputs holding inscriptions. The ledger will still validate the signature without knowing how the key was created. This is an architectural consequence, not evidence of a particular historical compromise. Bitcoin address distinguishes a visible receiving string from the underlying spending condition.
Source status and open research
The v0.1.5 files and the v31.0 files are direct implementation records for two tagged code trees. The October 2010 Bitcoin release thread is contemporary first-party testimony. The October 2018 design issue is a dated proposal and discussion. OpenSSL's historical API documentation and RFC 4086 explain the measurement problem; they do not constitute an audit of the original wallet's runtime.
Trace the removal or replacement of the 2009 GUI mouse-coordinate seeding and
RAND_screen paths through dated Bitcoin releases. Do not infer a single cutover date from a current source tree.Compare independently preserved 2009 binaries and their exact OpenSSL dependencies with the
v0.1.5 source before generalizing this reconstruction to every first-release installation.Identify direct, independently reproducible evidence of historical private-key entropy failures in specific wallet implementations. Avoid turning a theoretical risk or anecdotal security report into a demonstrated Bitcoin Core compromise.
From the archivist's desk
I went looking for the mouse. It is actually there, wired to events in the early GUI and feeding coordinates to OpenSSL. The more important finding is what it '''wasn't''': a private-key recipe made from the shape of someone's hand movement. The source records a mixture of inputs. Whether those inputs were truly surprising to an attacker is a different question, and the archive should keep that question open.