Rohan Shield
OfficialMCP server exposing five tools for confidential zero-knowledge commitments, ledger inspection, and audit verification on Midnight.
Execute confidential handshakes: Submit a confidential state transition with a required public
actionSummary, optionalagentId, counterparty, and confidential payload canonicalized and hashed locally.Read ledger state: Inspect the anchored contract state root, block height, and last mined transaction hash.
List transaction history: Retrieve recent settlement transactions and receipts, with an optional limit.
Verify commitments/audit bundles offline: Check plaintext payloads against expected SHA-256 digests or validate portable
RohanAuditBundlesignatures, intent binding, and payload digests.Check agent status: Report local DID identity, signing mode, configured network, and relayer reachability/block height without exposing private keys.
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 | β | Submits a confidential state transition. The legacy |
| Inspection / Read | Read-only | β | Reads the contract state root, block height, and last transaction hash. |
| Inspection / Read | Read-only | β | Lists recent settlement transactions and receipts. |
| Audit / Verify | Local verification | β | Checks plaintext against the inner payload digest via RFC 8785 JCS + SHA-256, or verifies a |
| Identity / Status | Read-only | β | Reports the configured identity and relayer reachability. |
π¦ Monorepo Packages
@rohan-protocol/sdk: Enterprise Node.js SDK (Node 22 CI-tested) with cryptographic zeroization, RFC 8785 canonicalization, and state inspection. Browser support is not included; isomorphic support is separate R&D for RFC-006 / Midnight Grants Milestone 1.@rohan-protocol/mcp: Official Model Context Protocol (MCP) server for Claude Desktop, Cursor, Cline, and Gemini, with local Ed25519 agent identity and optionalagentIdinference from its signer.@rohan-protocol/webmcp: Browser-native WebMCP shield with zero-width character sanitization (V-07).
Local commitments and remote transports
With the Local Stdio MCP or SDK, the client computes payloadDigest = SHA-256(UTF-8(JCS(confidentialPayload))) locally, where JCS is RFC 8785 canonical JSON. The sealed action summary contains this inner digest. The outer intentHash is locally computed as SHA-256 over the UTF-8 commitment witness agentId:sealedActionSummary:{}:timestamp; it is not the payload digest. The plaintext confidential payload is not sent to the relayer. dryRun: true previews the signed commitment locally without submitting or producing a txHash.
The separate Remote HTTP MCP at https://api.rohanprotocol.network/mcp runs in a hosted sandbox; do not treat it as equivalent to local processing. Use Local Stdio when the local RAM boundary is required.
The local MCP accepts ROHAN_RELAYER_URL (self-hosted relayer URL), ROHAN_NETWORK (preprod, testnet, or mainnet), ROHAN_CONTRACT_ADDRESS, ROHAN_AGENT_PRIVATE_KEY (64 hex-character seed; use a secret store), and ROHAN_API_KEY. Defaults are supplied for the relayer, network, and contract; an auto-provisioned local identity is used unless the private-key variable is set.
To independently check a returned txHash, query the Midnight Preprod Indexer v4 GraphQL endpoint directly (remove a leading 0x from the hash); this does not rely on Rohan's relayer:
curl -sS -X POST 'https://midnight-preprod.blockfrost.io/api/v0?project_id=<YOUR_BLOCKFROST_TOKEN>' \
-H 'content-type: application/json' \
--data '{"query":"{ transactions(offset: { hash: \"<TX_HASH_WITHOUT_0x>\" }) { hash protocolVersion block { height hash } } }"}'π Quickstart
1. Install SDK
npm install @rohan-protocol/sdk2. Basic SDK Usage
import { RohanClient, canonicalizeJson } from '@rohan-protocol/sdk';
const client = new RohanClient({
contractAddress: '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e',
});
// 1. Inspect on-chain state (Read)
const state = await client.getLedgerState();
console.log('Current Root:', state.currentStateRoot, 'Block:', state.blockHeight);
// 2. Submit a confidential handshake (Write)
const receipt = await client.submitHandshake({
agentId: 'did:midnight:agent-alpha',
intent: 'Vendor Purchase Order #1042',
privateData: { budgetUsd: 75000, approvalCode: 'AUTH-99' },
});
console.log('Confirmed TxHash:', receipt.txHash);
// 3. Verify plaintext commitment locally (Verify)
const audit = await client.verifyCommitment(
{ budgetUsd: 75000, approvalCode: 'AUTH-99' },
receipt.intentHash
);
console.log('Cryptographic match?', audit.valid);π‘οΈ 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