Cross Chain NS

ENS powered Walrus sites with custom resolver with chrome extension and subnames

Cross Chain NS

Created At

ETHGlobal New Delhi

Project Description

The ENS powered Walrus sites project allows Ethereum Virtual Machine (EVM) developers to host decentralized websites on Walrus, a Sui-based storage protocol optimized for blobs and AI/DePIN workloads, and make them accessible via ENS domains (e.g., yourname.eth). Instead of storing individual blob IDs (43-character base64url strings), you store a hex-encoded site object ID (a Sui object ID representing the website's root, aggregating multiple blobs) in the ENS contenthash field using a custom multicodec (walrus-site-ns, protoCode e.g., 0xb29911). This ID is converted to base36 for URL-friendly subnames (e.g., [base36_id].your-portal.eth.limo), served through a Fluence-deployed Walrus portal for decentralized resolution. A Chrome extension (Manifest V3) resolves .eth domains in browsers by querying the contenthash, decoding it to the hex site ID, converting to base36, building the portal URL, and rendering the content, with web workers offloading tasks like fetching or decoding for performance. This creates a cross-chain solution: ENS on Ethereum/Sepolia for naming, Walrus on Sui for storage, and Fluence for scalable, decentralized portal hosting, enabling seamless website access in Chromium-based browsers (Chrome, Brave, Edge). Key Components

ENS Contenthash with Custom Multicodec:

Site Object ID: A hex string (e.g., 0x1a2b3c4d...) representing the Sui object ID for a Walrus Site, created via the site-builder tool. Custom Multicodec: Defined as walrus-site-ns (mock protoCode 0xb29911), encoding the hex ID to bytes with a varint prefix, stored in the contenthash field of yourname.eth on Sepolia. Encoding/Decoding: Modified @ensdomains/content-hash library to handle walrus-site-ns, converting hex to/from bytes (e.g., encode('0x1a2b3c...') → varint + binary).

Base36 Conversion for Subnames:

The hex site ID is converted to base36 (0-9, a-z) for URL-friendly subnames (e.g., 0x1a2b3c... → k2t6wyfsu4pfw...). Subnames mimic eth.limo (e.g., [base36_id].your-portal.eth.limo), resolved by the Fluence-deployed portal.

Fluence-Deployed Walrus Portal:

Fluence: A decentralized compute platform for running serverless, peer-to-peer applications. You deploy the Walrus portal as a Fluence service (using Aqua scripts and Fluence CLI) on a network of nodes, ensuring high availability and censorship resistance. Role: The portal resolves base36 subnames (e.g., k2t6wyfsu4pfw.your-portal.eth.limo), fetches the corresponding Walrus site object from Sui, reconstructs the site (HTML, CSS, JS), and serves it via HTTP. Setup: Deployed using Fluence’s Rust or TypeScript SDK, integrating with Walrus SDK (@mysten/walrus) for blob fetching and Sui RPC for object queries.

Chrome Extension with Web Workers:

Purpose: Resolves .eth domains to Walrus site content in browsers. Flow: Intercepts .eth navigation (chrome.webNavigation), queries contenthash via viem on Sepolia, decodes to hex site ID, converts to base36, builds portal URL (e.g., https://k2t6wyfsu4pfw.your-portal.eth.limo), fetches content, and renders in the tab. Web Workers: Offload tasks (e.g., contenthash decoding, base36 conversion, or fetching) to a worker thread to avoid blocking the UI, improving performance for large sites. Compatibility: Works on Chrome, Brave, Edge using Manifest V3.

Modified ENS Libraries:

@ensdomains/content-hash: Added walrus-ns profile for encoding/decoding hex site IDs. ens-app-v3: Updated validateContentHash to support walrus-site-ns with hex validation (no fixed length, as Sui object IDs vary). ensjs: Updated to use modified content-hash for resolution.

How it's Made

Technical Workflow

Hosting a Walrus Site:

Use Walrus site-builder CLI (from MystenLabs/walrus-sites): site-builder publish ./my-site --epochs 1 (testnet). Output: Hex site object ID (e.g., 0x1a2b3c4d...) representing the site on Sui. Convert to base36: BigInt('0x1a2b3c4d...').toString(36) (e.g., k2t6wyfsu4pfw...).

Storing in ENS:

Use local ens-app-v3 to set contenthash for yourname.eth on Sepolia. Encode: encode('0x1a2b3c4d...') using walrus-site-ns multicodec (varint 0xb29911 + hex-to-bytes). Store via Public Resolver (0x8FADE66B79cC9f707aB26793a6b97791FC928AC9).

Fluence Portal Deployment:

Deploy a Walrus portal as a Fluence service using Fluence CLI (fluence init, fluence deploy). Aqua script defines logic: Resolve subname (e.g., k2t6wyfsu4pfw.your-portal.eth.limo), convert base36 to hex, query Sui for site object, fetch blobs via Walrus SDK, serve HTML. Config: Set Sui testnet RPC (https://fullnode.testnet.sui.io:443) and Walrus publisher (https://publisher.testnet.walrus.site).

Browser Resolution:

User navigates to yourname.eth in Chrome/Brave/Edge with extension. Extension:

Intercepts via chrome.webNavigation.onBeforeNavigate. Queries contenthash with viem. Decodes to hex site ID using modified content-hash. Converts to base36. Builds URL: https://[base36_id].your-portal.eth.limo. Web worker fetches content (avoids UI blocking). Content script renders HTML in tab.

background image mobile

Join the mailing list

Get the latest news and updates