Taproot is a highly-anticipated protocol upgrade designed to add smart contract flexibility and more transactional privacy to bitcoin.
History of bitcoin upgrades
Bitcoin was created by Satoshi Nakamoto in 2009. It is the largest cryptocurrency in the world by market cap. Bitcoin is created by a process called mining. Bitcoin miners use computational power to solve a complex cryptographic problem and whosoever solves it first gets rewarded with 1 BTC. One of the most important jobs of the miners is to keep a check on double-spending, apart from verifying the transactions.
Given the decentralized nature of the Bitcoin blockchain network, all the key stakeholders (miners) need to be onboarded with any changes proposed in the bitcoin technology ecosystem.
After its original creation, there have been multiple hard forks and upgrades that happened to bitcoin to improve its functionality. Some of the hard forks resulted in Bitcoin Cash, Bitcoin Gold, etc. However, an upgrade is entirely different from hard forks. While the hard forks give a new development chain to build something entirely new, upgraded on the other hand improves the original bitcoin ecosystem.
One such upgrade happened in Nov 2017 - the SegWit (Segregated Witness) upgrade to improve block size to fit more transactions. Those who are following this space for long must admit that SegWit was not just an event; it was a saga. It was the biggest consensus battle ever played in the ecosystem, and SegWit was the product, along with top-quality social drama.
A community-wide intense techno-political debate that raged for more than years, and finally concluded with a split of the Bitcoin ecosystem. It not only divided the network, but it also ended with broken companies, relationships and is partly responsible for much of the reputed “toxicity” of Bitcoin Twitter today. You can still find its aftershocks, and it all revolved around SegWit. If you missed that event in real-time, you might find it challenging to recreate the impact of this episode. There are Few attempts to archive the history, and here’s a good one.
What is Taproot and how it will benefit bitcoin?
Taproot which was first proposed by Bitcoin Core contributor and former Blockstream CTO Gregory Maxwell is going to be the most significant upgrade to the bitcoin blockchain network since 2017’s SegWit. Taproot is primarily a privacy improvement for complex spending conditions on bitcoin like multisig transactions, which aims to enhance the overall usability by making transactions cheaper, faster, and easier to deploy. Not only that but it also eventually will allow for the deployment of smart contracts. Let’s dive deeper and understand what the Taproot upgrade will do to the bitcoin network.
When we do transactions using bitcoin on the blockchain, all bitcoins are locked in a script that defines how the coins will be spent. These scripts are nothing but certain if-then-else conditions specifying how to use the coins. Different conditions can be mixed and matched, to create complex types of smart contracts. An example of such a contract could be that coins can be spent if both Alice and Bob sign, or if Alice alone signs after a week have passed, or if Bob alone signs while also providing a secret number. Whichever of these three conditions is met first, is how the coins are spent.
These conditions are not publicly available at first and only the new owner of the coins knows how they can be spent using a technique called P2SH (pay to script hash). When the owner spends the coins, he reveals the whole script as well as the “solution” to the script at the same time.
This has two main downsides. One, it’s data-heavy, especially if there are many conditions. And two, it’s bad for privacy. Everyone learns all the different ways in which funds could have been spent, which can, for example, reveal what kind of wallet was used and perhaps even more.
To work around the above two downsides, Merkelized Abstract Syntax Tree (MAST) was proposed. Using MAST, all the different conditions under which the funds can be spent are individually hashed (as opposed to combined into a single hash) and included in a Merkle tree, which ultimately produces a single hash: the Merkle root. This Merkle root “locks up” the coins.
With MAST, we can verify a single condition in a transaction using the Merkle root and some additional data (called the Merkle path). The rest of the data remains hidden.
This means that only the condition that is met needs to be revealed. If in the initial example above, Alice alone spends the funds after a week, she just reveals that condition (and the Merkle path). No one learns that the money could have also been spent by Alice and Bob together, or by Bob alone if he’d added a secret number. This makes MAST more data-efficient than complex P2SH smart contracts and adds privacy to boot.
Using Schnorr’s signature on MAST can do even better. A transaction can hide that a MAST structure existed at all. Under normal circumstances, no one will ever know that a regular transaction was hiding such a complex smart contract as a fallback.
So Taproot allows all this, we can create complex transaction conditions using fewer data and the complexity remains hidden from the outside world.
Also see - Cardano is launching smart contracts
Major benefits that will come along after Taproot upgrades are -
Schnorr signatures scheme allows several signatures in the same transaction to be combined into one. A similar trick could be applied to multisig transactions. Combining both public keys and signatures into “threshold public keys” and “threshold signatures,” a multisig transaction can be made indistinguishable from any regular transaction.
For example, a transaction might be executed immediately if all the four multisig signers agree, or it might take a certain amount of time to pass before funds are unlocked if only three out of four signers are available. Without this, an external party was able to identify every possible condition, but with Taproot they will see only the actual one that was eventually triggered and not individual conditions.
Easier, cheaper and more flexible
Taproot will remove the complications revolving around the type of signature, which will enhance smart contract functionality of Bitcoin like discreet log contracts (DLC), making it more data-efficient. The size of the transaction data will also be reduced, leading to lower transaction costs.
Taproot will make transactions on the lightning network which is a layer 2 solution for faster and more scalable payments.
The current state of Taproot upgrade
As per the lead developer for Taproot, Pieter Wuille, the Bitcoin Improvement Proposals, 340 through 342 were merged into the Bitcoin codebase in October 2020, signaling that the anticipated Taproot upgrade is ready, but there’s a bottleneck here – the consensus mechanism.
As per the activation rules by Speedy Trial, which started on May 1, 2021, the Taproot activation will only be given the green light if 90% out of the 2,016 mined blocks in a difficulty epoch (cycle) include an activation signal.
As per Taproot.watch, created by Hampus Sjöberg, a Bitcoin developer, it showed that Taproot signaling accounted for about 44% of the total Bitcoin hashing power as of May 4, 2021, and 90% seemed like a long way to go.
The earliest supporters were AntPool and F2Pool (the largest mining pools), followed by Slush Pool and recently joined by BTC.Top (at a block height of 683,945).
On May 7, the “no” votes issued by these miners currently account for 30% of the 2,016 blocks in the current difficulty window.
Even the largest crypto exchange, Binance, tweeted on May 17, saying that Binance Pool had begun signaling for Taproot at a block height of 683,878.
Taproot.watch’s latest report shows there have been many occasions where at least 10 successive blocks with Taproot signals occurred during the current difficulty epoch.
The latest report, on May 20, shows that mining pools that represent 94% of Bitcoin’s hashrate have now included the Taproot “signal bit” to show their support for the upgrade.
Bitcoin’s next difficulty adjustment is in approximately 5 days. This next adjustment will mark the third of six possible signaling periods under Taproot’s Speedy Trial activation process, which began on May 1.
Taproot activation must be locked in before Aug 11, for the network upgrade to get executed in November. If 90% signaling has not been achieved by that date, Taproot goes back to the drawing board.