decodescript

Decode a hex-encoded script.

Arguments:

  1. "hexstring" (string) the hex encoded script

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":"decodescript","params":["3045022100841503366177939ab60e53df8d77cd6f7de40241e52192011c34db09542c40d3022063ffd94b93be3066023b2f8bd97a994c2ca6ad5cfa43b07414230112529d7c6901"]}'

Response

{
  "result": {
    "asm": "45022100841503366177939ab60e53df8d77cd6f7de40241e52192011c34db09542c40d3022063ffd94b93be3066023b [error]",
    "type": "nonstandard",
    "p2sh": "3EGonyazy77KwEYVt7s81bPVBHj9vBueKv",
    "segwit": {
      "asm": "0 a024b26a934feb48d1a6ac9f0f47fd61bb33de1b2eef710062eba0c1a1cf07ff",
      "hex": "0020a024b26a934feb48d1a6ac9f0f47fd61bb33de1b2eef710062eba0c1a1cf07ff",
      "reqSigs": 1,
      "type": "witness_v0_scripthash",
      "addresses": [
        "bc1q5qjty65nfl4535dx4j0s73lavxan8hsm9mhhzqrzawsvrgw0qllsk0q0ew"
      ],
      "p2sh-segwit": "353KSfSA7ootWvYhDh1HmcNrwSsFaDfgBZ"
    }
  },
  "error": null,
  "id": 1
}