ENS offchain resolver gateway in Rust

Use the official offchain resolver contract with a Rust gateway instead!

ENS offchain resolver gateway in Rust

Background

Lens and CoinBase announced free ENS domains for their users a few months back. Lens is based on the official offchain resolver contract. The same repository contains a gateway and CloudFlare workers but all of them are implemented in TypeScript (using a TypeScript library for CCIP-Read Server from ChainLink). There isn't any gateway implementation in Rust, nor a CCIP-Read Server library.

Progress

So far two things are available in this repository: https://github.com/jeje/ens-offchain-resolver-gateway-rs

  • a gateway working similarly than the TypeScript one
    A Database interface is introduced with an implementation reading a static Json file.
  • a CCIP-Read Server library in Rust

You can see this gateway in action when requesting https://app.ens.domains/me.jerome-bernard.com on the Goerli network.

Roadmap

  • deliver the CCIP-Read Server library in crates.io
  • improve documentation
  • make it easier to dev custom gateways besides the sample given, probably by introducing a gateway framework as another Rust library
  • provide more Database implementations
  • Cross Chain Write Deferral Protocol (aka EIP-5559), initiated by CoinBase, is probably worth a look too. It could enable users to edit their records in ENS app instead of requiring a custom app to edit the offchain records.

More details in a Twitter thread