decoderawtransaction

Return a JSON object representing the serialized, hex-encoded transaction.

Arguments:

  1. "hexstring" (string, required) The transaction hex string
  2. iswitness (boolean, optional) Whether the transaction hex is a serialized witness transaction
    If iswitness is not present, heuristic tests will be used in decoding

Request

curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
    -X POST \
    -H 'x-amberdata-blockchain-id: bitcoin-mainnet' \
    -d '{"jsonrpc":"2.0","id":1,"method":"decoderawtransaction","params":["02000000000101a850a28d65....682e90120900"]}'

Response

{
  "result": {
    "txid": "6b029135dcbff2c9bba177b3875542c1a5d0c8ffa6f889658b14ff9d97487b0a",
    "hash": "b83f126afb106885d60c4cf0bf59bd11276ed1ddd3e024fd389c895f6446597b",
    "version": 2,
    "size": 249,
    "vsize": 168,
    "weight": 669,
    "locktime": 0,
    "vin": [{
      "txid": "34ae66b0f51c9cd4bf667b99301a073e0233ff66da43607e2b214653106aea24",
      "vout": 1,
      "scriptSig": {
        "asm": "0014ace8b2a4231527c2901f544deac0f3178a23bc1a",
        "hex": "160014ace8b2a4231527c2901f544deac0f3178a23bc1a"
      },
      "txinwitness": [
        "304402207ac235915ec0e199c8e3e7af1d6f1e4dcde9e6d2856447f84e70a8a778a36dbd022051d6ce9f4f643a6c89a3efd445d9d61db8cabe53c323465def66edfa21b5e47201",
        "02acea3ff9d52e4dee60b03c0b933aed9d1a7aedc50ca41c6468f6237a38cf6e27"
      ],
      "sequence": 4294967295
    }],
    "vout": [{
        "value": 0.33874,
        "n": 0,
        "scriptPubKey": {
          "asm": "OP_DUP OP_HASH160 5a6a6e57d026f8421ef823d8bcae0807d2205d26 OP_EQUALVERIFY OP_CHECKSIG",
          "hex": "76a9145a6a6e57d026f8421ef823d8bcae0807d2205d2688ac",
          "reqSigs": 1,
          "type": "pubkeyhash",
          "addresses": [
            "19F5KDtN81LGfmMU7ZvCN7kYsMCPvZnccd"
          ]
        }
      },
      {
        "value": 0.859448,
        "n": 1,
        "scriptPubKey": {
          "asm": "OP_HASH160 f7deab017a95f24a46981d10ab8d46e7c3dd313b OP_EQUAL",
          "hex": "a914f7deab017a95f24a46981d10ab8d46e7c3dd313b87",
          "reqSigs": 1,
          "type": "scripthash",
          "addresses": [
            "3QHdaAmDZxac19PyEKP2LnbpyaG4o8okvb"
          ]
        }
      }
    ]
  },
  "error": null,
  "id": 1
}