Web3 Beginner Series: Want to Get Rich by Luck? Let’s Talk About Blockchain “Address Collisions”

Introduction

Suppose someone has a wallet with 100 BTC (roughly $10 million), but they lost the private key. In theory the bitcoins are still on‑chain — if someone “by chance” generates the exact same private key or address, they could take the funds.

So the question is: can I write a program that frantically generates random addresses, try my luck, and maybe hit a wealthy address?

What is an “address collision”?

Plain explanation

Imagine:

  • The world has about 10^48 lockers (that is, a 1 followed by 48 zeros).
  • About 100 million of those lockers contain money.
  • You randomly guess a locker number to see if you win.

That’s what a blockchain “address collision” is — randomly generating addresses in hopes of colliding with an address that has a balance.

How are blockchain addresses derived?

Simplified flow:

  1. Generate a random number (the private key)
  2. Compute the public key from the private key using math
  3. Hash the public key to get the address

That’s it — an address is produced.

Try it yourself: 10 lines of code to generate a wallet

Step 1: install the tool

# install ethers.js via npm
npm install ethers

Step 2: write the code

Create a file create-wallet.js

const { ethers } = require('ethers');

// generate a random wallet
const wallet = ethers.Wallet.createRandom();

console.log('🎉 Congrats! Your new wallet:');
console.log('Address:', wallet.address);
console.log('Private key::', wallet.privateKey);
console.log('\nMnemonic(12 words — remember it!):');
console.log(wallet.mnemonic.phrase);

Step 3: run it

node create-wallet.js

Sample output:

🎉 Congrats! Your new wallet:
Address: 0x0649472C2c03cFc0841bAd56A51f3c8e7f952F35
Private key: 0x084fdb0de766d3e8e5a164a84bf49f43c170bcacb2944e233e9cfdadd1d48fe7

Mnemonic (12 words — remember it!):
basic zoo front around turkey boy crew hair awake prefer acquire obey

There you go — you’ve generated a wallet address. 🎊

So, can I mass‑generate addresses and try my luck?

Example “address collision” program

You can certainly try! Here’s a loop example.

(First you’ll need to sign up for a ZAN account, enable node services, and get an RPC URL.)

const { ethers } = require('ethers');

console.log('🎰 Starting address collision attempt — good luck!\n');

// connect to Ethereum network (to check balances)
const provider = new ethers.JsonRpcProvider('https://api.zan.top/node/v1/eth/sepolia/YOUR_API_KEY');

let attempts = 0;

async function tryMyLuck() {
  while (true) {
    attempts++;
    
    // generate a random address
    const wallet = ethers.Wallet.createRandom();
    
    // check balance
    try {
      const balance = await provider.getBalance(wallet.address);
      
      if (balance > 0) {
        // 🎉 jackpot!
        console.log('💰💰💰 Jackpot! Found a funded address!');
        console.log('Address:', wallet.address);
        console.log('Balance:', ethers.formatEther(balance), 'ETH');
        console.log('Private key:', wallet.privateKey);
        break;
      } else {
        // still empty...
        if (attempts % 100 === 0) {
          console.log(`Tried ${attempts} times, still going...`);
        }
      }
    } catch (error) {
      console.log('Query error, continuing...');
    }
  }
}

tryMyLuck();

Run result (example)

🎰 Starting address collision attempt — good luck!

Tried 100 times, still going...
Tried 200 times, still going...
Tried 300 times, still going...
Tried 400 times, still going...
Tried 500 times, still going...
...
(You’ll keep seeing this until the heat death of the universe.)

How hard is it? Let’s do the math

Basic data

  • Ethereum address space: 2160 possible addresses (≈ 1.46×1048 )
  • Estimated number of addresses with a balance: ~100 million (108)
  • Single‑try collision probability: 108 /1048 = 10-40

What does 10^−40 mean?

Let’s make it relatable.

1. Lottery 🎫

Winning the Double‑Color Ball jackpot:        1/17,721,088     (about 1 in 10 million)
Colliding with a blockchain address:    1/10^40          (1 in 10^40)

Difficulty gap:            10^32 times harder

Another analogy: If winning the lottery is like “randomly picking the right person in all of China,” then an address collision is like “randomly picking a specific atom in the entire universe correctly 40 times in a row.”

Gacha game 🎴
Suppose the SSR drop rate is 0.6% (0.006). Address collision is roughly equivalent to pulling 18 SSRs in a row at that rate — essentially impossible.

2. Everyday probabilities 🌍

You need...

Probability

Randomly selecting yourself from 8 billion people

10^-9

Getting struck by lightning while walking

10^-6

Winning the lottery

10^-7

Colliding with a blockchain address

10^-40

Why so hard? The math principle

Huge address space

An Ethereum address looks like:

0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

Without the 0x it’s 40 hexadecimal characters, i.e., 160 bits.

Number of possible combinations:

2^160 = 1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

If you tried to read it aloud it would come out roughly like: 'one thousand four hundred and sixty‑one ... unfathomable five thousand...' (this already exceeds the conventional Chinese number‑naming scale).

Real‑world cases

Has anyone ever succeeded? 🤔

From Bitcoin’s birth in 2009 to today:

  • Zero successes by random collision — nobody has gained funds by purely random address collision.
  • Zero private‑key brute‑force cracks — no one has mathematically brute‑forced a private key.

So how are wallets stolen?

All reported wallet thefts are due to:

Cause

Share (percentage)

Prevent

🎣 Phishing sites

40%

Double‑check URLs

📱 Malware / trojans

30%

Don’t install random software

💬 Private key leaks

20%

Never share your private key

🐛 Smart contract vulnerabilities

10%

Be cautious with approvals

🎰 Address collision success

0%

Doesn’t happen

Key point: thefts are caused by human error, not mathematics being broken.

Should I still worry about security?

Mathematically: you’re safe

As long as:

  • Your private key is truly randomly generated (don’t use weak keys like 1234567890 )
  • You don’t leak your private key

Mathematically, no one can crack your wallet.

In practice: watch out for these ⚠️

Although address collisions are essentially impossible, you should still be careful:

What NOT to do

// ❌ Create a wallet from a weak private key
const wallet = new ethers.Wallet('0x0000000000000000000000000000000000000000000000000000000000000001');

// ❌ Screenshot private keys
// ❌ Paste them into cloud notes
// ❌ Send them over WeChat / email
// ❌ Tell anyone your mnemonic
// ❌ Use example mnemonics from tutorials

What TO do:

// ✅ Use the library’s random generator
const wallet = ethers.Wallet.createRandom();

// ✅ Write the mnemonic on paper
// ✅ Store it in a safe or safety deposit box
// ✅ Keep multiple offline backups in different places
// ✅ Use a hardware wallet for large balances

Quick summary

Key takeaways

  1. Generating addresses is trivial — a few lines of code generate countless addresses.
  2. Address collision is astronomically hard — ~10^32 times harder than winning the lottery.
  3. Math is secure — from 2009 to now, nobody has succeeded by collision.
  4. Humans are the weakest link — all known thefts result from leaked keys or scams, not broken cryptography.

One‑line conclusion

Instead of wasting time trying to collide addresses, go buy a lottery ticket; instead of that, get a job. 😄

For those who really want to try address collisions

If you insist:

const { ethers } = require('ethers');

console.log('Address collision difficulty comparison:');
console.log('');
console.log('Lottery jackpot probability:     1 / 10,000,000');
console.log('Address collision probability:     1 / 10,000,000,000,000,000,000,000,000,000,000,000,000,000');
console.log('');
console.log('Recommendations:');
console.log('1. f you have that compute power, mine instead');
console.log('2. If you have that time, do honest work instead');
console.log('3. If you have that luck, buy a lottery ticket');
console.log('4. If you really want to try, I won’t stop you 🤷');

Appendix: full address‑collision simulator

Want to experience “waiting forever”? Here’s a full version:

const { ethers } = require('ethers');

console.log('🎰 lockchain Address Collision Simulator v1.0\n');
console.log('⚠️ Warning: this program could run until the heat death of the universe\n');

const provider = new ethers.JsonRpcProvider('https://api.zan.top/node/v1/eth/sepolia/YOUR_API_KEY');

let attempts = 0;
let startTime = Date.now();

async function bruteForce() {
  console.log('🚀 Starting address collision attempt...\n');
  
  while (true) {
    attempts++;
    
    // generate a random wallet
    const wallet = ethers.Wallet.createRandom();
    
    // query balance every 1000 attempts (too frequent calls will be rate‑limited)
    if (attempts % 1000 === 0) {
      try {
        const balance = await provider.getBalance(wallet.address);
        
        if (balance > 0n) {
          console.log('💰💰💰 Wow! Jackpot!💰💰💰');
          console.log('Address:', wallet.address);
          console.log('Balance:', ethers.formatEther(balance), 'ETH');
          console.log('Private key:', wallet.privateKey);
          console.log('Mnemonic:', wallet.mnemonic.phrase);
          console.log('\n🎉 Go buy a lottery ticket! Your luck is insane!');
          break;
        }
      } catch (error) {
        // on query failure, continue
      }
      
      // show progress
      const elapsed = (Date.now() - startTime) / 1000;
      const speed = attempts / elapsed;
      const remainingAttempts = 1e40;
      const remainingYears = (remainingAttempts / speed) / (365.25 * 24 * 3600);
      
      console.log(`Attempts: ${attempts.toLocaleString()}`);
      console.log(`Elapsed: ${elapsed.toFixed(1)} s`);
      console.log(`Speed: ${speed.toFixed(0)} attempts/s`);
      console.log(`Estimated remaining: ${remainingYears.toExponential(2)} years`);
      console.log(`Progress: ${(attempts / 1e40 * 100).toExponential(2)}%`);
      console.log('---');
    }
  }
}

bruteForce().catch(console.error);

Final notes

Remember these three rules:

  1. Generating addresses is easy — a few lines of code do it.
  2. Address collisions are virtually impossible — astronomically less likely than lotteries.
  3. Protect your private key — that’s the only real security risk.


⚠️ Important reminder ⚠️

Never use example mnemonics or private keys from online tutorials!

Never tell anyone your private key!

Never tell anyone your private key!

Never tell anyone your private key!

(Important things, said three times.)

About ZAN

As a technology brand of Ant Digital Technologies for Web3 products and services, ZAN provides rich and reliable services for business innovations and a development platform for Web3 endeavors.

The ZAN product family includes ZAN Node ServiceZAN PowerZebra (zk acceleration), ZAN Identity (Know your customers and clients), ZAN Smart Contract Review, with more products in the pipeline.

Contact Us

WebsiteXDiscordTelegram