...by Daniel Szego
quote
"Simplicity is the ultimate sophistication."
Leonardo da Vinci

Sunday, February 12, 2017

Creating simple name service on the Ethereum Blockchain

Let we implement a simple name service on the Ethereum Blockchain. The service is manifested by one smart contract, called NameService, providing functions to register a name for an address, getting an address for a registered name and rewriting the address of an already registered name. The accessibility is pretty simple, everyone can create a new DNS entry but an existing item can only from the owner of the address overwritten.


Testing the service can be done for the first run simply in Ethereum Studio sandbox, like registering a name and testing if the name can be read back.


Let we test the case from javascript side as well, extending the app.js side of the project with two simple javascript functions to read out and write the name service and some html code that integrates the code on the user interface.



Testing the result from the Javascript side, we get the same result as from the Ethereum Studio.