Skip to main content
The SQL API schema is a set of opinionated tables and columns used to organize onchain data for efficient retrieval.

Supported Tables

TableDescription
base.blocksBlock metadata including timestamps, gas usage, and consensus fields
base.transactionsTransaction data including hash, block number, gas usage, and signatures
base.eventsDecoded event logs with contract interactions on Base
base.encoded_logsEncoded log data of event logs that aren’t able to be decoded by our event decoder (ex: log0 opcode)
base.decoded_user_operationsDecoded ERC-4337 user operations bundled into transactions
base.transaction_attributionsBuilder/searcher attribution metadata for transactions

base.blocks

Block metadata including timestamps, gas usage, and consensus fields.
See an example block on Basescan to understand how blockchain data corresponds to these SQL fields.
FieldTypeDescription
block_numberUInt64The sequential number of the block in the chain
block_hashStringThe keccak256 hash of the block header
parent_hashStringThe keccak256 hash of the parent block header
timestampDateTimeThe timestamp in UTC when the block was produced
minerStringThe address of the miner/validator who produced the block
nonceUInt64The nonce used in the block proof-of-work (legacy, 0 post-merge)
sha3_unclesStringThe hash of the ommers/uncles list in the block
transactions_rootStringThe root of the transaction trie of the block
state_rootStringThe root of the state trie after the block
receipts_rootStringThe root of the receipts trie of the block
logs_bloomStringThe bloom filter for log entries in the block
gas_limitUInt64The maximum gas allowed in the block
gas_usedUInt64The total gas used by all transactions in the block
base_fee_per_gasUInt64The base fee per gas in the block (EIP-1559)
total_difficultyStringThe total difficulty of the chain up to this block
sizeUInt64The size of the block in bytes
extra_dataStringArbitrary extra data included by the block producer
mix_hashStringA hash used in the proof-of-work algorithm (legacy)
withdrawals_rootStringThe root hash of the withdrawals trie (EIP-4895)
parent_beacon_block_rootStringThe root of the parent beacon block (EIP-4788)
blob_gas_usedUInt64The total blob gas consumed by transactions in the block (EIP-4844)
excess_blob_gasUInt64The running total of excess blob gas after this block (EIP-4844)
transaction_countUInt64The number of transactions in the block
actionInt8Block state: 1=added to chain, -1=removed via re-org

base.transactions

Transaction data including hash, block number, gas usage, and signatures.
See an example transaction on Basescan to understand how transaction data corresponds to these SQL fields.
timestamp on base.blocks and base.transactions is DateTime (second precision, server timezone), while block_timestamp on base.events, base.encoded_logs, base.decoded_user_operations, and base.transaction_attributions is DateTime64(3, 'UTC') (millisecond precision, UTC). When joining or comparing timestamps across these tables, cast explicitly (for example, toDateTime64(timestamp, 3, 'UTC')) to avoid precision loss or timezone surprises.
FieldTypeDescription
block_numberUInt64The number of the block containing this transaction
block_hashStringThe hash of the block containing this transaction
transaction_hashStringThe keccak256 hash of the transaction
transaction_indexUInt64The index position of the transaction within the block
from_addressStringThe address that sent the transaction (EOA)
to_addressStringThe recipient address (EOA or contract). Empty for contract creation.
valueStringThe value transferred in wei (decimal string)
gasUInt64The gas limit provided by the sender
gas_priceUInt64The gas price in wei provided by the sender
inputStringThe calldata sent with the transaction (hex-encoded)
nonceUInt64The number of prior transactions from the sender
typeUInt64The EIP-2718 transaction type (0=legacy, 1=access list, 2=EIP-1559, 3=blob)
max_fee_per_gasUInt64Maximum fee per gas the sender is willing to pay (EIP-1559)
max_priority_fee_per_gasUInt64Maximum priority fee (tip) per gas for the validator (EIP-1559)
chain_idUInt64The EIP-155 chain identifier
vStringECDSA signature recovery id
rStringECDSA signature r value
sStringECDSA signature s value
is_system_txBoolWhether this is a system transaction (OP Stack)
max_fee_per_blob_gasStringMaximum fee per blob gas the sender is willing to pay (EIP-4844)
blob_versioned_hashesArray(String)List of versioned blob hashes for blob transactions (EIP-4844)
timestampDateTimeThe timestamp in UTC of the block containing this transaction
actionInt8Transaction state: 1=added to chain, -1=removed via re-org

base.events

Decoded event logs with contract interactions on Base.
Schema changes: timestamp has been renamed to block_timestamp, and transaction_index has been removed. To retrieve a log’s transaction position within its block, join to base.transactions on transaction_hash and select transaction_index from there.
See example events on Basescan to see how event logs appear on the blockchain.
FieldTypeDescription
log_idStringA unique identifier for the log. It is derived from information inherent to the log, so if a log is processed multiple times, the unique log id will be the same.
block_numberUInt64The number of the block that the log is in
block_hashFixedString(66)The hash of the block that the log is in
block_timestampDateTime64(3, ‘UTC’)The timestamp in UTC of the block that the log is in
transaction_hashFixedString(66)The hash of the transaction that the log is in
transaction_toFixedString(42)The address the transaction is acting against. Could be either an EOA (ex: ETH transfer) or a contract (ex: smart contract call).
transaction_fromFixedString(42)The address that originated the transaction. Will be an EOA.
log_indexUInt32The index of the log within the transaction. First log is in the transaction at index 0, second is index 1, etc.
addressFixedString(42)The address of the contract that the log was created from
topicsArray(FixedString(66))The topics of the log. Topics are the indexed parameters of the event and the keccak256 hash of the event signature.
event_nameLowCardinality(String)The name of the event. Ex: Transfer
event_signatureLowCardinality(String)The signature of the event. Ex: Transfer(address,address,uint256)
parametersMap(String, Variant(Bool, Int256, String, UInt256))Map of parameter name to its value. Ex: {"from": "0x1234...", "to": "0x1234...", "value": "1000000000000000000"}
parameter_typesMap(String, String)Map of parameter name to its ABI type
actionEnum8(‘removed’ = -1, ‘added’ = 1)If the log is created, it is 1. If the log is re-orged out it is -1. If the sum of all actions for a given log is greater than 0, the log is “active”, meaning it is still in the chain (has not been re-orged out).

base.encoded_logs

Encoded log data of event logs that aren’t able to be decoded by our event decoder (ex: log0 opcode).
FieldTypeDescription
log_idStringA unique identifier for the log. It is derived from information inherent to the log, so if a log is processed multiple times, the unique log id will be the same.
block_numberUInt64The number of the block that the log is in
block_hashFixedString(66)The hash of the block that the log is in
block_timestampDateTime64(3, ‘UTC’)The timestamp in UTC of the block that the log is in
transaction_hashFixedString(66)The hash of the transaction that the log is in
transaction_toFixedString(42)The address the transaction is acting against. Could be either an EOA (ex: ETH transfer) or a contract (ex: smart contract call).
transaction_fromFixedString(42)The address that originated the transaction. Will be an EOA.
log_indexUInt32The index of the log within the transaction. First log is in the transaction at index 0, second is index 1, etc.
addressFixedString(42)The address of the contract that the log was created from
topicsArray(FixedString(66))The topics of the log. Topics are the indexed parameters of the event and the keccak256 hash of the event signature.
actionEnum8(‘removed’ = -1, ‘added’ = 1)If the log is created, it is 1. If the log is re-orged out it is -1. If the sum of all actions for a given log is greater than 0, the log is “active”, meaning it is still in the chain (has not been re-orged out).

base.decoded_user_operations

Decoded ERC-4337 user operations bundled into Base transactions.
FieldTypeDescription
block_numberUInt64The number of the block containing the bundle transaction
block_timestampDateTime64(3, ‘UTC’)The timestamp in UTC of the block containing the bundle transaction
transaction_hashFixedString(66)The hash of the bundle transaction containing the user operation
transaction_indexUInt32The index of the bundle transaction within the block
user_op_hashFixedString(66)The unique hash identifying the user operation
bundlerFixedString(42)The address of the bundler that submitted the bundle transaction
entry_pointFixedString(42)The address of the EntryPoint contract that executed the user operation
entry_point_versionLowCardinality(String)The version of the EntryPoint contract (ex: v0.6, v0.7)
beneficiaryFixedString(42)The address designated to receive the gas refund for the bundle
method_nameEnum8(‘handleOps’ = 1, ‘handleAggregatedOps’ = 2)The EntryPoint method invoked to execute the bundle
method_signatureLowCardinality(String)The full canonical signature of the invoked EntryPoint method
senderFixedString(42)The smart account address that originated the user operation
user_op_dataStringThe raw, encoded user operation payload
actual_gas_costStringThe actual gas cost paid for executing the user operation (decimal string in wei)
actual_gas_usedStringThe actual amount of gas consumed by the user operation (decimal string)
successEnum8(‘failure’ = 0, ‘success’ = 1)Whether the user operation executed successfully
builder_codesArray(LowCardinality(String))Builder attribution codes associated with the user operation
annotation_dataStringAdditional annotation metadata for the user operation
actionInt8User operation state: 1=added to chain, -1=removed via re-org

base.transaction_attributions

Builder/searcher attribution metadata for Base transactions.
FieldTypeDescription
builder_codeLowCardinality(String)Identifier code attributing the transaction to a builder or searcher
block_timestampDateTime64(3, ‘UTC’)The timestamp in UTC of the block containing the transaction
block_numberUInt64The number of the block containing the transaction
transaction_hashFixedString(66)The hash of the attributed transaction
transaction_indexUInt32The index of the attributed transaction within the block
actionInt8Attribution state: 1=added to chain, -1=removed via re-org
annotation_dataStringAdditional annotation metadata for the attribution
ingested_atDateTime64(3, ‘UTC’)The timestamp in UTC when the attribution record was ingested