AEGISNET

Guardrailed AI agent execution matrix on ENSv2, 0G Private Compute & Uniswap V3.

AEGISNET

Created At

ETHGlobal Mumbai

Project Description

The Problem: Autonomous AI agents are rapidly entering DeFi, managing treasuries, rebalancing liquidity, and executing trades. However, giving an AI agent direct access to private keys or smart contract allowances creates catastrophic risks: flash loan exploits, prompt injection, slippage bleeding, and rogue transactions drain user capital with zero recourse.

The Solution — AegisNet: AegisNet is a guardrailed AI execution matrix that establishes cryptographic and onchain safety boundaries for autonomous agents before they can touch DeFi protocols:

ENSv2 Subname Identity & EAC: Every agent is minted an ENSv2 subname (e.g., agent1.aegisnet.eth). The ENS subname registry serves as an Execution Access Control (EAC) whitelist, specifying exactly which adapters (e.g., Uniswap V3), daily spend limits, and ENSIP-26 metadata records the agent is bound to. 0G Private Compute & AI Strategy: Autonomous trade proposals are evaluated and generated inside 0G Private Compute using verifiable AI models, ensuring decision confidentiality and tamper-resistance. Dual-Path Execution & Human Approval Gate: Low-value transactions (< $1,000 threshold): Automatically verified against ENS permission whitelists and daily allowances, executing instantaneously on Uniswap V3. High-value transactions (≥ $1,000 threshold): Automatically paused onchain in AegisExecutionManager. The transaction cannot execute until authenticated by the real human subname owner through an EIP-712 cryptographic signature checkpoint. 0G Storage Verifiable Audit Trail: Every proposed strategy, reasoning payload, and execution receipt is Merkle-hashed and permanently archived to 0G Decentralized Storage for cryptographic auditability. 2. "How it's Made" / Technical Implementation

AegisNet is built end-to-end on Ethereum Sepolia, 0G, and Uniswap V3:

Smart Contracts (Solidity v0.8.24, Hardhat): AegisSubnameRegistry: Native ENSv2-compliant hierarchical subregistry managing subname node ownership, EAC target contract whitelists, daily spend limits, and ENSIP-26 agent text records (agent.capabilities, agent.biometric_threshold, agent.operator).

AegisExecutionManager: The central security gateway that intercepts all proposed trades, checks daily spend limits, enforces the threshold security gate, and securely executes approved transactions.

AegisUniswapAdapter: Direct execution adapter integrating Uniswap V3 SwapRouter02 with dual-path resilience (real ERC-20 token swap delivery with strict slippage protection).

AI Strategy Layer (0G Private Compute): Utilizes 0G Decentralized AI Router and Private Compute (0gm-1.0-35b-a3b) to reason over market conditions, construct optimal trade parameters, and sign off on trades.

Verifiable Audit Logging (0G Turbo Storage): Submits trade logs, parameters, and AI reasoning trees to the 0G Storage testnet via Merkle proof hashing, returning permanent root hashes verifiable on 0G Storage Scan. Backend & Relayer (Node.js, Express, TypeScript, Ethers.js v6): Event indexer syncing Sepolia contract state, managing EIP-712 human gate verification sessions, and serving serverless API functions on Vercel. Frontend (Vanilla HTML5 / Modern CSS / Vanilla JS): High-performance, zero-framework Web3 console with EIP-6963 multi-wallet discovery (MetaMask, Rabby), live onchain state synchronization, and human approval modals. 3. ENSv2 Qualification Requirement: "How does your project use ENSv2?"

Centrality to the Product: ENSv2 is not a cosmetic label in AegisNet; it is the fundamental access control and identity architecture:

Subregistry EAC: Agent permissions (allowed target contracts, max trade size, daily limits) are hard-coded directly into the ENSv2 Subname node state. An agent cannot call any contract unless that contract is whitelisted under its ENS subname node. ENSIP-26 Agent Text Records: Stores machine-readable agent capabilities, operator addresses, and human approval threshold policies directly on the ENS text resolver. Owner Derivation & Replay Protection: High-value human gate approvals derive authorization directly from the registered subname owner on Sepolia, guaranteeing single-use replay protection and true sovereign delegation. 4. Links & Contract Reference for Submission GitHub Repository: https://github.com/shriyashsoni/aegisnet Network: Ethereum Sepolia (Chain ID 11155111) AegisSubnameRegistry: 0x6Dbd89B71e8AB7BF93a9200C6fB81951699549FE AegisExecutionManager: 0x13d7b8Add8265AB1Cfdc3a6E8E60D1b3bcD56fa8 AegisUniswapAdapter: 0xD855719f7Cc2cD867540F8398E3d2Fa4b2dD8221 0G Storage Explorer Sample: https://storagescan.0g.ai/file/0x915b0d5c28f574cbf40708585c0e95e54f17c23df768b0ef467cc9d572a7c7b3

How it's Made

AegisNet was built from the ground up as a production-grade Web3 & AI architecture consisting of four integrated layers:

  1. Onchain Smart Contracts (Solidity v0.8.24, Hardhat, Sepolia) AegisSubnameRegistry: Implements an ENSv2-compliant hierarchical subregistry. It records subname node ownership, manages Execution Access Control (EAC) contract whitelists per subname, enforces daily spend allowances, and serves as an ENS resolver for ENSIP-26 agent text records (agent.capabilities, agent.biometric_threshold, agent.operator). AegisExecutionManager: The security interception layer. All agent trades pass through requestExecution(). It inspects the agent's ENS subname node permissions, checks remaining daily budget, and dynamically branches into: Immediate execution for transactions under the safety threshold. Pausing the trade in an onchain queue for high-value operations, requiring approveWithRelayer(requestId, nullifier, deadline, sig) signed by the verified human subname owner. AegisUniswapAdapter: Custom execution adapter connecting directly to the official Uniswap V3 SwapRouter02 (0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E). It implements dual-path execution: executing live token transfers and exactInputSingle calls with strict slippage protection when real ERC-20 tokens are traded, and simulating deterministic 0.3% pool fee tiers for testnet pairs.
  2. Decentralized AI Strategy Layer (0G Private Compute) Integrated 0G’s Private Compute decentralized router (https://router-api.0g.ai/v1) using the 0gm-1.0-35b-a3b model. Agents formulate market actions via confidential inference. The outputs are constrained to a strict JSON decision schema (strategyType, targetContract, valueUSD, callData, summary), guaranteeing deterministic execution and preventing hallucinated parameters from reaching the smart contracts.
  3. Cryptographic Storage & Audit Trail (0G Turbo Storage) Integrated 0G Decentralized Turbo Storage (https://indexer-storage-testnet-turbo.0g.ai) via the @0gfoundation/0g-storage-ts-sdk. Each proposed strategy, decision snapshot, and execution receipt is Merkle-tree hashed into a 32-byte root hash and permanently anchored on the 0G storage testnet. Anyone can verify the exact reasoning and parameters that led to an onchain trade via 0G Storage Scan.
  4. Backend & Relayer Service (Node.js, TypeScript, Express, Ethers.js v6) Built a real-time Sepolia event indexer syncing subname registrations, trade proposals, and approval states with block reorg resilience. Manages EIP-712 cryptographic signature sessions for the Human Approval Gate, verifying subname ownership and generating relayer attestations with single-use replay protection. Architected for dual runtime: long-running Node daemon or serverless Vercel Edge functions.
  5. Frontend Console (HTML5, Modern CSS, Vanilla JS, Ethers.js UMD) Zero-framework, lightweight, high-performance console featuring EIP-6963 multi-wallet discovery (MetaMask, Rabby), live subname creation, agent proposal triggers, and an interactive Human Approval checkpoint modal. What was the hardest challenge?

Designing an Execution Access Control system that doesn't rely on centralized offchain gatekeepers or compromise agent composability. By anchoring permissions directly to ENSv2 subname nodes and enforcing spending rules inside Solidity, the safety checks are purely cryptographic and decentralized.

background image mobile

Join the mailing list

Get the latest news and updates

AEGISNET | ETHGlobal