Getting your Trinity Audio player ready...
|
What a weekend! The Bitcoin SV DevCon was a whirlwind of valuable information, and nChain CTO Steve Shadders was the capable (if not perfect) master of ceremonies. However, this article is not to praise Shadders’ hosting abilities, but rather to take a look at what he calls “Steve’s Weekend Project.” Once or twice amid the pandemic, Shadders has mentioned that while he has been out of the office, he has been tinkering away at “something,” and last weekend, we got to see a forty minute demonstration with some valuable Q&A at the end.
To start the session, Shadders took the humble road, letting viewers know that his session just might become a live debugging exercise. He also hinted again (last that I recall was CoinGeek London 2020) at the huge opportunity that exists in becoming one of fewer than a hundred “Bitcoin script experts” in the world. While prefacing that he is a perfectionist, he let the audience know that he still needs to get a few important things hammered out for prime time, but knowing Shadders’ work ethic, and the world-class nChain dev team at his disposal, this “weekend project” could end up being a world-changing tool!
So what is it?
Looking relaxed, Shadders started by giving some background on Bitcoin script, saying it is analogous to an assembly language, and looks similar to virtual machine language. It’s very fast and efficient, and has similar parentage to military application languages because of the simplicity and speed that comes from such low level efficiency. Being a low-level language, it is also a good foundation for devs to build other things- namely, JavaScript which runs atop it nicely.
However, Bitcoin script is nasty to look at. In fact, he showed a giant block of code on screen: All in caps with uncommon spacing and “OP_” for every single command and no punctuation separators—simply brutal on the senses!
He continued with a brief segue explaining how bitcoin script is simple, but it needs a direct interpreter, and THAT has been his project—something in a similar vein to sCrypt which is a sort of abstraction of Bitcoin Script, but written in a way that looks and feels more like JavaScript. Lamenting why Satoshi made it this way, Shadders said he would ask Craig about it later—a good reason to watch the fireside chat that occurred later in the event!
The live demo
So, Satoshi wrote “OP_” essentially everywhere. It is very consistent and academic, but lacking in elegance. The Shadders interpreter was geared up, Steve deleted the “OP_” prefixes and pressed Go!
The scripts STILL RUN!
The next example was in greater detail. He showed an example of some OP prefixes being expressed as integers – cool! The next example started with the curiosity of Satoshi writing out OP_GREATERTHANOREQUAL, instead of “GTE” or “>=.”
With the Shadders interpreter, changing to either “GTE” or “>=” causes no issues. Eliminating all caps (what I like to call “bitcoin’s shouting OP_Codes”) also works! Shadders’ demonstration continued to go down the rabbit hole of simplification, minimization and optimization, and it was beautiful! Adding indentation and other visual formatting to help with reading, worked as well, and the design aesthetic of Shadders’ programming began to really take shape live on the screen.
Anything else?
The script debugging is still bad. Failures just fail with no explanation. Steve illustrated this live by breaking the script with OP_PICK before going into a brief explainer about development stacks. Working his way to the end of the session, Shadders explained the different ways of structuring operators and operands. He used an English-vs-Japanese written language example to clarify the practice to those who are not well-versed in coding. English uses the subject, verb, object structure, while Japanese uses subject, object, verb. Bitcoin script can be expressed in much the same way.
A phrase that stuck as a great summary was that bitcoin script is “demystefyable,” and it would seem that Steve is doing the dirty work of demystification for us. The Q&A session was largely boilerplate, but a highlight was Deggen asking when/if he could get his hands on the tools. Shadders gave a quick chuckle at the notion, and reminded everyone that he is a perfectionist, but that he should probably hand it off to an nChain dev team to tighten up the loose ends.
However, it was obvious that Steve is excited about the tools he has been working on, and just might take a few extra weekends to do the finishing touches himself!