🟪 Polygon

Polygon API Documentation

debug_traceBlockByHash JSON-RPC Method

The debug_traceBlockByHash allows you to trace the execution of all transactions included in a specific block, identified by its hash, on the Polygon network.


Please note that you can use debug_traceBlockByHash with no extra fee 👉 here (opens in a new tab)


  • block hash - [required] - The hash of the block you trace

  • tracer object - [optional] - An object that defines the type of tracing that should be performed. If not provided, a default tracer will be used. :

    • The type of tracer - String - It might be callTracer or prestateTracer

      • callTracer - The calltracer keeps track of all call frames, including depth 0 calls, that are made during a transaction.

      • prestateTracer - The prestateTracer replays the transaction and tracks every part of state that occured during the transaction.

    • tracerConfig - The object to specify the configurations of the tracer

      • onlyTopCall - When set to true, this will only trace the top-level call and not any sub-calls. It eliminates the additional processing for each call frame.


callTracer response

type of the callType of the call
fromThe transaction sender.
toThe address of the transaction recipient.
gasThe gas included in the transaction by the sender.
transaction valueThe actual value per gas deducted from the sender's account.
gasUsedThe total used gas by the call. Encoded as hexadecimal.
inputThe optional input data sent with the transaction, usually used to interact with smart contracts.
outputThe return value of the call, encoded as a hexadecimal string.
errorAn error message in case the execution failed.
callsA list of sub-calls made by the contract during the call, each represented as a nested call frame object.
revertReasonThe reason why the transaction was reverted, returned by the smart contract if any.

prestateTracer response

  • smart contract address — The address of the smart contract associated with the result.

    • balance — The balance of the contract, expressed in wei and encoded as a hexadecimal string.

    • code — The bytecode of the contract, encoded as a hexadecimal string.

    • nonce — The nonce of the account associated with the contract, represented as an unsigned integer.

    • storage — A map of key-value pairs representing the storage slots of the contract. The keys and values are both encoded as hexadecimal strings.


POST https://<network>.chainnodes.org/YOUR-API-KEY

💡 Confusing?

Ask our experienced blockchain developers in Telegram


  • HTTPS POST Request with a JSON RPC call in the body
  • Replace YOUR-API-KEY with the API key from your CHAINNODES.ORG Dashboard
  • You can use a different supported network by replacing polygon-mainnet
curl https://polygon-mainnet.chainnodes.org/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"method":"debug_traceBlockByHash","params":["0x97b49e43632ac70c46b4003434058b18db0ad809617bd29f3448d46ca9085576", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}'


{"jsonrpc": "2.0",
    "id": 1,
    "result": [
            "result": {
                "from": "0x64bbde373e909501de1309231336761adeaa07d5",
                "gas": "0x4b26c",
                "gasUsed": "0x2a421",
                "to": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
                "calls": [
                        "from": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
                        "gas": "0x49451", 

Need RPC API keys?

Get 12.5M archival requests for free today.

debug_traceBlockByHash JSON-RPC Method Documentation by CHAINNODES