Skip to main content

decoderawtransaction RPC Method

Decodes the raw transaction and provides chain information in the form of JSON.

Updated on
Oct 4, 2023

decoderawtransaction RPC Method

Parameters

hexstring
string
REQUIRED
The transaction hex string
iswitness
boolean
a "true" or "false" value that indicates whether the transaction hex is a serialized witness transaction

Returns

txid
The transaction id
hash
The transaction hash (differs from txid for witness transactions)
size
The transaction size
vsize
The virtual transaction size (differs from the size for witness transactions)
weight
The transaction's weight (between vsize*4 - 3 and vsize*4)
version
The block version
locktime
The transaction locktime
vin
A JSON array. Each element in the array serves as a transaction's input vector (vin).
txid
The transaction id
vout
The output number
scriptSig
The script's signature
asm
The script's public key in the form of a string
hex
The hex-encoded witness data
txinwitness
An array of JSON objects
hex
The hex-encoded witness data
sequence
The script sequence number
vout
A JSON array containing tx information
value
The value in BTC
n
The output index
scriptPubKey
A JSON object containing information about the PubKey script
asm
The script public key in the form of string
desc
The inferred descriptor for the output
hex
The hex of the script's public key in string format
address
The Bitcoin address
type
The type of script, e.g. pubkeyhash, multisig
Request
1
curl https://docs-demo.btc.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method": "decoderawtransaction", "params": ["0100000001eaefefbd1f687ef4e861804aed59ef05e743ea85f432cc146f325d759a026ce6010000006a4730440220718954e28983c875858b5a0094df4607ce2e7c6e9ffea47f3876792b01755c1202205e2adc7c32ff64aaef6d26045f96181e8741e560b6f3a8ef2f4ffd2892add656012103142355370728640592109c3d2bf5592020a6b9226303c8bc98ab2ebcadf057abffffffff02005a6202000000001976a914fe7e0711287688b33b9a5c239336c4700db34e6388ac10ca0f24010000001976a914af92ad98c7f77559f96430dfef2a6805b87b24f888ac00000000"]}'
5
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free