decodescript | Bitcoin

The decodescript method is used to decode a hex-encoded script, providing insights into its structure and purpose. This includes identifying the script type, associated addresses, and whether it is a segwit script.

👍

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • scriptHex (required): The hex-encoded script to decode.

Response

  • result — an object containing detailed information about the decoded script, including its type, related addresses, and segwit status.
  • error — an object containing an error message if an error occurred, otherwise null.
  • id — an integer representing the ID of the request.

Use case

The decodescript method is invaluable for developers and analysts working with Bitcoin scripts, providing a way to inspect and understand the functionality of arbitrary scripts without executing them.

Try the decodescript RPC method yourself

Language
Click Try It! to start a request and see the response here!