Chain data

These fields describe the output of various TrueBlocks blockchain queries.

Each data structure is created by one or more tools which are detailed below

Block

chifra blocks returns top level data specified block. You can also include an array for the blocks’ transactions.

The following commands produce and manage blocks:

Tools
chifra blocksretrieve one or more blocks from the chain or local cache

Block data is made of the following data fields:

FieldDescriptionType
gasLimitthe system-wide maximum amount of gas permitted in this blockgas
hashthe hash of the current blockhash
blockNumberthe number of the blockblknum
parentHashhash of previous blockhash
minerAddress of block’s winning mineraddress
difficultythe computational difficulty at this blockuint64
timestampthe Unix timestamp of the objecttimestamp
transactionsa possibly empty array of transactions or transaction hashesCTransactionArray
baseFeePerGasthe base fee for this blockwei
finalizedflag indicating the system considers this data finalbool
unclesCntthe number of uncles in this blockuint64

Transaction

Transactions represent eth transfers to and from other addresses.

Most of the fields that TrueBlocks returns are standard to all eth transaction. However, one field is very interesting: articulatedTx provides a human readable output of the input field.

This is a very powerful way to understand the story behind a smart contract.

The following commands produce and manage transactions:

Tools
chifra transactionsRetrieve one or more transactions from the chain or local cache

Transaction data is made of the following data fields:

FieldDescriptionType
gasPricethe number of wei per unit of gas the sender is willing to spendgas
hashThe hash of the transactionhash
blockHashThe hash of the block containing this transactionhash
blockNumberthe number of the blockblknum
transactionIndexthe zero-indexed position of the transaction in the blockblknum
noncesequence number of the transactions sent by the senderuint64
timestampthe Unix timestamp of the objecttimestamp
fromaddress from which the transaction was sentaddress
toaddress to which the transaction was sentaddress
valuethe amount of wei sent with this transactionswei
gasthe maximum number of gas allowed for this transactiongas
inputbyte data either containing a message or funcational data for a smart contracts. See the –articulatebytes
receiptCReceipt
statementsarray of reconciliationsCReconciliationArray
articulatedTxCFunction
compressedTxtruncated, more readable version of the articulationstring
hasTokentrue if the transaction is token related, false otherwiseuint8
finalizedflag indicating the system considers this data finalbool
extraDatastring
isErrorbool
datedate

Receipt

Receipts record the amount of gas used for a transaction among other things. If the transaction succeeded, a receipt might also have logs.

If the to address of a transaction is 0x0, the input data is considered to be the source code (byte code) of a smart contract. In this case, if the creation of the contract succeeds, the contractAddress field of the receipt carries the address of the newly created contract.

The following commands produce and manage receipts:

Tools
chifra receiptsretrieve receipts for the given transaction(s)

Receipt data is made of the following data fields:

FieldDescriptionType
status1 on transaction suceess, null if tx preceeds Byzantium, 0 otherwiseuint32
contractAddressthe address of the newly created contract, if anyaddress
gasUsedthe amount of gas actually used by the transactiongas
logsa possibly empty array of logsCLogEntryArray

Log

Logs appear in a possibly empty array in the transaction’s receipt. They are only created if the underlying transaction suceeded. In the case where the transaction failed, no logs will appear in the receipt. Logs are only ever generated during transactions whose to address is a smart contract.

The following commands produce and manage logs:

Tools
chifra logsretrieve logs for the given transaction(s)

Log data is made of the following data fields:

FieldDescriptionType
blockNumberthe number of the blockblknum
transactionIndexthe zero-indexed position of the transaction in the blockblknum
logIndexthe zero-indexed position of this log relative to the blockblknum
timestampthe timestamp of the block this log appears intimestamp
addressthe smart contract that emitted this logaddress
topicsThe first topic hashes event signature of the log, up to 3 additional index parameters may appearCTopicArray
dataany remaining un-indexed parameters to the eventbytes
articulatedLoga human-readable version of the topic and data fieldsCFunction
compressedLoga truncated, more readable version of the articulationstring

Trace

The deepest layer of the Ethereum data is the trace. Every transaction has at least one trace which is itself a record of the transaction. If the to address of the transaction is a smart contract, other traces may appear, if, for example, that smart contract calls other smart contracts.

Traces may be arbitrarily deep (up to the gasLimit) and ultimately represent a tree of function calls. Some transactions have 100s of traces. The format of the trace is similar to the transaction itself have a trace action (which contains from, to, value like the transaction) and the trace result (containing gasUsed like the receipt).

The following commands produce and manage traces:

Tools
chifra tracesretrieve traces for the given transaction(s)

Trace data is made of the following data fields:

FieldDescriptionType
blockHashThe hash of the block containing this tracehash
blockNumberthe number of the blockblknum
transactionHashthe transaction’s hash containing this tracehash
transactionIndexthe zero-indexed position of the transaction in the blockblknum
traceAddressa particular trace’s address in the trace treeCStringArray
subtracesthe number of children traces that the trace hashuint64
typethe type of the tracestring
actionthe trace action for this traceCTraceAction
resultthe trace result of this traceCTraceResult
articulatedTracehuman readable version of the trace action input dataCFunction
compressedTracea compressed string version of the articulated tracestring

TraceAction

Other than the first trace which is the trace of the transaction itself, traces represent calls into smart contracts. Because of this, trace actions closely resemble the fields of the transaction.

The following commands produce and manage traceactions:

Tools
chifra tracesretrieve traces for the given transaction(s)

Traceaction data is made of the following data fields:

FieldDescriptionType
fromaddress from which the trace was sentaddress
toaddress to which the trace was sentaddress
gasthe maximum number of gas allowed for this tracegas
inputan encoded version of the function callbytes
callTypethe type of callstring
refundAddressif the call type is self-destruct, the address to which the refund is sentaddress

TraceResult

As mentioned above, other than the first trace, traces represent calls into other smart contracts. Because of this, the trace results closely resembles the fields of the receipt.

The following commands produce and manage traceresults:

Tools
chifra tracesretrieve traces for the given transaction(s)

Traceresult data is made of the following data fields:

FieldDescriptionType
newContractAddress of new contract, if anyaddress
codeif this trace is creating a new smart contract, the byte code of that contractbytes
gasUsedthe amount of gas used by this tracegas
outputthe result of the call of this tracebytes

DatedBlock

Left to its own devices, the blockchain would try to convince us that only hashes and bytes are important, but being human beings we know that this is not true. TrueBlocks articulates various types of data with chifra names detailing the names for addresses, -articulate describing the Functions and Events of a transaction, and chifra when describing dated blocks. Dated blocks assign a human-readable date to blocks given block numbers or timestamps and visa versa.

The following commands produce and manage datedblocks:

Tools
chifra whenfind block(s) based on date, blockNum, timestamp, or ‘special’

Datedblock data is made of the following data fields:

FieldDescriptionType
blockNumberthe number of the blockblknum
timestampthe Unix timestamp of the blocktimestamp
dateHuman readable version of timestampdate

Base types

This documentation mentions the following basic data types.

TypeDescriptionNotes
addressa 20-byte hexadecimal string starting with ‘0x’lowercase
blknuman alias for a uint64
boola value either true, false, 1, or 0
bytesan arbitrarily long string of bytes
datea JSON formatted dateas a string
gasan unsigned big numberas a string
hasha 32-byte hexadecimal string starting with ‘0x’lowercase
stringa normal character string
timestampa 64-bit unsigned integerUnix timestamp
uint32a 32-bit unsigned integer
uint64a 64-bit unsigned integer
uint8an alias for the boolean type
weian unsigned big numberas a string
Published on: May 2, 2022 Last edited: May 2, 2022

Edit this page on GitHub