Parameters
- txidstringREQUIRED
The transaction id
- verboseboolean
default=false. If false, returns the serialized, hex-encoded data for 'txid'; if true, returns a JSON object. Bitcoin Core also accepts a numeric verbosity in this position: 0 for hex-encoded data, 1 for a JSON object, and 2 for a JSON object with fee and prevout information
- blockhashstring
The block in which to look for the transaction
Returns
- resultstring | object
Hex-encoded transaction when verbose is false, or a transaction JSON object when verbose is true
- txidstring
The transaction id
- hashstring
The transaction hash (differs from txid for witness transactions)
- versioninteger
The block version
- sizeinteger
The transaction size
- vsizeinteger
The virtual transaction size (differs from the size for witness transactions)
- weightinteger
The transaction's weight (between vsize4 - 3 and vsize4)
- locktimeinteger
The transaction locktime
- vinarray
A JSON array. Each element in the array serves as a transaction's input vector (vin).
- txidstring
(Optional) The transaction id of the output being spent (omitted for coinbase inputs)
- voutinteger
(Optional) The output number being spent (omitted for coinbase inputs)
- scriptSigobject
(Optional) The input's script signature (omitted for coinbase inputs)
- asmstring
The script signature in assembly form
- hexstring
The hex-encoded script signature
- coinbasestring
(Optional) Coinbase data hex (only present on coinbase inputs)
- txinwitnessarray
(Optional) Hex-encoded witness stack items (SegWit inputs)
- prevoutobject
(Optional) Spent output details (verbose level 2, or getblock verbosity 3)
- generatedboolean
Whether the spent output was coinbase
- heightinteger
Height of the block containing the spent output
- valuenumber
Value of the spent output in BTC
- scriptPubKeyobject
scriptPubKey of the spent output
- asmstring
The script public key in the form of string
- descstring
The inferred descriptor for the output
- hexstring
The hex of the script's public key in string format
- addressstring
The Bitcoin address
- typestring
The type of script, e.g. pubkeyhash, multisig
- sequenceinteger
The script sequence number
- voutarray
A JSON array containing tx information
- valuenumber
The value in BTC
- ninteger
The output index
- scriptPubKeyobject
A JSON object containing information about the PubKey script
- asmstring
The script public key in the form of string
- descstring
The inferred descriptor for the output
- hexstring
The hex of the script's public key in string format
- addressstring
The Bitcoin address
- typestring
The type of script, e.g. pubkeyhash, multisig
- feenumber
(Optional) Transaction fee in BTC (verbose level 2 only)
- hexstring
The serialized, hex-encoded data for 'txid'
- blockhashstring
The block hash
- confirmationsinteger
The number of confirmed transaction in the block
- timeinteger
Same as 'blocktime'
- blocktimeinteger
The block time expressed in UNIX epoch time
- in_active_chainboolean
(Optional) Whether specified block is in the active chain or not (only present with explicit 'blockhash' argument)
- errorobject | null
(Optional) JSON-RPC error when the request failed; omitted or null on success
- codeinteger
Error code
- messagestring
Error message
1{2"jsonrpc": "2.0",3"result": "01000000000101e17e03d21d051aa2bd9d336c3ac0693cfa92ce71592ceec521b1c48019ff77a101000000171600146d76e574b5f4825fe740ba6c41aaf1b319dfb80cffffffff02819a010000000000160014422002d927a1cae901eac668444cce8dd0ae60d529b31b0b0000000017a914f5b48d1130dc3d366d1eabf6783a552d1c8e08f4870247304402206701306a4750908fd48dead54331a3c7b4dce04ec10bfc6dd32049e2cff061a5022013c9d66827fabbeaadeb30b41c09aca2daddf4628cd00e3b993b1c86a12ff5190121034bcb9be1daf6ce1193774d15f863768b621bc95a363f1da5810129e961a2317400000000",4"id": 15}
1{2"jsonrpc": "2.0",3"result": "01000000000101e17e03d21d051aa2bd9d336c3ac0693cfa92ce71592ceec521b1c48019ff77a101000000171600146d76e574b5f4825fe740ba6c41aaf1b319dfb80cffffffff02819a010000000000160014422002d927a1cae901eac668444cce8dd0ae60d529b31b0b0000000017a914f5b48d1130dc3d366d1eabf6783a552d1c8e08f4870247304402206701306a4750908fd48dead54331a3c7b4dce04ec10bfc6dd32049e2cff061a5022013c9d66827fabbeaadeb30b41c09aca2daddf4628cd00e3b993b1c86a12ff5190121034bcb9be1daf6ce1193774d15f863768b621bc95a363f1da5810129e961a2317400000000",4"id": 15}