Ethereum Raw Data - An Overview
Source Content : Yahoo
How does anyone get this information?
The public blockchain records everything that happens on the Ethereum network. Every participating node contains raw data that can be queried to learn or answer questions about what is going on in the ecosystem.
Let's take a look at the data stores in an Ethereum node: global state, transactions, traces, logs, and mempool.
Ethereum Raw Data
Every participating node in Ethereum maintains a global state, which is continuously updated as new blocks are added to the blockchain.
The state contains
- ETH balances of all accounts.
- Smart contract code and data. For an NFT contract, the state could contain tokens and ownership information. For a DAO contract, it could be tokens, members, voting control, or treasury balance.
Since all the information is stored in the state, anyone can query the most recent state to learn the truth.
Any changes to the global state happen via transaction. Transactions are grouped into batches (generally referred to as "blocks") and then added to the blockchain.
Some of the common transactions types are
- ETH transfer between accounts.
- Deployment of a new smart contract. For example, Nike launches their own NFT.
- Smart contract state changes. For example, a user purchases an NFT token.
Traces capture detailed run time data of the transactions. During execution, a transaction may fail, call another contract, or transfer ETH. This activity is not recorded in the blockchain but can be seen in the traces.
Most nodes do not store traces by default because it increases storage costs and has an impact on node performance. However, it is critical data for understanding what is going on within the transaction that cannot be seen otherwise.
Some common scenarios for tracing are as follows:
- Learn more about transaction failures.
- Internal token transfers. A smart contract may airdrop its token to specific users.
- Internal Contract calls. A smart contract might call another contract to determine whether a user is eligible to claim tokens.
- Self destruct. A smart contract removes itself from blockchain and transfers balance to a specific account.
Logs are used to store data that is not required by the contract but must be accessed by other applications (UI notifications, analytics, oracles etc). Some uses for logs are
- Display notifications to the user about the transaction status.
- an NFT marketplace app that wants to display token ownership history can do so by searching logs for all transfer events involving the specific token.
Mempool contains transactions that are waiting to be added to the blockchain. Since each node can be configured differently, Mempool data may not be the same across all nodes. They are used for a variety of purposes, including
- Analysing pending transactions to adjust gas prices for new transactions.
- Front running a trade.
All of the blockchain data is public and can be accessed by anyone. Using the data points listed above, one can surface insights about what is going on in the blockchain network.
However, it is easier said than done due to
- Overhead in setting up and maintaining an Ethereum node.
- Data retrieval and transformation challenges.
Many data providers (TheGraph, Dune Analytics, and Flipside Crypto) are attempting to make blockchain data more accessible.
If you're interested in learning more about blockchain analytics, sign up to receive notifications about upcoming articles and projects.