Back to Home

EarlyLottery

Lottery / Gambling
0x7af6af3d4491...ada43ffbb992
FrontierContract #105Exact Bytecode MatchEdit this contract
Deployed August 9, 2015 (11 years ago)Block 56,646

A commit-reveal lottery on an 88-block cycle, deployed August 9, 2015, ten days after genesis. Players commit a hashed secret, reveal it to earn one ticket per 0.1 ETH, and the winner is drawn from the XOR of all revealed secrets. Source recovered by exact bytecode match (solc v0.1.1).

Frontier EraVerified Source

Historical Significance

One of the earliest lottery contracts on Ethereum mainnet, deployed 10 days after genesis as an iteration on a same-day prototype. The deployer was among the very first Ethereum users. Its recovered source is a fully worked commit-reveal randomness scheme, showing that the trust problem in on-chain gambling was being addressed with real cryptographic constructions, not just noted as a limitation, within the first two weeks of Ethereum's existence.

Context

Deployed August 9, 2015 (Frontier period), 10 days after the Ethereum genesis block. The deployer was active from block 46,235 and created 18 contracts during the first weeks of Ethereum. Compiled with solc v0.1.1, released just five days earlier on August 4, 2015. On-chain randomness challenges for lottery contracts were recognized from the earliest period of Ethereum development, and this contract's commit-reveal design is an early practical response.

Key Facts
Deployment Block
56,646
Deployment Date
Aug 9, 2015, 03:19 AM
Code Size
1.5 KB
Gas at Deploy
454,900
Transactions by Year
20157
202618

Description

Deployed at block 56,646 on August 9, 2015, this lottery contract is the second deployment by address 0xFD2605a2bF58fDbB90db1Da55dF61628B47F9e8c in the same session. The deployer had built a prototype lottery at 0xcdd192f2c49383af4321c7d1941fb3c9ca1b622c (block 56,478), tested it with two participants, paid out, and then self-destructed it. This contract was deployed 42 minutes later as the follow-up iteration.

The source has been recovered by bytecode archaeology and matches the on-chain code exactly: 1,475 of 1,475 runtime bytes, and 1,516 of 1,516 creation bytes, compiled with solc v0.1.1+commit.6ff4cd6 with the optimizer enabled. v0.1.1 was released on August 4, 2015, five days before deployment.

The recovered source shows a commit-reveal lottery running on a fixed 88-block cycle, split into three phases by block.number % 88:

  • Buy phase (cycle position 0-39): buyTicket(uint256) records a hash commitment for the caller in secretHash and credits the ETH sent to both the caller's balance and the shared prize pot.
  • Reveal phase (cycle position 49-67): submitSecret(uint256) checks the caller's preimage against the stored commitment, appends the revealed secret to the secrets array, and grants the caller one entry in the tickets array for every 0.1 ETH staked, so a larger stake buys proportionally more chances.
  • Payout phase (cycle position 68+, and at least 68 blocks since the last draw): payout() selects tickets[random()] and sends the pot to the winner, then clears all per-round state.

random() returns the XOR of every revealed secret, reduced modulo the ticket count. Because each participant contributes entropy that is committed before any reveal, no single player can steer the draw unless they are the last to reveal. The payout deducts 25000 * tx.gasprice from the pot to reimburse the caller's gas, an early instance of paying a keeper to trigger settlement.

Gambling and lottery contracts were among the earliest use cases deployed on Ethereum, and the difficulty of generating verifiable randomness on a deterministic chain was a known limitation discussed in the community from the start. The commit-reveal scheme here is a direct answer to that problem, implemented within the first two weeks of the network's existence.

Source Verified

SolidityExact bytecode match(1,516 bytes)
Compiler: v0.1.1+

Exact match: runtime 1475/1475 bytes and creation 1516/1516 bytes. Compiler solc v0.1.1+commit.6ff4cd6, optimizer ON. No constructor arguments. Verified on Etherscan.

Historian Categories

Lottery / Gambling
Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Lottery / Gambling
Contains SELFDESTRUCT opcode

Bytecode Overview

Opcodes1,516
Unique Opcodes160
Jump Instructions96
Storage Operations56

External Links

Related contracts