---
title: "Decode a transaction"
method: POST
path: "/{blockchain_id}/decode"
---

# Decode a transaction

`POST /{blockchain_id}/decode`

Returns the raw json of the decoded transaction

## Request body

- ApiTxDecodeRequest
  - `tx` string, required — The encoded transaction to be decoded.

## Response `200`

OK

- union
  - ApiTxDecodeResponseEVM
    - `chain_id` string — The chain ID.
    - `type` string — The type of transaction.
    - `to` string, required — The recipient of the transaction.
    - `from` string — The sender of the transaction.
    - `value` integer — The amount you wish to transfer.
    - `gas` integer — Gas of transaction. If omitted, the gas will be estimated using eth_estimateGas.
    - `maxPriorityFeePerGas` integer — The max priority fee per gas. Also referred to as the miner tip. When omitted an estimate will be used.
    - `maxFeePerGas` integer — The max fee per gas, this includes the base fee and max priority fee per gas. When omitted an esitmate will be used.
    - `nonce` integer — The account Nonce.
    - `decoded_data` object — An unlimited size byte array specifying the input data of the message call
    - `v` string — This is a signature component. This is the recovery id.
    - `r` string — This is an ECDSA signature component.
    - `s` string — This is an ECDSA signature component.
    - `public_key` string — This is the public key of the signer of the transaction.
    - `hash` string — The hash of the transaction.
    - `data` string — The encoded input data of the transaction.
    - `method_hash` string — This is the method signature of the contract call. It is the first 4 bytes of the input data.
    - `method_signature` string — The method name called.
    - `full_method_signature` string — The entire method signature including named params.
  - ApiTxDecodedBTC
    - `from` ApiTxSourceDecodedBTC[], required — The source UTXOs.
      - `tx_id` string, required — UTXO's transaction ID
      - `index` integer, required — UTXO's index in source transaction
      - `script_sig_hex` string — Hex encoded tx input's script data field
      - `tx_witness` string[] — Tx input's witness data
      - `value` integer, required — Amount of previous output used in input
      - `address` string, required — Address that owns previous output used in input
    - `to` ApiTxDestinationDecodedBTC[], required — The recipient of the transaction.
      - `destination` string, required — The destination address.
      - `value` integer, required — The amount you wish to transfer, in sats.
      - `script_pub_key` ApiScriptPubKeyBTC
        - `hex` string, required — Script pub key's hex encoded data
        - `type` 'nonstandard' | 'pubkey' | 'pubkeyhash' | 'witness_v0_keyhash' | 'scripthash' | 'witness_v0_scripthash' | 'multisig' | 'nulldata' | 'witness_v1_taproot' | 'witness_unknown', required — Script type
  - ApiTxDecodeResponseTron
    - `tx_id` string, required — Transaction ID
    - `signature` string[] — Transaction signatures
    - `raw_data_hex` string, required — The hex encoded protobuf unsigned transaction.
    - `raw_data` TronRawDataTx, required
      - `contract` TronTxContractData[], required
        - `type` string, required — Type of the contract
        - `parameter` TronContractParameter, required
          - `type_url` string, required — Protobuf type of contract data
          - `value` object, required — Contract call data of transaction
      - `ref_block_bytes` string, required — The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes
      - `ref_block_hash` string, required — The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes
      - `expiration` integer, required — Transaction expiration time, beyond which the transaction will no longer be packed
      - `timestamp` integer, required — Transaction timestamp, set as the transaction creation time
      - `fee_limit` integer — The maximum energy cost allowed for the execution of smart contract transactions
  - ApiTxDecodeResponseStellar
    - `envelope` StellarEnvelope
      - `v1` StellarV1, required
        - `tx` StellarTx, required
          - `source_account` StellarAccount, required
            - `ed25519` string, required — The ed25519 account address.
          - `fee` integer, required
          - `seq_num` integer, required
          - `cond` StellarPreconditions
            - `time_bounds` StellarTimeBounds
              - …
          - `memo` StellarMemo
            - `hash` string — The hash memo.
            - `text` string — The text memo.
            - `id` integer — The id memo.
          - `operations` StellarOperations[], required
            - `source_account` StellarAccount
              - …
            - `body` StellarBody, required
              - …
        - `signatures` StellarSignatures[]
          - `signature` string — The base64 encoded signature.
          - `hint` string — The base64 encoded 4-byte signature hint.
  - ApiTxDecodeResponseSolana — Decoded Solana Transaction. Currently only supports decoding System and Compute-Budget Instructions.
    - `message` SolanaMessage
      - `version` string — The version of the transaction, legacy or v0.
      - `recent_block_hash` string — The recent block hash of the transaction.
      - `account_keys` string[]
      - `header` SolanaHeader
        - `num_required_signatures` integer — Number of required signatures
        - `num_readonly_signed_accounts` integer — Number of read-only signed accounts
        - `num_readonly_unsigned_accounts` integer — Number of read-only unsigned accounts
      - `instructions` SolanaInstructions
        - `programs` SolanaProgram[]
          - `instruction` SolanaInstruction
            - `name` string — Instruction name
            - `accounts` SolanaAccount[]
              - …
            - `params` SolanaParams — A map of the parameters passed in the instruction
          - `name` string — Program name
    - `signatures` string[]
  - ApiTxDecodeResponseNear — Decoded Near transaction in human-readable format.
    - `transaction` ApiTxDecodedResponseNearTransaction, required
      - `signer_id` string, required
      - `public_key` string, required
      - `nonce_for_public_key` number, required
      - `receiver_id` string, required
      - `block_hash` string, required
      - `actions` object[], required
    - `signature` string

## Other responses

- `401` — Invalid or expired token
- `429` — Rate limit exceeded
- `500` — An internal server error happened
- `501` — The request endpoint is not implemented
- `503` — The resource you are trying to access is currently unavailable

---

[API](https://skmtc.net/blockdaemon/apis/staking-api.md) · [All operations](https://skmtc.net/blockdaemon/apis/staking-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blockdaemon/staking-api/versions/f94e296a08a3/schema)
