Blockchain RPC Methods
Blockchain RPCs provide access to Bitcoin blockchain data, including blocks, transactions, chain state, and UTXO information.Chain Information
getblockchaininfo
Returns comprehensive information about the current state of the blockchain.string
Current network name (main, test, signet, regtest)
number
Current number of blocks processed
number
Current number of headers validated
string
Hash of the best (tip) block
number
Current proof-of-work difficulty
number
Block time of the best block (Unix timestamp)
number
Median time for the current best block
number
Estimate of verification progress (0 to 1)
string
Total amount of work in active chain (hex)
number
Estimated size of the block and undo files on disk
boolean
Whether the blocks are subject to pruning
string
Any network and blockchain warnings
getblockcount
Returns the height of the most-work fully-validated chain.number
The current block count (genesis block has height 0)
getbestblockhash
Returns the hash of the best (tip) block in the most-work fully-validated chain.string
The block hash (hex-encoded)
getdifficulty
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.number
The current difficulty
Block Operations
getblock
Returns information about a block at the given hash or height.string
Block hash (same as provided)
number
Number of confirmations (-1 if block is not in main chain)
number
Block height
number
Block version
string
Merkle root hash
number
Block time (Unix timestamp)
number
Median time past
number
Block nonce
string
Difficulty target bits (hex)
number
Difficulty
string
Expected chain work (hex)
array
Transaction IDs (verbosity 1) or full transaction objects (verbosity 2+)
string
Hash of previous block
string
Hash of next block (if available)
getblockhash
Returns the hash of the block at the given height.string
The block hash at the specified height
getblockheader
Returns information about a block header.getblockstats
Computes per-block statistics for a given window.number
Average fee in the block
number
Average feerate (satoshis per virtual byte)
number
Average transaction size
string
Block hash
number
Block height
number
Maximum fee in the block
number
Maximum feerate
number
Minimum transaction size
number
Total fees in the block
number
Number of transactions (excluding coinbase)
Transaction Operations
gettxout
Returns details about an unspent transaction output (UTXO).string
Hash of the block at tip of chain
number
Number of confirmations
number
Transaction value in BTC
object
Script pubkey information including asm, hex, type, and address
boolean
Whether this is a coinbase transaction
Returns
null if the transaction output is spent or doesn’t exist.gettxoutsetinfo
Returns statistics about the unspent transaction output set.number
Block height
string
Best block hash
number
Number of unspent transaction outputs
number
Total amount in BTC
getrawtransaction
Returns raw transaction data.Chain State Queries
getchaintips
Returns information about all known chain tips.number
Height of the chain tip
string
Block hash of the tip
number
Length of branch connecting tip to main chain (0 for main chain)
string
Status: active, valid-fork, valid-headers, headers-only, invalid
getchaintxstats
Computes statistics about the total number and rate of transactions in the chain.verifychain
Verifies blockchain database integrity.boolean
Whether verification passed