developer.bitcoin.org icon indicating copy to clipboard operation
developer.bitcoin.org copied to clipboard

Some sort of Bitcoin Script guide + "playground"

Open Cobra-Bitcoin opened this issue 6 years ago • 2 comments

I think it would be good to have a thorough documentation and guide on Script somewhere on the developer documentation as its own separate category.

Explaining Script would be pretty trivial, as the language itself is pretty simple. But I think we could make things even better by having some sort of interactive "Bitcoin Script playground", with a Script interpreter, and the reader being guided through with simple challenges and examples. There's something about the instant feedback that a playground can provide that would be helpful to a lot of people. I know lots of people use https://www.tryhaskell.org/ to play with Haskell in a similar way.

I'm thinking we can make this more of a process. We can first start writing a decent guide, and then make a design for the playground (how do we blend it into the guide? we obviously want the stack behaviour clearly animated right?), and just go from there. The hardest thing will be the design and UX, because we need to present it right, and make it easy to use. I really believe we should have some challenges, to encourage developers to actually come up with creative ways to use Script to solve actual problems.

Does anyone know of a good bug compatible Script interpreter written in JS? I don't trust the quality of JS projects much, so when I see libraries, I'm generally going to assume there's a ton of subtle bugs. This seems more like the kind of thing where we really don't want any bugs, except to be compatible with existing behavior on the network. I'm hoping someone has a interpreter they can strongly recommend that we can look into.

I could write the guide, but for the other stuff, Web / Javascript development really isn't my strong suit. I wonder if we can find an experienced JS developer with Bitcoin knowledge to help out with this, in exchange for a significant bounty or something. A lot of good can come out of a more interactive approach to educating people about Bitcoin internals.

Cobra-Bitcoin avatar Jun 21 '18 00:06 Cobra-Bitcoin

I've recently stumbled upon Bitcoin IDE, it seems that it could fit the "playground" part of your suggestion, it even includes a visual representation of the execution stack which can really help beginners understand the order of execution of instructions. It's also open-source and on Github.

TheRec avatar Jun 21 '18 01:06 TheRec

I would like to give it a try if we turn this issue into a bounty 😄

zheli avatar Mar 31 '19 15:03 zheli