zks_getBytecodeByHash | zkSync Era

The zks_getBytecodeByHash API method provides the functionality to retrieve the bytecode of a transaction given its hash. This is particularly useful for developers and applications that require inspection or verification of the transaction's bytecode for analysis, security audits, or integration purposes within the zkSync network.


Get your own node endpoint today

Start for free and elevate your app to production levels immediately. No credit card required.

Sign up with your GitHub, X, Google, or Microsoft account for immediate access.


  • hash — a H256 string representing the hash of the transaction whose bytecode is being requested. This hash acts as a unique identifier for transactions within the zkSync network.


The response returns the bytecode of the specified transaction as an array of bytes:

  • result — the bytecode is returned as an array, with each element representing a byte.

Use case

For a blockchain analytics platform, understanding the bytecode of transactions can be crucial for analyzing contract interactions, detecting anomalies, or verifying contract logic on the zkSync network. The zks_getBytecodeByHash method enables such platforms to fetch transaction bytecode dynamically, providing a powerful tool for in-depth blockchain analysis.

Try the zks_getBytecodeByHash RPC method yourself

Click Try It! to start a request and see the response here!