Skip to main content

Table description

The bitcoin.transactions table represents the transactions on the Bitcoin blockchain. A transaction is a transfer of Bitcoin value that is broadcast to the network and collected into blocks. A transaction typically references previous transaction outputs as new transaction inputs and dedicates all input Bitcoin values to new outputs. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block.

Table Schema

ColumnTypeDescription
block_timeTIMESTAMPTimestamp of the block containing this transaction
block_dateDATEDate of the block for daily aggregations
block_heightBIGINTHeight of the block containing this transaction
indexINTEGERPosition of this transaction within the block
block_hashVARBINARYHash of the block containing this transaction
idVARBINARYUnique transaction identifier (txid)
lock_timeBIGINTEarliest time or block height at which this transaction can be included
sizeBIGINTTotal size of the serialized transaction in bytes
virtual_sizeBIGINTVirtual size in vbytes, accounting for SegWit discount
coinbaseVARBINARYCoinbase data if this is a coinbase transaction, otherwise empty
is_coinbaseBOOLEANWhether this is a coinbase transaction (block reward)
versionBIGINTTransaction version number
input_countINTEGERNumber of inputs in this transaction
output_countINTEGERNumber of outputs in this transaction
input_valueDOUBLETotal BTC value of all inputs
output_valueDOUBLETotal BTC value of all outputs
feeDOUBLETransaction fee in BTC (input_value minus output_value)
hexVARBINARYFull raw transaction in serialized hex format
inputARRAY(ROW(VALUE DOUBLE, COINBASE VARBINARY, HEIGHT BIGINT, TX_ID VARBINARY, OUTPUT_NUMBER BIGINT, SCRIPT_PUB_KEY ROW(ADDRESS VARCHAR, ASM VARCHAR, DESC VARCHAR, HEX VARBINARY, TYPE VARCHAR), SCRIPT_SIGNATURE ROW(ASM VARCHAR, HEX VARBINARY), SEQUENCE BIGINT, WITNESS_DATA ARRAY(VARBINARY)))Array of transaction inputs with full details including spent output info
outputARRAY(ROW(INDEX BIGINT, SCRIPT_PUB_KEY ROW(ADDRESS VARCHAR, ASM VARCHAR, DESC VARCHAR, HEX VARBINARY, TYPE VARCHAR), VALUE DOUBLE))Array of transaction outputs with script and value details

Table Sample

Struct definitions

Within several of these columns is a data type of STRUCT which allows for representing nested hierarchical data and has key-value pairs. It’s similar to a dictionary in Python and can be used to group fields together to make them more accessible. Note that you can work with these columns with the syntax input[1].witness_data[2] or input[3].script_pub_key.address depending on lengths of arrays within each value. It is an array(row(map)) type, and while it looks like just an array in the returned table - it is more than that! input
FieldData typeDescription
valuedoubleThe number of Satoshis attached to this output
heightbigintThe height of the output
tx_idstringThe transaction id of the output that is here used as input
output_numberbigintThe number (index) of the output in transaction tx_id’s outputs
coinbasestringThe data specified in this transaction, if it was a coinbase transaction
sequencebigintSequence number
witness_dataarray<string>Array of hex encoded witness data
script_signaturestructThe script signature
script_pub_keystructThe script public key

input.script_signature
FieldData typeDescription
hexstringThe transaction’s script operations, in hex
asmstringThe transaction’s script operations, in symbolic representation

input.script_pub_key
FieldData typeDescription
asmstringThe transaction’s script operations, in symbolic representation
descstringThe transaction’s script operations, in symbolic representation
addressstringThe transaction’s script operations, in symbolic representation
hexstringThe transaction’s script operations, in hex
typestringThe address type of the output

output
FieldData typeDescription
indexbigint0-indexed number of an output within a transaction used by a later transaction to refer to that specific output
valuedoubleThe number of Satoshis attached to this output
script_pub_keystructThe public key

output.script_pub_key
FieldData typeDescription
asmstringThe transaction’s script operations, in symbolic representation
hexstringThe transaction’s script operations, in hex
addressstringThe address the BTC came from
typestringThe address type of the output