World's earliest known on-chain prediction-market resolution oracle, deployed August 12, 2015 — resolves bets on Ethereum mining difficulty.
Historical Significance
This contract is the world's earliest known on-chain prediction-market resolution oracle. Deployed at block 76,165 on August 12, 2015 — seven days after Ethereum's Frontier mainnet release — it introduces the pattern of using a protocol-level data source (block.difficulty) as the input to on-chain bet resolution. The mechanism predates later prediction-market platforms such as Augur, Gnosis, and Polymarket by years.
Context
Deployed in transaction 0xc9f378d160ea94f514a1c166c7221930f6492e7f53055e1c19e51a631cda2bca, this oracle resolves outcomes for prediction-market bets that wager on Ethereum's mining difficulty. A setWinningOutcome(targetBlock, lower, upper) call at or after targetBlock reads block.difficulty and writes a uint16 outcome — 1 if difficulty fell below the lower bound, 10001 if it exceeded the upper bound, or a linear interpolation 0..10000 within range, computed as 10000 * (block.difficulty - lower) / (upper - lower). Each (targetBlock, lower, upper) triple is keyed into a single mapping(uint => uint16) slot via the packed expression targetBlock + lower * (100 * 10**18) + upper * (10000000000000000000000 * 10**18).
The oracle is one of three contracts deployed in the same week by 0x77b97786b0fb73e55d9e92d4b182befbf346f979: the fixed-point math library at 0x258c09146b7a28Dde8d3e230030e27643F91115F (which exposes e_exp, ln, and floor_log2) and a market-maker contract intended to live at 0xdb7c577b93baeb56dab50af4d6f86f99a06b96a2 (the creation transaction ran out of gas, so no code was deployed at that address).
Key Facts
Source Verified
Compiled with `solc 0.1.0` (native C++ build), optimizer OFF. Both creation (496 bytes) and runtime (477 bytes) are byte-for-byte exact matches against the on-chain bytecode. Reconstruction script and on-chain references at https://github.com/cartoonitunes/frontier-oracle-verification.
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 Oracle {
mapping(uint => uint16) winningOutcome;
function setWinningOutcome(uint _targetBlock, uint _lower, uint _upper) {
uint eventKey = _targetBlock + _lower * (100 * 10**18) + _upper * (10000000000000000000000 * 10**18);
if (block.number >= _targetBlock && winningOutcome[eventKey] == 0) {
if (block.difficulty < _lower) {
winningOutcome[eventKey] = 1;
} else if (block.difficulty > _upper) {
winningOutcome[eventKey] = 10001;
} else {
winningOutcome[eventKey] = uint16(10000 * (block.difficulty - _lower) / (_upper - _lower));
}
}
}
function getWinningOutcome(uint _eventKey) constant returns (uint16) {
return winningOutcome[_eventKey];
}
}External Links
Related contracts
Fixed-Point Math Library
Same deployer64.64 fixed-point library: e_exp, ln, floor_log2 for an early LMSR prediction market. Deployed Aug 12, 2015 — pre-Gnosis.
0x258c09...91115fAugust 12, 2015Prediction Market
Same deployerLMSR prediction market (Aug 2015 – Jun 2016, 662 ETH). 11/25 selectors byte-exact, 14/25 semantic reconstructions.
0x2935aa...7a9085August 23, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle fetcher (Oct 12, 2015). get(string) requires >=0.007 ETH, derives a request id from sha3+block.prevhash, emits GetRequest, returns the id, and sends the balance to Vitalik's 0xde0b2956 address. Byte-for-byte cracked (Serpent @ f0b4128).
0x7e7f63...ddf746October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle fetcher (Oct 12, 2015). Same get(string) request contract as 0x7e7f6373; sweeps balance to 0xb3cd4c25. Byte-for-byte cracked (Serpent @ f0b4128).
0x36517c...f1eaf1October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle caller (Oct 12, 2015). Two functions: call() invokes an external fetcher's get(string) and stores a callback id; callback() re-emits the response as LogResponse. NOT a lottery. Byte-for-byte cracked (Serpent @ f0b4128).
0xc861fc...407166October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle caller (Oct 12, 2015). callback + call; call() forwards value to an external fetcher's get(string) and stores a callback id. Sibling of 0xc861fc8d. Byte-for-byte cracked (Serpent @ f0b4128).
0x4fea5c...aa609bOctober 12, 2015