About
## Challenges we ran into
# π οΈ Challenges I Ran Into & How We Overcame Them
Building **1Shot Agentic Wallet (`ukii`)** required bridging cutting-edge Account Abstraction standards (**ERC-7710**, **ERC-7715**), cryptographic signature protocols, and natural language AI processing into a smooth, single-page Web3 application. Here are the main technical hurdles we faced and how we solved them:
---
### 1. π Cryptographic EIP-712 Signature Compatibility for ERC-7715 Delegations
* **The Challenge:**
Implementing **ERC-7715 (`wallet_grantPermissions`)** requires producing strict **EIP-712 Typed Data signatures** so that Smart Accounts and off-chain relayer nodes can cryptographically verify delegated permissions. Different Web3 environments (e.g., MetaMask browser extensions vs. custom WebAuthn/Passkey private key signers) handle `eth_signTypedData_v4` domain parameters and BigInt/uint256 serialization differently, leading to frequent signature verification mismatches across different chain IDs.
* **How We Overcame It:**
We designed a unified cryptographic signing abstraction within [`DelegationManager`](file:///Users/meta/coding/ppapa/js/modules/delegation.js). It normalizes the EIP-712 domain schema (`name`, `version`, `chainId`, `verifyingContract`) and typed data structs (`Delegation`). For BigInt parameters like `spendLimitDaily` and `expiryTimestamp`, we standardized unit conversion using Ethers.js v6 `parseUnits` and built a fail-safe fallback signing pipeline to ensure signature validity across all connected account types.
---
### 2. π€ Safeguarding Autonomous AI Execution Against Agent Hallucination
* **The Challenge:**
Allowing an AI Assistant to translate natural-language user prompts directly into executable Web3 transactions poses a critical security risk: if the AI misinterprets a prompt or hallucinates contract parameters, it could generate unsafe operations or exceed user expectations.
* **How We Overcame It:**
We implemented a **two-tier execution barrier** in [`AgentEngine`](file:///Users/meta/coding/ppapa/js/modules/agent.js): 1. **Intent Parsing & Pre-Flight Audit:** Natural language inputs are parsed into structured execution plans containing protocol routes, token amounts, and gas sponsorship breakdowns. 2. **Strict On-Chain Policy Verification:** Before any transaction plan can be executed or sent to a relayer, it is checked against active ERC-7715 delegation policies in `validateAgentAction()`. If a planned action exceeds daily spending limits or violates whitelisted contracts, execution is blocked immediately with an explicit policy warning.
---
### 3. β‘ Multi-Chain RPC State Management & Provider Switching
* **The Challenge:**
Supporting multiple EVM testnets (**Base Sepolia**, **Arbitrum Sepolia**, **Optimism Sepolia**, and **Sepolia**) alongside multiple wallet authentication types (Injected Web3 Wallets vs. 1Shot Passkey Accounts) often led to desynchronized provider states, stale RPC balance queries, or broken transaction signing when switching networks dynamically.
* **How We Overcame It:**
We created an event-driven `SmartWallet` controller in [`wallet.js`](file:///Users/meta/coding/ppapa/js/modules/wallet.js). We separated RPC read operations (`ethers.JsonRpcProvider`) from transaction signing (`ethers.BrowserProvider` / `ethers.Wallet`). When a user switches networks or wallet modes, the provider pool automatically reinstantiates the appropriate RPC provider, purges cached balances, and performs asynchronous multi-token balance refetches without refreshing the page.
---
### 4. β½ Zero-Gas EIP-7710 Relayer Integration
* **The Challenge:**
Executing transactions for users who have **zero native gas tokens (`ETH`)** required routing transaction payloads through EIP-7710 Paymaster Relayers. Ensuring transaction payloads were correctly structured with Paymaster gas limits while providing instant visual feedback on dollars saved was non-trivial.
* **How We Overcame It:**
We wrapped transaction payloads with EIP-7710 Paymaster metadata, delegating gas payment to the 1Shot Public Relayer. We also built real-time gas tracking hooks that calculate estimated gas fees in native tokens and convert them to USD, giving users transparent visibility into their cumulative gas savings.
## The problem it solves
# π― Problem Statement & Solution Overview
## 1. The Core Problem in Current Web3 / DeFi Interactions
### π΄ High UX Friction & Multi-Step Complexity Performing basic DeFi actionsβsuch as swapping tokens, bridging assets across layer-2s, or executing yield strategiesβrequires navigating complex decentralized application interfaces, manually approving token allowances, calculating slippage, and individually signing multiple sequential wallet popups.
### π΄ Gas Token Management Bottleneck ("No ETH for Gas") Users frequently find their accounts stuck because they hold ERC-20 tokens (e.g., USDC, DAI) but lack the native chain gas token (`ETH`), forcing them to acquire or bridge ETH just to pay transaction fees for a single transfer or swap.
### π΄ All-or-Nothing Private Key Exposure for AI Agents Autonomous AI agents, DCA bots, and trading scripts currently require users to share their private keys or grant unrestricted, non-custodial wallet access. If an agent is compromised, exhibits algorithmic failure, or hallucinates, all funds in the user's wallet are at risk of being drained.
### π΄ Lack of Pre-Execution Safety & Seed Phrase Security Blindly executing automated or AI-generated transaction plans leaves users vulnerable to high slippage, front-running, or malicious contract interactions. Additionally, traditional seed phrase backups remain a major single point of failure for mainstream user security.
---
## β‘ The Solution: 1Shot Agentic Wallet (`ukii`)
`ukii` transforms Web3 interaction into a **natural-language, gasless, safe, and autonomous agent-enabled experience**.
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 1Shot Agentic Wallet β ββββββββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ€ β π€ Agentic AI β β‘ EIP-7710 Gas β π ERC-7715 Permission β β Assistant β Abstraction β Delegation β β β β β β - Natural Language β - 100% Sponsored β - Bounded Agent Scopes β β - Multi-Step Routes β - Zero Native ETH β - Max Spending & Gas Caps β β - Safety & Risk β - Public Paymaster β - Contract Whitelisting β β Scoring (0-100%) β Relayer β - 1-Click Instant Revocation β ββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ ```
### π€ 1. Natural Language Intent & Multi-Step Automation (Easier) Instead of manually navigating multiple DEXs and bridge interfaces, users express their intent in plain English: > *"Swap 25 USDC to ETH on Base and bridge 50 USDC to Arbitrum when gas is optimal."*
The integrated **Agentic AI Assistant** parses natural language into structured, multi-step transaction plans, automatically computing optimal swap routes and execution steps with a single click.
### β‘ 2. EIP-7710 Gas Abstraction & Paymaster Relayer (Seamless & Gasless) Leveraging EIP-7710 specifications and sponsored Paymaster Relayers, `ukii` delivers **100% sponsored transactions**. Users can swap, bridge, and execute agentic strategies with zero native `ETH` in their smart account.
### π 3. ERC-7715 Granular Permission Delegation (Safer) Users can delegate execution authority to autonomous AI agents without exposing private keys. With **ERC-7715 policy enforcement**, users set strict on-chain operational boundaries: * **Max Spending Allowance**: Cap total spending per transaction (e.g., max $50 USDC per tx). * **Gas Caps**: Limit the maximum gas fee allowed per automated execution. * **Contract Whitelisting**: Restrict agent execution exclusively to verified routers (e.g., Uniswap V3, Hop Protocol). * **Expiration Timestamps**: Set automatic permission expiration (e.g., valid for 7 days). * **Instant Revocation Engine**: Revoke active delegation grants at any time with a single transaction. ### π‘οΈ 4. Transaction Safety Scoring & Passkey Recovery (Safer & Frictionless) * **Automated Risk Scoring (0β100%)**: Before execution, every plan undergoes real-time pre-flight inspection checking contract integrity, output slippage, and parameter sanity. * **Passkey & Social Recovery**: Built-in support for hardware-bound WebAuthn / Passkey authentication (Touch ID, Face ID) paired with an **m-of-n Guardian Social Recovery network** prevents single-point-of-failure key loss. --- ## π‘ What People Can Use It For
- **Gasless Intent-Based DeFi**: Execute swaps and cross-chain transfers across EVM L2 testnets (Base Sepolia, Arbitrum Sepolia, Optimism Sepolia, Sepolia) using natural language with zero native gas tokens required.
- **Safe Autonomous AI Trading & Delegation**: Delegate bounded execution permissions to automated AI agents or trading algorithms with user-defined spending caps, whitelisted dApps, and expiration limits.
- **Seedless Smart Account Management**
- **Pre-Flight Risk Auditing**
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.










