Bitcoin’s Remote Procedure Call (RPC) interface is a powerful tool for developers interacting directly with the Bitcoin Core node. Whether you're building blockchain explorers, wallets, or mining tools, understanding the full range of available Bitcoin RPC commands is essential. This comprehensive guide organizes and explains all major Bitcoin JSON-RPC APIs, helping you leverage them effectively in your decentralized applications.
Blockchain Data Management
The blockchain API group enables direct access to core blockchain data, allowing developers to retrieve block information, verify chain integrity, and inspect transaction outputs.
Retrieve Block Information
Commands like getblock and getblockhash let you fetch specific blocks by hash or height. Use getbestblockhash to obtain the hash of the current chain tip—critical for syncing applications with the latest state.
getblockchaininfo returns metadata such as chain name, block height, and difficulty, while getblockcount gives a quick count of total blocks. For header-only queries (faster and lighter), getblockheader retrieves block headers without full transaction data.
To analyze unconfirmed transactions, use getmempoolinfo and getrawmempool. These provide insights into pending transactions, their fees, and dependencies. Advanced tools like getmempoolancestors and getmempooldescendants help trace transaction lineage in the mempool.
👉 Discover how real-time blockchain data powers next-gen apps
Node Control & System Operations
Maintaining node health and diagnosing issues requires control over the Bitcoin daemon itself.
Manage Node Behavior
Use stop to safely shut down the Bitcoin Core node. The help command lists all available RPCs or provides detailed usage for a specific one—ideal for debugging or exploration.
getrpcinfo returns current RPC server details including active commands and execution times, useful for monitoring performance under load.
These commands are vital during deployment, maintenance, or when integrating Bitcoin Core into larger systems.
Mining & Block Construction
Although most mining is now done via specialized pools and hardware, these RPCs remain valuable for test environments and educational purposes.
Mine Blocks Locally
The generate and generatetoaddress commands allow local block creation—perfect for regtest or development setups. They return newly mined blocks immediately, speeding up testing cycles.
For advanced mining coordination, getblocktemplate delivers a block template that miners can use to construct candidate blocks. After mining, submit results using submitblock.
Monitor network hash rate with getnetworkhashps, which estimates the total computational power securing the network. This metric helps assess network security trends over time.
Developers working on mining software or consensus research will find prioritisetransaction particularly useful—it adjusts a transaction’s priority in the mempool, influencing inclusion likelihood without changing fees.
Peer-to-Peer Network Interaction
Bitcoin operates on a decentralized peer-to-peer network. These APIs give you visibility and control over node connectivity.
Monitor and Manage Connections
Use getconnectioncount to check how many peers your node is connected to—a key indicator of network health.
getpeerinfo provides detailed stats per peer: IP address, connection time, data sent/received, and supported services. This is crucial for diagnosing sync issues or detecting unreliable peers.
To manage peer access:
addnode: Manually connect to a nodedisconnectnode: Drop a connectionsetban/listbanned: Ban misbehaving nodesclearbanned: Remove all bans
Use ping to test peer responsiveness. The node sends a ping message and logs the round-trip time from each peer.
These tools are indispensable for running reliable full nodes or building network analysis tools.
Raw Transaction Handling
Raw transaction APIs offer fine-grained control over transaction creation, signing, and broadcasting—essential for wallet development and custom scripts.
Build and Broadcast Transactions
Start with createrawtransaction to define inputs and outputs without signing. Then use fundrawtransaction to automatically select inputs and cover fees.
Before signing, decode transactions with decoderawtransaction to inspect structure. Similarly, decodescript helps analyze complex scripts like multisig or P2SH.
Once ready, sign with signrawtransaction (or signrawtransactionwithkey/signrawtransactionwithwallet) and broadcast using sendrawtransaction.
For UTXO management, gettxout checks whether an output exists and is spendable. Use gettxoutproof to generate cryptographic proof that a transaction exists in a block—valuable for lightweight clients.
👉 Learn how secure transaction signing enhances wallet safety
Utility Functions
A collection of helper tools that support broader development workflows.
Address and Script Utilities
validaddress validates Bitcoin addresses—checking format and network type (mainnet/testnet). Combine it with createmultisig to generate multisignature addresses requiring multiple keys for spending.
Message signing and verification (signmessage, verifymessage) enable secure off-chain authentication. For example, proving ownership of an address without transferring funds.
System monitoring tools like getmemoryinfo report memory usage—useful for optimizing long-running services.
Fee estimation commands (estimatefee, estimatepriority) were once central but are now deprecated in favor of dynamic fee algorithms. Still, they may appear in legacy codebases.
Wallet Management
Wallet APIs let you manage keys, addresses, balances, and transactions securely within Bitcoin Core.
Key and Address Operations
Generate new addresses with getnewaddress. Use getrawchangeaddress to create change addresses manually when crafting custom transactions.
Import keys or addresses using importprivkey, importaddress, or bulk import via importwallet. For enhanced security, encrypt your wallet with encryptwallet.
Check balances with getbalance or drill down by address using getreceivedbyaddress. For full transaction history, use listtransactions or filter since a specific block with listsinceblock.
Transaction Control
Send funds via sendtoaddress or batch payments with sendmany. If a low-fee transaction is stuck, use bumpfee to replace it with a higher-fee version (RBF must be enabled).
Manage UTXOs precisely with listunspent and lock specific outputs using lockunspent. This prevents accidental double-spending in complex workflows.
Other critical functions include:
backupwallet: Create encrypted backupsdumpprivkey: Export private keys (handle with extreme care)walletlock/walletpassphrase: Secure wallet access
Use getwalletinfo for an overview: version, balance, key count, and encryption status.
Frequently Asked Questions
Q: What is the Bitcoin RPC API used for?
A: It allows developers to interact programmatically with a Bitcoin Core node—querying blockchain data, managing wallets, sending transactions, and controlling node behavior.
Q: How do I enable RPC access on Bitcoin Core?
A: Enable it in the configuration file (bitcoin.conf) by setting parameters like server=1, rpcuser, and rpcpassword. Always secure RPC endpoints in production.
Q: Can I use RPC commands for live trading or exchange operations?
A: Yes—but ensure high availability, proper error handling, and rate limiting. Many exchanges use RPC-backed systems for deposit tracking and payout processing.
Q: Are raw transaction APIs safe for production wallets?
A: They offer maximum control but require deep understanding of Bitcoin scripting and UTXO management. Mistakes can lead to lost funds. Test thoroughly in regtest first.
Q: Is there rate limiting on RPC calls?
A: Bitcoin Core does not enforce built-in rate limits. You should implement external throttling if exposing RPC over networks.
👉 See how professional platforms handle secure blockchain integration
This guide covers every major Bitcoin RPC command across nine functional categories. By mastering these interfaces, developers gain direct access to the backbone of the Bitcoin network—enabling everything from simple balance checks to complex smart contract interactions. As blockchain technology evolves, these foundational tools remain critical for innovation in decentralized finance and digital ownership.