API & RPC Documentation

Everything you need to integrate Sahyadri CSM into your wallet, exchange, explorer, or application. Real-time blockchain data via JSON-RPC, gRPC, and WebSocket subscriptions.

Network Online JSON-RPC + gRPC + WebSocket 45+ RPC Methods DID + Accounts

Coin Parameters

Essential constants for integrating Sahyadri CSM into exchanges, wallets, and indexers.

ParameterValueDescription
Network NameSahyadri MainnetProduction network
Coin TickerCSMCryptographic Sovereign Money
Address Prefixcsm1s...All addresses start with csm1s
Max Supply21,000,000 CSMHard-capped, no inflation
Decimals81 CSM = 100,000,000 Kana
Block Time~1 secondTarget block interval via DAA
ConsensusProof of Work (DAG)DAG (Directed Acylic Graph)
Mining AlgorithmSahyadriXCustom PoW algorithm
Post-Quantum SecurityDilithium (CRYSTALS-Dilithium)NIST PQC standard for transaction signatures
Treasury SystemOn-chain TreasuryAutomated dev/community funding
JSON-RPC HTTP:27112Primary RPC via HTTP POST
WebSocket:27110Real-time subscriptions over WS
gRPC:27113High-performance RPC calls
P2P Port:26111Peer-to-peer network
RPC ProtocolJSON-RPC 2.0HTTP POST + WebSocket (P2P)

Dilithium Post-Quantum Cryptography

Sahyadri uses CRYSTALS-Dilithium for all transaction signatures, making it the first DAG-based blockchain with native post-quantum protection.

Dilithium is a NIST-standardized lattice-based digital signature scheme selected in 2022 as the primary post-quantum signature algorithm. Unlike RSA and ECDSA, Dilithium resists attacks from both classical and quantum computers, ensuring long-term cryptographic security for all on-chain transactions.

ParameterValueDescription
AlgorithmCRYSTALS-DilithiumNIST PQC Standard (FIPS 204)
ModeDilithium-3NIST Level 3 — balanced security & performance
Public Key Size~1,952 bytesLattice-based public key
Signature Size~3,293 bytesCompact for PQC standards
Secret Key Size~4,000 bytesLattice-based secret key
Security LevelNIST Level 3128-bit quantum security
Lattice Dimensionn = 1024Module rank k = 8
Signing Speed~7 ms (Rust/wasm)Optimized via dilithium-rs crate
Verification Speed~2 ms (Rust/wasm)Fast verification for block validation
Implementationdilithium-rs + WASMRust crate compiled to WebAssembly for wallet signing

Plonky3 Zero-Knowledge Proofs

Recursive ZK proof system for verifiable state transitions and trustless cross-chain bridges.

Plonky3 is a state-of-the-art recursive proof system built on Plonkish arithmetization. Sahyadri integrates Plonky3 for generating compact zero-knowledge proofs of block validity, enabling light clients and trustless bridge verification without downloading full block data.

ParameterValueDescription
Proof SystemPlonky3Recursive SNARK based on Plonkish arithmetization
FieldGoldilocks (64-bit)Optimal for 64-bit architectures
Proof Size~50-200 KBCompact proofs for efficient on-chain verification
Proving Time~2-10 secondsPer block proof generation
Verification Time< 100 msConstant-time verification regardless of proof complexity
RecursionSupportedProofs can verify other proofs (recursive composition)
Use CasesBridge proofs, light clients, state verificationEnables trustless cross-chain and SPV verification
Implementationsahyadri-plonky3 (Rust)Custom Plonky3 fork with Sahyadri-specific circuits

Available RPC Methods (31 total)

RPC Endpoints

For exchanges, wallets, and direct node communication. Use these for deposit/withdrawal integration.

Decentralized P2P Architecture — No Central Server! Connect directly to any Sahyadri Node. For development use localhost:27112. For production use node.sahyadri.io or any community node. All data comes from the blockchain network.

Direct Node RPC Access (Decentralized P2P)

JSON-RPC HTTP (Primary)
http://127.0.0.1:27112
WebSocket (Real-time)
ws://127.0.0.1:27110
gRPC (High Performance)
127.0.0.1:27113
P2P Network
127.0.0.1:26111
Production (When Mainnet Live)
https://node.sahyadri.io:27112 (or any community node)

Available RPC Methods (31 total)

MethodDescriptionUsed By
submitTransactionBroadcast a signed transactionExchanges, Wallets
submitTransactionReplacementReplace a pending transaction (RBF)Exchanges
submitBlockSubmit a mined block to the DAGMiners, Pools
getBlockGet block by hash or blue scoreExplorers, Indexers
getBlocksGet range of blocksExplorers
getBlockCountGet current block count (blue score)All
getBlockTemplateGet mining block templateMiners, Pools
getHeadersGet block headersIndexers, SPV
getInfoNode info: server version, sync status, UTXO indexAll
getSahyadriDagInfoDAG info: block rate, DAA score, difficulty, supplyExplorers, CoinGecko
getCurrentNetworkCurrent network name (mainnet/testnet)All
getCoinSupplyCirculating supply, total supplyCoinGecko, CMC
getSinkCurrent sink blockConsensus
getSinkBlueScoreCurrent sink blue scoreConsensus
getVirtualChainFromBlockGet virtual chain from a blockExplorers
getSubnetworkGet subnetwork infoAll
getBalanceByAddressGet balance for a single addressWallets, Exchanges
getBalancesByAddressesGet balances for multiple addressesExchanges
getUtxosByAddressesGet UTXOs for given addressesWallets, Exchanges
getMempoolEntryGet specific mempool transactionExplorers
getMempoolEntriesGet all current mempool transactionsExplorers
getMempoolEntriesByAddressesGet mempool txs for specific addressesWallets
getPeerAddressesGet all known peer addressesNetwork Monitors
getConnectedPeerInfoGet connected peer detailsNetwork Monitors
addPeerManually add a peerNode Operators
banBan a peer by addressNode Operators
unbanUnban a peer by addressNode Operators
estimateNetworkHashesPerSecondEstimate network hashrateMiners, Explorers
resolveFinalityConflictManually resolve a finality conflictNode Operators
shutdownGracefully shutdown the nodeNode Operators
pingHealth check / connection testAll
JavaScript (WS)
Python (gRPC)
cURL
// Connect to Sahyadri node via WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

ws.onopen = () => {
  // Call any RPC method
  ws.send(JSON.stringify({
    "id": 1,
    "method": "submitTransaction",
    "params": ["signed_tx_hex_string..."]
  }));
};

ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
  console.log(response);
};

Blocks

Query blocks by hash, blue score, or get block templates for mining.

RPC getBlock

Get a single block by its hash or blue score. Returns full block data including transaction IDs, parent block hashes, and miner reward.

ParameterTypeRequiredDescription
hashstringOptionalBlock hash (hex)
blueScoreintegerOptionalBlock blue score (height)
includeTransactionsbooleanOptionalInclude full transaction data
// Request via JSON-RPC over WebSocket
{
  "id": 1,
  "method": "getBlock",
  "params": [{ "blueScore": 6602, "includeTransactions": true }]
}

// Response
{
  "block": {
    "header": {
      "version": 1,
      "hash": "0bea8500abc...",
      "blueScore": 6602,
      "daaScore": 6598,
      "timestamp": 1710255328,
      "bits": 2072554627,
      "nonce": 4521893761,
      "parentBlockHashes": ["7f3c1200...", "a1e93300..."]
    },
    "transactions": ["8f3a9b2...", "2c1e8d4..."],
    "verboseData": {
      "minerAddress": "csm1sp5fndd452...",
      "reward": "25.00000000"
    }
  }
}
RPC getBlocks

Get a range of blocks between two blue scores. Used by explorers for block listing pages and indexers for syncing.

{
  "id": 2,
  "method": "getBlocks",
  "params": [{
    "lowHash": "block_hash_start...",
    "includeBlocks": true,
    "includeTransactions": false
  }]
}

Transactions

Broadcast transactions and query transaction details. Used by exchanges for deposits and withdrawals.

RPC submitTransaction

Broadcast a signed transaction to the network. Used by exchanges to process withdrawals and by wallets to send funds. Returns the transaction ID on success.

// Broadcast a signed transaction
{
  "id": 1,
  "method": "submitTransaction",
  "params": ["serialized_tx_hex_string..."]
}

// Response
{
  "transactionId": "8f3a9b2c1d..."
}
RPC getMempoolEntry

Get details of a specific transaction from the mempool (pending, not yet in a block). Returns fee, mass, and calculated fee rate.

{
  "id": 3,
  "method": "getMempoolEntry",
  "params": [{ "transactionId": "a1b2c3d4...",
    "includeOrphanPool": true,
    "filterTransactionPool": true }]
}

// Response
{
  "mempoolEntry": {
    "transaction": { "transactionId": "a1b2c3d4...", ... },
    "fee": 100000,
    "isOrphan": false
  }
}

Addresses & Balances

Query UTXOs, balances, and transaction history for wallet addresses. Essential for exchange deposit monitoring.

RPC getBalanceByAddress

Get the total balance of a single Sahyadri address. Used by wallets for balance display and exchanges for deposit verification.

{
  "id": 4,
  "method": "getBalanceByAddress",
  "params": ["csm1sp5fndd452tss097m7dhcyhs5nzlwpp..."]
}

// Response
{
  "balance": "2301100000000"
}
RPC getUtxosByAddresses

Get the full UTXO set for one or more addresses. Each UTXO includes the outpoint (tx ID + index), value, and script public key. Used by exchanges and wallets for coin selection before building transactions.

ParameterTypeRequiredDescription
addressesstring[]RequiredArray of Sahyadri addresses
{
  "id": 5,
  "method": "getUtxosByAddresses",
  "params": [[
    "csm1sp5fndd452...",
    "csm1sar30mvpd..."
  ]]
}

// Response
{
  "entries": [
    {
      "address": "csm1sp5fndd452...",
      "utxoEntries": [
        {
          "outpoint": {
            "transactionId": "8f3a9b2...",
            "index": 0
          },
          "utxoEntry": {
            "amount": 20000000000,
            "scriptPublicKey": "76a914...",
            "blockDaaScore": 6590
          }
        }
      ]
    }
  ]
}

Network & Supply

Node information, network status, coin supply data, and peer management. Used by CoinGecko, CMC, and monitoring tools.

RPC getInfo

Returns comprehensive node information including server version, network ID, sync status, UTXO index availability, and whether the notify command is supported.

{
  "id": 6,
  "method": "getInfo",
  "params": [{}]
}

// Response
{
  "serverVersion": "1.1.0",
  "networkId": "sahyadri-mainnet",
  "hasUtxoIndex": true,
  "isSynced": true,
  "mempoolSize": 23,
  "p2pId": "abc123...",
  "hasNotifyCommand": true,
  "hasMessageId": true
}
RPC getCoinSupply

Returns the current circulating supply and maximum supply. This is the primary endpoint for CoinGecko and CoinMarketCap to poll live supply data for listing.

{
  "id": 7,
  "method": "getCoinSupply",
  "params": [{}]
}

// Response
{
  "circulatingkana": "29145625000000",
  "maxkana": 2100000000000000
}
RPC getSahyadriDagInfo

Returns comprehensive DAG statistics: block count, blue score, DAA score, difficulty, block rate, past median time, and parent median blue score. Used by explorers and mining dashboards.

{
  "id": 8,
  "method": "getSahyadriDagInfo",
  "params": [{}]
}

// Response
{
  "blockCount": 11636,
  "headerCount": 11636,
  "daaScore": 11100,
  "blueScore": 11110,
  "difficulty": 2586428.53,
  "virtualSelectedParentBlueScore": 11108,
  "pastMedianTime": 1710255300,
  "parentMedianBlueScore": 11100,
  "daaScore": 11100
}

Mining

Block template retrieval, block submission, and network hashrate estimation for miners and mining pools.

RPC getBlockTemplate

Get the current block template for mining. Returns the block header template with current DAA score, parent blocks, and mining reward address. Mining pools use this to distribute work to miners.

{
  "id": 9,
  "method": "getBlockTemplate",
  "params": [{
    "payAddress": "csm1sp5fndd452...",
    "extraData": ""
  }]
}

// Response
{
  "block": {
    "header": {
      "version": 1,
      "parentBlockHashes": ["7f3c1200...", "a1e93300..."],
      "hashMerkleRoot": "00000000...",
      "hash": "00000000...",
      "daaScore": 11101,
      "timestamp": 1710255320,
      "bits": 2072554627,
      "nonce": 0
    },
    "isSynced": true
  }
}
RPC estimateNetworkHashesPerSecond

Estimates the current network hashrate based on recent block timestamps and DAA difficulty adjustments. Used by mining dashboards and explorers.

{
  "id": 10,
  "method": "estimateNetworkHashesPerSecond",
  "params": [{ "windowSize": 1000, "startHash": null }]
}

// Response
{
  "networkHashesPerSecond": 12584962340
}

WebSocket Subscriptions

Real-time notifications via WebSocket. Subscribe to chain events for live data feeds in trading bots, monitors, and notification systems.

All subscriptions are over WebSocket. Connect to wss://api.sahyadri.io:27110/ws, then send subscribe/unsubscribe RPC calls. Each subscription has a matching unsubscribe method.

WS subscribeVirtualDaaScoreChanged

Receive a notification every time the virtual DAA score changes. Ideal for mining dashboards that need to track difficulty adjustments in real-time.

// Subscribe
{
  "id": 1,
  "method": "subscribeVirtualDaaScoreChanged",
  "params": [{}]
}

// Notification received
{
  "type": "VirtualDaaScoreChangedNotification",
  "virtualDaaScore": 11101
}
WS subscribeUtxosChanged

Receive notifications when UTXOs change for specified addresses. Pass an array of addresses to watch. Essential for exchange hot wallets and wallet apps to detect incoming deposits in real-time.

// Subscribe to specific addresses
{
  "id": 2,
  "method": "subscribeUtxosChanged",
  "params": [[
    "csm1sp5fndd452...",
    "csm1sar30mvpd..."
  ]]
}

// Notification received
{
  "type": "UtxosChangedNotification",
  "address": "csm1sp5fndd452...",
  "added": [{ "outpoint": {...}, "utxoEntry": {...} }],
  "removed": [{ "outpoint": {...} }]
}
WS subscribeVirtualChainChanged

Receive notifications when the virtual chain changes with new accepted blocks and their transaction IDs. Set includeAcceptedTransactionIds to true for full transaction coverage. Used by explorers and block scanners.

// Subscribe
{
  "id": 3,
  "method": "subscribeVirtualChainChanged",
  "params": [{ "includeAcceptedTransactionIds": true }]
}

// Notification received
{
  "type": "VirtualChainChangedNotification",
  "chainBlocks": [{
    "acceptingBlockHash": "0bea8500...",
    "acceptedTransactionIds": ["8f3a9b2..."]
  }]
}

How to Connect

Step-by-step connection guides for exchanges, wallets, explorers, and data aggregators.

JS JavaScript / Browser WebSocket

Connect from any browser or Node.js environment. All RPC calls go through WebSocket — Sahyadri has no REST endpoint. This is the primary way wallets, explorers, and web apps communicate with the node.

// Connect to Sahyadri RPC via WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

ws.onopen = () => {
  console.log('Connected to Sahyadri node');

  // Get node info
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    "method": "getInfo",
    "params": [{}]
  }));

  // Subscribe to new blocks in real-time
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 2,
    "method": "subscribeVirtualChainChanged",
    "params": [{ "includeAcceptedTransactionIds": true }]
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);

  // Handle subscription notifications
  if (data.type === 'VirtualChainChangedNotification') {
    console.log('New block:', data.chainBlocks);
  }
  // Handle RPC responses
  else {
    console.log('RPC Response:', data);
  }
};
PY Python / gRPC

For high-performance backend integrations, exchanges, and data pipelines. Use the gRPC proto definition from the Sahyadri repository to generate Python stubs, then connect on port 26110.

# pip install grpcio grpcio-tools
# Generate stubs: python -m grpc_tools.protoc -I proto/ proto/rpc.proto --python_out=. --grpc_python_out=.

import grpc
from rpc_pb2 import *
from rpc_pb2_grpc import RPCServiceStub

# Connect to Sahyadri gRPC endpoint
channel = grpc.insecure_channel('api.sahyadri.io:26110')
stub = RPCServiceStub(channel)

# Get node info
response = stub.GetInfo(GetInfoRequest())
print(f"Network: {response.serverVersion}")
print(f"UTXO Index: {response.hasUtxoIndex}")
print(f"Synced: {response.isSynced}")

# Get balance for an address (exchange deposit check)
balance = stub.GetBalanceByAddress(
    GetBalanceByAddressRequest(address="csm1qp5fndd452tss097m7dhcyhs5nzlwpp...")
)
print(f"Balance: {int(balance.balance) / 1e8} CSM")
SH cURL / wscat (Testing)

Quick testing from terminal. Use wscat for interactive WebSocket sessions and cURL for one-shot RPC calls via the HTTP WebSocket upgrade endpoint.

# Install wscat for interactive WebSocket testing
npm install -g wscat

# Connect to Sahyadri node
wscat -c wss://api.sahyadri.io:27110/ws

# Once connected, send RPC calls as JSON:
> {"jsonrpc":"2.0","id":1,"method":"getInfo","params":[{}]}
> {"jsonrpc":"2.0",1,"method":"getCoinSupply","params":[{}]}
> {"jsonrpc":"2.0","id":2,"method":"getBlockTemplate","params":[{"payAddress":"csm1q..."}]}

# Or test with a one-liner (websocat)
echo '{"jsonrpc":"2.0","id":1,"method":"ping"}' | websocat wss://api.sahyadri.io:27110/ws

Exchange Integration (Binance, Bybit, Coinbase, etc.)

Exchanges need: deposit detection, withdrawal broadcasting, and balance monitoring. All done via WebSocket RPC.

Step 1: Detect Deposits
Step 2: Withdraw
Step 3: Balance Check
// 1. Connect WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

// 2. Subscribe to your hot wallet addresses
ws.onopen = () => {
  ws.send(JSON.stringify({
    "id": 1,
    "method": "subscribeUtxosChanged",
    "params": [[
      "csm1syour_hot_wallet_address...",
      "csm1syour_deposit_address..."
    ]]
  }));
};

// 3. When notification arrives, a deposit was received
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  if (data.type === "UtxosChangedNotification") {
    // data.added = new UTXOs (incoming deposit)
    // data.removed = spent UTXOs
    console.log("Deposit detected!", data.added);
    // -> Credit user account in your database
    // -> Wait for confirmations (DAA score)
  }
};

Wallet Integration (Trust Wallet, Mobile, Desktop)

Wallets connect via WebSocket RPC for balance display, transaction building, and broadcast.

Get Chain Info
Get Balance
Send Transaction
// First call: get network info
ws.send(JSON.stringify({
  "id": 1,
  "method": "getInfo",
  "params": [{}]
}));
// Response gives: networkId, serverVersion, isSynced, hasUtxoIndex
// Use this to verify you're on sahyadri-mainnet

Explorer / Dashboard Integration

Explorers need block listing, block details, and real-time new block notifications.

List Blocks
Live New Blocks
Supply Data
// Get latest blocks
ws.send(JSON.stringify({
  "id": 1,
  "method": "getBlocks",
  "params": [{
    "lowHash": null,
    "includeBlocks": true,
    "includeTransactions": false
  }]
}));
// Use getBlockCount first to know the current tip

Mining Pool Integration

Get block templates for miners, submit solutions, and track network hashrate.

Get Work
Submit Block
Network Hashrate
ws.send(JSON.stringify({
  "id": 1,
  "method": "getBlockTemplate",
  "params": [{
    "payAddress": "csm1syour_miner_address...",
    "extraData": "my_pool_id"
  }]
}));
// Response: block header template with parent hashes, bits, DAA score
// Distribute to miners, they find nonce with SahyadriX hash

Testing Tools & Commands

Quick commands to test the RPC endpoint. No setup needed.

wscat (WebSocket)
grpcurl (gRPC)
Browser Console
# Install wscat
npm install -g wscat

# Connect to Sahyadri node
wscat -c "wss://api.sahyadri.io:27110/ws"

# Test: Get node info
> {"id":1,"method":"getInfo","params":[{}]}
# Response: { id:1, result:{ serverVersion:"1.1.0", networkId:"sahyadri-mainnet", ... } }

# Test: Get coin supply
> {"id":2,"method":"getCoinSupply","params":[{}]}
# Response: { id:2, result:{ circulatingkana:"...", maxkana:2100000000000000 } }

# Test: Get DAG info
> {"id":3,"method":"getSahyadriDagInfo","params":[{}]}
# Response: { id:3, result:{ blockCount:..., daaScore:..., blueScore:..., difficulty:... } }

# Test: Ping
> {"id":4,"method":"ping","params":[{}]}
# Response: { id:4, result:"pong" }

Coin Parameters (for listing forms)

ParameterValue
TickerCSM
Networksahyadri-mainnet
Address Prefixcsm1s...
Decimals8 (1 CSM = 100,000,000 kana)
Max Supply21,000,000 CSM
Block Time1 second
ConsensusSahyadri CSM (DAG)
Mining AlgoSahyadriX (Blake3 + 16MB memory)
RPC Endpointwss://api.sahyadri.io:27110/ws
gRPC Endpointapi.sahyadri.io:26110
Explorerhttps://explorer.sahyadri.io

Live API Tester

Test any RPC method directly from the browser. No tools needed.

// Select a method above and click "Send Request"
// Response will appear here

Rate Limits & Errors

Fair usage limits to ensure stability for all users.

50
WebSocket Connections
Unlimited
RPC Calls (Direct Node)
No Auth
API Key Required
JSON-RPC
Transport Protocol

HTTP Response Codes

200 Success — request completed
400 Bad Request — invalid parameters or malformed request
404 Not Found — block, transaction, or address does not exist
429 Too Many Requests — rate limit exceeded. Retry after cooldown.
500 Internal Server Error — something went wrong on our end
503 Service Unavailable — node is syncing or temporarily down