A single-owner key to value registry: whoever claims ownership first can then map any 256-bit key to any 256-bit value.
Historical Significance
Half of the hash-to-document lookup that early Ethereum tooling used to attach documentation to deployed code. Deploying a contract puts bytecode on chain and nothing else, and this registry is an early attempt at binding a human-readable description to it without trusting a web server to keep the link alive.
Context
Ethereum's Frontier network went live on 30 July 2015. The chain carried almost no applications in its first months: what was deployed was mostly tutorial code, token experiments and registries, written in a Solidity that was itself only a few months old and compiled from the geth console.
Contract Information
Key Facts
Description
HashReg holds one owner and one mapping from a 256-bit key to a 256-bit value. setowner() assigns the owner, but only while the slot is still zero, so whoever calls it earliest holds the contract permanently. After that only the owner may write, through register(key, content).
The intended use is content addressing: the key is the hash of a document, most often the code of a contract, and the value is the hash of the document that describes it. The registry says nothing about where that document can be found, which is what its companion URLhint supplies.
The stored mapping is not readable through a public getter, so a reader has to go to storage directly. Ownership cannot be transferred or renounced.
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
This contract has verified source code on Etherscan.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract HashReg {
function setowner() {
if (owner == 0) {
owner = msg.sender;
}
}
function register(uint256 _key, uint256 _content) {
if (msg.sender == owner) {
content[_key] = _content;
}
}
address owner;
mapping (uint256 => uint256) content;
}
External Links
Related contracts
URLhint
Same deployerA registry mapping a content hash to the URL it can be fetched from, stored in 32-byte pieces, claimable by whoever registers it first.
0xe76f21...16e944August 25, 2015Greeter
Same eraA HelloWorld greeter deployed at block 51,909 on 8 August 2015, one of a run of contracts from the same account that week.
0x412fda...7267edAugust 8, 2015Greeter
Same eraA Greeter with the message 'Ethereum will change the world smarter' - deployed Aug 8, 2015 by a developer connected to the Tokyo Smart Contract meetup.
0xda0c1c...7a68ebAugust 8, 2015MessageStore
Same eraA 6-line contract storing a single public string, deployed Day 9 of Ethereum by a prolific early experimenter who shipped 18 contracts in one week.
0xd2eccd...ff3d6bAugust 8, 2015Greeter
Same eraThe go-ethereum Contract Tutorial greeter, deployed with the greeting: Hello World!
0x506f4b...466983August 8, 2015Contract 0xd4eae4...a2c77a
Same eraThe ethereum.org crowdsale tutorial, deployed on the ninth day of the public chain, with the funding goal, deadline and price fixed at construction.
0xd4eae4...a2c77aAugust 8, 2015