Ethereum Name Service
Nick Johnson <nick@ethereum.org>
Why do we need another name service?
What makes a good name service?
- Separation of concerns
- Distributed authority & implementation
- Forward-compatibility
- Efficient on-chain resolution
ENS Registry
ENS Registry
Namehash
nick.wallet.eth.
Namehash
nick.wallet.eth.
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
0x4f5b81270x46a31f1f0x5d5727cb
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
SHA3(0, 0x4f5b8127)0x46a31f1f0x5d5727cb
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
SHA3(0, 0x4f5b8127)SHA3( , 0x46a31f1f)0x5d5727cb
0x93cdeb70
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
SHA3(0, 0x4f5b8127)SHA3(0x93cdeb70 , 0x46a31f1f)SHA3( , 0x5d5727cb)
0x4bcc8335
Namehash
SHA3(eth)SHA3(wallet)SHA3(nick)
SHA3(0, 0x4f5b8127)SHA3(0x93cdeb70 , 0x46a31f1f)SHA3(0x4bcc8335 , 0x5d5727cb)
0xefcbf86e
Resolvers
contract SimpleResolver is owned {
mapping(bytes32=>address) addresses;
function has(bytes32 node, bytes32 kind)
constant returns(bool)
{
return kind == "addr" && addresses[node] != 0;
}
function addr(bytes32 node) constant returns(address)
{
if(addresses[node] == 0)
throw;
return addresses[node];
}
function setAddr(bytes32 node, address addr) owner_only
{
addresses[node] = addr;
}
function()
{
throw;
}
}
Registrars
contract FIFSRegistrar {
ENS ens;
bytes32 rootNode
function FIFSRegistrar(ENS _ens, bytes32 _rootNode) {
ens = _ens;
rootNode = _rootNode;
}
function register(bytes32 label, address newOwner) {
address owner = ens.owner(sha3(rootNode, label));
if(owner != 0 && owner != msg.sender)
throw;
ens.setSubnodeOwner(rootNode, label, newOwner);
}
}
Auction-based registration
- Only names under .eth are available
- Names are auctioned off using a blind second-price auction
- Names shorter than 7 characters are prohibited
- Winning bidders' deposits are held in contract accounts
- Users can recover deposit by abandoning name
- ...or, transfer name and deposit to the permanent registrar
An interim solution
Questions and comments?
nick@ethereum.org
https://gitter.im/ethereum/go-ethereum/name-registry
https://github.com/ethereum/EIPs/issues/137