MuHaven

Where AI manages your wealth on encrypted state — invisible to everyone, even itself.

About

## Wave 1 submission

🤖 MuHaven is the first confidential DeFAI platform — an AI agent that manages RWA portfolios entirely on encrypted state. Not just private balances, but an agent that advises, allocates, and executes without ever seeing unencrypted data. Wave 1 established the complete vision, architecture, and UX for both sides of the platform.

📄 Full documentation suite shipped: ARCHITECTURE.md (system layers, contract dependency graph, CoFHE data flow diagrams), SMART_CONTRACTS.md (full Solidity specs with euint128/euint64 encrypted type reference and cofhejs v0.4.0 compatibility matrix), AGENT_DESIGN.md (three-role agent architecture — Advisor, Risk Manager, Executor — plus TypeScript tool schemas for deposit, buy_rwa, claim_yield, view_portfolio), ISSUER_MODEL.md (supply-side yield flow, wrapped vs. native token models), COMPETITIVE_ANALYSIS.md (positioning against Canton, Silent Data, Virtuals, SingularityDAO).

🖥️ Full Vue 3 frontend live with both investor and issuer dashboards. Investor side: AI agent onboarding chat, encrypted portfolio dashboard (balances only shown after unsealing), deposit/withdraw, yield timeline. Issuer side: token management, yield distribution (aggregate preview only — no individual positions visible), investor whitelist, compliance/KYC configuration.

🔐 Core architectural decisions locked: fhERC-20 with euint128 encrypted balances, modular IKYCGate interface (ERC-3643 first, swappable), YieldDistributor that reads all holder balances via CoFHE and creates proportional ReineiraOS escrows, RiskParams.sol storing investor guardrails as euint64 on-chain, sealed outputs via TFHE.sealOutput for per-investor decryption.

🏗️ The two-sided design is complete — issuers create tokens and deposit yield; investors describe goals in natural language, receive encrypted allocations, and claim yield. No one — not the issuer, not the agent, not MEV bots — sees unencrypted positions.

## Wave 2 submission

🚀 MuHaven went from Wave 1 vision to live confidential RWA pipeline on Arbitrum Sepolia. End-to-end, fully encrypted: passkey login spins up a smart account, gasless USDC deposit wraps into an encrypted fhERC-20 RWA token, issuers distribute yield into per-investor confidential escrows, and investors redeem — all on-chain, no party seeing plaintext balances. The AI-managed portfolio remains the long-term target; Wave 2 shipped the rails it will run on.

🔗 Eight contracts deployed and verified on Arbitrum Sepolia: fhERC-20 token, vault, investor registry, yield distributor, confidential escrow, yield gate, KYC adapter, and encrypted risk params. Roughly 180 Hardhat unit tests cover the FHE patterns — permit-based decryptForView, silent-fail via FHE.select, FHE.allow re-grants after every mutation — plus contract invariants. A 25-case SDK integration suite drives the full two-phase yield pipeline against an in-process Hardhat fixture.

🔐 Authentication runs on ZeroDev kernel smart accounts over ERC-4337: one WebAuthn passkey replaces the seed phrase, gas is sponsored, and @zerodev/permissions session keys collapse the stacked signature tax of passkey + FHE permit + kernel signature into two prompts on the first session action and zero for every action after. Sensitive operations still ask for a biometric — everything else is silent. No ETH required by users, ever.

🖥️ The Vue 3 + Vite + Tailwind v4 dashboard is wired to live contracts on both sides: investor (portfolio, deposit, yields, activity) and issuer (tokens, distribute, investors, compliance). Encrypted balances stay redacted until the user signs a permit and decryptForView returns the plaintext client-side. A 45-case Playwright browser suite (35 passing, 10 skipped, 0 failing) exercises the golden paths on both roles, backed by a data-testid contract that keeps the flows stable across UI refactors.

🏗️ The backend runs as a Docker stack behind a Cloudflare tunnel: a Node 20 + tsx API on Clean Architecture with Drizzle + PostgreSQL for persistence, a dedicated FHE worker owning the heavy WASM encryption, and a NAV worker pulling live treasury yields from FRED and on-chain oracles into Postgres on a schedule, with a source-audit trail and static fallbacks. An in-house @muhaven/sdk — pluggable sender (EOA for scripts and tests, kernel for the frontend) with progress callbacks on every write — is the single source of truth driving scripts, tests, dashboard, and workers against the same encrypted flow.

## Wave 3 submission

🚀 Wave 2 shipped the encrypted-state pipeline. Wave 3 makes that pipeline production-grade. A single atomic transaction now runs the full purchase — KYC → modular compliance → oracle read → encrypted multiply → confidential USDC pull → encrypted mint — with the investor's passkey signing once. The investor-as-minter shortcut is gone. Redemption mirrors purchase: instant when the per-token treasury covers it, queued per-epoch when it can't. Yield moved from issuer-pushed distributions to investor-pulled snapshots — one epoch fans out to thousands of holders without an O(N) issuer loop.

💵 The protocol's own confidential USDC wrapper — `MuHavenStable` (mhUSDC) — replaces legacy PUSDC for every Wave 3 flow. 1:1 collateral backing, ephemeral-EOA-aware modern surface, drop-in IFHERC-20 legacy shim, and a documented peg-break runbook. Built in-house rather than waiting on upstream, so the cash leg of every flow honors the same `FHE.allow` discipline as the share leg.

📜 Full ERC-3643 / ONCHAINID compliance topology landed: `IdentityRegistry` + `TrustedIssuersRegistry` + `ClaimTopicsRegistry` + `ModularCompliance`, plus five gate modules (country allow/restrict, max-holders, lockup, max-balance). Dev-mode permissive bypass with an irreversible production latch; state hooks fire on every mint, transfer, and burn through per-token authorized callers.

📈 NAV pricing moved to a pluggable `IPriceOracle` with two reference impls — `IssuerControlledOracle` (issuer-write) and `ChainlinkFunctionsOracle` (FRED-backed) — both gated by sequencer-uptime, a deviation gate with owner-accept pending state, and per-token staleness windows. A sibling Docker worker (`nav-publisher`) keeps `updatedAt` fresh against a database-side liveness gate.

🔐 The FHE permit/decrypt lifecycle is hardened end-to-end. Every encrypted mutation grants the investor's per-session ephemeral EOA `FHE.allow` access on the resulting handle, replacing Wave 2's defer-and-retry over kernel-signed permits. A new `refreshDecryptGrant` self-service primitive handles cross-session reveals — fresh-tab logins re-stamp the ACL silently through a session-key UserOp.

🛡️ A coprocessor op-chain length limit surfaced late in cutover and got a structural fix: a new `trustedPayout` external on the stablecoin skips redundant silent-fail bounds where conservation is already guaranteed off-chain, cutting the post-claim chain from eight FHE ops to five. Two real RWA classes — TBILL1 (US T-bill, FRED `DGS3MO`) and GOLD1 (London PM gold fix) — are live on Arbitrum Sepolia. Eleven contracts verified; ~786 Hardhat + ~490 backend + 25 SDK tests; four Docker workers behind Cloudflare.

## Wave 4 submission

🚀 Wave 4 puts an agent on top of the Wave 3 pipeline. Four surfaces — HavenBot in the dashboard, `@muhaven/mcp` over the Model Context Protocol, an OpenClaw skill on ClawHub, a Telegram bot — all route through the same ZeroDev kernel, session keys, backend tools, and audit log. Adding a surface adds reach, not privilege.

🤖 HavenBot is the in-dashboard copilot. A Gemini planner streams tool calls through a deterministic policy gate that produces cleartext ActionDescriptors; ConfirmModal renders the cleartext preview and the investor's passkey-bound kernel signs every commit. The same 18-tool catalog — `propose_buy`, `propose_claim`, `set_policy`, `pause`, issuer-side `distribute_yield`, `kyc_add`, `audit_query`, governance vote — ships behind every surface.

🌐 `@muhaven/mcp` is on npm with OIDC trusted-publishing and Sigstore provenance. A companion `muhaven-broker` daemon over Unix socket / named pipe holds the JWT in the OS keychain, with a file fallback for WSL2 / devcontainer / SSH-remote. Tool-description SHA-256 hash pinning gates the CI build (post-MCPoison defense). Device-code OAuth with scoped JWT (`mcp.read.*` / `mcp.propose.*`) replaces paste-token UX.

📲 The OpenClaw skill `muhaven-rwa-skill` ships on ClawHub with cosign + GitHub OIDC signing; the Telegram bot routes through the existing backend with three-tier confirmation — ≤$200 inline · $200–$5K Mini App + 6-digit OTP · >$5K dashboard passkey deep-link. `chat.id` ≠ `from.id` enforced explicitly to defeat the bot-protocol footgun.

🔐 A tiered-autonomy engine sits underneath every surface: Advisory (no signing), Confirm-per-action (passkey per commit), Policy-bound (a `@zerodev/permissions` session key executes inside encrypted thresholds in `RiskParams`). `RiskParams.sol` gained a branchless `FHE.select` hot path, async breach decrypt, `ebool` signal flags, and an EIP-712 `AgentPermit` with monotonic nonces. A `/pause` kill-switch uninstalls the validator in ≤1 Arb block.

🛡️ Safety as a forcing function: PromptArmor + a CaMeL planner→action split + a recursive output sanitiser stripping ANSI / control / bidi / Unicode-Tag on every wire write + a `pnpm run lint:trifecta` strict CI gate asserting no surface co-bundles web-fetch + signing + filesystem. The broker is a separate process precisely because the lint refused to let it co-bundle with the LLM transport. A 69-case OWASP / Agentic red-team vitest corpus gates CI.

📦 P11 lands the next encrypted contracts: `DefaultProtection` (mhUSDC reserve, batched payout via `MuHavenEscrow`), `EncryptedGovernance` (vote weights stored as `FHE.select(isYes, balance, 0)` so vote-value manipulation is impossible by construction), KYC attestation stubs for cross-chain identity.

## Wave 5 submission

🤖 Wave 5's headline: the `@muhaven/mcp` agent now signs and submits real on-chain trades from inside Claude Desktop, Claude Code, and Cursor. Arm a Scoped session once with your passkey, and `buy` / `sell` / `claim` execute with no per-action tap — the agent moves money on its own, but only inside the limits the investor signed.

🔐 The signer never reaches the LLM. The dashboard mints a ZeroDev session key (one passkey signature) bounded on-chain by `@zerodev/permissions` — a CallPolicy locking it to `purchase` / `redeem` / `claimYield` only (transfer excluded), a per-op cap, a RateLimitPolicy, and a hard expiry. The key lives in a separate `muhaven-broker` daemon with zero network egress; bundler submission lives in the MCP server, which has egress but no key. Three layers enforce scope — on-chain validator, broker, audit log — and an authoritative backend gate plus a Telegram `/revoke_session` kill-switch pull the plug from anywhere, even away from the laptop.

♻️ On top of that rail: a headless auto-reinvest runner that claims matured yield and buys more shares amount-blind (the encrypted yield never decrypts), and in-app auto-rebalance toward target allocations — where drift is `balance × NAV` vs target and the balances are encrypted, so it runs client-side via a browser permit.

💵 Wave 5 also closes the money round-trip. mhUSDC now exits straight back to cleartext USDC through a reserve-backed async withdrawal — `withdrawToUsdc` burns an `FHE.min(balance, requested)` clamp, the coprocessor decrypts, and `claimUsdc` pays from an owner-seeded reserve (claimId-keyed after a content-addressed handle-collision fix). A single-step `wrapUsdc` deposit and cleartext-USDC sends to any external address round out the cash rail.

📚 And it's all documented: **docs.muhaven.app** ships a public VitePress site with a 32-page Testing Guide — a 10-minute happy path plus full investor, agent, and issuer tracks. The MCP itself ships via a Sigstore-signed git tag with SHA-256 tool-description hash pinning; ~930 contract tests gate the protocol.

🧭 On scope: the two planned presentation surfaces — hosted checkout and a public `/metrics` page — stayed in development by design. Provably-safe autonomous execution and the confidential cash round-trip both ran harder and higher-value than first scoped, so we chose to land them properly rather than spread thin. The depth is the deliverable.

Prizes

  • Wave 5 grant · 350 USDC

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

No public repo linked, so we can't tell.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

Agent-Verify

Trust layer for AI agents: ENS identity, on-chain execution proof, and decentralized storage.

Adapt.ai

A decentralized AI agent marketplace enabling users to autonomously execute financial strategies in DeFi with tailored AI agents, multisig security and AI-driven insights.