Skip to main content
Glama
Rohan Shield

Rohan Shield

Official

Rohan Protocol (v0.8.3)

NPM Version License: Apache 2.0 Midnight Network Rohan Shield MCP server – quality and maintenance score on Glama Rohan Protocol MCP on mcprush

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 legacy rohan_zk_handshake name 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-chain intentHash.


Related MCP server: mem9-guard-mcp

πŸ› οΈ The 5 MCP Tools

Tool

Category

Gas Cost

Latency

Description

rohan_execute_handshake

Mutation / Write

Relayer-submitted

β€”

Submits a confidential state transition. The legacy rohan_zk_handshake alias is accepted.

rohan_get_ledger_state

Inspection / Read

Read-only

β€”

Reads the contract state root, block height, and last transaction hash.

rohan_get_transaction_history

Inspection / Read

Read-only

β€”

Lists recent settlement transactions and receipts.

rohan_verify_commitment

Audit / Verify

Local verification

β€”

Checks plaintext against the inner payload digest via RFC 8785 JCS + SHA-256, or verifies a RohanAuditBundle.

rohan_get_agent_status

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 optional agentId inference 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/sdk

2. 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 tools
rohan_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_statusA
Read-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_stateA
Read-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_historyA
Read-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_commitmentA
Read-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

    A4.6/5.0

    Scored across 5 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP 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.
      1
      AGPL 3.0
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides a guarded interface to the mem9 persistent memory backend, protecting AI agents against prompt injection, secret leakage, and memory poisoning.
      6
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      MCP 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
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      A 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 npm
      3
      Apache 2.0