The Trust Layer for
AI Agents

Secure your autonomous workflows with zero-knowledge proofs. Rohan Protocol delivers cryptographic certainty for high-throughput AI operations on the Midnight Blockchain.

npm i @rohan-protocol/sdk
bash - zkp_node

Universal Integration

Deploy verifiable agents in your preferred environment.

import { RohanNode } from '@rohan-protocol/sdk';

// 1. Initialize the Gasless Node
const agent = new RohanNode({ 
  apiKey: process.env.ROHAN_API_KEY,
  relayerUrl: "https://api.rohanprotocol.network" 
});

// 2. Secure your M2M deal via ZK-Proof
const proof = await agent.handshake("did:rohan:partner", { 
  budget: 5000, 
  secret: "Top Secret Strategy" 
});

console.log("Deal secured! TxID:", proof.txId);

Absolute Privacy

Compute sensitive data off-chain while proving execution integrity. Never leak proprietary agent prompts.

Gasless Relays

Built-in paymasters handle all on-chain settlement. Your agents execute seamlessly without holding native tokens.

Midnight Native

Optimized for Midnight's data-protection blockchain, leveraging native shielded state for enterprise compliance.

Documentation

Everything you need to integrate the Rohan Protocol into your AI agent stack.

Quick Start

STEP 1

Install the SDK

npm i @rohan-protocol/sdk
STEP 2

Initialize Your Agent

const agent = new RohanNode({
  apiKey, relayerUrl
});
STEP 3

Execute ZK-Handshakes

await agent.handshake(
  targetDID, secretData
);

API Reference

new RohanNode(config)

Creates a new agent node connected to the Rohan Gas Station Relayer.

Parameter Type Required Description
apiKey string API key for the Gas Station Relayer
relayerUrl string URL of the Rohan Gas Station
did string Auto-generated Decentralized Identifier
agent.handshake(target, data, fee)

Generates a ZK-Proof locally and relays it via the Gas Station API.

target— DID or Contract Address
data— string | object (auto-stringified)
fee— Toll in DUST (default: 150)
Returns: Promise<HandshakeResult>
agent.onHandshake(callback)

Fires when a ZK-Proof addressed to this agent is verified on the Midnight Ledger.

callback— (deal) => void
agent.onHandshake((deal) => {
  console.log(deal.commitment);
  console.log(deal.txId);
});

Architecture

┌──────────────────────────────────────────────────────┐
│                    Your AI Agent                      │
│                                                      │
│   const agent = new RohanNode({ apiKey, relayerUrl })│
│   agent.handshake("did:rohan:partner", { secret })   │
└──────────────────┬───────────────────────────────────┘
                   │
        ┌──────────▼──────────┐
        │  @rohan-protocol/sdk │
        │  (Prover Module)    │ ← Generates ZK-Proof locally
        └──────────┬──────────┘
                   │ HTTP POST (Proof Blob + API Key)
        ┌──────────▼──────────┐
        │  Rohan Relayer Node  │ ← Verifies API Key & Pays DUST Fee
        └──────────┬──────────┘
                   │ Submit transaction to Midnight
        ┌──────────▼──────────┐
        │  Midnight Network   │ ← The ZK-Settlement Layer
        └─────────────────────┘