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.
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];
}
}