Note — Work in progress: The repository already includes main UI components, services, and smart contract sources. We're actively finishing the final end-to-end integration and the local AggSandbox setup to enable easy local testing and full deployment.
Demo / Announcement: See the demo announcement for a short showcase: POC Demo on X.
EggNS is an educational cross-chain name service that demonstrates how to register names on one blockchain and seamlessly bridge them to another using Agglayer's Unified Bridge.
| Feature | Description | Example |
|---|---|---|
| Cross-Chain Registration | Register names on source chain, materialize on destination | alice.egg on Sepolia → Cardona |
| Unified View | Single interface across multiple blockchains | View all your names from one dashboard |
| Bridge Integration | Agglayer LxLy implementation | Automatic message encoding & execution |
- Application Architecture
- Service Layer Components
- Smart Contract Integration
- Bridge Implementation
- Component Architecture
- Hooks & State Management
- Testing Strategy
- Configuration & Security
- Implementation Guide
User Journey: Register → Bridge → Verify
- Check Availability - Ensure name is available
- Register on Source - Submit transaction to Sepolia
- Bridge Message - Send via Agglayer LxLy to Cardona
- Verify Destination - Confirm name exists on target chain
File: services/name-registration-service.ts
Purpose: Complete registration workflow orchestration
1. Check Availability
2. Create Signer
3. Submit Transaction
4. Wait for Confirmation
5. Verify Success
File: services/bridge-service.ts
Purpose: Agglayer LxLy integration
Name + Owner → ABI Encode → Agglayer LxLy → Destination Execution
Core Functions:
encodeDestinationCall()- Convert function to bytecodesubmitBridgeMessage()- Send via Agglayer LxLytrackBridgeStatus()- Monitor execution
Technical Detail: Uses receiveBridgedName(name, owner) as the destination function
File: services/multi-chain-name-service.ts
Purpose: Unified cross-chain data view
Sepolia Query ──┐
├─→ Merge & Deduplicate → Unified Results
Cardona Query ──┘
File: services/browser-registration-service.ts
Purpose: Client-side integration wrapper
Provides a clean interface between frontend components and backend services for a seamless user experience.
Files: contracts/EggRegistry.sol, contracts/EggNSRegistryMinimal.sol
| Function | Purpose | Access |
|---|---|---|
registerName(name) |
Direct user registration | External |
receiveBridgedName(name, owner) |
Bridge message handler | External (bridge) |
getNameData(name) |
Query ownership | View |
mapping(string => address) nameToOwner; // name → owner
mapping(address => string[]) ownerToNames; // owner → names[]Files: abis/EggRegistry.json, abis/EggNSRegistry.json
Minimal ABI example:
{
"name": "registerName",
"inputs": [{"name": "name", "type": "string"}]
}File: services/utils/lxly-utils.ts
1. Function Name: "receiveBridgedName"
2. Parameters: [name: string, owner: address]
3. ABI Encoding: Convert to bytecode
4. Bridge Payload: Ready for cross-chain transport
| Phase | Location | Action |
|---|---|---|
| Encode | Source Chain | Create function call bytecode |
| Submit | Bridge Layer | Send via Agglayer LxLy |
| Execute | Destination | Automatic function execution |
// Clean interface
bridgeNameToDestination(name, owner) → { transactionHash }Key Responsibilities:
- ABI encoding for destination calls
- Agglayer LxLy client interaction
- Gas management for bridge operations
- Transaction tracking & monitoring
| Component | File | Purpose |
|---|---|---|
| EggNSHeader | components/EggNSHeader.tsx |
Navigation & branding |
| EggNSHomepage | components/EggNSHomepage.tsx |
Landing page |
| EggNSDashboard | components/EggNSDashborad.tsx |
Main dashboard |
Directory: components/NameRegistry/
| Component | Purpose |
|---|---|
NameLookup.tsx |
Search & find names |
NameRegistration.tsx |
Register new names |
CrossChainNameTransfer.tsx |
Bridge names across chains |
CrossChainNameVerifier.tsx |
Verify cross-chain names |
BridgeNameToChain.tsx |
Bridge interface |
Directory: components/Bridge/
| Component | Purpose |
|---|---|
BridgeStatus.tsx |
Track bridge operations |
TransactionMonitor.tsx |
Monitor transaction status |
Directory: components/ui/
Common UI components like NameCard.tsx, ChainBadge.tsx, LoadingSkeleton.tsx for consistent user experience.
Directory: hooks/
| Hook | File | Purpose |
|---|---|---|
| useEggNS | useEggNS.ts |
Main EggNS functionality |
| useNameRegistration | useNameRegistration.ts |
Registration flow |
| useMultiChainNames | useMultiChainNames.ts |
Cross-chain data |
| useCredentials | useCredentials.ts |
User credentials |
| useReducedMotion | useReducedMotion.ts |
Accessibility |
// Clean hook interface
const { register, bridge, verify } = useEggNS();Benefits:
- Encapsulate complex logic
- Reusable across components
- Centralized state management
- Optimized re-renders