# Decoderawtransaction

## decoderawtransaction

> Decodes a raw hex-encoded Bitcoin transaction and returns a JSON object with readable fields.\
> Useful for viewing the contents of raw transactions before broadcasting.<br>

```json
{"openapi":"3.0.0","info":{"title":"BlockBook RES-API","version":"1.0.0"},"servers":[{"url":"https://firo.nownodes.io"}],"security":[{"api-keyAuth":[]}],"components":{"securitySchemes":{"api-keyAuth":{"type":"apiKey","in":"header","name":"api-key"}},"schemas":{"DecodeRawTransactionRequest":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string"},"id":{"type":"string"},"method":{"type":"string","enum":["decoderawtransaction"]},"params":{"type":"array","minItems":1,"maxItems":1,"description":"Parameters:\n1. `hexstring` (string, required) — The raw transaction hex string.\n","items":{"type":"string"}}}},"DecodeRawTransactionResponse":{"type":"object","properties":{"result":{"type":"object","description":"Decoded transaction","properties":{"txid":{"type":"string","description":"Transaction ID"},"hash":{"type":"string","description":"Witness hash of the transaction"},"version":{"type":"integer","description":"Transaction version"},"size":{"type":"integer","description":"Serialized size in bytes"},"vsize":{"type":"integer","description":"Virtual size (for segwit)"},"locktime":{"type":"integer","description":"Locktime"},"vin":{"type":"array","description":"List of inputs","items":{"type":"object","properties":{"txid":{"type":"string"},"vout":{"type":"integer"},"scriptSig":{"type":"object","properties":{"asm":{"type":"string"},"hex":{"type":"string"}}},"txinwitness":{"type":"array","items":{"type":"string"},"nullable":true},"sequence":{"type":"integer"}}}},"vout":{"type":"array","description":"List of outputs","items":{"type":"object","properties":{"value":{"type":"number","format":"float","description":"Amount in BTC"},"n":{"type":"integer","description":"Index of the output"},"scriptPubKey":{"type":"object","properties":{"asm":{"type":"string"},"hex":{"type":"string"},"type":{"type":"string"},"reqSigs":{"type":"integer","nullable":true},"addresses":{"type":"array","items":{"type":"string"},"nullable":true}}}}}}}},"error":{"type":"object","nullable":true,"description":"Null if successful; otherwise contains error info"},"id":{"type":"string","description":"Request identifier"}}}}},"paths":{"/":{"post":{"tags":["decoderawtransaction"],"summary":"decoderawtransaction","description":"Decodes a raw hex-encoded Bitcoin transaction and returns a JSON object with readable fields.\nUseful for viewing the contents of raw transactions before broadcasting.\n","operationId":"decoderawtransaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeRawTransactionRequest"}}}},"responses":{"200":{"description":"Transaction decoded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecodeRawTransactionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```
