MainHistoryExamplesRecommended Reading
Explain Like I'm 5 /Web Technology

What is JSON-RPC?

Help others learn from this page

image for entry

JSON-RPC in action: client sends a method call, server responds with results

JSON-RPC is a lightweight, stateless remote procedure call (RPC) protocol. It uses JSON to encode requests and responses and operates over HTTP, WebSockets, or any other transport.

It’s especially popular in systems where you want to keep integration simple and language-agnostic — like between a backend server and an AI model, or between microservices.

Basic JSON-RPC request:

{
  "jsonrpc": "2.0",
  "method": "getBalance",
  "params": ["0x1234..."],
  "id": 1
}

And the response:

{
  "jsonrpc": "2.0",
  "result": 1000,
  "id": 1
}

Key characteristics:

  • Pure JSON
  • No HTTP status code semantics (everything goes in the payload)
  • Supports named or positional parameters
  • Supports notifications (no response expected)

JSON-RPC is widely used in blockchain, AI agent toolchains, and increasingly with Model Context Protocol (MCP) as the transport layer for function calls.

FAQ

Is JSON-RPC the same as REST?
No. JSON-RPC focuses on calling remote functions, not on resources like REST. It's closer to calling a method in a shared library.
Does JSON-RPC support WebSockets?
It supports anything that can transport JSON. HTTP, WebSockets, pipes, even message queues.
Why use JSON-RPC vs gRPC?
It’s simpler, requires no codegen, and works great in JavaScript-heavy or browser environments. gRPC is more performant but more complex.
Is JSON-RPC secure?
It depends on the transport. The protocol doesn’t include authentication or encryption by default — that’s handled by the layer it runs on.

Related Stuff

Enjoyed this explanation? Share it!