Back to Insights

Bitcoin CLI Reference: Your Node is an API

Published Blockchain

This is a companion to my Bitcoin node build log. If you followed along and got a node running, this is what you can do with it.

The Realization

When you run a Bitcoin Core node, you're not just validating transactions. You're running a programmable interface to the entire Bitcoin network.

Your node is the same backend infrastructure that powers blockchain.com, mempool.space, and every Bitcoin wallet. The difference is you control it. No API keys, no rate limits, no third-party dependency.

What is RPC?

RPC stands for Remote Procedure Call. It's a way for one program to request that another program execute a function — like asking "what's the current block height?" or "send this transaction."

Think of it like a remote control for your Bitcoin node.

When you run Bitcoin Core, it exposes an RPC interface on localhost port 8332. You can interact with it from virtually any programming language — Python, JavaScript, Go, whatever — by sending JSON-RPC requests to your node.

# The CLI is just a convenient wrapper around these RPC calls
bitcoin-cli getblockchaininfo

# Under the hood, it's sending JSON like this:
curl --user user:pass --data-binary \
  '{"jsonrpc": "1.0", "method": "getblockchaininfo", "params": []}' \
  http://127.0.0.1:8332/

Your Bitcoin Core node becomes your personal gateway to the Bitcoin network. This is how real Bitcoin applications are built — they run a node and use these RPC commands to interact with Bitcoin programmatically.

Anything you see on sites like blockchain.com or mempool.space? Those are just applications built on top of nodes using these same RPC calls. Your node is the backend. You can build whatever frontend or application logic you want on top of it.

The Stack

Take any traditional app — an e-commerce site, a SaaS product, a mobile app, a game — and by integrating with a Bitcoin node, you've added a programmable money layer to it.

Lightning works the same way. Lightning implementations like LND, Core Lightning, or Eclair expose their own RPC/API interfaces. Your stack might look like:

Your Application
      ↓
Lightning Node (LND, CLN, Eclair) ← Lightning RPC API
      ↓
Bitcoin Core Node ← Bitcoin RPC API
      ↓
Bitcoin Network

This is exactly how real products are built.

The powerful realization: Bitcoin and Lightning are just open APIs. There's no company to get permission from, no developer account to sign up for, no fees to Visa or Stripe. You run the infrastructure yourself and build whatever you want on top.

You're essentially adding a global, permissionless payment rail to any application.

RPC Command Reference

All commands below are invoked via bitcoin-cli <command>. Full documentation: developer.bitcoin.org/reference/rpc

Blockchain RPCs

Commands for querying block and chain data.

CommandDescription
getbestblockhashReturns the hash of the best (tip) block
getblockReturns data about a specific block
getblockchaininfoReturns blockchain state info (sync progress, chain, etc.)
getblockcountReturns the height of the most-work chain
getblockhashReturns hash of block at given height
getblockheaderReturns header data for a block
getblockstatsReturns statistics about a block
getchaintipsReturns info about all known chain tips
getchaintxstatsReturns transaction statistics for the chain
getdifficultyReturns current proof-of-work difficulty
getmempoolinfoReturns mempool state info
getrawmempoolReturns all transaction IDs in the mempool
gettxoutReturns details about an unspent transaction output
gettxoutsetinfoReturns statistics about the UTXO set
verifychainVerifies blockchain database

Network RPCs

Commands for peer connections and network info.

CommandDescription
getnetworkinfoReturns network state info
getpeerinfoReturns data about connected peers
getconnectioncountReturns number of connections
getnettotalsReturns network traffic statistics
addnodeAdd/remove a node from the connection list
disconnectnodeDisconnect from a specific peer
getaddednodeinfoReturns info about added nodes
getnodeaddressesReturns known node addresses
listbannedReturns list of banned peers
setbanAdd/remove an IP from the ban list
pingPing all connected peers

Wallet RPCs

Commands for wallet management. Requires wallet support (enabled by default).

CommandDescription
getbalanceReturns wallet balance
getbalancesReturns all balances (trusted, untrusted, immature)
getnewaddressGenerates a new receiving address
getreceivedbyaddressReturns amount received by an address
gettransactionReturns details about a wallet transaction
getwalletinfoReturns wallet state info
listreceivedbyaddressLists amounts received by each address
listtransactionsReturns recent transactions
listunspentReturns unspent transaction outputs
sendtoaddressSend bitcoin to an address
sendmanySend to multiple addresses in one transaction
signmessageSign a message with an address's private key
walletpassphraseUnlock an encrypted wallet
backupwalletBackup the wallet to a file
createwalletCreate a new wallet
loadwalletLoad a wallet from file

Control RPCs

Commands for controlling the node itself.

CommandDescription
stopGracefully shut down the node
uptimeReturns node uptime in seconds
helpList all commands, or get help for a specific command
loggingGet or set log categories
getrpcinfoReturns RPC server info
getmemoryinfoReturns memory usage info

Mining RPCs

Commands for mining operations.

CommandDescription
getmininginfoReturns mining-related info
getnetworkhashpsReturns estimated network hash rate
getblocktemplateReturns data for constructing a block
submitblockSubmit a new block to the network
prioritisetransactionAdjust priority of a mempool transaction

Raw Transaction RPCs

Commands for creating and handling raw transactions.

CommandDescription
createrawtransactionCreate an unsigned raw transaction
decoderawtransactionDecode a raw transaction hex
decodescriptDecode a script hex
getrawtransactionReturns raw transaction data
sendrawtransactionBroadcast a signed transaction
signrawtransactionwithkeySign a raw transaction with provided keys
testmempoolacceptTest if a transaction would be accepted

PSBT Commands

Partially Signed Bitcoin Transactions — for multi-party signing workflows.

CommandDescription
createpsbtCreate an unsigned PSBT
decodepsbtDecode a PSBT
finalizepsbtFinalize and extract a PSBT
combinepsbtCombine multiple PSBTs
analyzepsbtAnalyze a PSBT

Utility RPCs

General utility commands.

CommandDescription
validateaddressValidate a Bitcoin address
verifymessageVerify a signed message
estimatesmartfeeEstimate fee rate for confirmation target
createmultisigCreate a multisig address
deriveaddressesDerive addresses from a descriptor

The Bottom Line

Running a Bitcoin Core node gives you programmable access to the entire Bitcoin network. These RPC commands are your interface — the same ones powering block explorers, wallets, and payment processors.

Your node connects you to a global financial network. The only ongoing cost is electricity and internet. No API keys. No rate limits. No permission required.

That's the infrastructure. Now build something.


This is a companion to Running a Bitcoin Node. Next up: Core Lightning setup and the Lightning RPC API.

Building on Bitcoin? Let me know on X what you're working on.

Rodrigo Ortega

Rodrigo Ortega

Four years in commercial banking at JPMorgan. Five years building technology. Writing about where emerging tech is heading and what it means for business.