The settlement infrastructure for the AI agent economy on Sui.
π Sui Overflow 2026 β Agentic Web + Walrus Tracks
Live on Sui Testnet:
0x262b81797305980a5ddf2c509a6ac8fb9577dee6ac6c96ceba6580bd3dde5058(Verify on Explorer)Original v1 still addressable at
0xa051...4453(audit trail, never deleted on Sui).v2 upgrade (tx
HEpaW4...AH5G): on-chainexpected_price > 0is now a hard requirement (was previously a stub). Seemove/sources/agent_wallet.moveexecute_tradefor the rationale.
Sui-Nexus is the missing middle layer between AI agents and Sui. Instead of building another agent that trades, it builds the settlement infrastructure those agents need to trade safely on-chain: HMAC + zkLogin auth, Move-enforced wallet policy (not middleware-enforced), Walrus-backed memory, and PTB-based atomic execution.
Core innovation: Policy constraints (budget, protocol scope, time window, price floor) are enforced atomically in a Move smart contract β not in gateway middleware. The blockchain itself rejects policy violations. See Key Innovation.
# judge-friendly demo β no setup, no keys, no chain
HACKATHON_DEMO_MODE=true ./scripts/demo/run_agent_wallet_demo.sh
# open the dashboard it printsMost "AI agent wallets" check budget caps and protocol scope in backend middleware β a if amount > budget { return } in Python or Node.js that any agent can bypass by calling a different endpoint. Sui-Nexus does not.
The AgentWallet is a Move shared object. Every trade goes through a single execute_trade function in the Move contract, which atomically enforces all 7 policy constraints in one transaction:
Agent β Gateway Guardian β Move Contract (atomic 7-check enforcement on-chain)
β fails any check β whole tx reverts
| # | Constraint | Move Check (agent_wallet.move:206-250) |
Bypassable? |
|---|---|---|---|
| 1 | Agent identity | assert!(agent_addr == wallet.agent_address, ENotAuthorized) |
β Chain-enforced |
| 2 | Wallet active | assert!(wallet.is_active, EWalletRevoked) |
β Chain-enforced |
| 3 | Time window | assert!(epoch >= time_start && epoch <= time_end) |
β Chain-enforced |
| 4 | Protocol allowlist | vector::contains(&allowed_protocols, &protocol) |
β Chain-enforced |
| 5 | Budget cap | assert!(new_spent <= budget_cap_mist, EBudgetExceeded) |
β Chain-enforced |
| 6 | Balance sufficiency | assert!(balance >= amount_mist) |
β Chain-enforced |
| 7 | Price-floor commitment | assert!(expected_price > 0, EGuardianRejected) |
β Chain-enforced |
The gateway is a relay, not the authority. The Move contract is the authority.
This is defense-in-depth β the gateway Guardian (slippage, concentration checks) catches bad inputs early, and the Move contract enforces policy immutably on-chain. An agent that tries to overspend, use an unauthorized protocol, or skip the price floor gets rejected by the blockchain, not by a config file.
| Blocker | Today | Sui-Nexus |
|---|---|---|
| Key custody | Agent must hold private keys β security + compliance risk | HMAC + zkLogin β no keys on the agent |
| Statelessness | Agents lose context across sessions β no learning loop | Walrus + MemoryObject on-chain |
| No guardrails | One bad prompt drains the wallet | Move-enforced: budget cap, protocol allowlist, time window |
flowchart TB
subgraph AgentLayer[" AI AGENT LAYER "]
direction LR
Agent1["Analyst Agent\n(Python, LLM)"]
Agent2["Trader Agent\n(Python, LLM)"]
Agent3["Custom Agents\n(Any Language)"]
end
subgraph Gateway[" GO GATEWAY (Gin) "]
direction TB
subgraph MW[" Middleware "]
direction LR
HMAC["HMAC Auth"]
RL["Rate Limiter"]
CORS["CORS / Recovery"]
end
subgraph API[" API Endpoints "]
direction LR
Intent["/api/v1/intent\nTrade submission"]
Wallet["/api/v1/wallet/*\nPolicy-enforced ops"]
ZK["/api/v1/auth/zklogin\nzkLogin OAuth"]
WS["/ws\nReal-time dashboard"]
end
subgraph Guardian[" GUARDIAN RISK LAYER "]
direction LR
SL["Slippage <5%"]
BC["Budget Cap"]
PA["Protocol Allowlist"]
end
MW --> API --> Guardian
end
subgraph Infra[" INFRASTRUCTURE "]
direction LR
Kafka["Kafka Queue\n(async processing)"]
Redis["Redis Cache\n(task/wallet state)"]
WSHub["WebSocket Hub\n(live push)"]
end
subgraph PTB[" PTB BUILDER & EXECUTOR "]
direction LR
Swap["Swap (Cetus)"]
Transfer["Transfer"]
AgentW["AgentWallet"]
DB["DeepBook Orders"]
end
subgraph Sui[" SUI BLOCKCHAIN "]
direction TB
subgraph Move[" Move Contracts "]
direction LR
AW["agent_wallet\nΒ· budget caps\nΒ· protocol scope\nΒ· time windows\nΒ· revocation"]
AM["agent_memory\nΒ· Walrus blob ID\nΒ· task reference"]
DEX["DeepBook / Cetus\nΒ· limit orders\nΒ· swap routes"]
end
WalrusLayer["WALRUS\nDecentralized AI context, logs, and cross-agent memory"]
Move --> WalrusLayer
end
AgentLayer -- "HMAC" --> Gateway
Gateway --> Infra
Infra --> PTB
PTB --> Sui
- Agent Wallet lifecycle β Owner creates wallet (Move policy) β Agent authenticates via zkLogin (Google OAuth β client-side ZK proof) β Agent submits intent β Guardian pre-checks (slippage / budget / protocol) β PTB atomically enforces policy on-chain and executes via DeepBook/Cetus β Owner can revoke at any time.
- Cross-agent memory β Analyst writes LLM context to Walrus + mints a
MemoryObjecton-chain (blob_id + task_id) β Trader reads blob via task lookup β Trader submits an informed intent. Two agents, one shared memory, no off-chain coordination.
| Primitive | Usage | Depth |
|---|---|---|
| PTB | Atomic multi-agent settlement: swap β distribute to N agents in one tx | Core |
| Move Objects | AgentWallet (policy state), MemoryObject (Walrus blob ref) |
Core |
| zkLogin | Agent identity: Google OAuth β client-side ZK proof β Sui address | Core |
| Walrus | AI context storage: agent analysis, logs, cross-agent shared memory | Core |
| DeepBook V3 | Limit order placement within agent wallet policy bounds | Integration |
HACKATHON_DEMO_MODE=true ./scripts/demo/run_agent_wallet_demo.shHACKATHON_DEMO_MODE is an explicit judge-friendly simulation path. It keeps the same HTTP
API, Move-call plans, wallet policy cache, Guardian checks, WebSocket stream, and Walrus memory
references, but uses deterministic local digests instead of submitting live Sui transactions.
The live testnet path remains available by disabling demo mode and configuring signer / gas /
funding / package IDs.
It then prints the dashboard URL β open it in a browser for the interactive console.
Key demo: scripts/demo/agent_wallet_demo.py β exercises the full lifecycle:
- Owner creates wallet with Move-enforced policy (e.g. 500 SUI budget, DeepBook only, 24h window)
- Agent authenticates via zkLogin (Google OAuth β client-side ZK proof β session)
- Agent executes trade within policy β Guardian passes β on-chain execution
- Agent attempts overspend β rejected by Move contract (budget cap enforced on-chain)
- Owner revokes wallet β agent permanently frozen β
WalletRevokedevent emitted - Activity log verified on-chain via Sui Explorer
Key demo: scripts/demo/walrus_memory_demo.py β cross-agent persistent memory:
- Analyst Agent analyzes market news via LLM β writes context to Walrus
- Gateway stores blob β mints
MemoryObjecton-chain (blob_id + task_id) - Trader Agent queries shared memory β reads analyst's context from Walrus
- Trader submits a follow-up intent informed by the analyst's research
| Contract | Address | Explorer |
|---|---|---|
| Package | 0x262b81797305980a5ddf2c509a6ac8fb9577dee6ac6c96ceba6580bd3dde5058 (v2) |
View |
| Upgrade Cap | 0x225f7b278c1fc2d3b5cf3d38a5f5e344463aaaf67f52a97b4a51008499a2145f |
View |
HACKATHON_DEMO_MODE=true ./scripts/demo/run_agent_wallet_demo.shOpen the printed dashboard URL.
# 1. env (minimum required for live mode)
export HMAC_SECRET_KEY="$(openssl rand -hex 32)"
export SUI_RPC_URL="https://fullnode.testnet.sui.io"
export SUI_SIGNER_PRIVATE_KEY="suiprivkey..."
export SUI_GAS_OBJECT_ID="0x..."
export SUI_FUNDING_OBJECT_ID="0x..." # dedicated coin for wallet funding
export SUI_GAS_BUDGET="10000000"
export AGENT_WALLET_PACKAGE_ID="0x262b81797305980a5ddf2c509a6ac8fb9577dee6ac6c96ceba6580bd3dde5058"
export DEEPBOOK_PACKAGE_ID="0xdee9" # DeepBook V3 testnet
export DEEPBOOK_POOL_ID="0x..." # SUI/USDC pool
# 2. (optional) infra β Redis is optional, Kafka is only needed for /api/v1/intent
docker run -d --name redis -p 6379:6379 redis:alpine
# 3. gateway
go run cmd/gateway/main.go
# 4. live smoke check
bash scripts/demo/live_testnet_smoke.shcd move
sui move build
sui client publish --gas-budget 100000000 # save the new package IDSee docs/DORAHACKS_SUBMISSION.md for the submission guide and docs/ZKLOGIN_SETUP.md for zkLogin OAuth setup.
| Method | Path | Auth | Purpose |
|---|---|---|---|
POST |
/api/v1/wallet/create |
Owner session | Create + fund Agent Wallet (Move) |
POST |
/api/v1/wallet/execute |
zkLogin session | Agent executes trade (Guardian + Move) |
POST |
/api/v1/wallet/:id/revoke |
Owner session | Owner revokes wallet |
GET |
/api/v1/wallet/:id |
β | Query wallet state |
GET |
/api/v1/wallet/:id/activity |
β | Query on-chain activity log |
POST |
/api/v1/intent |
HMAC | Submit agent trading intent |
GET |
/api/v1/auth/zklogin |
OAuth | Initiate zkLogin flow |
GET |
/ws |
β | WebSocket live task updates |
Full reference: see router registration in internal/gateway/router.go.
sui-nexus/
βββ cmd/gateway/main.go # Entry point
βββ internal/
β βββ gateway/ # HTTP handlers, router, middleware, WS hub
β β βββ zklogin/ # OAuth + ephemeral key + ZK proof
β βββ ptb/ # PTB builder + Sui SDK / demo executor
β βββ kafka/ # Async task queue (producer + consumer)
β βββ storage/ # Redis task/wallet cache
β βββ walrus/ # Walrus HTTP client
β βββ model/ # Domain types
β βββ config/ # Env-driven config
βββ pkg/hmac/ # HMAC-SHA256 signer
βββ move/sources/ # agent_wallet.move, agent_memory.move
βββ scripts/demo/ # Judge demos (Python + shell)
βββ web/dashboard.html # Real-time WebSocket dashboard
βββ docs/ # DORAHACKS_SUBMISSION, RECORDING_GUIDE, ZKLOGIN_SETUP
Full per-file comments live at the top of each file. Deep dives: docs/DORAHACKS_SUBMISSION.md Β· docs/RECORDING_GUIDE.md Β· docs/ZKLOGIN_SETUP.md
MIT
Design tradeoffs and project rationale are documented in inline code comments.