DIA Oracles Now Accessible via ENS Registry

To optimise the oracle user experience, DIA is now leveraging Ethereum Naming Service (ENS) domains as a single source of truth for its oracle addresses.

Jul 13, 2021

Overview

Currently, all oracles deployed by DIA are represented by a smart contract address and if public, published on DIA’s documentation page. Any blockchain developer can easily build DeFi applications by simply inputting the oracle contract address.

This system leaves room for optimisation: In some cases, oracles may be updated and receive a new smart contract address. After such updates, these new addresses need to be actively communicated to the oracle users and updated in their respective dApps, leaving room for human error and potential delays in updates.

To optimise this process and eliminate error potential arising from updated oracle addresses, DIA leverages Ethereum Naming Service (ENS) domains for its public and custom (user-specific) oracles .

The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. ENS maps human-readable names like ‘ alice.eth’ to machine-readable identifiers such as Ethereum addresses, other cryptocurrency addresses, content hashes, and metadata.

Architecture

The ENS domain system comprises three main parts:

  1. ENS registry: it holds all the domains for all oracle addresses.
  2. Resolver: it is the contract that looks up the subdomains for DIA’s price feeds.
  3. Registrar: it is the owner of the root domain ( diaoracles.eth ) and is responsible for creating subdomains and updating new resolver contract addresses of the subdomains.

Resolving an ENS domain into an oracle address is a two-step process:

  1. The user asks the DIA ENS registry what resolver is responsible for the ‘diaoracles.eth’ ENS domain.
  2. The user automatically asks that resolver the answer to their query, resulting in the oracle contract address.

ENS Oracle Addresses are now Live

From now on, DIA’s public and private oracles will be represented with human-readable strings such as ‘example.diaoracles.eth’ . These new domains are resolved into the oracle’s address by any blockchain wallet, application and browser.

If there is an update in the DIA oracle, the ENS domain will always be resolved into the latest oracle contract address and automatically updated in the users’ code.

→ DIA’s demo ETH oracle is accessible via demo.diaoracles.eth string.