Online Bitcoin Script simulator or debugger?

15

9

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

Geremia

Posted 2016-01-26T00:12:11.000

Reputation: 3 665

1

See good examples with oline compiler at https://curiosity-driven.org/bitcoin-contracts

Peter Krauss 2018-01-14T21:06:59.287

Answers

5

I know of these two:

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

morsecoder

Posted 2016-01-26T00:12:11.000

Reputation: 12 624

1

bitcoinIDE can be now run from https://siminchen.github.io/bitcoinIDE/build/editor.html

Walter K 2019-07-16T06:00:12.287

The first one is more what I was imagining. The second one seems very useful, too. thank youGeremia 2016-01-26T17:23:57.063

@StephenM347♦ First link throws 404 error...mosg 2016-11-23T07:36:55.690

4Unfortunately none of the above works anymore.nopara73 2017-06-05T09:16:12.417

1The second one is still working for memorsecoder 2017-06-05T11:55:53.687

I posted another answer with a new tool you may want to add here: https://bitcoin.stackexchange.com/a/84822/5841

Jason Dreyzehner 2019-02-22T20:44:51.767

6

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.

JBaczuk

Posted 2016-01-26T00:12:11.000

Reputation: 6 172

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

Samarth Hattangady

Posted 2016-01-26T00:12:11.000

Reputation: 238

1On 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 2017-09-30T10:31:12.887

2

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.

Jason Dreyzehner

Posted 2016-01-26T00:12:11.000

Reputation: 545

1

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.

Ohad Cohen

Posted 2016-01-26T00:12:11.000

Reputation: 119

I don't think checksig actually does anything in this projectJBaczuk 2018-08-06T15:06:25.847

I don't think it knows what the transaction is, and what transaction you spend so it can't check the signatureOhad Cohen 2018-09-20T20:37:17.723

1

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.

Ned Kelly

Posted 2016-01-26T00:12:11.000

Reputation: 11

0

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

Igor Barinov

Posted 2016-01-26T00:12:11.000

Reputation: 456

Yes, I saw that from the Bitcoin wiki page on Script, but it's a converter, not a debugger/simulator.

Geremia 2016-01-26T17:13:49.193