Briefly: What is Bitcoin Script?

Bitcoin Script is the programming language used in bitcoin transactions.

It’s a stack-based language, and it’s used to describe the authentication requirements for some funds to be spent. This description is called a locking script, or more commonly a bitcoin address.

When you send money, you’re actually re-assigning the funds to whomever can authenticate for that address. Many users use a single key to hold their bitcoin, but it’s possible to create much more secure kinds of addresses.

For a detailed introduction to Bitcoin Script, and a basic walkthrough of Bitauth IDE, check out this video.

You can also read more about Bitcoin Script on the bitcoin.it Wiki. Below I describe in more detail the components of the project.

BTL in 2 Minutes

Bitauth Templating Language (BTL) is a very simple templating language for Bitcoin Script. If you have seen a disassembled bitcoin script, it may look familiar:

OP_DUP OP_HASH160 <pubkeyhash> OP_EQUALVERIFY OP_CHECKSIG

This is a disassembled view of a script (a P2PKH locking script) copied from the bitcoin.it Wiki. It’s in a common format used for describing script constructions. It’s actually valid BTL:

In BTL, this is interpreted as two operations ( OP_DUP OP_HASH160 ), a Push of the variable pubkeyhash , and two final operations ( OP_EQUALVERIFY OP_CHECKSIG ).

BTL makes the convention of surrounding data pushes with the characters, < and > , a core part of the language. This goes one step further:

This example (a P2SH locking script), shows the other core element of the language: an internal Evaluation. At compile time, the script inside of the $( and ) is first evaluated by the virtual machine, and the top stack item in the result is used in its place (like bash Command Substitution). This example results in the following valid P2SH script:

OP_HASH160 OP_PUSHBYTES_20 0x70fa88150dd44dddc81bfc988bbb27b4aab5b23d OP_EQUAL