---
title: "Bitcoin RPC Interface — definition | Nuri Glossary"
description: "The JSON-RPC interface for controlling a node and querying chain, mempool and wallet data."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/bitcoin-rpc"
---

# Bitcoin RPC Interface

The JSON-RPC interface for controlling a node and querying chain, mempool and wallet data.

## Basically

Bitcoin Core's RPC interface lets your apps talk to your Bitcoin node. You can use it to manage your wallet and node, or to look up blockchain data.

## Key Takeaways

- The Bitcoin RPC interface is a JSON-RPC API exposed by Bitcoin Core. It lets applications query blockchain data, manage wallets, broadcast transactions and control node behaviour programmatically.
- It provides over 100 commands organised into categories: blockchain queries, wallet operations, network management, mining and raw transaction construction. The bitcoin-cli tool is the standard command-line client.
- Cookie-based credentials provide authentication by default, and you should never expose the interface to the public internet. Lightning implementations like LND and Core Lightning depend on RPC access to a fully synced node.

## What Is the Bitcoin RPC Interface?

The Bitcoin RPC interface is a JSON-RPC server built into Bitcoin Core that lets external programs interact with a running Bitcoin node. RPC stands for Remote Procedure Call, a protocol where a client sends a structured request to a server, which executes the corresponding function and returns the result.
bitcoind (the Bitcoin Core daemon) listens for JSON-RPC requests over HTTP on a local port when you start it, and any application that can make HTTP POST requests and parse JSON can communicate with the node. You can query block data, create transactions, check mempool state, estimate fees and more. These capabilities make the RPC interface the primary way that wallets, block explorers, Lightning nodes and other Bitcoin infrastructure interact with the base layer.
Bitcoin Core has supported JSON-RPC since 2010, when Gavin Andresen added HTTP authentication to the interface. The protocol has evolved across major releases. Bitcoin Core v28.0 added full JSON-RPC 2.0 compliance alongside the legacy 1.1 protocol.

## How It Works

The RPC server uses libevent to run an HTTP server on a configurable port. You send JSON-formatted requests with a method name and parameters, and the server executes the method against the node's state and returns a JSON response.

## Request and Response Format

A JSON-RPC request has four fields: the protocol version, a method name, parameters and a client-chosen ID. The ID matches responses to requests.
You can pass parameters by position as an array or by name as an object. The bitcoin-cli tool supports named parameters with the -named flag, which makes complex commands easier to read.

## Default Ports

Each Bitcoin network uses a different default RPC port. The separate ports prevent accidental cross-network commands:

## Command Categories

Bitcoin Core exposes over 100 RPC commands organised into functional groups. The most commonly used commands include:
Blockchain commands query the state of the chain. getblockchaininfo returns sync status, chain name and verification progress. getblock retrieves a specific block by hash, and getbestblockhash returns the tip of the longest chain.
Wallet commands handle key management, address generation and transaction creation. These commands are only available when Bitcoin Core is compiled with wallet support, which is the default.
Network commands provide visibility into peer connections and network health. getpeerinfo returns detailed information about each connected peer, including latency, services and protocol version.
Mining commands support block construction. getblocktemplate returns a candidate block template for miners, containing the selected transactions and required header fields.
Raw transaction commands provide granular control over transaction construction and signing. They work with both raw hex transactions and PSBTs (Partially Signed Bitcoin Transactions).

## Authentication and Security

The RPC interface provides full control over a node and its wallets, so you need proper authentication. Bitcoin Core supports three authentication methods.

## Cookie-Based Authentication

Cookie-based authentication is the default and recommended method. Bitcoin Core generates a random username and password on each startup when no explicit credentials are configured, then writes them to a.cookie in the data directory. The file is readable only by the system user that started the daemon, and clients like bitcoin-cli read it automatically.

## rpcauth (Multi-User)

The rpcauth method uses HMAC-SHA256 hashed credentials when multiple applications need different access levels. A Python script bundled with Bitcoin Core generates the hashed entry for bitcoin.conf:

## Access Control

Bitcoin Core provides several access control mechanisms beyond authentication. These controls let you limit access further:

## bitcoin-cli: The Command-Line Client

bitcoin-cli is the standard command-line tool for interacting with a running bitcoind instance. It reads connection settings from bitcoin.conf, handles authentication, including automatic cookie file reading, and formats requests as JSON-RPC calls.
Developers can use bitcoin-cli to prototype and debug before integrating RPC calls into application code. Any language with HTTP and JSON support can call the RPC interface directly. Client libraries exist for Python, JavaScript, Go, Rust and most other popular languages.

## Lightning Network Infrastructure

Lightning implementations depend heavily on the Bitcoin RPC interface, and Core Lightning requires a synced bitcoind with RPC access. LND requires JSON-RPC access to a fully synchronised bitcoind for on-chain operations: opening channels, force-closing, sweeping outputs and monitoring confirmation depth. LND also uses Bitcoin Core's ZMQ notification interface, a complementary push-based system, to receive real-time block and transaction events.

## Block Explorers and Analytics

Self-hosted block explorers connect directly to a node via RPC to query blocks, transactions and address histories. The txindex flag enables fast transaction lookups by hash, which is essential for explorer functionality. Chain analysis tools also use RPC to scan the UTXO set and trace transaction flows.

## Wallet Applications and Custody

Enterprise custody solutions, hardware wallet coordinators and desktop wallets use RPC to manage keys, construct transactions and broadcast them to the network. Multi-wallet support lets a single Bitcoin Core instance serve multiple wallets through the /wallet/<name>/ endpoint. The guide to building Bitcoin payment apps has more on building Bitcoin payment infrastructure.

## Development and Testing

The RPC interface is central to Bitcoin development workflows. Developers use regtest mode to spin up private networks where blocks can be generated on demand via generatetoaddress, enabling rapid testing of transaction logic, Script execution and fee estimation without spending real bitcoin. The signet and testnet networks provide more realistic testing environments while still using the same RPC commands.

## Complementary Interfaces

Bitcoin Core provides two additional interfaces alongside the JSON-RPC server. The additional interfaces are:

## Security Exposure

The RPC interface provides full control over the node and any loaded wallets. Compromised credentials can lead to stolen funds, network disruption or filesystem access, so always use cookie-based authentication or rpcauth, restrict access with rpcallowip and never store plaintext credentials in configuration files.

## Resource Consumption

Some RPC commands are computationally expensive. gettxoutsetinfo scans the entire UTXO set and can take several minutes, while batch requests with no size limit can cause out-of-memory conditions. Production deployments should implement rate limiting and use rpcwhitelist to prevent abuse.

## Deprecation and Breaking Changes

The RPC interface evolves with each Bitcoin Core release. Commands are deprecated with a one-version grace period and can be re-enabled via -deprecatedrpc, and some are removed entirely. Bitcoin Core v30.0, for example, removed 11 legacy wallet RPCs, including dumpprivkey and importprivkey, as part of the migration to descriptor-based wallets, so applications must track release notes and adapt accordingly.

## Consistency Guarantees

Blockchain queries reflect chain state at execution time, and mempool queries return self-consistent snapshots. Wallet state may lag behind the mempool, so applications that require strong consistency across multiple queries should account for state changing between calls.
The Bitcoin node implementation comparison provides a broader comparison of Bitcoin node implementations. It also covers their RPC capabilities.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
