Is there an online simulator that would allow me to step through, debug, or simulate the execution of a Bitcoin script?

up vote 7 down vote accepted

I know of these two:

The second one in particular I have found to be very useful.

  • The first one is more what I was imagining. The second one seems very useful, too. thank you – Geremia Jan 26 '16 at 17:23
  • @StephenM347♦ First link throws 404 error... – mosg Nov 23 '16 at 7:36
  • 1
    Unfortunately none of the above works anymore. – nopara73 Jun 5 '17 at 9:16
  • 1
    The second one is still working for me – StephenM347 Jun 5 '17 at 11:55

have a look at BitcoinIDE (on github.io, working as of Apr 2018)

p,s:

as @Samarth Hattangady mentioned, the source code can be found at this repo if you want to run it locally.

  • I don't think checksig actually does anything in this project – JBaczuk Aug 6 at 15:06
  • I don't think it knows what the transaction is, and what transaction you spend so it can't check the signature – Ohad Cohen Sep 20 at 20:37

Highly recommend btcdeb by kallewoof. Among other things, you can step through scripts including verify signatures. It is written in c++ and compiles using autotools.

btcdeb

Bitcoin Script debugging utilities.

This is a set of tools used to debug or construct scripts for use in Bitcoin.

enter image description here

btcdeb> help
step     Execute one instruction and iterate in the script.
rewind   Go back in time one instruction.
stack    Print stack content.
altstack Print altstack content.
vfexec   Print vfexec content.
exec     Execute command.
tf       Transform a value using a given function.
print    Print script.
help     Show help information.

The github repository for the first link posted by StephenM347 can be found here

If you want to run it locally, clone the repo and then,

  1. cd into /path/to/bitcoinIDE/build
  2. Launch a server from here. This will launch a server on port 8000.

    python -m SimpleHTTPServer 8000
    
  3. From the browser, visit localhost:8000, and select the file editor.html

  • On playing with this a lot, there seem to be some bugs. I was trying to solve a pay to pubkey hash script, and it didn't seem able to load larger items onto the stack (the sig and pubkey, and they seemed to just get rounded off instead) and thus the OP_HASH160 function didn't give the desired results. – Samarth Hattangady Sep 30 '17 at 10:31

There is a "Script Playground": http://www.crmarsh.com/script-playground/

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.