Skip to content

Latest commit

 

History

History
153 lines (118 loc) · 6.18 KB

iip-6.md

File metadata and controls

153 lines (118 loc) · 6.18 KB
iip title author discussions-to status type category created
6
ICON Name Service Standard
Phyrex Tsai <[email protected]>, Portal Network Team
Draft
Standards Track
IRC
2018-08-06

Abstract

This draft proposal details the ICON Name Service inspired by the Ethererum Name Service, which originated from the EIP137. This protocol and related interface definition is to provide extendable resoultion of easy-to-remeber, human-recognizable names to services and resources identifers from both centralized and decentralized systems, and only updated the names whenever the underlying resource (public wallet address, smart contract, content-addressed data, etc) changes.

It's common nowadays that using URI with certain convention mapping to the specific resources. With this experience, we utilize the advantage of blockchain to provide blockchain domain names as short, stable, and human-readable identifiers used to specify network resources. In this way, users can enter a memorable string, such as loopchain.icon, just like how we normally do on browser, and be directed to the appropriate resource. The mapping between names and resources may change in any scenarios, so a website may change the corresponding IPFS hashes, projects may update their smart contract, a user may change wallets, or a IPFS document may be updated to a new version, without the domain name changing. Further, a domain need not specify a single resource; different record types allow the same domain to reference different resources. For instance, the browser may resolve loopchain.icon to the IPFS hash to redirect to IPFS content, even resolve the same address to a smart contract.

Motivation

Hash is the fundamental of blockchain and used to represent an account of an identity, but the hash address is not easily remember for the normal user, by integrate the ICON Name Service will bring three following advantages:

  • Human-readable identity, users can easily catch up with the name like loopchain.icon instead of hash address.
  • Multiple services under a single name, such as a DApp hosted in IPFS, a contract address, and even a mail server.
  • Increaing the security by tamper proof of the accessing smart contract for the mapping address.

These three features will lower the gap of blockchain technologies and improvement the user adoption.

Specification

The INS system has thsee main parts:

Registry

INS registry is a single contract that provides a mapping from any registered name to the resolver responsible for it, and permits the owner of a name to set the resolver address, and to create subdomains, potentially with different owners to the parent domain.

Registrars

INS registrar is a smart contract that owns a Top-level domain, and allocates subdomains of it according to some set of rules defined in the smart contract code. For any available domain name, users will be able to purchase. The rules for the INS registrar smart contract will be interatly updated according to meet the benefit of whole ICON community.

Resolvers

INS resolvers are responsible for performing resources from a domain name, a resources can be a contract address, wallet address and IPFS hash. Utilizing the resolver smart contract enables users and developers using the decentralized resources easily bring more ideas and values to the ecosystem.

Reverse Resolvers

INS reverse resolver is a smart contract records that mapping from addresses to names.

Registry Smart Contract

The INS registry contract exposes the following functions:

Returns the owner of the specified node.

@external(readonly=True)
def owner(node) -> Address: 

Returns the resolver for the specified node.

@external(readonly=True)
def resolver(node) -> Address: 

Returns the time-to-live (TTL) of the node; that is, the maximum duration for which a node's information may be cached.

@external(readonly=True)
def ttl(node) -> int: 

Transfers ownership of a node to another registrar. And this function may only be called by the current owner of node.

@external
def setOwner(node, owner: Address) : 

Create a subdomain and the sets its owner to owner

@external
def setSubnodeOwner(node, label, owner: Address) : 

Sets the resolver address for node. And this function may only be called by the owner of node.

@external
def setResolver(node, resolver: Address) : 

Registrar Smart Contract

The INS registrar contract exposes the following functions:

Register a name, or change the owner of an existing registration.

@external
def register(node, owner: Address) : 

Resolver Smart Contract

The INS resolver contract exposes the following functions:

Sets the hash address for node. And this function may only called by the owner of node.

@external
def setAddr(node, addr: Address) : 

Returns the hash address for the specified node.

@external(readonly=True)
def addr(node) -> Address : 

Sets the multihash associated with an INS node.

@external
def setMultihash(node, hash) : 

Returns the multihash associated with an INS node.

@external(readonly=True)
def multihash(node) -> str : 

Sets the text data associated with an INS node and key.

@external
def setText(node, key, value) : 

Returns the text data associated with an INS node and key.

@external(readonly=True)
def text(node, key) : 

Reverse Resolver Smart Contract

The INS reverse resolver contract exposes the following functions:

Sets the name record for the reverse INS record associated with the calling account.

@external
def setName(name) : 

Returns the hash for a given address's reverse records.

@external(readonly=True)
def node(addr: Address) -> str : 

Implementation

Please visit ICON Name Service source code at https://github.com/PortalNetwork/ins.

References

Copyright

Copyright and related rights waived via CC0.