Start investing in Bitcoin with Pix, in a few minutesSponsoredOpen free account
Taproot on Bitcoin: Schnorr, Script Tree and BC1P Addresses
Bitcoin

Taproot on Bitcoin: Schnorr, Script Tree and BC1P Addresses

The 2021 update that leaves complex wallets looking like a common wallet. See what has changed inside.

Photo: Unsplash

By Boletim Bitcoin newsroom

. 8 min reading.

In short: Taproot is the Bitcoin update activated in Block 709,632, on November 14, 2021, which brought together three proposals: the Schnorr signatures (BIP 340), the Taproot itself (BIP 341) and TapScript (beep 342). It allows portfolios with complex rules, such as multisig and inheritances, to spend as if they were a common wallet, revealing only what is necessary. Taproot addresses start with BC1P. Below, how it all works.

Taproot in numbers

709.632minimum block of activation, where the rule came into effect
90%of the blocks of a period signaling support (1,815 of 2016)
3 beeps340 (Schnorr), 341 (taproot) and 342 (Tapscript)
bc1pSegWit version 1 address prefix

Even the Taproot, every more elaborate spending condition appeared in full on the blockchain at the time of spending. A MultiSIG 2 of 3 showed the three public keys and the script; A safe with a recovery deadline revealed all possible paths, including those that would never be used. This cost space, that is, rate, and delivered free information to those who analyze the blockchain. Taproot changes this logic: in the common case, no one sees that there were hidden rules.

The three pieces: Schnorr, Taproot and TapScript

The package activated in 2021

Beep 340: Schnorr signaturesNew signature scheme on the same SECP256K1 curve, with linear property that allows you to add keys and signatures.
Beep 341: TaprootSegWit Spending Rules Version 1: A Key Path and a Hidden Script Tree.
Beep 342: TapScriptUpdates the scripting language used inside the tree leaves and facilitates future improvements.
Sources: Beep repository on GitHub.

The three were activated together as a soft fork, that is, a change compatible with old nodes: those who have not updated continues to accept the blocks, just without checking the new rules. BIP 341 is authored by Pieter Wuille, Jonas Nick and Anthony Towns.

Why Schnorr subscriptions

Bitcoin was born with ECDSA, a signature scheme that works well but is difficult to match. Schnorr signatures use the same elliptical curve and the same private key type, but they have a property called linearity: public keys and multiparticipant signatures can be aggregated into one. This is what makes MuSig2, specified in BIP 327 possible, in which several people sign together and the result looks like a single person's signature. We explain this use in the guide Multisig on Bitcoin.

Other benefits cited in the BIP 340 are the simplest security test, under well-studied hypotheses, and the possibility of checking many signatures in batch, faster than one by one. Taproot public keys occupy 32 bytes, and the signatures, 64 bytes.

Key path and script path

A Taproot output is committed to a single point of the curve, the output switch Q. It is constructed from an internal key P and the root of a script tree (m), by the formula described in beep 341: Q = P + hash(p || m) × g. This "adjustment" (tweak) ties the tree to the key without revealing anything about it. When it's time to spend, there are two ways:

How a Taproot output can be spent

P2TR outputOn blockchain, only the 32-byte Q key. Nobody knows if there are scripts behind it.
→
Key PathA Schnorr signature valid for Q. looks like a common expense, even if Q is the sum of several keys.
→
Script pathIt only reveals the used sheet, the control block and the Merkle test. The other leaves remain secret.
The key path is the cheapest and the most private. The script is plan B.

The Script Tree is a Merkle tree, an idea known as MAST. If a wallet has four alternative conditions, for example "Me and my spouse together", "Me and the lawyer", "my spouse after a year" and "the lawyer after two years", only the condition effectively used appears in the expense. The rest are never revealed. Before Taproot, they would all appear.

A practical example

Imagine a family savings 2 of 3 mounted with Taproot. The internal key is the MuSig2 aggregation of the two keys used in everyday life. Combinations that include the spare key are on the leaves of the tree. In 99% of spending, the two main keys sign together by the key path and the transaction is the size of a common expense, indistinguishable from any other wallet. Only if one of the main keys is lost is that a sheet with the spare key is revealed.

The effect on rates

By Bitcoin Optech tables, spending a Taproot entry by the key path occupies about 57.75 Vbytes, against 68.25 Vbytes of a SegWit P2WPKH input and 148 Vbytes from an entry. legacy. The Taproot output is slightly larger, 43 Vbytes against 31 from P2WPKH, because it saves the entire key instead of a hash. For those who spend a lot of entries, such as consolidations, the economy appears, especially when the mempool It's full. Do the math for your wallet with the guide calculator UTXO on bitcoin or with the network rate calculator.

EntrySize (VB)Comparison
P2PKH (legacy)148old reference
P2WPKH (SegWit v0)68,25about 54% lower than the legacy
P2TR Key Path57,75about 15% lower than P2WPKH
P2WSH 2 of 3104,75Traditional Multisig; a MuSig2 in the worn key path like P2TR

How Taproot was activated

The activation used the version bit signaling mechanism, in a format dubbed the Speedy Trial. According to BIP 341, the signaling window was from April 24 to August 11, 2021, and 90% of the blocks of a difficult period (1,815 from 2016) needed to signal support. Support was achieved in June, and the rule was scheduled for real from block 709,632, mined on November 14, 2021. It was the biggest protocol update since SegWit, 2017.

  1. Proposal and reviewThe beeps have been publicly discussed for years, with reviews by researchers and developers.
  2. ImplementationThe code entered Bitcoin Core and other customers, disabled until the signage.
  3. SignalingMiners signaled support in the blocks during the Speedy Trial window.
  4. ClampingUpon reaching 90% in a period, activation was guaranteed to the minimum block.
  5. ActivationIn block 709.632, updated nodes required new rules for SegWit v1 outputs.

BC1P addresses and how to use

Taproot addresses use the Bech32M encoding, defined in BIP 350, and start with bc1p. a good part of crypto wallets modern, including several hardware wallets, already generate this type of address; In many, just choose "taproot" when creating a new account. Before receiving in BC1P, confirm that whoever will send, as a brokerage, accepts withdrawals for this format. You can check an address at bitcoin address checker.

Tip: If your portfolio uses native SegWit (BC1Q), there is no urgency to migrate. The savings per entry is small. The biggest gain from Taproot is on wallets with multiple keys or recovery rules.

Unexpected Effects: Ordinals and Lightning

Taproot also opened doors that were not at the center of the proposal. The Ordinals Protocol, launched in January 2023, writes entries within Taproot sheet scripts, taking advantage of the witness data discount. This generated a large debate in the community, which we explain in the Guide to Ordinals and Runes. on the side of Lightning Network, the specification went on to describe "Simple Taproot" channels, in which the opening of the channel seems like a common expense.

Pros

  • Multisig and contracts with a common spending face
  • Only the path used is revealed
  • Smaller and cheaper tickets on the key path
  • Basis for MuSig2 and future improvements

Cons

  • Not every broker accepts BC1P
  • Advanced tools still maturing
  • Outputs a little bigger than P2WPKH
  • The Key Path exposes the public key, the theme of the quantum debate

Taproot and the debate on quantum computing

One criticism made of Taproot is that the output shows the public key directly, rather than a hash of it. The BIP 360, still in draft, lists Taproot outputs among those vulnerable to a long-term quantum attack precisely because of the key path, and proposes a new type of exit without that path. There is no quantum computer capable of this today, but the theme advances, as we show in Bitcoin and Quantum Computing.

Want to practice with real Bitcoin?Buy a small amount and test a withdrawal to a Taproot address from your wallet. advertising. Crypto involves risk.Open free account

In technical summary: Taproot has turned the output of Bitcoin into a flexible commitment. In the best case, it's a simple Schnorr signature; At worst, it is the revelation of a single leaf from a condition tree. This design gives more privacy and efficiency to those who use sophisticated wallets and sets the stage for the upcoming protocol improvements, a subject that you can follow in our guide to which is bitcoin and in the technical news of the bulletin.

Frequently asked questions

When was Taproot activated?

In block 709,632, mined on November 14, 2021. The miners' signage took place between April and August 2021, with a limit of 90% of the blocks for a period.

What is a BC1P address?

It is a Taproot address, or SegWit version 1, encoded in Bech32M (BIP 350). It receives bitcoin normally, but the sender needs to have support for this format.

Do I need to migrate my wallet to Taproot?

It is not mandatory. BC1Q addresses remain valid and cheap. Migration makes more difference for those who use multisig, recovery safes or want more privacy in these arrangements.

What is the difference between Schnorr and ECDSA?

Both use the same curve and the same type of private key. Schnorr has simpler security proof and is linear, which allows you to add several keys and signatures into one.

Has Taproot created the ordinals?

Not directly. Taproot was not made for this, but the Ordinals protocol uses Taproot sheet scripts to record inscriptions, taking advantage of the discount of witness data.

References

  1. BIP 340: Schnorr Signatures for secp256k1
  2. Beep 341: Taproot
  3. Beep 342: TapScript
  4. Beep 350: bech32m
  5. Bitcoin Optech: Taproot Topic
  6. Bitcoin Optech: Transaction Size Calculator
  7. Cash App: Taproot Update (11/14/2021)
  8. Cointelegraph: Taproot locked, activation in November (2021)
  9. FXStreet: Bitcoin network activates Taproot (11/15/2021)
  • Taproot
  • Schnorr
  • Beep 341
  • bc1p
  • MuSig2
  • bitcoin

This content is informative and is not an investment recommendation. found an error? Write to contato@boletimbitcoin.com.

Read also

Start in crypto today

Open your free account, deposit with PIX and access Spot, Futures, Copy Trading and Trading Robots in one app.

  • Easy deposits
  • Copy trading
  • Grid and DCA bots
  • All-in-one app
Advertising. Crypto involves risk, invest responsibly.
Create free account