# bsv_decodeTransaction

Decodes and analyzes Bitcoin SV transactions to provide detailed insights. This powerful tool accepts either a transaction ID or raw transaction data and returns comprehensive information including inputs, outputs, fee calculations, script details, and blockchain context. Supports both hex and base64 encoded transactions and automatically fetches additional on-chain data when available.

## Result

Decoded transaction data as JSON text, or an error.

## Permissions

No spending approval is requested by this handler. Public network lookups can still fail or require a compatible service.

## Definition 1 (full)

Registered in: Before wallet setup; Legacy local wallet; Legacy local identity; Local Vault · broadcasting disabled; Local Vault · all roles; Local Vault · payment role only; Project · payments scope; External BRC-100 wallet; Local Vault + sponsor; Droplit wallet.

Decodes and analyzes Bitcoin SV transactions to provide detailed insights. This powerful tool accepts either a transaction ID or raw transaction data and returns comprehensive information including inputs, outputs, fee calculations, script details, and blockchain context. Supports both hex and base64 encoded transactions and automatically fetches additional on-chain data when available.

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| tx | string | Yes | Transaction data or txid |  |
| encoding | "hex" \| "base64" | No | Encoding of the input data | default: "hex" |

Nested requirements apply when their parent is supplied.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "tx": {
      "type": "string",
      "description": "Transaction data or txid"
    },
    "encoding": {
      "default": "hex",
      "description": "Encoding of the input data",
      "type": "string",
      "enum": [
        "hex",
        "base64"
      ]
    }
  },
  "required": [
    "tx"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```

[All tools](https://bsvmcp.com/docs/tools)