Skip to main content
Time to read: 1 min

RIF RNS: RIF Name Service | Rootstock (RSK)

RNS provides an architecture which enables the identification of blockchain addresses by human-readable names.

Try the service

Register a domain in the Testnet, for free.

Integrate with RNS

Easy guides on how to integrate RNS in your solution.

Develop on top of RNS

Deploy RNS suite in your local development environment

Use the libraries

Use simple libraries to interact with RNS service.

The stack

image

Motivation

By adding a name resolution service, also known as “alias”, the probability of errors is significantly reduced. In addition, centralizing the access to multiple resources associated with a human-readable name improves the blockchain platform user experience. As resource names may change over time, the system needs to be flexible to support frequent changes.

Currently over the World Wide Web, the Domain Name System (DNS) is responsible for mapping human-readable names to IP addresses. RNS is a decentralized and secure service that works over RSK's blockchain.

Here’s a refined version of your text, maintaining the same tone and voice:

Design

RNS is a hierarchical namespace inspired by DNS, where the hierarchy roughly reflects organizational structure, with levels separated by the "." character.

The design of the RIF Name Service is shaped by specific goals:

  • The primary objective is to establish a consistent namespace for referencing resources.
  • Each piece of data associated with a name is tagged with a type, allowing queries to be limited to a specific type.
  • To ensure the namespace is adaptable across different networks and applications, RNS supports the use of the same namespace with various protocol families or management systems. Data in RNS is tagged with both a class and a type, enabling the parallel use of different formats for data of type "address."
  • There may be trade-offs between data acquisition costs, update speed, and cache accuracy. The domain owner, as the data source, should consider these trade-offs and decide what to store and how to cache it.

RNS specs

Elements of the RNS

RNS has three major components:

  • The RNS Registry, which is specification for a tree structured name space and data associated with the names.

    Conceptually, each node and leaf of the domain name space tree names a set of information, and query operations are attempts to extract specific types of information from a particular set. A query names the domain name of interest and describes the type of resource information that is desired.

    Specs

  • RNS Resolvers are contracts that provide information from a name in response to client requests.

    Resolvers must be able to answer a query directly, or pursue the query using referrals to other resolvers. A resolver will typically be a contract's public function that is directly accessible to user programs or other contracts; hence no protocol is necessary between the resolver and the user program.

    Specs

  • RNS Registrar is a critical component within the RIF Name Service, responsible for managing the registration of .rsk domain names. This contract is granted the authority to register names in the RSK Owner contract, ensuring that new domain registrations are handled securely and efficiently. Specs

These three components roughly correspond to the three layers or views of the domain system:

  • From the user's point of view, the domain system is accessed through a simple resolution operation. The domain space consists of a single tree and the user can request information from any section of the tree.
  • From the resolver's point of view, the domain system is composed of an unknown number of names. Each name has a corresponding resolver that provides information for a set of resolution types directly.
  • From the registry's point of view, the domain system consists of a hierarchical tree where each leaf has an owner (contract or account) and an associated resolver that provides information of the name.

Guidelines on use

Before RNS can be used to hold naming information for some kind of object, two needs must be met:

  • A convention for mapping between object names and domain names. This describes how information about an object is accessed. Find specs here
  • Resource record types and data formats for describing the object. Find specs.

The guideline for finding a specific record for a name is as follows:

  1. Calculate the name identifier with namehash function.
  2. Get the name's resolver address via resolver(bytes32).
  3. Determine if resolver supports desired resource record via ERC-165 interface detection.
  4. Get the desired resource record. Find currently standardized resolvers.

Guidelines on integration

Resource records

A domain name identifies a node. Each node has a set of resource information, which may be empty. The set of resource information associated with a particular name is composed of separate resource records (RRs). The order of RRs in a set is not significant. Resource records associated with a name are found in the domain's resolver

Last updated on by Wisdom Nwokocha