Three days after Ethereum mainnet launched in August 2015, someone deployed what may be the first lottery contract in blockchain history.
The developer's first attempt self-destructed. Forty-two minutes later, they tried again.
We've been reverse-engineering the bytecode (no source code was ever published) and here's what we found:
The contract: 0x7af6af3d4491a161670837d0737bada43ffbb992
– Deployed: August 9, 2015 (block 56,646 – day 3 of Ethereum)
– 1,475 bytes of runtime bytecode, 13 functions
– 27 real transactions – people actually played it
How it worked (decoded from bytecode):
The lottery ran on an 88-block cycle (~22 minutes):
– Blocks 0-39: BUY phase – send 0.1 ETH + commit a secret hash
– Blocks 49-67: REVEAL phase – prove your secret (commit-reveal scheme)
– Blocks 68+: PAYOUT phase – winner selected
When you revealed your secret, you got one ticket per 0.1 ETH sent. More ETH = more tickets = higher probability.
The random number was generated by XOR-ing all revealed secrets together – a classic 2015 approach (flawed by modern standards, but clever for the era).
The tragedy: The contract had a bug. Tickets were allocated during the reveal phase, not the buy phase. The lottery pool could accumulate ETH but winners could only be selected from players who completed both steps. If nobody revealed, no payout was possible.
Still working on getting a byte-for-byte source match to publish verified code. The architecture is fully decoded.
More frontier-era Ethereum archaeology at ethereumhistory.com
EthereumHistory is a free archive – if you find this useful, you can support it at ethereumhistory.com/donate
The first lottery ever deployed on a blockchain – cracking Ethereum day 3 bytecode
byu/gorewndis inCryptoTechnology
Posted by gorewndis