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).
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
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 insecretHashand 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 thesecretsarray, and grants the caller one entry in theticketsarray 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()selectstickets[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
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
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract EarlyLottery {
uint public lastBlock;
address owner;
uint public balance;
address[] public tickets;
uint[] public secrets;
mapping (address => uint) public secretHash;
mapping (address => uint) public balances;
function EarlyLottery() {
lastBlock = block.number;
owner = msg.sender;
}
function sha(uint x) returns (uint) {
return uint(sha3(x));
}
function die() {
if (msg.sender == owner) suicide(owner);
}
function payoutReady() returns (bool) {
return block.number % 88 > 68 && block.number - lastBlock > 68;
}
function buyTicket(uint secret) {
if (block.number % 88 < 40) {
secretHash[msg.sender] = secret;
balances[msg.sender] += msg.value;
balance += msg.value;
}
}
function submitSecret(uint secret) {
if (block.number % 88 < 68 && block.number % 88 > 48) {
if (uint(sha3(secret)) == secretHash[msg.sender]) {
secrets.length = secrets.length + 1;
secrets[secrets.length - 1] = secret;
for (uint32 i = 0; i < balances[msg.sender] / 100000000000000000; i++) {
tickets.length = tickets.length + 1;
tickets[tickets.length - 1] = msg.sender;
}
}
}
}
function payout() returns (address winner) {
address w;
uint i;
if (payoutReady()) {
w = tickets[random()];
w.send(balance - 25000 * tx.gasprice);
lastBlock = block.number;
delete secrets;
balance = 0;
for (i = 0; i < tickets.length; i++) {
delete secretHash[tickets[i]];
delete balances[tickets[i]];
}
delete tickets;
return w;
}
}
function random() returns (uint64) {
uint x;
uint i;
for (i = 0; i < secrets.length; i++) {
x = x ^ secrets[i];
}
return uint16(x % tickets.length);
}
}External Links
Related contracts
Lottery
Same deployerThe first draft of the EarlyLottery commit-reveal lottery, deployed on 8 August 2015 a few hours before its rewrite.
0xf6bf0e...ec3b5cAugust 8, 2015EarlyLottery
Same deployerCommit-reveal lottery prototype deployed on 8 August 2015, the earlier draft of the EarlyLottery contract by the same developer.
0x7573ac...ad9fb4August 8, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0xb179a8...4bf09dAugust 9, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0x82000e...b0690aAugust 9, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0x627a6e...25bce8August 9, 2015LotteryPrototype
Same deployerThe first lottery contract deployed on Ethereum mainnet, created August 9, 2015 by one of the earliest recorded Ethereum users. Built, tested with two participa
0xcdd192...1b622cAugust 9, 2015