What is Tapscript? How Will it Benefit Bitcoin?
Interdax logo with dark blue background
What is Tapscript? How Will it Benefit Bitcoin?

By Interdax | interdax | 19 Mar 2020


In the final part of our series on BIPs 340–342, we’ll look at what Tapscript is and highlight the advantages of the proposal.

Read the first two articles in our series on BIPs 340–342, on Schnorr and Taproot.

We’ll also look at how Bitcoin Improvement Protocols (or BIPs) are activated to implement upgrades into Bitcoin.

Tapscript (BIP 342)

The third part of the proposal, BIP 342, describes an upgrade that complements both Schnorr and Taproot, known as Tapscript. As explained in our first part on Schnorr/Taproot/Tapscript, Bitcoin Script is used to define the spending policies of coins.

BIP 342 improves signature hashing so we can validate taproot scripts, introduces flexibility to add new opcodes to enhance Bitcoin’s smart contract capability, and also changes some limits for resource requirements.

What is an Opcode?

Opcodes, short for operation codes, are basically script words or commands. These commands can return either “TRUE” or “FALSE”, and are used to send/receive transactions successfully.

For example, the instructions specify the number of signatures required to unlock the script. They also indicate the amount of bitcoin that is sent, along with the recipient’s address.

Opcodes can be used to remove items and perform calculations, where the result is added back onto the stack. Remember, as a stack-based programming language, Script commands are executed sequentially, starting from the top of the stack and finishing at the bottom.

What is Tapscript?

As an upgraded version of Bitcoin’s programming language (Script), Tapscript enables easier addition of new features and builds on the batch verifiability of Schnorr signatures.

What is batch verification? Find out in our first part on Schnorr/Taproot/Tapscript here.

Tapscript also complements the improvements to Bitcoin’s script structure proposed in BIP 341 (Taproot) — which requires certain opcodes to change, and BIP 342 concerns itself with the changes that need to happen.

Another way of understanding Tapscript is by considering the Merkle tree of Taproot, where every leaf is a script that is combined with what is called a leaf version — similar to script versioning with SegWit.

But the difference is that the scripts aren’t revealed at payment time, only at spending time. Different leaves can have different versions, where only the one that is actually used is revealed. Tapscript is the proposed version 0 of the leaf version under Taproot.

 

Read more here:

https://medium.com/interdax/what-is-tapscript-and-how-will-it-benefit-bitcoin-96fbb43a7169?source=friends_link&sk=f082c3e09d3c4e41a5f8fdccc417b40a


Interdax
Interdax

The First Competitive Crypto Trading Platform: https://www.interdax.com


interdax
interdax

The first competitive crypto trading platform. Trade crypto derivatives with up to 100x leverage while competing.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.