zkproofport-ai
proofport-ai
ZKProofport向けのAIエージェントネイティブなZK証明インフラストラクチャ。AWS Nitro Enclave内でエンドツーエンド暗号化を使用してゼロ知識証明を生成・検証するスタンドアロンサービスです。サーバーはブラインドリレーとして機能し、証明の入力内容を一切閲覧しません。
アーキテクチャ
Client (AI Agent / SDK)
│
│ 1. POST /api/v1/prove → 402 { nonce, price, teePublicKey }
│ 2. Sign EIP-3009 USDC payment
│ 3. Encrypt inputs with TEE X25519 public key (ECIES)
│ 4. POST /api/v1/prove + X-Payment-TX + X-Payment-Nonce + encrypted_payload
│
▼
┌─────────────────────────────────────┐
│ Node.js Server (port 4002) │
│ ─ Verify USDC payment on-chain │
│ ─ Blind relay: pass encrypted │
│ payload to enclave via vsock │
│ ─ Return proof + TEE attestation │
└────────────┬────────────────────────┘
│ vsock
▼
┌─────────────────────────────────────┐
│ AWS Nitro Enclave │
│ ─ X25519 key pair (bound to NSM) │
│ ─ Decrypt inputs (AES-256-GCM) │
│ ─ bb prove (Barretenberg CLI) │
│ ─ NSM attestation of proof hash │
└─────────────────────────────────────┘主な特性:
E2E暗号化 — X25519 ECDH + AES-256-GCM。
nitroモードでは、プレーンテキストの入力は拒否されます。ブラインドリレー — Node.jsホストは証明の入力内容を読み取ることができません。エンクレーブのみが復号を行います。
x402決済 — シングルステップフロー:402チャレンジ → USDC決済 → 証明生成。ミドルウェアは不要です。
ハードウェア構成証明 — NSM構成証明ドキュメントにより、TEE公開鍵とエンクレーブ測定値(PCR)が紐付けられます。
Related MCP server: AgentStamp
ディレクトリ構造
proofport-ai/
├── src/
│ ├── index.ts # Express server entry (port 4002)
│ ├── logger.ts # Pino logger
│ ├── swagger.ts # OpenAPI spec
│ ├── tracing.ts # OpenTelemetry tracing
│ ├── a2a/
│ │ ├── agentCard.ts # /.well-known/agent.json, agent-card.json
│ │ ├── proofportExecutor.ts # A2A task executor
│ │ └── redisTaskStore.ts # Redis-backed task persistence
│ ├── chat/
│ │ ├── geminiClient.ts # Gemini API client
│ │ ├── llmProvider.ts # LLM provider interface
│ │ ├── multiProvider.ts # Multi-provider routing
│ │ └── openaiClient.ts # OpenAI API client
│ ├── circuit/
│ │ └── artifactManager.ts # Circuit artifact download/cache
│ ├── config/
│ │ ├── index.ts # Environment config
│ │ ├── circuits.ts # Circuit metadata
│ │ └── contracts.ts # Deployed contract addresses
│ ├── identity/
│ │ ├── agentAuth.ts # Agent JWT authentication
│ │ ├── autoRegister.ts # ERC-8004 auto-registration
│ │ ├── register.ts # Identity registration
│ │ └── reputation.ts # Reputation management
│ ├── input/
│ │ ├── attestationFetcher.ts # EAS GraphQL attestation fetch
│ │ ├── inputBuilder.ts # Circuit input construction
│ │ └── merkleTree.ts # Merkle tree builder
│ ├── mcp/
│ │ ├── server.ts # StreamableHTTP MCP server
│ │ └── stdio.ts # stdio MCP server (local use)
│ ├── payment/
│ │ └── freeTier.ts # Payment mode config
│ ├── proof/
│ │ ├── proofRoutes.ts # x402 single-step proof API
│ │ ├── guideBuilder.ts # Dynamic proof generation guide
│ │ ├── paymentVerifier.ts # On-chain USDC payment verification
│ │ ├── sessionManager.ts # Proof session/nonce management
│ │ └── types.ts
│ ├── prover/
│ │ ├── bbProver.ts # bb CLI direct prover
│ │ ├── tomlBuilder.ts # Prover.toml builder
│ │ └── verifier.ts # On-chain verification (ethers v6)
│ ├── redis/
│ │ ├── client.ts # Redis client
│ │ ├── cleanupWorker.ts # Expired data cleanup
│ │ ├── constants.ts # Redis key prefixes
│ │ ├── proofCache.ts # Proof result caching
│ │ ├── proofResultStore.ts # Proof result persistence
│ │ └── rateLimiter.ts # Rate limiting
│ ├── skills/
│ │ ├── skillHandler.ts # Skill routing
│ │ └── flowGuidance.ts # Step-by-step flow guidance
│ ├── tee/
│ │ ├── index.ts # TEE mode config
│ │ ├── attestation.ts # NSM attestation validation (COSE Sign1)
│ │ ├── detect.ts # TEE environment detection
│ │ ├── enclaveBuilder.ts # Enclave image builder
│ │ ├── enclaveClient.ts # Nitro Enclave vsock client
│ │ ├── encryption.ts # AES-256-GCM encryption utilities
│ │ ├── teeKeyExchange.ts # X25519 ECDH key exchange
│ │ └── validationSubmitter.ts # TEE validation on-chain
│ └── types/
│ └── index.ts
├── packages/
│ ├── sdk/ # @zkproofport-ai/sdk (npm)
│ └── mcp/ # @zkproofport-ai/mcp (npm)
├── aws/
│ ├── enclave-server.ts # TypeScript TEE prover (Nitro Enclave)
│ ├── Dockerfile.enclave # Enclave image
│ ├── deploy-blue-green.sh # Zero-downtime deployment
│ ├── boot-active-slot.sh # Systemd boot script
│ ├── stop-active-slot.sh # Systemd stop script
│ ├── build-enclave.sh # Enclave build helper
│ ├── ec2-setup.sh # EC2 instance setup
│ ├── Caddyfile # Reverse proxy config
│ ├── docker-compose.aws.yml # AWS Docker Compose
│ ├── vsock-bridge.py # vsock-to-TCP bridge
│ └── systemd/ # Systemd service files
├── sign-page/ # Next.js signing page (WalletConnect)
├── tests/
│ ├── e2e/ # Full E2E tests (REST, MCP, A2A, proof, verify)
│ ├── a2a/ # A2A unit tests
│ ├── identity/ # ERC-8004 identity tests
│ ├── integration/ # Integration tests
│ ├── payment/ # Payment tests
│ ├── tee/ # TEE tests
│ └── *.test.ts # Unit tests
├── docker-compose.yml # Local dev: server + redis
├── docker-compose.test.yml # Test stack: + a2a-ui + Phoenix
├── Dockerfile # Node.js server image
└── README.mdクイックスタート
npm (開発環境)
npm install
npm run dev # Hot reload with tsx
npm run build # Build TypeScript
npm start # Production
npm test # Run tests
npm run test:e2e # E2E tests against Docker stackDocker Compose (ローカル環境)
docker compose up --build # Start redis + server
docker compose down # Stop
docker compose down -v # Reset dataポート 4002: Node.jsサーバー
ポート 6380 (ホスト) → 6379 (コンテナ): Redis
E2E暗号化 (ブラインドリレー)
証明の入力データは、クライアントとNitro Enclave間でエンドツーエンドで暗号化されます。Node.jsサーバーは、暗号化されたBLOBを読み取ることなく転送します。
プロトコル: X25519 ECDH + AES-256-GCM (ECIESパターン)
TEEは起動時にX25519キーペアを生成し、公開鍵をNSM構成証明に紐付けます
クライアントは402レスポンスからTEE公開鍵を取得し、構成証明を検証します
クライアントはエフェメラルなX25519キーペアを生成し、ECDH共有秘密を計算し、SHA-256経由でAES鍵を導出します
クライアントはAES-256-GCMで入力を暗号化し、
{ ephemeralPublicKey, iv, ciphertext, authTag, keyId }を送信しますサーバーは暗号化されたエンベロープをvsock経由でエンクレーブに渡します(ブラインドリレー)
エンクレーブは復号し、証明を生成し、証明とNSM構成証明を返します
強制: nitroモードでは、プレーンテキストの入力はPLAINTEXT_REJECTEDで拒否されます。
x402決済フロー
ミドルウェアやセッションを必要としない、シングルステップのアトミックフローです:
POST /api/v1/prove { circuit, inputs }
↓
402 { nonce, price, payTo, teePublicKey }
↓
Client signs EIP-3009 TransferWithAuthorization (USDC)
↓
POST /api/v1/prove { circuit, encrypted_payload }
+ X-Payment-TX: <txHash>
+ X-Payment-Nonce: <nonce>
↓
200 { proof, publicInputs, proofWithInputs, attestation, timing, verification }決済モード:
モード | ネットワーク | 効果 |
| なし | すべてのリクエストが無料 |
| Base Sepolia | USDC決済が必要 (テストネット) |
| Base Mainnet | USDC決済が必要 (本番環境) |
RESTエンドポイント
エンドポイント | メソッド | 目的 |
| GET | ヘルスチェック + TEEステータス + 決済モード |
| POST | x402シングルステップ証明生成 |
| GET | 動的証明生成ガイド (JSON) |
| POST | StreamableHTTP MCPエンドポイント |
| POST | A2A JSON-RPCエンドポイント |
| GET | OASFエージェントカード |
| GET | A2Aエージェントカード |
| GET | MCPディスカバリー |
| GET | Swagger UI |
| GET | OpenAPI仕様 |
MCPツール
/mcp (StreamableHTTP) またはローカルの @zkproofport-ai/mcp パッケージ (stdio) 経由で利用可能:
ツール | 目的 |
| オールインワン証明生成 (x402決済 + E2E暗号化自動検出) |
| オンチェーン証明検証 |
| 利用可能な回路の一覧表示 |
| 402チャレンジのリクエスト (ステップバイステップフロー) |
| x402 USDC決済の実行 (ステップバイステップフロー) |
| 証明入力の送信 (ステップバイステップフロー) |
| 回路入力の準備 (ステップバイステップフロー) |
npmパッケージ
@zkproofport-ai/sdk — TypeScript SDK for proof generation (ethers v6)
@zkproofport-ai/mcp — Local MCP server for AI agents (stdio transport)ローカルのAIエージェントで使用するためにMCPサーバーをインストールします:
npm install @zkproofport-ai/mcp
npx zkproofport-mcp # Starts stdio MCP serverガイドシステム
GET /api/v1/guide/:circuit は、クライアントAIエージェントがすべての証明入力を準備するための包括的なJSONガイドを返します。以下が含まれます:
コード例付きのステップバイステップ手順
定数 (アテスター鍵、コントラクトアドレス、EASスキーマUID)
数式 (ヌリファイア計算、信号ハッシュ、マークルツリー構築)
型と説明を含む入力スキーマ
EAS GraphQLクエリテンプレート
回路はエイリアスを使用します: coinbase_kyc → coinbase_attestation, coinbase_country → coinbase_country_attestation, oidc_domain → oidc_domain_attestation。
A2Aプロトコル
POST /a2a で利用可能なA2A v0.3 JSON-RPCエンドポイント:
メソッド | 目的 |
| 証明タスクの送信 (ブロッキング) |
| 証明タスクの送信 (SSEストリーミング) |
| タスクステータスのクエリ |
| 実行中のタスクのキャンセル |
| タスクイベントへの再サブスクライブ |
/.well-known/agent.json のエージェントカードは、ERC-8004オンチェーンアイデンティティと機能のディスカバリーを提供します。
TEE統合 (AWS Nitro Enclave)
モード | 動作 |
| 標準Linux、TEEなし、プレーンテキスト許可 |
| AWS Nitro Enclave、ハードウェア構成証明、E2E暗号化強制 |
エンクレーブは aws/enclave-server.ts (コンパイル済み dist/aws/enclave-server.js) を実行し、--oracle_hash keccak (Solidity検証器との互換性に必要) を指定して bb prove を実行します。NSM構成証明は、証明ハッシュとTEE公開鍵をエンクレーブ測定値 (PCR0/PCR1/PCR2) に紐付けます。
構成証明検証チェーン: AWS Nitro Root CA → リージョン → ゾーン → インスタンス → リーフ証明書 (COSE ES384署名で検証)。
サポートされている回路
Coinbase KYC (coinbase_attestation)
保持者がCoinbase KYC認証を通過したことを証明します。
エイリアス:
coinbase_kyc,coinbase_attestation公開入力: address, scope
ヌリファイア: あり (プライバシー、リプレイ防止)
Coinbase Country (coinbase_country_attestation)
保持者のKYC国籍が認証と一致することを証明します。
エイリアス:
coinbase_country,coinbase_country_attestation公開入力: address, country, scope
ヌリファイア: あり (プライバシー、リプレイ防止)
OIDC Domain (oidc_domain_attestation)
OIDC JWT検証を通じて、保持者が特定のドメインのメールアドレスを所有していることを証明します。
エイリアス:
oidc_domain,oidc_domain_attestation入力タイプ: OIDC JWT (Google等からの
id_token)公開入力: domain hash, scope
ヌリファイア: あり (プライバシー、リプレイ防止)
コントラクトアドレス
Base Sepolia (テストネット)
コントラクト | アドレス |
KYC Verifier |
|
Country Verifier |
|
ERC-8004 Identity |
|
ERC-8004 Reputation |
|
Base Mainnet (本番環境)
コントラクト | アドレス |
ERC-8004 Identity |
|
ERC-8004 Reputation |
|
ERC-8004エージェントアイデンティティ
エージェントは起動時にERC-8004 Identityコントラクトを介してオンチェーンで自動登録されます。評判スコアは、証明生成が成功するたびに増加します。
環境変数
必須
変数 | 説明 |
| Redis接続文字列 |
| BaseチェーンRPCエンドポイント |
| 証明検証用RPC |
| 認証クエリ用EAS GraphQLエンドポイント |
| エージェントウォレット秘密鍵 (64桁の16進数、0xなし) |
|
|
| 公開サービスURL (エージェントカード用) |
オプション
変数 | デフォルト | 説明 |
|
| Expressサーバーポート |
|
| ノード環境 |
|
| Barretenberg CLIパス |
|
| Nargo CLIパス |
|
| 回路アーティファクトディレクトリ |
| (GitHub raw URL) | 回路アーティファクトダウンロードURL |
|
|
|
| — | Nitro Enclave CID ( |
|
| Nitro Enclaveポート |
|
| 構成証明検証の有効化 |
| — | オペレーターウォレット (決済有効時に必須) |
|
| 証明あたりの価格 (USD) |
| — | ERC-8004 Identityコントラクト |
| — | ERC-8004 Reputationコントラクト |
| — | チャット用Gemini APIキー |
| — | チャット用OpenAI APIキー |
| — | トレース用Phoenix OTLPエンドポイント |
|
| エージェントバージョン文字列 |
デプロイ (AWS Nitro Enclave)
proofport-aiは、Nitro EnclaveをサポートするAWS EC2にデプロイされます。デプロイには、ダウンタイムゼロを実現するブルーグリーン・スロット切り替えを使用します。
ブルーグリーン・デプロイ
aws/deploy-blue-green.sh2つのスロット: ブルー (ポート 4002/3200) とグリーン (ポート 4003/3201)
アクティブなスロットは
/opt/proofport-ai/active-slotで追跡Caddyのリロード (再起動ではない) でトラフィックを切り替え
切り替え前にインフライトリクエストをドレイン (証明生成用に最大660秒)
新しいコンテナのヘルスチェックが失敗した場合は自動ロールバック
インフラストラクチャ
Caddy — HTTPS対応リバースプロキシ (Cloudflare Full SSL)
systemd — サービス:
proofport-ai,proofport-ai-redis,proofport-ai-enclave,vsock-bridgeCloudWatch — ログドライバー
awslogs、30日間の保持期間GitHub Actions —
deploy-ai-aws.ymlワークフロー (GCP用のdeploy.ymlではない)
起動 / 停止
aws/boot-active-slot.sh # Start active slot containers
aws/stop-active-slot.sh # Stop active slot containersテスト
npm test # Unit tests
npm run test:e2e # E2E against Docker stack
npm run test:watch # Watch modeA2Aテスト (a2a-ui + Phoenix)
docker compose -f docker-compose.yml -f docker-compose.test.yml up --build -dサービス | URL | 目的 |
proofport-ai |
| エージェントサーバー |
a2a-ui |
| A2AウェブテストUI |
Phoenix |
| トレース可視化 |
バージョンロック
ツール | バージョン |
bb (Barretenberg) |
|
nargo |
|
ethers |
|
@modelcontextprotocol/sdk |
|
Node.js | 20 LTS |
ライセンス
Apache 2.0
Available Tools
7 toolsgenerate_proofA
All-in-one ZK proof generation. Handles: prepare inputs, request challenge, and submit proof in a single call. Use this when you want the simplest path to a proof. For fine-grained control over each step, use prepare_inputs, request_challenge, and submit_proof individually.
CIRCUITS:
"coinbase_kyc": Proves the user passed Coinbase KYC verification, optionally binding the wallet's signature to ONE EIP-712 action (as giwa_attestation). Without action it signs the request signal hash.
"coinbase_country": Proves the user's country of residence is (or is not) in a given list, optionally binding the wallet's signature to ONE EIP-712 action (as coinbase_kyc). Requires country_list and is_included.
"oidc_domain": Proves the user authenticated via OIDC and their email belongs to a specific domain. Requires jwt and scope.
"human_passport": Proves the wallet holds an unexpired Human Passport score at or above min_score, without revealing the wallet or the exact score; optionally binds ONE EIP-712 action (as coinbase_kyc). Requires min_score and chain (the chain id the person recorded the score on).
"giwa_attestation": GIWA attestation, optionally binding the wallet's signature to ONE EIP-712 action. Without action it signs the request signal hash. With one, the proof carries that action's hash, so a contract can check WHICH instruction was authorised -- not merely that somebody eligible signed something. Uses a GIWA-attested wallet; verified on GIWA Sepolia (chain 91342).
WITH ACTION: Returns awaiting_approval with an approval URL for the HUMAN to review and sign in their wallet. Keep the request parameters unchanged, query get_action_approval, then repeat with approval_id when approved. ATTESTATION_KEY cannot authorize an action on the human's behalf. Ordinary proofs without action retain automatic signing.
SIGNAL HASH: without an action the wallet signs signal_hash = keccak256(scope ++ circuitId ++ request_id). It contains no wallet address. Pass request_id when the verifier issued one; otherwise a fresh one is minted and returned as requestId.
NULLIFIER: wallet circuits require oprf_domain (the service the proof is for). The nullifier is one per wallet per (oprf_domain, scope), computed with the OPRF network before the wallet signs; a service whose environment has no OPRF network refuses before anything is signed or paid.
RETURNS: awaiting_approval or the full ProofResult with proof bytes, public inputs, timing information, and the requestId, scope and oprfDomain the proof answers. Use verify_proof separately to verify on-chain.
Inputs: scope (required), circuit (required), jwt, chain, +12 more.
get_action_approvalA
Read the status of a human wallet approval created by this MCP client. This operation never starts a proof or payment.
Inputs: approval_id (required).
get_supported_circuitsA
List all ZK circuits supported by ZKProofport, including verifier addresses and authorized signers. No parameters required. Call this first to discover available circuits before starting proof generation.
Inputs: no named parameters.
prepare_inputsA
Step 1 of the step-by-step flow. WITH ACTION: human wallet approval is required; returns awaiting_approval until resumed with approval_id. Approved action witnesses stay in private local storage; pass the returned prepared_inputs_id to submit_proof. The action hash is public: an action whose proof is shown off-chain should not contain the wallet's address. WITHOUT ACTION: the credential key signs signal_hash = keccak256(scope ++ circuitId ++ request_id), no wallet address; the first result block is the inputs for submit_proof, the second names request_id and scope for the verifier. Handle private witness inputs only in trusted local code, never expose them to the dApp, model or logs. Call this BEFORE request_challenge. For oidc_domain provide jwt and scope.
Inputs: scope (required), circuit (required), jwt, chain, +8 more.
request_challengeA
Step 2 of the step-by-step flow: Request a challenge from the server. Pass inputs: {} to discover the live payment offers, nonce and optional TEE key without transmitting private witness inputs. You MUST pass the returned "nonce" to submit_proof — without it the server just issues another challenge. MCP submit_proof does not sign payments or encrypt inputs; use generate_proof or the SDK for paid/encrypted orchestration.
Inputs: inputs (required), circuit (required).
submit_proofA
Step 3 of the step-by-step flow: Submit prepared inputs to generate the ZK proof. The TEE server runs the Noir circuit and returns the UltraHonk proof. This step may take 30-90 seconds. The TEE server builds Prover.toml from these inputs.
You MUST pass the nonce returned by request_challenge. POST /api/v1/prove answers every request that arrives without that nonce with a fresh 402 challenge, so a submission that omits it can never produce a proof.
Inputs: nonce (required), circuit (required), inputs, prepared_inputs_id.
verify_proofA
Step 4 (optional): Verify a ZK proof on-chain against ZKProofport's own pinned verifier contract for the circuit and chain. Pass the full generate_proof result object directly. The result's verifierAddress is only compared with the pinned one: a different address is refused, never called. Issuer anchors are checked too (OIDC provider key against Google/Microsoft's published keys; Coinbase/GIWA signer-list root). Returns { valid: true } if the proof is valid, otherwise { valid: false, error }.
Inputs: result (required), min_score.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
generate_proof deliberately overlaps with the prepare_inputs → request_challenge → submit_proof trio, but the description explicitly frames it as the convenience path versus fine-grained control, and each step tool has a distinct stated role and ordering. get_action_approval, verify_proof, and get_supported_circuits are clearly separate concerns, leaving only the intentional all-in-one/stepwise duality as potential confusion.
All seven tools follow a clean snake_case verb_noun pattern: generate_proof, prepare_inputs, request_challenge, submit_proof, verify_proof, get_action_approval, get_supported_circuits. Verbs (generate/prepare/request/submit/verify/get) match the actual operations with no mixed conventions.
Seven tools is well-scoped for a ZK proof server: discovery, an all-in-one path, a three-step manual flow, verification, and approval polling. Each tool maps to a real, non-redundant operation within that workflow.
The surface covers the full proof lifecycle from circuit discovery through generation and on-chain verification, including human-in-the-loop approval status. Minor gaps: no way to cancel or revoke a pending approval, no proof/status listing, and payment/encryption orchestration is explicitly deferred to the SDK, leaving MCP users unable to complete paid flows unaided.
Maintenance
Related MCP Connectors
A paid remote MCP for ZeroID, built to return verdicts, receipts, usage logs, and audit-ready JSON.
MCP server for the Z1N Protocol - on-chain identity for AI agents on Polygon
MCP server for verifying EUDI/Talao wallet data via OIDC4VP (pull) for AI agents.
Remote MCP server exposing 330 production AI-agent services for web/data processing, validation, AI utilities, blockchain/crypto utilities, and x402 pay-per-use access.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for wallet auth: read wallet state on-chain, evaluate against conditions, return an ECDSA-signed boolean with a post-quantum companion signature. Condition-based access across 37 chains (EVM, Solana, XRPL, Bitcoin, Tron, Stellar, Sui). No balances, no identity, no shared secrets; verifiable offline via JWKS. 27 tools: wallet attestation, trust profiles, payment verification.27552 npm2MIT
- AlicenseAqualityDmaintenanceTrust intelligence MCP server for AI agents. 19 tools for identity stamps, reputation scoring (0-100), agent registry, forensic audit trails, ERC-8004 bridge, and A2A passports via x402 USDC micropayments.192Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP Server for AI agent identity and authorization. Create, verify, and manage agent identities with trust scores and scoped authorization tokens.25 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for agentic commerce, enabling AI agents to discover services, make x402 payments with USDC across multiple chains, and manage crypto wallets and token swaps.598 npm1MIT