Resolve SuiNS names from ENS clients—query happysingh.onsui.eth to get your Sui address
SuiNS-ENS Gateway bridges Sui Name Service names to Ethereum Name Service using EIP-3668 (CCIP-Read). If you own happysingh.sui on Sui mainnet, you can resolve it as happysingh.onsui.eth from any ENS-compatible client—viem, ethers, Rainbow, or any dApp that supports ENS resolution.
The problem: ENS expects on-chain Ethereum data, but SuiNS names live on Sui. Syncing every name to Ethereum would be expensive and defeat the purpose of having names on a separate chain.
Our solution: An offchain resolver that queries Sui in real-time. When you call getEnsAddress("happysingh.onsui.eth"), our resolver contract reverts with an OffchainLookup error pointing to our gateway. The gateway fetches the name record from Sui mainnet, signs the response, and returns it. The contract verifies the signature and gives you the SUI address.
This works with the existing ENS infrastructure—no protocol changes needed. Any app that supports CCIP-Read can resolve SuiNS names today.
The project has two main components: a Solidity resolver contract and a Cloudflare Worker gateway.
The resolver contract implements ENSIP-10 (IExtendedResolver). When you call resolve() , it doesn't return data—it reverts with an OffchainLookup error containing the gateway URL. This is the EIP-3668 pattern. ENS clients like viem automatically catch this error, call the gateway, and send the signed response back via resolveWithProof().
The gateway is a Cloudflare Worker written in TypeScript. It uses @mysten/suins to query Sui mainnet for name records. When a request comes in, it decodes the ENS calldata, maps happysingh.onsui.eth → happysingh.sui, fetches the record, and signs the response with ECDSA. The contract verifies this signature against a list of trusted signers.
One tricky bit was contenthash encoding. SuiNS stores raw IPFS CIDs like QmXxx or bafyxxx, but ENS expects ENSIP-7 format (0xe301 + CIDv1 bytes). We handle both CIDv0 and CIDv1 and convert to the right format using the multiformats library.
We chose Cloudflare Workers for the gateway because it's fast, globally distributed, and has a generous free tier. The whole thing deploys with one command.

