Entropy (Cryptographic Randomness)

The randomness a key is generated from. Weak entropy means guessable keys and stolen funds.

Basically

Entropy is how unpredictable the random numbers behind your wallet are. Good randomness keeps your private keys and recovery words hard to guess.

Key Takeaways

  • Entropy measures how unpredictable the random numbers behind your private keys and seed phrases are. Higher entropy gives stronger security, and 128 bits of entropy makes brute-force attacks computationally impossible.
  • BIP-39 seed phrases encode either 128 bits of entropy for 12 words or 256 bits for 24 words. The quality of the entropy source when you generate the seed permanently determines the security of every key derived from it.
  • Weak randomness has caused severe losses through the 2013 Android wallet bug, the 2023 Milk Sad vulnerability and brainwallet attacks. Strong cryptographic algorithms cannot protect a wallet when its keys come from weak entropy.

What Is Entropy?

Entropy in cryptocurrency measures the randomness and unpredictability of the data used to generate cryptographic keys. Your wallet software must produce a random number as the foundation for your private key when you create a new Bitcoin wallet. The quality of that randomness determines whether your wallet is secure or vulnerable to attack.

Entropy works like rolling dice. A fair die has high entropy because each roll is genuinely unpredictable, while a loaded die has low entropy because outcomes are biased and partly predictable. Even slight predictability in key generation can reduce security from "unbreakable" to "trivially compromised", and a Bitcoin private key requires 256 bits of entropy selected from roughly 10^77 possible values.

Entropy is a one-time property that matters only when a key is generated. No later security measures can fix a key created from weak entropy. The vulnerability remains permanently embedded in that key.

How It Works

Secure key generation collects raw randomness from physical sources. Algorithms then process that randomness to ensure a uniform distribution and use the result to derive keys.

Entropy Sources

Computers are deterministic machines, so they need external input to produce true randomness. Modern systems collect entropy from multiple physical sources.

From Entropy to Seed Phrase

The BIP-39 standard defines how raw entropy becomes a human-readable seed phrase. The standard sets out the process for that conversion.

The resulting seed phrase uses the PBKDF2 key derivation function to produce a 512-bit seed. An HD wallet then derives all private keys and addresses from that seed using the BIP-32 hierarchical deterministic standard.

Entropy in Private Key Generation

A Bitcoin private key is a random 256-bit integer. That integer must fall within the range [1, n-1], where n is the order of the secp256k1 elliptic curve.

A space of 256 bits of entropy contains more possible Bitcoin private keys than the estimated 10^80 atoms in the observable universe. Brute-forcing a properly generated key is not just impractical but physically impossible with any conceivable technology.

Real-World Entropy Failures

Cryptographic entropy theory is straightforward: use enough random bits and keys are unbreakable. Implementation bugs and design shortcuts have repeatedly undermined that guarantee in practice and caused significant financial losses.

Android Bitcoin Wallet Bug (2013)

A critical flaw was discovered in Android's Java Cryptography Architecture in August 2013. The SecureRandom class did not properly initialise its pseudorandom number generator, causing the ECDSA signing algorithm to reuse nonce values when generating digital signatures.

An attacker can algebraically recover a private key when two signatures use that key and share the same nonce. Multiple Bitcoin wallets were affected, including Bitcoin Wallet for Android, Blockchain.info, BitcoinSpinner and Mycelium. The vulnerability was patched by explicitly seeding the PRNG with entropy from /dev/urandom.

Milk Sad Vulnerability (2023)

The Milk Sad vulnerability, CVE-2023-39910, was disclosed in August 2023 and affected Libbitcoin Explorer (bx) versions 3.0.0 through 3.6.0. The bx seed command used the Mersenne Twister PRNG seeded with only 32 bits derived from the system clock.

The tool could produce only 2^32 unique seeds, approximately 4.3 billion, even when users requested 256 bits of entropy. An attacker with a standard gaming PC could enumerate that brute-forceable space in a matter of days. Over 2,600 wallets were identified as vulnerable, with estimated losses exceeding $900,000 across Bitcoin, Ethereum and other blockchains.

Brainwallet Attacks

Brainwallets derive private keys by hashing a user-chosen passphrase. Human-memorable phrases contain far less entropy than the 256 bits required for secure key generation, so a four-word English phrase chosen from a 200,000-word dictionary provides roughly 70 bits of entropy. That is strong by password standards but catastrophically weak for a cryptocurrency private key.

Attackers build rainbow tables from dictionaries, leaked password databases, famous quotes, song lyrics and other predictable sources. Modern GPUs can test billions of candidate passphrases per second. Automated scanning bots typically steal funds sent to brainwallet addresses derived from common phrases within minutes.

Use Cases

Entropy is not a feature you interact with directly. It underpins every security-critical operation in cryptocurrency.

Silent Failure Mode

Entropy failures are uniquely dangerous because they are invisible when they occur. A wallet generated with weak entropy looks and functions identically to one generated with strong entropy, with no error message, warning or way to detect the weakness by examining the key itself. The vulnerability becomes apparent only when an attacker exploits it.

Supply Chain Risks

You must trust that your wallet software or hardware uses a proper entropy source. A compromised random number generator in a wallet application, operating system or hardware device could systematically generate weak keys across all users. Cold storage devices therefore use dedicated, auditable TRNGs, while open-source wallet implementations allow independent verification of entropy handling. For a deeper look at how wallet infrastructure handles key generation, see the Bitcoin wallet SDK comparison.

Quantum Computing Considerations

Quantum computers threaten some cryptographic algorithms, such as ECDSA via Shor's algorithm, but they do not reduce the entropy of a properly generated random number. Grover's algorithm could theoretically halve the effective entropy, turning 256 bits into 128 bits of equivalent security, but 128 bits remains far beyond any practical attack. The real quantum threat to Bitcoin lies in the signature scheme rather than the entropy of key generation. For more on this topic, see the research on post-quantum cryptography and Bitcoin.

Best Practices

Adequate entropy is essential when you generate cryptocurrency keys. You should follow practices that protect the quality of the randomness behind those keys.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms