Nick Johnson
nick@ens.domains
Ethereum Name Service
This event is brought to you by workonblockchain.com
Overview
What is ENS?
0x112234455c3a32fd112
30c42e7bccd4a84e02010
What is ENS?
inigomontoya.eth
More than just names
ENS names contracts and accounts, but also…
What is ENS?
ENS Architecture
Resolving a name
ENS by example: Resolvers
Contract MyResolver {
address me;
function MyResolver() {
me = msg.sender;
}
function addr(bytes32 node) constant returns (address) {
return me;
}
}
Using ENS from Javascript
var ENS = require(‘ethereum-ens’);
var ens = new ENS(web3);
Looking up names
var address = ens.resolver(‘inigomontoya.eth’).addr();
Reverse resolution
var name = ens.reverse(‘0x112234455...’).name();
Setting up reverse resolution
In JS:
reverseRegistrar.claim(eth.accounts[0],
{from: eth.accounts[0]});
In Solidity:
reverse.claim(msg.sender);
Contracts in web3
var testContract = web3.eth.contract(
[{"constant":true,"inputs":...}])
var test = testContract.at(“0x0904dac3347ea47d208f...”);
Contracts in ENS
var test = ens.resolver(‘inigomontoya.eth’).instance();
Registrars in ENS
REGISTERED
ENS by example: Registrars
contract SimpleRegistrar {
ENS ens;
bytes32 root;
function claim(bytes32 label) {
if(ens.owner(sha3(root, label)) != 0)
throw;
ens.setSubnodeOwner(root, label, msg.sender);
}
}
The .eth registrar
ENS status
180,822 names auctioned
Ξ168,595 Ether deposited
Top Domains
Client Adoption
What’s next
Any questions?
This event is brought to you by workonblockchain.com