Spending Coins with Taproot

Published by Mario Oettler on

Last Updated on 24. April 2024 by Mario Oettler

Taproot provides three methods for spending Bitcoin:

  1. Raw public key
  2. Key Path Spend
  3. Script Path Spend

In a raw public key spend, you need to provide only the signature for the public key. It can be distinguished in a single signature and a multisignature spend.

In a Key Path Spend, the sender only needs to provide a signature that corresponds to the public key in the P2TR (Pay to Taproot) output.

In a Script Path Spend, the spender provides a script to prove that the P2TR output fits to the hash given in a MAST leaf. The spender also provides all other necessary information to successfully execute the script. Often, these data contain a signature.

A Key Path Spend and a Script Path Spend can be distinguished by the number of items in the witness stack. If there is only one item, it is a Key Path Spend. If there are more than one item in the witness stack, it is a Script Path Spend.

Example

The following transaction has two inputs. The first input is a Key Path Spend (only a single item in the witness stack). The second input is a Script Path Spend (more than one item in the witness stack).

You can find this transaction here: https://mempool.space/tx/37777defed8717c581b4c0509329550e344bdc14ac38f71fc050096887e535c8

Categories:

https://blockchain-academy.hs-mittweida.de/wp-content/uploads/2021/04/logo_bcam_rgb_gross.png

Welcome

Blockchain Academy

Continue with credential

No account yet?

Powered by Hidy

Register with Hidy


Register
Sign in

We need the following credential to register:

please select:

To create a new account, we need the following data from you:

We would appreciate the following additional information from you for the creation of your account:

Welcome

Blockchain Academy

Continue with credential

Already have an account?

Powered by Hidy

Sign in with Hidy


Register
Sign in

We need the following credential to log in:

please select:
Do you need assistance?
Click here to open chat.

Privacy Notice: This chat sends your questions to an external AI server.
How can we help you?
  • Please note: All questions, chat history, and feedback are sent to an external AI server for processing. Do not share sensitive personal information.

    All responses are generated by AI. Independently verify and fact-check all information before use.
  • No Chat History yet, start talking...