Rohan Shield
OfficialRohan Shield is an MCP server for confidential AI-agent settlement on Midnight: it submits/previews handshakes, reads ledger/history, verifies commitments offline, and reports agent identity/status.
Submit or preview a confidential handshake/settlement commitment with
rohan_execute_handshake(dryRun: truefor preview; legacyrohan_zk_handshakealias accepted).Read the latest anchored ledger state, block height, and last transaction hash with
rohan_get_ledger_state.List recent settlement transactions and receipts with
rohan_get_transaction_history.Cryptographically verify plaintext payloads, expected digests, or portable audit bundles offline with
rohan_verify_commitment.Inspect the local sovereign agent DID, signing mode, network, and relayer reachability with
rohan_get_agent_status.
Rohan Protocol (v0.8.3)
The Sovereign Privacy & Settlement Layer for Autonomous AI Agents on the Midnight Blockchain.
Rohan Protocol equips autonomous AI agents with zero-knowledge intent commitments, confidential state transitions, and a complete, verifiable audit lifecycle. Sensitive parameters (budgets, vendor contracts, PII) are strictly canonicalized (RFC 8785) and hashed in client RAMβnever exposed on-chain or leaked in LLM context windows.
π The Closed-Loop Multi-Agent Architecture
Rohan Protocol eliminates the classic "dead-end" MCP agent problem by establishing a complete, multi-turn lifecycle between coordinating agents:
βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ
β Agent Alpha β β Agent Beta β β Agent Beta β β Agent Beta β
β (State Mutation) β β (State Inspection)β β (History Review) β β (Agreement Audit) β
βββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββ
β β β β
β 1. rohan_execute_handshakeβ 2. rohan_get_ledger_stateβ 3. rohan_get_transaction_historyβ 4. rohan_verify_commitment
β (Confidential Payload)β (Read Anchored Root) β (Settlement Receipts) β (RFC 8785 In-Memory JCS)
βΌ βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Rohan Protocol Relayer β
β Midnight Preprod L1 Settlement & Paymaster β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββStep 1 β Write (
rohan_execute_handshake): Agent Alpha commits an intent. The Relayer verifies proof commitments and anchors the state root on Midnight Preprod L1. The legacyrohan_zk_handshakename remains accepted.Step 2 β Read (
rohan_get_ledger_state): Agent Beta inspects the contract's anchored state root, block height, and transaction receipt from cache (0 Gas, <1 ms).Step 3 β History (
rohan_get_transaction_history): Agent Beta lists recorded settlement transactions and receipts (0 Gas).Step 4 β Verify (
rohan_verify_commitment): Agent Beta checks plaintext against its canonical SHA-256 payload digest in local RAM (0 Gas). This is the inner payload digest, not the outer on-chainintentHash.
Related MCP server: mem9-guard-mcp
π οΈ The 5 MCP Tools
Tool | Category | Gas Cost | Latency | Description |
| Mutation / Write | Relayer-submitted | ~25s L1 (or <1ms | Submits a confidential state transition (supports |
| Inspection / Read | Read-only (0 Gas) | <5 ms (15s Cache) | Reads the contract state root, block height, and last transaction hash. |
| Inspection / Read | Read-only (0 Gas) | <5 ms | Lists recent settlement transactions and receipts. |
| Audit / Verify | Local RAM (0 Gas) | <1 ms | Checks plaintext against the inner |
| Identity / Status | Read-only (0 Gas) | Local / Relayer ping | Reports the configured |
π¦ Monorepo Packages
@rohan-protocol/sdk: Zero-dependency Node.js SDK (>=20.0.0) with cryptographic zeroization, Ed25519did:keysigning, andRohanAuditBundleverification. Browser-safe offline verification primitives are exported via@rohan-protocol/sdk/identity. (Client-side Compact ZK-SNARK proving in WASI Preview 2 is active R&D under RFC-006 / Midnight Grants Milestone 1.)@rohan-protocol/mcp: Official Model Context Protocol (MCP) server & CLI (init,status,verify) for Claude Desktop, Cursor, Cline, and Gemini, with local Ed25519 agent identity (rohan-shield).@rohan-protocol/webmcp: Browser-native WebMCP shield with zero-width character sanitization (V-07).
π Documentation
π Quickstart
1. Install SDK
npm install @rohan-protocol/sdk2. Basic SDK Usage (Signed V-08 Handshake & Offline Audit)
import {
RohanClient,
InMemoryEd25519Signer,
verifyAuditBundle,
} from '@rohan-protocol/sdk';
// 1. Create a Sovereign Agent Identity (Ed25519 W3C did:key)
const signer = await InMemoryEd25519Signer.generate();
const client = new RohanClient({
network: 'preprod',
signer,
});
// 2. Inspect on-chain state (Read)
const state = await client.getLedgerState();
console.log('Current Root:', state.currentStateRoot, 'Block:', state.blockHeight);
// 3. Submit a signed confidential handshake (Write β agentId defaults to signer.did)
const deal = { budgetUsd: 75000, approvalCode: 'AUTH-99' };
const receipt = await client.submitHandshake({
intent: 'Vendor Purchase Order #1042',
confidentialPayload: deal,
});
console.log('Confirmed TxHash:', receipt.txHash);
console.log('Inner PayloadDigest:', receipt.payloadDigest);
// 4. Verify AuditBundle & plaintext commitment offline (0 Gas, 0 Network)
const audit = await verifyAuditBundle(receipt.auditBundle!, deal);
console.log('Cryptographic match?', audit.valid); // true (payloadMatch, intentBindingValid, signatureValid)
signer.destroy();π‘οΈ Security & Zero-Trust Principles
RFC 8785 JSON Canonicalization Scheme (JCS): Deterministic, cross-platform key sorting and whitespace elimination.
DoS & ReDoS Guarding: Recursive depth ceiling (max. 32 levels) and RAM payload bounds (max. 256 KB).
Zeroize RAM Sanitation: Sensitive witnesses and private keys are scrubbed from RAM immediately after commitment derivation.
Optimistic Credit Escrow: Atomic balance reservations prevent concurrent quota-drain exploits.
π License
Apache-2.0. Copyright (c) 2026 Rohan Protocol Authors.
Available Tools
5 toolsrohan_execute_handshakeA
Executes or locally previews a confidential handshake commitment on Midnight. Usage guidelines:
Use for a user-authorized settlement; set dryRun: true only when the user asks to preview, test, or inspect a commitment without on-chain settlement (default false).
Do not use for reads, history, status, or audit; use rohan_get_ledger_state, rohan_get_transaction_history, rohan_get_agent_status, or rohan_verify_commitment instead.
Keep sensitive values in confidentialPayload, actionSummary generic, and private keys out of tool arguments. Follow recoveryAction on errors; after replay check transaction history, and after signature errors check agent status. Payloads are canonicalized and hashed locally.
Inputs: actionSummary (required), dryRun, intent, agentId, +2 more.
rohan_get_agent_statusARead-onlyIdempotent
Returns the active Sovereign Agent identity (W3C did:key), signing mode, configured network, and relayer reachability (gracefully degrades if offline). Usage guidelines:
Use to inspect local identity or diagnose connectivity and signature errors; do not use for transaction details (use rohan_get_transaction_history) or full ledger state (use rohan_get_ledger_state).
Never exposes private keys. Do not send secrets as arguments; if offline, inspect configuration and retry only after recovery.
Inputs: no named parameters.
rohan_get_ledger_stateARead-onlyIdempotent
Reads the current anchored Rohan Protocol contract state on Midnight. Usage guidelines:
Use for the latest state root, block height, or last transaction hash; do not use for transaction lists (use rohan_get_transaction_history) or identity/relayer health (use rohan_get_agent_status).
This is a read-only network lookup; do not include confidential payloads. If unavailable, check rohan_get_agent_status before retrying.
Inputs: no named parameters.
rohan_get_transaction_historyARead-onlyIdempotent
Lists historical Rohan Protocol settlement transactions and receipts on Midnight. Usage guidelines:
Use to find or inspect prior settlements, especially after REPLAY_DETECTED; do not use for the latest state root (use rohan_get_ledger_state) or identity/health (use rohan_get_agent_status).
This read-only lookup accepts no confidential payload. If it fails, check rohan_get_agent_status and follow the returned error guidance.
Inputs: limit.
rohan_verify_commitmentARead-onlyIdempotent
Cryptographically audits a plaintext payload and/or a portable RohanAuditBundle offline in local memory (0 gas). Usage guidelines:
Use to verify a payload digest or audit bundle; do not use to submit a handshake (use rohan_execute_handshake).
For expectedDigest mode provide the exact original JSON payload and the inner payloadDigest; never pass the outer timestamp-salted intentHash. For auditBundle mode, provide the complete bundle and optionally the original payload.
Verification is local and does not send plaintext to the relayer. Treat valid: false as a cryptographic mismatch, not a tool execution error; use recoveryAction to correct inputs.
Inputs: payload, auditBundle, expectedDigest.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: execute settlement, read ledger state, list transaction history, inspect agent identity/health, and verify commitments offline. The descriptions explicitly cross-reference the other tools to redirect common misuses, leaving little overlap.
All tools use a consistent rohan_ prefix followed by a snake_case verb_noun pattern (execute_handshake, get_ledger_state, get_transaction_history, get_agent_status, verify_commitment). The convention is predictable throughout.
Five tools is well-scoped for this domain: one write operation, three reads/diagnostics, and one offline verification tool. Each tool earns its place without obvious redundancy.
The surface covers the core settlement lifecycle: execution, state read, history, identity/health, and cryptographic verification. Minor gaps exist, such as querying a specific commitment by ID or cancelling a pending settlement, but agents can work around them via history and state reads.
Maintenance
Related MCP Connectors
Real-time MCP & A2A prompt-injection, jailbreak, and tool-schema poisoning firewall for AI agents.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Zero-LLM guardrail MCP to detect prompt injections, redact/HMAC PII, and validate tool args.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that lets AI agents call APIs without ever seeing the credentials, using a local encrypted vault and per-secret allowlist policies for HTTP requests and subprocess environment variables.1AGPL 3.0
- AlicenseAqualityDmaintenanceAn MCP server that provides a guarded interface to the mem9 persistent memory backend, protecting AI agents against prompt injection, secret leakage, and memory poisoning.6MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for end-to-end encrypted secret storage and retrieval, enabling LLM agents to fetch secrets by name via one-time URLs while keeping plaintext out of model context and logs.1-
- AlicenseNot gradedqualityBmaintenanceA local-first MCP server that lets AI agents use gated APIs without holding keys, enforcing declarative policies, injecting secrets server-side, and auditing access without content.85 npm3Apache 2.0