Development

Architecture

When you call an Id.someMethod(name,...), id.js normalizes the name and creates a Domain instance which contains the processed name components and routes it to different handlers based on the ending/TLD. You will soon be able to write your own custom handlers to support other TLDs or override existing ones.

Almost all id.js calls are batchable. This library uses three contracts to be able to do most calls on-chain.

MutliRegistryResolver

This contract is based on ENS's UniversalResolver, but it is more "universal" because it works with any ERC-137 registry. Currently, only used for finding the controller address on chain and calling the legacy methods such as addr, contentHash ... etc. Offchain resolution is still a todo and not currently implemented in the library.

ChainChain IDAddress
Mainnet10x00001F01A52B8fd2ef88DD3c87d502E90Ea505cb
Goerli50x00001F01A52B8fd2ef88DD3c87d502E90Ea505cb

ControllerResolver

This contract is used to find a controller that implements a given interface by calling interfaceImplementer on the TLD resolver. These calls are made on-chain to make methods like getPrice batchable.

ChainChain IDAddress
Mainnet10x76e325A21527E403a6b335e8efc2e0500aEF77D9
Goerli50x76e325A21527E403a6b335e8efc2e0500aEF77D9

Multicall v3

Used whenever batching doesn't need intermediate calls on-chain. This library uses the deployments by mds1/multicall. Note that ethers v6 also supports batching but not all providers support RPC style batching. This should work with all providers.

Previous
UniversalDataSource