Mapae
by jungjipdo
README.md
<div align="center">
# Mapae
**Give your AI assistant a scoped payment pass, never your wallet.**
*Task-scoped payment mandates, isolated 7-step HSP settlement, and Chainlink CCIP cross-chain kill-switch controls for commercial AI assistants on **HashKey Chain**.*
[](https://mapae.web-three.net)
[](./JUDGES.md)
[](./PROOF.md)
[](https://github.com/jungjipdo/mapae/releases/download/v1.0.0/mapae-hackathon-demo.mp4)
[](https://hsk.blockscout.com/address/0x3a8460060904fe4009c8dfde18d6f1c95ab1e3d3)
[](https://mapae.web-three.net/mcp)
[](./LICENSE)
<br />
<img src="./docs/evidence/landing-hero-1440-light.png" alt="Mapae Landing Hero — Disposable payment passes for commercial AI assistants" width="100%" />
</div>
---
## Demo Video (`2m 42s` · `1080p 30fps`)
<div align="center">
<a href="https://github.com/jungjipdo/mapae/releases/download/v1.0.0/mapae-hackathon-demo.mp4">
<img src="./docs/evidence/demo-video-poster.png" alt="Watch Mapae 1080p Live Hackathon Demo Video (2m 42s)" width="100%" />
</a>
[](https://github.com/jungjipdo/mapae/releases/download/v1.0.0/mapae-hackathon-demo.mp4)
[](./docs/evidence/mapae-hackathon-demo.mp4)
</div>
| Timestamp | Scene | Live Proof Demonstrated |
|---|---|---|
| `0:00 – 0:24` | **Problem & Landing** | Why agent payments fail today + live `mapae.web-three.net` Hero & 10 supported commercial/dev assistants |
| `0:24 – 0:44` | **4-Step StoryDeck** | Interactive mission cap (`$90`), silent HTTP 402 lookups, HSK cap enforcement, and 1-tap freeze |
| `0:44 – 1:05` | **Overview, MCP & 1-Tap Approval** | Live console overview → Claude Duet Streamable HTTP MCP config → 1-tap approval minting scoped `mpt_` proxy token |
| `1:05 – 1:29` | **End-to-End Mission & 7-Step HSP** | `⌘K` humidifier mission → 3× `$0.03` HTTP 402 auto-settled + `$100.08` 7-step HSP EIP-712 drawer + `$23.04` `Blocked · Cap` |
| `1:29 – 1:43` | **Price-Drift Guardrail (`>5%`)** | Automatic `Held · Drift` protection → 1-tap `Approve drift` signing inside isolated `MapaeSignerDO` |
| `1:43 – 2:01` | **Multi-Rail Treasury & CCIP Revoke** | Safe 2/3, Session Vault & EOA reservations → `mp_94a1` 1-tap revoke cascading via Chainlink CCIP to sub-agent `mp_94a2` |
| `2:01 – 2:25` | **Live On-Chain Verification** | Blockscout `Exact Match` verified `MapaeRegistry.sol` (HSK Testnet `133`) & `MapaeMirror.sol` (Sepolia `11155111`) |
| `2:25 – 2:42` | **5 Primitives & Verification Summary** | Full HashKey ecosystem architecture, test scoreboard (`16/16` unit/Foundry · `9/9` live HTTPS · `10/10` Chrome E2E) |
---
## Live Production Endpoints (V2 — 24/7 Cloud AI Disposable Pass & OAuth 2.1)
> **Judge Quick Start**: Read [`JUDGES.md`](./JUDGES.md) (60-second verification), [`PROOF.md`](./PROOF.md) (complete on-chain + Official HSP QA proof ledger), [`docs/PRODUCT_FEATURES.md`](./docs/PRODUCT_FEATURES.md) (full feature catalog), and [`docs/V2_PRODUCTION_PLAN.md`](./docs/V2_PRODUCTION_PLAN.md) (`DC-0..DC-12` completion checklist). Verify all 6 live on-chain & HSP proofs with zero private keys: `node scripts/verify-proofs.mjs`.
| Surface | Live URL | Description |
|---|---|---|
| **Web & Installable PWA** | https://mapae.web-three.net | Interactive landing, 4-step walkthrough, EN/KO, Light/Dark |
| **Owner Console App (0-Click)** | https://mapae.web-three.net/app | 5-view console + **Live Verified Proof Inspector** + 1-Time Scoped Spending Authority Passes |
| **Remote Streamable HTTP MCP** | https://mapae.web-three.net/mcp | 6 standard JSON-RPC 2.0 payment tools (`mapae_request`, `mapae_poll_approval`, `mapae_quote`, `mapae_pay`, `mapae_status`, `mapae_close`) with global coordinator routing |
| **OAuth 2.1 + PKCE (`S256`) MCP** | https://mapae.web-three.net/mcp/oauth | Spec-compliant MCP Auth (`RFC 9728` / `RFC 8414` / `RFC 7591` DCR / `RFC 8707` / refresh rotation) |
| **Mobile Out-of-Band Approval** | `https://mapae.web-three.net/approve/:requestId` | 1-Tap Pass Issuance + optional 1-Time EIP-6963 Wallet Anchor (`HSK Mainnet 177`, auto-disconnects) + `/approve/drift/:driftId` |
| **Cross-Device Pairing & SIWE** | `https://mapae.web-three.net/pair/:code` | Single-use 10-min QR pairing + 1-Time EIP-4361 Wallet SIWE sync |
| **Agent Skill & OpenAPI 3.1** | https://mapae.web-three.net/plugin/SKILL.md | Drop-in skill + [Manifest](https://mapae.web-three.net/plugin/manifest.json) + [OpenAPI 3.1](https://mapae.web-three.net/plugin/openapi.json) + [Well-Known](https://mapae.web-three.net/.well-known/ai-plugin.json) |
## Verified On-Chain Smart Contracts & DC-0 Single-Order Correlated Proof
| Layer / Contract | Network | Verified Address / Flow ID | Live On-Chain Proof |
|---|---|---|---|
| **DC-0 v2 Distinct-Signer Correlated Proof** | **HSK Mainnet (`177`) ↔ Official HSP QA (`Sepolia`)** | Mandate `0x149fe66c…e2a00` (distinct `owner` ≠ gas-only `agentSigner`) ↔ Flow [`8e8aebdb-4d66-4bf0-a72d-2afc7cf643f7`](https://merchant-qa.hashkeymerchant.com/api/v1/payment/flow/8e8aebdb-4d66-4bf0-a72d-2afc7cf643f7) (`app_key=Z3I63VAI`) | Exact `100,041` micro-USDC decoded directly from Sepolia ERC-20 `Transfer` logs (`$0.100041`, pre-payment EIP-191 `+25%` drift sig): Sepolia [`0x66650301…2afc`](https://eth-sepolia.blockscout.com/tx/0x66650301a24079a0a06ec226840b2e9a0eae449b13a4d2ba8c16474bbde32afc) ↔ HSK [`issue`](https://hsk.blockscout.com/tx/0xc3f8373eb8c0e782a6f830f8a269dccb8b682fa7943a7f495db7dd90914328db) · [`consume(100041)`](https://hsk.blockscout.com/tx/0x2f73711969645024898b6d32052c81587961fd86f6b45ddd966371fb3890ee18) · [`anchorReceipts`](https://hsk.blockscout.com/tx/0x89997b5a1855a883fb2e467de908d1aa9e1feb53db3f3f821657736acc65fbaa) · [`revoke`](https://hsk.blockscout.com/tx/0xf3dfd0618af3449d84e8df08fbc5a3b019fb6381a795d11d617e9f826b41a709) + 6 live reverts ([`correlated-e2e-proof.json`](./docs/evidence/correlated-e2e-proof.json)) |
| **Official HSP QA Gateway (`5/5 payment-finalized`)** | **Ethereum Sepolia (`11155111`)** · Circle USDC (`eip3009`) | 5 live `MAPAE` (`Z3I63VAI`) settlements across 3 distinct payees (`0.100041`, `0.100021`, `0.050006`, `0.080017`, `0.120025` USDC; 5/5 `payment-finalized`, 4 `attribution_verified: true`) | [`0x6665…2afc`](https://eth-sepolia.blockscout.com/tx/0x66650301a24079a0a06ec226840b2e9a0eae449b13a4d2ba8c16474bbde32afc) · [`0x974d…a959`](https://eth-sepolia.blockscout.com/tx/0x974d55f8e6408607fd1dae553992c38190ba2dd5b725fdbddce6bd5d01bba959) · [`0x424e…247f`](https://eth-sepolia.blockscout.com/tx/0x424e967d30f7148c6877d54ca981f3d3003304e84523ea3a608da4c5411d247f) · [`0x5a7f…dd5f`](https://eth-sepolia.blockscout.com/tx/0x5a7f1d87e0b150d6fc76c123c76a0bc4c2716d724fb6aa559b4fb27c6e7fdd5f) · [`0x5d89…ae3b`](https://eth-sepolia.blockscout.com/tx/0x5d891c2c9fbdf7af1e184500d72175b14e471db00031dacf0c008b27a030ae3b) · [PROOF.md](./PROOF.md) |
| **`MapaeRegistry.sol`** | **HashKey Chain Mainnet (`177`)** | [`0x3a8460060904Fe4009C8dFde18D6F1c95Ab1e3D3`](https://hsk.blockscout.com/address/0x3a8460060904fe4009c8dfde18d6f1c95ab1e3d3) (**`is_fully_verified: true`**) | [Deploy](https://hsk.blockscout.com/tx/0xa385d20e92e4e0367359f55cbf59d5db3fa329e30953cd69c14e117c55c2db63) · Full Guardrail Proof ([`hsk-mainnet-proof.json`](./docs/evidence/hsk-mainnet-proof.json)) |
| **`MapaeRegistry.sol`** | **HashKey Chain Testnet (`133`)** | [`0x802e24b4663e25D3d8F00b5E76b577EDEDCE0318`](https://testnet-explorer.hskchain.net/address/0x802e24b4663e25d3d8f00b5e76b577ededce0318) | [Deploy](https://testnet-explorer.hskchain.net/tx/0xcc6546165c406964bd8880be5afb28d19a062e36c3c24d4e53ca3c3699d09cf8) · [`issue()`](https://testnet-explorer.hskchain.net/tx/0x0ba71ae56251cf7df62235bf72a934a9e5c27c46c83d4576cd0b85677cf84a7d) · [`consume()`](https://testnet-explorer.hskchain.net/tx/0x1e2b4e6ca6fe04b7570d54295debd396a52fbbe6344e1414570dd2031c1e194b) |
| **`MapaeMirror.sol`** | **Ethereum Sepolia (`11155111`)** | [`0xC878F6ea160433129f6733AFD50F6fE3E1f43d3a`](https://eth-sepolia.blockscout.com/address/0xc878f6ea160433129f6733afd50f6fe3e1f43d3a) | [Deploy](https://eth-sepolia.blockscout.com/tx/0x275af8cfdc5597e4dd2387b79e73c48611a1f696cfd0a1e21630de1ae1527833) · [HSK 177 Source Wired](https://eth-sepolia.blockscout.com/tx/0x8a8b56933b7060c0da45082c5706ee9970ca24cfa9060471bfb676faa917b234) · [HSK 133 Source Wired](https://eth-sepolia.blockscout.com/tx/0xf430bac19840f534a214e634f8c84be769fb8d73c03123067c428b198df58219) |
> **Runtime Transparency & Non-Custodial Authority Model**: Mapae has completed **5 real live settlements on HashKey's official HSP QA MCP server (`https://mcp-qa.hashkeymerchant.com/`)** (including the **DC-0 v2 distinct-signer correlated run** linking directly decoded Sepolia `100,041` micro-USDC `Transfer` logs to HSK Mainnet `177` `MapaeRegistry.consume(100041)` + 6 live custom-error reverts) — independently verifiable with `node scripts/verify-proofs.mjs`. Because Cloudflare Workers egress IPs are dynamic (outside HSP QA's static IP allowlist), the hosted interactive console (`https://mapae.web-three.net`) transparently displays a **Sandbox Mode** badge and emits `onchainAnchored: false` / `ccipStatus: simulated` (zero fabricated tx hashes) alongside an inline **Live Verified Proof Inspector**, running **real per-pass `viem` EIP-712 signing**, **per-visitor isolated Durable Objects (`MapaeSignerDO`)**, **non-custodial 1-time scoped spending authority passes** (`authorityStatus` + `releasedAuthorityUsd`, zero custodial sweep), **owner-authenticated CIBA out-of-band mobile approval**, and **OAuth 2.1 + PKCE `S256`**.
---
## Why Mapae?
Commercial AI assistants (`Claude Duet`, `OpenAI dots`, `Perplexity Computer`, `Gemini Spark`, `Grok Bot`, `Meta Muse`, `Pickle`, `Manus Cue`, `Cursor`, `Claude Code`) can already browse merchants and invoke paid APIs — yet payments fail in three predictable ways:
1. **Raw Credential Exposure** — Handing credit cards or wallet private keys directly to an untrusted agent runtime.
2. **Unbounded Spend Loops** — Runaway tool calls draining funds before a human can intervene.
3. **Approval Fatigue** — Interrupting the user on every `$0.03` metered API call instead of approving one mission budget once.
**Mapae** — inspired by the Joseon royal *Mapae* travel warrant (scoped authority, fixed allowance, instant recall) — issues a **single-task proxy pass (`mpt_...`)** with **0 private keys** in the assistant VM. Metered HTTP 402 lookups auto-settle silently inside the limit, unexpected price drift holds for 1-tap owner approval, over-cap attempts revert on-chain (`ExceedsMapaeCap`), and one-tap revocation freezes every chain via **Chainlink CCIP**.
---
## Product Preview
<table>
<tr>
<td width="50%">
<img src="./docs/evidence/ko-app-activity-1440-light.png" alt="Settlement Ledger & Drift Approval" />
<br /><sub><b>Settlement Ledger</b> — 7-step HSP EIP-712 traces, HTTP 402 auto-settlements, cap blocks, and 1-tap drift approval</sub>
</td>
<td width="50%">
<img src="./docs/evidence/ko-app-mandates-1440-light.png" alt="Payment Mandates & CCIP Propagation" />
<br /><sub><b>Mandates & CCIP Kill-Switch</b> — Hierarchical sub-agent delegation with instant cross-chain revocation</sub>
</td>
</tr>
<tr>
<td width="50%">
<img src="./docs/evidence/ko-app-connections-1440-light.png" alt="Commercial AI Assistants & MCP Hub" />
<br /><sub><b>Assistants & MCP Hub</b> — 10 commercial/dev assistant surfaces with isolated per-workspace MCP endpoints</sub>
</td>
<td width="50%">
<img src="./docs/evidence/app-overview-1440-dark.png" alt="Treasury Overview (Dark Mode)" />
<br /><sub><b>Treasury Overview (Dark)</b> — Real-time spend velocity, budget guardrails, protocol mix, and utilization heatmap</sub>
</td>
</tr>
</table>
---
## Architecture — 5 Organic HashKey Ecosystem Primitives
Mapae separates **AI assistant execution** from **payment authority, cryptographic signing, and on-chain enforcement** across five tightly interlocked layers:
```mermaid
flowchart TB
subgraph USER["1. Owner Surface (Zero Persistent Wallet)"]
PWA["Owner Console & Mobile PWA<br/>/app · /approve/:id · /pair/:code"]
WALLET["Optional 1-Time EIP-6963 Wallet<br/>MapaeRegistry.issue() / SIWE<br/>Auto-Disconnects Immediately"]
PWA -. "1-Time Sign Only" .-> WALLET
end
subgraph AI["2. 24/7 Cloud & Local AI Assistants (0 Private Keys)"]
CLIENTS["Claude · ChatGPT · Grok · Perplexity<br/>Claude Code · Codex · Cursor · OpenCode"]
TOK["Holds ONLY Scoped Pass Token (mpt_...)<br/>+ Agent Poll Token (mpp_...)"]
CLIENTS --- TOK
end
subgraph EDGE["3. Cloudflare Edge Control & Isolated Signer Plane"]
MCP["MCP Layer (6 Tools)<br/>/mcp (Streamable HTTP) · /mcp/oauth (OAuth 2.1)<br/>npx mapae-mcp · SKILL.md · OpenAPI 3.1"]
COORD["Global Coordinator DO<br/>Routes req_ / drift_ / sha256(mpt_)<br/>OAuth 2.1 · QR Pairing · SIWE Nonces"]
DO["Per-Owner Isolated MapaeSignerDO<br/>Atomic Cent Reservation · >5% Drift Guard<br/>Per-Pass viem EIP-712 · HTTP 402 Gateway"]
MCP --> COORD --> DO
end
subgraph HSKLAYER["4. Official HSP Settlement & HashKey Chain Authority"]
HSP["Official HSP 8-Tool Gateway<br/>get_chain_config -> create_order -> prepare<br/>EIP-3009 Gasless USDC -> query_payment"]
REG["MapaeRegistry.sol (HSK Mainnet 177)<br/>0x3a84...e3D3 · Verified<br/>issue() · delegate() · consume() · anchorReceipts() · revoke()"]
end
subgraph CCIPLAYER["5. Chainlink CCIP Cross-Chain Kill-Switch"]
MIRROR["MapaeMirror.sol (Sepolia / Base)<br/>0xC878...3d3a · ERC-165 OffRamp Receiver<br/>ccipReceive() -> assertChainActive()"]
end
CLIENTS -- "JSON-RPC 2.0 / HTTP 402" --> MCP
PWA -- "HttpOnly mapae_owner<br/>1-Tap Approve / Drift / Revoke" --> COORD
WALLET -- "1-Time issue() Tx" --> REG
DO -- "Verify MapaeIssued RPC<br/>+ Consume / Anchor / Revoke" --> REG
DO -- "7/8-Step Signed Settlement" --> HSP
REG -- "revokeAndPropagate()<br/>via Chainlink CCIP" --> MIRROR
```
---
## AI Assistant ↔ User ↔ Mapae Interaction Flow (CIBA Out-of-Band Pass)
How a user and a 24/7 cloud AI assistant actually exchange messages, issue a 1-time scoped pass, settle silently inside the cap, handle price drift, and seal remaining authority:
```mermaid
sequenceDiagram
autonumber
actor User as User (Web / Mobile)
participant AI as AI Assistant (0 Keys)
participant MCP as Mapae MCP & Coordinator
participant DO as Isolated MapaeSignerDO
participant HSP as Official HSP Gateway / HTTP 402
participant HSK as MapaeRegistry (HSK 177)
participant CCIP as MapaeMirror (CCIP)
rect rgb(244, 246, 250)
note over User,HSK: Phase 1 — Natural Request & 1-Time Scoped Pass Issuance (CIBA)
User->>AI: "Find the quietest humidifier under $110 and complete checkout"
AI->>MCP: mapae_request(task, capUsd=108, category="shopping", ttlHours=12)
MCP->>DO: Create pending pass & derive isolated disposablePassAddress
MCP-->>AI: approvalUrl (/approve/req_...) + pollToken (mpp_...) [0 keys]
AI-->>User: Share clickable approvalUrl in chat
AI->>MCP: mapae_poll_approval(req_..., mpp_...) [waiting]
User->>MCP: Open /approve/req_... -> review cap & stores -> Tap Approve
opt Optional 1-Time On-Chain Anchor (Auto-Disconnects Wallet)
User->>HSK: EIP-6963 1-time MapaeRegistry.issue(salt, passAddr, cap, merkleRoot, ttl)
DO->>HSK: Verify MapaeIssued log via HSK 177 RPC
end
MCP-->>AI: Approved! Deliver scoped 1-time proxyToken (mpt_...)
end
rect rgb(240, 250, 245)
note over AI,HSK: Phase 2 — Silent HTTP 402 Micro-APIs & 7/8-Step HSP Checkout
AI->>HSP: GET /merchants/reviewpulse/acoustic (no token)
HSP-->>AI: 402 PAYMENT_REQUIRED (orderId, $0.03)
AI->>HSP: Retry with X-Mapae-Token: mpt_... + X-Mapae-Order-Id
DO->>DO: Atomic cent cap check + auto-settle (0 popups)
HSP-->>AI: 200 OK (review data + auto_settled receipt)
AI->>MCP: mapae_quote("homecraft", "humidifier-4l")
MCP-->>AI: Authoritative server-locked quote ($100.08, orderId)
AI->>MCP: mapae_pay(orderId, mpt_..., idempotencyKey)
DO->>DO: Verify scope, cap, replay & price drift (<=5%) -> viem EIP-712 sign
DO->>HSP: 7/8-Step HSP EIP-3009 Gasless Settlement (USDC)
HSP-->>DO: payment-finalized + txHash
DO->>HSK: consume(exactAmount, hspOrderHash) & anchorReceipts(merkleRoot, hspRef)
MCP-->>AI: Settled receipt + remaining allowance ($7.83 left)
AI-->>User: "Done! Purchased HomeCraft 4.2L ($100.08). Receipt & $7.83 left."
end
rect rgb(253, 245, 245)
note over User,CCIP: Phase 3 — Guardrails (Drift Hold / Over-Cap Block) & Instant Seal / CCIP Revoke
alt Merchant Price Jumps > 5%
DO-->>AI: PriceDriftHeld + driftApprovalUrl (/approve/drift/...)
AI-->>User: Send 1-tap drift approval link
User->>MCP: 1-Tap Approve Drift -> DO signs & settles
else Over-Cap or Unapproved Store Attempt
DO-->>AI: 402 Blocked BEFORE signing (ExceedsMapaeCap / MerchantNotInScope)
end
alt Mission Complete (Auto-Seal)
AI->>MCP: mapae_close(mpt_...)
DO->>DO: Seal pass & release unused authority (subsequent pay rejected)
else Emergency Owner Kill-Switch
User->>MCP: 1-Tap Revoke in Console
DO->>HSK: MapaeRegistry.revoke(mandateId)
HSK->>CCIP: revokeAndPropagate() -> MapaeMirror.ccipReceive()
CCIP-->>AI: Parent + all delegated sub-agents blocked across chains
end
end
```
| # | Official Tool / Ecosystem Primitive | Key Files | Organic Role in Workflow |
|---|---|---|---|
| **1** | **HSP API (HashKey Stablecoin Payment)** | [`apps/worker/src/hsp-adapter.ts`](./apps/worker/src/hsp-adapter.ts), [`PROOF.md`](./PROOF.md) | 8-tool Official HSP QA MCP client (`get_chain_config → create_order → get_order → prepare_payment → EIP-712 → finalize_payment → submit_payment → query_payment`) executing real Circle USDC EIP-3009 gasless settlements (`5/5 payment-finalized`, `app_key=Z3I63VAI`) |
| **2** | **Payment Mandate (`MapaeRegistry.sol`)** | [`contracts/src/MapaeRegistry.sol`](./contracts/src/MapaeRegistry.sol), [`apps/web/src/lib/wallet.ts`](./apps/web/src/lib/wallet.ts) | HSK Mainnet `177` verified authority ledger (`0x3a84...e3D3`) enforcing cumulative delegation caps (`ExceedsMapaeCap`), Merkle merchant scopes (`MerchantNotInScope`), root-tree replay protection (`OrderAlreadyConsumed`), receipt Merkle anchoring, and 1-time EIP-6963 browser anchoring |
| **3** | **HSP Gateway & HTTP 402 Facilitator** | [`apps/worker/src/engine.ts`](./apps/worker/src/engine.ts), [`apps/worker/src/merchants.ts`](./apps/worker/src/merchants.ts), `MapaeSignerDO` | Isolated per-owner signer holding derived pass keys (0 keys in AI), atomic integer-cent budget & shared-wallet reservations, silent HTTP 402 metered API auto-settlement, and `>5%` server-side price-drift holds |
| **4** | **MCP (`2025-03-26`) + OAuth 2.1 + CIBA** | [`apps/worker/src/mcp-server.ts`](./apps/worker/src/mcp-server.ts), [`apps/worker/src/oauth.ts`](./apps/worker/src/oauth.ts), [`packages/mapae-mcp/`](./packages/mapae-mcp/) | 6 purpose-built payment tools (`mapae_request`, `mapae_poll_approval`, `mapae_quote`, `mapae_pay`, `mapae_status`, `mapae_close`) over Streamable HTTP `/mcp`, OAuth 2.1 + PKCE `/mcp/oauth`, zero-key `npx mapae-mcp`, `SKILL.md`, and OpenAPI 3.1 |
| **5** | **Chainlink CCIP Kill-Switch (`MapaeMirror.sol`)** | [`contracts/src/MapaeMirror.sol`](./contracts/src/MapaeMirror.sol), [`apps/worker/src/workspace-store.ts`](./apps/worker/src/workspace-store.ts) | Verified ERC-165 OffRamp receiver on Ethereum Sepolia (`0xC878...3d3a`, wired on-chain to HSK Mainnet `177` & Testnet `133`) propagating 1-tap revocations across chains and blocking parents + all delegated descendants via `assertChainActive()` |
For the full security boundary specification (HttpOnly `mapae_owner` vs `?ws=` isolation, OAuth 2.1 PKCE + family revocation, concurrent wallet reservation, and strict 2-step HTTP 402 idempotency), see [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
---
## Connect Any Assistant in 10 Seconds
### Remote Streamable HTTP MCP (Claude / OpenAI / Grok / Perplexity)
```json
{
"mcpServers": {
"mapae": {
"type": "http",
"url": "https://mapae.web-three.net/mcp"
}
}
}
```
### Local Zero-Key Stdio Shim (`Cursor` / `Claude Desktop` / `Claude Code`)
```json
{
"mcpServers": {
"mapae": {
"command": "npx",
"args": ["-y", "mapae-mcp"],
"env": {
"MAPAE_MCP_URL": "https://mapae.web-three.net/mcp"
}
}
}
}
```
---
## Repository Structure
```text
mapae/
├── apps/
│ ├── web/ # React 19 + Tailwind v4 landing, 5-view console, EN/KO, installable PWA
│ └── worker/ # Cloudflare Worker + MapaeSignerDO, 7-step HSP adapter, MCP & HTTP 402 APIs
├── contracts/
│ ├── src/ # MapaeRegistry.sol (HSK Chain) & MapaeMirror.sol (Chainlink CCIP mirror)
│ ├── script/ # DeployHSK.s.sol, DeployMirror.s.sol, verify-anvil-live.sh
│ └── test/ # Foundry test suite (7/7 PASS)
├── packages/
│ ├── mapae-mcp/ # Zero-key stdio MCP shim (JSON-RPC single/batch + SSE)
│ └── shared/ # Shared chain configs (HSK 133/177, CCIP routers), types, horse grades
├── plugin/ # Static SKILL.md, manifest.json, and OpenAPI 3.1 spec
├── scripts/ # deploy-onchain.sh, verify-live.mjs, verify-browser-e2e.mjs
└── docs/ # ARCHITECTURE.md, VERIFICATION_EVIDENCE.md, and QA proof screenshots
```
---
## Local Development, Testing & On-Chain Deployment
### Prerequisites
- Node.js 20+, `pnpm` 9+, [Foundry](https://book.getfoundry.sh/) (`forge`, `cast`, `anvil`)
### Build & Run All Verification Suites
```bash
# 1. Install dependencies
pnpm install
# 2. Build web bundle, strict typecheck, and run all 26 unit/contract tests
pnpm build:web && pnpm typecheck && pnpm test
# 3. Run local Anvil (chainId 133) live signed EVM tx verification (7/7)
./contracts/script/verify-anvil-live.sh
# 4. Run live HTTPS production E2E against https://mapae.web-three.net (11/11)
pnpm verify:live
# 5. Run real Headless Chrome interactive browser E2E (14/14, multi-browser isolation + 390px mobile + PWA)
pnpm verify:browser
# 6. Start local dev servers (Vite proxies /api, /mcp, /merchants, /plugin to Worker)
pnpm dev:worker
pnpm dev:web
```
### Deploy Smart Contracts to HashKey Chain (1 Command)
```bash
cp .env.example .env
# Set DEPLOYER_PRIVATE_KEY in .env (~0.003 HSK needed on HSK Testnet at ~1 gwei)
# Deploy & verify MapaeRegistry on HSK Testnet (133) only:
./scripts/deploy-onchain.sh testnet --registry-only
# Or deploy MapaeRegistry (HSK 133) + MapaeMirror (Ethereum Sepolia 11155111):
./scripts/deploy-onchain.sh testnet
# Mainnet (HSK 177 + Base 8453):
./scripts/deploy-onchain.sh mainnet
```
---
## Verification Scoreboard
| Verification Suite | Status | Coverage |
|---|---|---|
| **Independent On-Chain & Official HSP QA Verifier** (`node scripts/verify-proofs.mjs`) | **6 / 6 PASS** | Live HSK Mainnet `177` + **DC-0 v2 distinct-signer correlated proof (decoded Sepolia ERC-20 `Transfer` `100041` === HSK `spent` + pre-payment EIP-191 drift sig + 6 live reverts)** + Sepolia `MapaeMirror` Mainnet `177` wiring + 5 live Official HSP QA flows + 6 MCP tools + RFC 9728 OAuth 2.1 |
| **Foundry Smart Contracts** (`forge test -vv`) | **7 / 7 PASS** | Caps, Merkle allowlists, delegation replay, ERC-165 CCIP mirror, spoofed-router rejection, non-payable pull refunds |
| **Worker Engine, CIBA & OAuth 2.1** (`vitest run`) | **15 / 15 PASS** | Full lifecycle, CIBA global routing, zero CSRF self-approval bypass (`401`) & post-request workspace/SIWE pre-existence gate (`403`), honest Sandbox (`onchainAnchored: false`), per-pass EIP-712 signing, strict cap/TTL/category bounds, per-IP rate limiting (`429`), idempotent close & post-close replay, OAuth 2.1 PKCE `S256` + 1h TTL + auth-code replay family revocation, cross-device `/pair`, full EIP-4361 SIWE, LIVE `MapaeIssued` RPC event decoding + 1-time anchor tx lock (`409`) |
| **`mapae-mcp` Stdio Shim** (`node --test`) | **4 / 4 PASS** | Single & batch JSON-RPC relay, `202` notification silence, multi-event SSE parsing |
| **Live HTTPS Production E2E** (`pnpm verify:live`) | **11 / 11 PASS** | Verified live on `https://mapae.web-three.net` (multi-tenant DO isolation, stdio→HTTPS MCP, CIBA + `401` CSRF bypass blocked, honest Sandbox fields, idempotent retry, post-close block, OAuth 2.1 PKCE + `1h` TTL + family revocation, security headers) |
| **Real Chrome Browser E2E** (`pnpm verify:browser`) | **14 / 14 PASS** | 0-click console, DC-0 v2 Live Proof Inspector, proactive owner auth on CIBA `/approve/:requestId`, cross-device QR `/pair/:code` + Login-CSRF confirmation, unpaired drift `401` proactive recovery, 390px Landing & KPI zero-overflow, mobile PWA — **0 console/page errors** |
| **Real Agent Resumption E2E** (`claude -p` & `codex exec`) | **2 / 2 PASS** | Live Claude Code & OpenAI Codex (`gpt-6.2-astra`) executed `mapae_request` → out-of-band approval → `mapae_poll_approval` → `mapae_quote` → `mapae_pay` (idempotent retry) → `mapae_close` → post-close block against `https://mapae.web-three.net/mcp` |
| **Adversarial Security Audit** (`Claude Opus`) | **PASS (0 P0/P1)** | Full review & re-verification of OAuth 2.1, CIBA, coordinator, pairing, SIWE, LIVE guards, and V2 frontend |
Full cryptographic digests, transaction hashes, and product feature catalogs are documented in [`PROOF.md`](./PROOF.md), [`JUDGES.md`](./JUDGES.md), [`docs/PRODUCT_FEATURES.md`](./docs/PRODUCT_FEATURES.md), and [`docs/V2_PRODUCTION_PLAN.md`](./docs/V2_PRODUCTION_PLAN.md).
---
## License
MIT © 2026 Mapae Contributors — see [`LICENSE`](./LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues