The first trustless M2M delegation economy — AI agents hire, scope, and pay sub-agents via MetaMask Smart Accounts, x402, and 1Shot, cryptographically constrained by ERC-7710 caveats.




AI agents are becoming autonomous economic actors—buying compute, fetching premium data, and calling APIs. However, there is no safe way to give an AI agent spending authority without trusting it completely. Granting full wallet access is extremely risky: one bug, one hallucination, or one prompt injection could drain your entire balance.
DelegAI is the first trustless machine-to-machine (M2M) delegation economy. It demonstrates a 3-level delegation chain where a user grants a Master Agent limited spending authority (50 USDC, 5 calls), and the Master Agent redelegates narrower sub-budgets to specialized Worker Agents—each cryptographically constrained by caveats that cannot be exceeded.
Worker agents autonomously:
* Purchase premium data via x402 micropayments (paying 0.01 USDC per API call).
* Execute on-chain transactions gaslessly via the 1Shot Relay.
* Return results to the Master Agent for aggregation.
DelegAI utilizes 10+ distinct Smart Accounts Kit APIs to enforce cryptographic constraints:
* toMetaMaskSmartAccount(Stateless7702): Creates smart accounts and upgrades them via EIP-7702.
* createDelegation() / signDelegation(): Builds and signs the root and sub-delegation chains off-chain.
* hashDelegation(): Links sub-delegations to the parent delegation via parent hashes.
* createCaveatBuilder(): Builds standard caveats LimitedCalls, Redeemer, Erc20TransferAmount) to restrict budgets.
* encodeDelegations() / decodeDelegations(): Prepares delegations for transit and decodes them on the seller side.
* createOpenDelegation(): Handles buyer-side payment delegation construction.
* sendUserOperationWithDelegation(): Submits delegation-wrapped operations.
* x402 Micropayments:
* Seller: Express/Next.js middleware protecting premium data endpoints, charging 0.01 USDC per call via Erc7710ExactEvmScheme.
* Buyer: Worker agents autonomously construct PAYMENT-SIGNATURE headers using open delegations.
* 1Shot API: Relays transactions gaslessly getFeeData, sendTransaction, getStatus) with gas fees paid in USDC.
The core differentiator: without parentDelegation linking, the Master Agent cannot create sub-budgets for workers. DelegAI's entire value proposition—scoped, hierarchical agent spending authority—is only possible with MetaMask's redelegation primitive.
During this hackathon, we built DelegAI completely from scratch, developing a full-stack platform with the following milestones:
1. MetaMask Smart Accounts Kit Integration:
- Developed the user root delegation flow enabling users to grant specific spending permissions (50 USDC, 5 calls limit).
- Implemented a 3-level off-chain delegation chain where the Master Agent redelegates scoped sub-budgets (10 USDC, 2 calls limit) to Data and Exec Workers using parentDelegation hashing.
- Integrated account upgrades using the new EIP-7702 smart account standard toMetaMaskSmartAccount(Stateless7702)).
2. x402 Micropayments Engine:
- Buyer-Side: Programmed the Data Worker to dynamically negotiate x402 payments (0.01 USDC per call) and generate cryptographically signed PAYMENT-SIGNATURE headers.
- Seller-Side: Built the premium data endpoint protection using custom middleware that decodes delegations and verifies signatures atomically.
3. 1Shot Gasless Relay:
- Integrated 1Shot Relayer APIs getFeeData, sendTransaction, and getStatus) to enable gasless executions on Ethereum Sepolia, charging fee premiums directly in USDC.
4. Venice AI Reasoning:
- Configured Venice AI (llama-3.3-70b) to provide real-time private LLM decision-making at every step of the agent workflow.
5. Engineering Quality Harness:
- Created a comprehensive test suite of 182 unit and integration tests, reaching 100% statement and branch coverage.
- Configured a multi-stage GitHub Actions CI/CD pipeline to automate linting, typechecking, and test coverage on every push.
- Set up Playwright end-to-end automated flows to record high-resolution walkthroughs and screenshots.
DelegAI is a bootstrapped research project and is not currently seeking outside funding. We are focused on building open-source developer tooling and demonstrating advanced cryptographic delegation primitives for autonomous machine-to-machine (M2M) economies.