Working with On-Chain Data
In Chapter 1, we learned about the fundamental concepts of a blockchain. We discovered that a blockchain is a distributed ledger composed of a chain of blocks, where each block is cryptographically linked to the previous one. Each block contains transaction information and the hash of the preceding block. Additionally, transactions can modify state data in Ethereum Virtual Machine (EVM)-based chains.
On-chain data represents the trace left by each transaction within the blockchain. It is stored as byte data, which requires parsing in order to become human-readable. To illustrate this follows a fragment of the Bitcoin genesis block in its raw format, sourced from https://wiki.bitcoinsv.io/index.php/Genesis_block (license: CC BY 3.0):
00000000 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 00000080 01 04 45 54 68 65 20 54 69 6D 65 73 20 30 33 2F ..Ethe Times 03/ 00000090 4A 61...