How to Decode Ethereum Transactions and Events

Chainlens Blockchain Explorer provides support for decoding smart contract transactions and events on EVM networks and appchains.

This means that for most smart contracts, when you view on-chain activity associated with them, instead of seeing cryptic hexadecimal such as 0x23b872dd you will instead see the translated human readable value transferFrom.

Raw data toggle on Chainlens Blockchain Explorer
Toggling between raw and decoded data on Chainlens

This greatly simplifies interpreting on-chain activity, as the human-readable values communicate the intent of the code.

Ethereum's Smart Contract ABI

This issue exists with the Ethereum Virtual Machine (EVM) as smart contracts are deployed in a compiled bytecode format, which is not human-readable, but is interpretable by the EVM.

The values you see in smart contract transactions are hexadecimal encoded values. They adhere to Ethereum's Smart Contract Application Binary Interface (ABI) specification. You can find further details on Ethereum's Smart Contract ABI in the Solidity documentation.

ABI files are produced when smart contracts are compiled into binary format, but they are not deployed to the blockchain when the contract bytecode is. Hence this information needs to be stored separately, which is where services like Sourcify help (see below).

How Chainlens Decodes Blockchain Data

In Chainlens, there are two primary sources used to gather this information.

  1. The Sourcify Service
  2. 4bytes database

Solidity Contract Verification with Sourcify

Sourcify is the smart contract verification service for Ethereum. Users upload Solidity smart contract source code to Sourcify for deployed smart contracts on Ethereum networks. Sourcify verifies that the deployed contract matches the source.

Sourcify.eth Logo

We wrote previously about how Sourcify and contract verification works in more depth in our recent article Solving Source Code Verification in Ethereum.

The Ethereum Signature Database

For smart contracts that are not present in Sourcify or cannot be verified as the source code has not been made available, we have the Ethereum Signature Database.

Ethereum Signature Database

The Ethereum Signature Database is also known as the 4bytes project. It was created by the Ethereum Foundation and provides a repository of method and event signatures and their associated hexadecimal representation.

By using Sourcify with the Ethereum Signature Database, Chainlens can decode method and event information. This works for most on-chain interactions with smart contracts.

Who Benefits from Decoded Data?

Using decoded data is beneficial for Chainlens Blockchain Explorer users as it results in a far less cryptic experience. This is especially important for those less familiar with web3 technology.

It is also helpful for developers who typically use Sourcify as part of their development workflows. This makes sure that the information they want to see is available for their DApps.

Finally it benefits blockchain network operators who better understand the type of activity taking place on the network.

Decoded Blockchain Data on Chainlens
Decoded Blockchain Data on Chainlens

Viewing Raw Data

Whilst the majority of users want to view decoded data all of the time, there are occasions where users may want to view the raw, undecoded transaction or event signatures. This is often the case for developers who want to search for these signatures in log files to help them debug or trace activity in their DApps.

To facilitate this, you can toggle between the decoded and raw signatures using the switch in the transaction and event views on Chainlens.

The raw blockchain data toggle switch in Chainlens
The raw blockchain data toggle switch

See It In Action

Decoded data is now available in all hosted deployments of Chainlens Blockchain Explorer. If you'd like to try it out for yourself you can use one of our hosted Chainlens instances, such as the publicly available Linea or Palm instances.

If you'd like to see how Chainlens can cater for your blockchain network and decode transaction data, reach out to our team to learn more.

News & Insights