Amber
Persistent, portable memory-as-a-service for AI agents. ERC-8004 identity, x402 payment-gated, attested on X Layer.
ビデオ




テックスタック
説明
AMBER: The Reputation Memory Layer for the OKX AI Marketplace
OKX AI Genesis Hackathon 2026
BUILT ON X Layer (chain ID 196) + USD₮0 + x402 v2 + MCP 2025-06-18 + ERC-8004
Live: https://amber-mcp.xyz
· ASP agentId #9228
· x402-compliant
· registered on X Layer
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXECUTIVE SUMMARY
AMBER is the persistent memory and live on-chain reputation layer for the OKX AI marketplace: one identity, one memory store, one reputation score, across every ASP vertical. It is not another chatbot. It is the infrastructure layer beneath the agents.
Every AI agent on OKX AI has an ERC-8004 identity but no memory that survives a session and no reputation that follows it between jobs. AMBER fixes both. It exposes a Model Context Protocol server that any client (Claude, Cursor, the OKX dispatcher) can call to write and recall context keyed to the agent's on-chain identity, and it computes a live 0-100 reputation score from what that identity has actually done: memories persisted, attestations verified, payments settled, verticals covered.
A Postgres + pgvector store holds 1024-dimensional embeddings for semantic recall. A batched Merkle attestation commits each write to X Layer for tamper-evidence. Every paid call settles per request in USD₮0 via the x402 exact scheme (EIP-3009), and a subscription (period) scheme is supported for recurring buyers. One HTTP call. Any client. Any of the five OKX AI verticals.
Status: Functional MVP · Live at https://amber-mcp.xyz on a Singapore VPS · Registered ASP (agentId #9228) on X Layer, tx 0xd5ec39a85da40905b8d8f00a346d0866641a9852b9094bcf16c31d0dac55b9c0 · 33 MCP tools + 6 prompts + 7 resources · 17 marketplace A2MCP services · x402 402 challenge verified compliant against the official OKX A2MCP spec · 38 tests, typecheck + lint clean · Full backend shipped.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PROBLEM > SOLUTION
Problems in the OKX AI agent economy
- No persistent memory.
Agents on the marketplace are session-only. The context an agent builds during one job evaporates before the next. There is no shared, identity-keyed store an agent can write to once and recall anywhere.
- No portable reputation.
OKX AI's own thesis is that "every AI agent has a single persistent identity that accumulates reputation across all work." Today that reputation is not computed or queryable. An agent that has done a hundred good jobs looks identical to one that just registered.
- No verifiable trust.
Buyers cannot prove that an agent's stored context or its track record is real and untampered. Trust is asserted, not attested.
- No cross-vertical layer.
The five OKX AI verticals (professional asset, resume, creative, software, prediction) each need memory and reputation, but nothing serves all of them.
The AMBER solution
- One memory store, identity-keyed.
A single persistent memory service writes structured context under an agent's ERC-8004 identity and returns it via semantic search (pgvector KNN over 1024-dim embeddings). Write once, recall anywhere, across sessions and clients.
- A live 0-100 reputation score.
GET /identity/reputation/:address returns a score computed from six axes: persistence, verification, economic activity, vertical breadth, deliberateness, and longevity. This makes OKX AI's thesis real and queryable in one call.
- Merkle attestation on X Layer.
Each batch of memory writes is committed to an on-chain Merkle root for tamper-evidence. Any reader can reconstruct the leaves from /attestation/:root and verify the root. (Computed off-chain today via an honest-degrade path; the AmberAttestation contract is written, tested, and ready to deploy.)
- Pay-per-call in USD₮0.
Every paid tool returns a compliant x402 402 challenge and settles in USD₮0 on X Layer via EIP-3009. First 100 writes per identity are free, so adoption is frictionless.
Market opportunity
- OKX AI's Agent Trade Kit is sized for 1.2B API calls/day; AMBER's per-call pricing (0.0005 to 0.001 USD₮0) is built for that scale.
- No competing memory service ships as an OKX AI ASP with computed on-chain reputation. First-mover claim.
- Applies across all five OKX AI verticals rather than competing inside any one of them.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TECHNICAL INNOVATION
1. Live 6-axis Reputation Score (core innovation)
GET /identity/reputation/:address returns a 0-100 score with a transparent breakdown:
| Component | Max | Formula |
|---|---|---|
| Persistence | 25 | log10(memories+1) × 12.5 |
| Verification | 25 | X Layer attestation ratio × 25 |
| Economic | 20 | log10(paidWrites + seals + 1) × 15 |
| Breadth | 15 | 3 per OKX AI vertical touched (max 5) |
| Deliberateness | 10 | log10(pinned+1) × 8 |
| Longevity | 5 | log10(daysActive+1) × 4 |
Tiers: unseen (0-9) · fresh (10-24) · active (25-49) · established (50-74) · trusted (75-100). The score is honest by construction: the verification and economic axes only rise from real on-chain attestation and real settled payments, so a high score is earned, not asserted.
### 2. x402 v2 pay-per-call on X Layer, verified against the official spec
- 402 challenge emits the PAYMENT-REQUIRED header (base64 accepts-array) that the OKX dispatcher validates, plus a WWW-Authenticate: Payment realm="AMBER", scheme="x402-exact", network="eip155:196", version="2" priority header.
- Settlement asset is USD₮0 0x779ded0c9e1022225f8e0630b35a9b54be713736), decimals 6, with the exact EIP-712 domain name="USD₮0" version="1" verified on-chain against the token's DOMAIN_SEPARATOR.
- exact scheme for per-call payment and period scheme for subscriptions, both on the same EIP-3009 wire.
- Self-facilitation settlement path SETTLE_ON_CHAIN + funded operator key) documented; on by default in production.
3. Merkle attestation for tamper-evident memory
- Each batch of up to 32 writes is hashed into a keccak256 Merkle root over the ordered memory ids, using OpenZeppelin-compatible sorted-pair concatenation.
- AmberAttestation.sol is a minimal event-only registry attest(bytes32 merkleRoot, address identity, uint256 timestamp), only-owner, ~30k gas) so attestation is cheap per batch.
- A cron worker batches every 15 seconds; a retry worker and an unattested sweeper guarantee eventual attestation.
- Honest-degrade: when no contract is configured, roots are computed and stored off-chain and the /healthz and reputation surfaces say so plainly rather than faking on-chain state.
4. MCP 2025-06-18 server, full spec surface
- 33 tools, 6 prompts, 7 resources, and 6 declared capabilities (tools, resources, prompts, completion, logging, elicitation).
- Streamable HTTP transport, per-request responses (no batching), MCP-Protocol-Version echoed on every response, title and accurate outputSchema on all 33 tools so strict clients honor structured output.
- memory_template writes to any of the five OKX AI verticals; memory_related runs pgvector KNN; memory_habit_check tracks streaks; finance_brief builds a portfolio brief from the OKX DEX API.
- A2A envelope routing: a msgType: "a2a-agent-chat" POST is routed to the correct tool before JSON-RPC parse, for the Onchain OS priority lane.
5. ERC-8004 identity + reputation integration
- /agent.json is ERC-8004 v1 compliant: x402Support: true, supportedTrust: [reputation, crypto-economic, tee-attestation], and the global id format eip155:196:{registry}:{agentId}.
- AMBER's own 0-100 score uses the same 0-100 axis as the on-chain Reputation Registry, so it can be posted via giveFeedback(agentId, score, dec=0, "amber-rep-v1", ...) after any paid session.
- No competing memory ASP claims all three trust models.
6. Shareable, verifiable demonstration surfaces
- /demo/live is a 3-second judge validation that seeds a genuine "established"-tier demonstration identity through the real write path (real OpenAI embeddings, real pgvector, real reputation math), never mock data.
- /portrait/:addr.svg?frames=N renders a deterministic memory-constellation timelapse; /portrait/:addr/card.png and /seal/:id/card.png are 1200×630 Twitter OG cards.
- /report/comparables is an honest head-to-head vs Mem0, Zep, and Letta; /report/judging is a machine-readable evidence packet; /status/production-ready is an 11-gate self-audit.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ARCHITECTURE
AI agent / MCP client (Claude, Cursor, OKX dispatcher)
| HTTPS
v
amber-mcp.xyz (nginx + Let's Encrypt TLS, Singapore VPS)
| reverse proxy -> 127.0.0.1:3700
v
AMBER backend (Bun 1.1 + Fastify, Docker, always-on)
|--> POST /mcp MCP 2025-06-18 streamable HTTP (33 tools, 6 prompts, 7 resources)
|--> x402 middleware 402 PAYMENT-REQUIRED (USD₮0, eip155:196, EIP-3009) -> paid response + receipt
|--> REST surface /identity/reputation, /report/*, /demo/*, /public/*, /portrait/*, /seal/*
|--> discovery /agent.json, /listing.json, /.well-known/x402 (Bazaar ext), /skills/amber/SKILL.md
|--> workers attestation batcher (15s), payment settler, unattested sweeper, retry | |--> Postgres 15 + pgvector (Supabase, Seoul) memories + 1024-dim embeddings + reputation source
|--> Redis 7 (Upstash, Singapore) nonce dedupe, quota, rate limit, embed cache, MCP sessions
|--> OpenAI text-embedding-3-small (1024-dim) semantic recall
|--> X Layer RPC (chain 196) USD₮0 domain, attestation, reputation registry Key properties:
- Identity-keyed memory. Every write is bound to an ERC-8004 address; recall is per-identity.
- Honest reputation. Verification and economic axes rise only from real on-chain activity.
- Pay-per-call with a free tier. First 100 writes free per identity, then x402 USD₮0.
- Always-on, self-hosted. Docker with restart policy on a prepaid VPS; database and cache are external managed services.
- Honest degrade everywhere. Missing attestation contract, unsettled payments, and empty identities are reported as-is, never faked.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OKX + X LAYER ECOSYSTEM INTEGRATION
X Layer (chain ID 196, settlement)
- USD₮0 0x779ded0c9e1022225f8e0630b35a9b54be713736) as the settlement stablecoin, EIP-712 domain verified on-chain.
- ERC-8004 Identity + Reputation registries 0x8004a169fb4a3325136eb29fa0ceb6d2e539a432).
- Merkle attestation posted from the backend cron via the ASP wallet.
OKX Onchain OS
- Registered as an A2MCP ASP via onchainos agent create + activate (agentId #9228), gas-free through the platform paymaster.
- 17 CJK-compliant marketplace services, all pointing at the immutable https://amber-mcp.xyz/mcp endpoint.
- Installable as a Skill + MCP server, matching the Onchain OS "one command" install model.
OKX Agentic Payments (x402 / APP)
- Compliant 402 with PAYMENT-REQUIRED (x402 v2 accepts) and WWW-Authenticate: Payment (APP priority lane).
- EIP-3009 transferWithAuthorization settlement in USD₮0; buyers pay through the OKX Agentic Wallet with no per-call confirmation.
OKX Market / Trade
- finance_brief and portfolio_snapshot call the OKX DEX aggregator and wallet APIs for the prediction/finance vertical.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPETITIVE ADVANTAGE
AMBER does not compete on retrieval benchmarks (LoCoMo, LongMemEval). It wins on OKX-AI-native infrastructure.
| | Mem0 / Zep / Letta | Generic vector DB | AMBER |
|---|:---:|:---:|:---:|
| ERC-8004 identity-keyed | No | No | Yes |
| Live 0-100 reputation endpoint | No | No | Yes |
| Merkle attestation on X Layer | No | No | Yes |
| x402 pay-per-call (USD₮0) | No | No | Yes |
| OKX Agentic Wallet compatible | No | No | Yes |
| Ships as an OKX AI ASP | No | No | Yes |
| 5 OKX AI vertical presets | No | No | Yes |
| MCP 2025-06-18 full surface | Partial | No | Yes |
| A2A envelope routing | No | No | Yes |
Full head-to-head: GET /report/comparables.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TECHNOLOGY STACK
- Backend: Bun 1.1 · Fastify · Prisma 7 + pg adapter · PostgreSQL 15 + pgvector · Redis 7 (ioredis) · node-cron workers
- Embeddings / AI: OpenAI text-embedding-3-small (1024-dim), 24h embed cache in Redis
- Payments: x402 v2 (exact + period) · USD₮0 · EIP-3009 · self-facilitation settlement path
- Identity / attestation: ERC-8004 (Identity + Reputation) · keccak256 Merkle roots · AmberAttestation.sol (event-only, ~30k gas, Foundry-tested)
- Protocol: MCP 2025-06-18 streamable HTTP (33 tools, 6 prompts, 7 resources, 6 capabilities)
- Discovery: /agent.json (ERC-8004 v1) · /listing.json (A2MCP, 17 services) · /.well-known/x402 (Bazaar Discovery Extension) · /skills/amber/SKILL.md
- Security: origin allowlist for /mcp (DNS-rebinding defense) · x402 nonce replay protection · parameterized SQL throughout · fail2ban + ufw on the host · no secrets in the repo (.env git-ignored)
- Infra: Docker on Ubuntu 24.04 VPS (Singapore) · nginx reverse proxy · Let's Encrypt TLS (auto-renew) · Supabase (Postgres, Seoul) · Upstash (Redis, Singapore) - Quality: 38 tests (bun:test) · tsc strict typecheck · eslint clean · every change code-reviewed to SHIP
- Chain: X Layer (eip155:196)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT IS REAL vs STAGED
| Item | Status | Evidence |
|---|---|---|
| Live public endpoint | Verified | https://amber-mcp.xyz/healthz returns 200; postgres/redis/xlayer/openai all green |
| x402 402 compliance | Verified | Decoded PAYMENT-REQUIRED matches OKX spec: USD₮0, eip155:196, extra{name,version}, WWW-Authenticate |
| ASP registered on X Layer | Verified | agentId #9228, tx 0xd5ec39a8…dac55b9c0, gas-free via paymaster |
| MCP full surface | Verified | 33 tools with titles + output schemas, initialize/tools/list/tools/call all pass |
| Memory write + semantic recall | Verified | Free write returns a real memoryId; pgvector KNN recall works |
| Reputation score | Verified | /identity/reputation/:address returns live 0-100 with 6-axis breakdown |
| Merkle attestation | Off-chain (honest degrade) | Roots computed + stored off-chain; AmberAttestation.sol written, Foundry-tested, ready to deploy |
| On-chain payment settlement | Fast-follow | SETTLE_ON_CHAIN + funded operator key documented; verify-only until the funded key is set |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ハッカソンの進行状況
**Foundation**
- Chose the positioning: the memory + reputation layer beneath all five OKX AI verticals, matching OKX's own thesis.
- Built the backend (Bun + Fastify + Prisma + Postgres/pgvector + Redis) with the MCP 2025-06-18 transport.
**Core build**
- Shipped 33 MCP tools, the x402 middleware, the 6-axis reputation engine, and the Merkle attestation worker.
- Wrote `AmberAttestation.sol` with a full Foundry test suite; prepared the X Layer deploy script.
- Verified x402 compliance against the official OKX A2MCP spec and corrected the settlement asset to USD₮0 with the on-chain-verified EIP-712 domain.
**Features and polish**
- Portrait constellation timelapse, OG cards, SEALSCRIBE seals.
- `/demo/live` self-seeding demonstration, `/public/showcase`, `/report/comparables`, `/status/production-ready`.
- Backfilled accurate `outputSchema` on all 33 tools; made revenue reporting settlement-honest; wrote a 38-test suite.
**Ship**
- Deployed live to `https://amber-mcp.xyz` on a Singapore VPS (Docker + nginx + Let's Encrypt), with Supabase and Upstash as managed Postgres and Redis.
- Registered the ASP on X Layer (agentId #9228) and submitted to the OKX AI marketplace for review.
資金調達の状況
Not fundraised. AMBER is a hackathon project built from scratch during the OKX AI Genesis Hackathon.
AMBER turns the OKX AI marketplace's missing layer into one HTTP call: persistent memory keyed to an ERC-8004 identity, a live 0-100 reputation earned across every job, Merkle-attested on X Layer and paid per call in USD₮0 via x402. One identity. One memory store. Reputation you can verify. Built for OKX AI, shipped on X Layer.