For the complete documentation index, see llms.txt. This page is also available as Markdown.

getrawtransaction - Zcash

Example code for the getrawtransaction JSON-RPC method. Сomplete guide on how to use the getrawtransaction JSON-RPC method in GetBlock.io Web3 documentation.

This method returns transaction data by txid. Verbosity 0 returns the raw serialized hex-encoded transaction bytes; verbosity 1 returns a decoded JSON object with all transaction fields, including transparent inputs/outputs and shielded pool data. Note that shielded transaction details are limited to what's on-chain — the actual amounts and recipients of shielded transactions are hidden by design.

Parameters

Parameter
Type
Required
Description

txid

string

Yes

32-byte transaction ID (hex-encoded)

verbose

integer

No

0 = raw hex, 1 = decoded JSON. Default 0

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getrawtransaction",
    "params": [
        "9c8f0e4f8d2e7c6b5a4f3e2d1c0b9a8e7f6d5c4b3a2b1c9d8e7f6a5b4c3d2e1f",
        1
    ],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'getrawtransaction',
    params: [
        "9c8f0e4f8d2e7c6b5a4f3e2d1c0b9a8e7f6d5c4b3a2b1c9d8e7f6a5b4c3d2e1f",
        1
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

Response

Response Parameters

Parameter
Type
Description

hex

string

Serialized transaction bytes, hex-encoded

txid

string

Transaction ID

authdigest

string

Authorization digest (post-NU5, ZIP 244)

size

integer

Serialized transaction size in bytes

overwintered

boolean

Whether this is an Overwintered (post-Sapling) transaction

version

integer

Transaction version

versiongroupid

string

Version group identifier

locktime

integer

Transaction locktime

expiryheight

integer

Height at which the transaction expires (0 = no expiry)

vin

array of object

Transparent inputs

vout

array of object

Transparent outputs

vShieldedSpend

array of object

Sapling shielded spends (empty for non-Sapling transactions)

vShieldedOutput

array of object

Sapling shielded outputs (empty for non-Sapling transactions)

orchard.actions

array of object

Orchard actions (empty for non-Orchard transactions)

orchard.valueBalance

number

Net Orchard value balance in ZEC

orchard.flags

object

Orchard action flags (enableSpends, enableOutputs)

bindingSig

string

Sapling binding signature

blockhash

string

Hash of the block containing this transaction

confirmations

integer

Number of confirmations

time

integer

Unix timestamp of the containing block

blocktime

integer

Same as time

Use Cases

  • Explorer Transaction Detail: Full transaction data for an explorer's transaction detail page

  • Wallet Post-Submit Verification: Poll after sendrawtransaction to confirm inclusion and read final block placement

  • Shielded Transaction Analysis: Detect Sapling vs Orchard usage patterns by inspecting vShieldedSpend/vShieldedOutput vs orchard.actions

  • Transparent-Pool Analytics: Iterate vin and vout to track transparent-pool flows for compliance or research

Error Handling

Error Code
Message
Description

-5

No information available about transaction

Transaction ID not found in the chain or mempool

-32602

Invalid params

Transaction ID is malformed or verbose parameter is invalid

-32603

Internal error

Node failed to retrieve transaction data

Was this helpful?