> ## Documentation Index
> Fetch the complete documentation index at: https://chainstack-docs-polygon-erigon-trace-deprecation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# zks_getBytecodeByHash | zkSync Era

> The zks_getBytecodeByHash API method provides the functionality to retrieve the bytecode of a transaction given its hash. On 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.

## Parameters

* `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.

## Response

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.


## OpenAPI

````yaml openapi/zksync_node_api/zks_getBytecodeByHash.json POST /afb8312f3710a5bc469f4c87cad3a2e4
openapi: 3.0.0
info:
  title: JSON-RPC API
  version: 1.0.0
servers:
  - url: https://nd-995-911-243.p2pify.com
security: []
paths:
  /afb8312f3710a5bc469f4c87cad3a2e4:
    post:
      summary: zks_getBytecodeByHash | zkSync Era
      operationId: zks_getBytecodeByHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForBytecodeByHash'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForBytecodeByHash'
components:
  schemas:
    JsonRpcRequestForBytecodeByHash:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getBytecodeByHash
          default: zks_getBytecodeByHash
        params:
          type: array
          default:
            - '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
          items:
            type: string
            example: '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
            default: '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
    JsonRpcResponseForBytecodeByHash:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: string
          description: The bytecode of the transaction.

````