23

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

1

10 Answers 10

4

I know of these two:

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

6
  • The first one is more what I was imagining. The second one seems very useful, too. thank you
    – Geremia
    Jan 26, 2016 at 17:23
  • @StephenM347♦ First link throws 404 error...
    – mosg
    Nov 23, 2016 at 7:36
  • 8
    Unfortunately none of the above works anymore.
    – nopara73
    Jun 5, 2017 at 9:16
  • 1
    The second one is still working for me
    – morsecoder
    Jun 5, 2017 at 11:55
  • 2
    bitcoinIDE can be now run from siminchen.github.io/bitcoinIDE/build/editor.html
    – Walter K
    Jul 16, 2019 at 6:00
10

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.
5

I've been looking for a tool to experiment with bitcoin script for a while now, and I finally finished developing one myself.

BitAuth IDE is an open source project for designing advanced scripts for bitcoin and bitcoin-like cryptocurrencies. It’s both a learning sandbox and a tool for designing new kinds of wallets.

It includes a live-updating, interactive, line-by-line debugger, which visualizes that state of the stack over the entire execution of the program. There's also an entity and variable system for automatically generating private keys, public keys, and correct signatures across locking and unlocking scripts.

See here for a more detailed tour and a video walkthrough.

You can use the online demo of BitAuth IDE.

And the source is on GitHub.

I've also assembled a much longer Bitcoin Script Reading List, which you might find useful. It includes links to several more related tools and script testing environments.

3

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.

3
  • I don't think checksig actually does anything in this project
    – JBaczuk
    Aug 6, 2018 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, 2018 at 20:37
  • The UI is great, but basic script functionality seems broken, e.g. OP_NOTIF didn't work. Jan 16, 2021 at 19:38
2

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

1
  • 1
    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. Sep 30, 2017 at 10:31
2

I have a tool at http://www.bowmain.co.uk/BSV/ which may be use. Let me know what you think as I can make changes to it.

1
  • When would you release a mac version
    – Baryon Lee
    Jul 13, 2020 at 8:29
1

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

1
0

Online script IDE for Bitcoin and Liquid: https://scriptwiz.app/

1
  • Hi Burak, we're looking for long answers that explain why they're right. Link-only answers can quickly become obsolete when the page they link to stops serving the content, for example when it moves elsewhere or changes their internal structure. If this link does provide a tool that satisfies Geremia's request, please add more information to substantiate this.
    – Murch
    Sep 15, 2021 at 11:23
0

Besides the Bitcoin Script editor you'll probably need an ECDSA generator.

Here's a simple online tool to create priv/pub key-pairs and sign with them using the Bitcoin Curve (secp256k1) https://kjur.github.io/jsrsasign/sample/sample-ecdsa.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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