Blocks
The bitcoin_blocks_rpc table provides detailed information about Bitcoin blockchain blocks. A block is a collection of transactions, and is identified by a block hash. Each block contains a reference to the previous block, forming a chain of blocks.
Inputs
fromBlock
BIGINT
Block number to start scanning from.
toBlock
BIGINT
Block number to stop scanning at.
url
VARCHAR
URL of the Bitcoin node.
Outputs
bits
VARCHAR
The value of the nBits field in the block header
chainwork
VARCHAR
Expected number of hashes required to produce the chain up to this block
confirmations
BIGINT
The number of confirmations (blocks in the longest chain linking to this block)
difficulty
DOUBLE
Proof-of-work difficulty as a multiple of the minimum difficulty
hash
VARCHAR
The block hash
height
BIGINT
The block number
mediantime
TIMESTAMP
The median time of the block
merkleroot
VARCHAR
The Merkle root of the block
nTx
BIGINT
Number of transactions in the block
nextblockhash
VARCHAR
Hash of the next block
nonce
BIGINT
The nonce value
previousblockhash
VARCHAR
Hash of the previous block
size
BIGINT
Total size of the block
strippedsize
BIGINT
Size of the block without witness data
time
TIMESTAMP
Timestamp when the block was mined
tx
LIST(VARCHAR)
List of transaction IDs in the block
version
BIGINT
The block version
weight
BIGINT
The block weight (SegWit metric)
Examples
D set variable bitcoin_url = 'https://bitcoin-mainnet.core.chainstack.com/xxx';
D select * from bitcoin_blocks_rpc(886654, 886654, getvariable('bitcoin_url'));
ββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββ¬ββββ¬ββββββββββ¬βββββββββββββββ¬ββββββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββ¬ββββββββββ
β bits β chainwork β confirmations β difficulty β hash β height β β¦ β size β strippedsize β time β tx β version β weight β
β varchar β varchar β int64 β double β varchar β int64 β β int64 β int64 β timestamp β varchar[] β int64 β int64 β
ββββββββββββΌβββββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββββββΌβββββββββΌββββΌββββββββββΌβββββββββββββββΌββββββββββββββββββββββΌβββββββββββββββββββββββΌββββββββββββΌββββββββββ€
β 17028bb1 β 000000000000000000β¦ β 1690 β 110568428300952.7 β 000000000000000000β¦ β 886654 β β¦ β 1628426 β 788426 β 2025-03-07 00:02:24 β [f397dd542f4f1dd0eβ¦ β 541065216 β 3993704 β
ββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββ΄ββββ΄ββββββββββ΄βββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββ€
β 1 rows 18 columns (12 shown) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββLast updated