/opscript

A viewer and debugger of Bitcoin scripts.

Primary LanguageGo

OP_SCRIPT

A viewer and debugger of Bitcoin scripts. Early development.

Screenshot

Features

  1. Can fetch transactions from:
    1. A Bitcoin node (requires a full node with txindex=1). Default.
    2. Blockstream.info JSON API. Use --blockstream flag.
  2. Automatically finds related output.
  3. Allows to navigate forward and backward.
  4. Shows stack per line of code.
  5. Shows opcodes information (hex code, input, output, and description).
  6. Supports witness data (SegWit).
  7. Uses btcd/txscript under the hood.

Usage

  1. go get github.com/Jeiwan/opscript
  2. opscript help
    Usage:
    opscript [flags] transactionHash:inputIndex
    opscript [command]
    
    Available Commands:
    buildspec
    help        Help about any command
    
    Flags:
        --blockstream        Use blockstream.info API to get transactions.
    -h, --help               help for opscript
        --node               Use Bitcoin node to get transactions (requires 'txindex=1'). (default true)
        --node-addr string   Bitcoin node address. (default "127.0.0.1:8332")
        --rpc-pass string    Bitcoin JSON-RPC password.
        --rpc-user string    Bitcoin JSON-RPC username.
    
    Use "opscript [command] --help" for more information about a command.

Key bindings

  • q – quit
  • / – navigate between lines of code

Examples

  • Using Blockstream.info API:
    opscript --blockstream 70fde4687efab8dae09737f87e30042030288fec42fd9e12f34c435cdeb7812c
  • Specifying input index:
    opscript --blockstream 70fde4687efab8dae09737f87e30042030288fec42fd9e12f34c435cdeb7812c:0
  • Using a Bitcoin node:
    opscript --rpc-user=woot --rpc-pass=woot 70fde4687efab8dae09737f87e30042030288fec42fd9e12f34c435cdeb7812c