Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP: Proposal - Taproot Payments #74

Closed
wants to merge 2 commits into from

Conversation

renashah
Copy link

@renashah renashah commented May 25, 2022

SIP proposal to integrate Taproot Payments by Rena (Trust Machines)

@renashah renashah changed the title Create sip-tbd-taproot_payments.md SIP: Proposal - Taproot Payments May 26, 2022

Type: Consensus

Status: Draft Proposal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just "Draft"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update, thanks!


License: CC0-1.0

Sign-off: Technical Committee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No one has signed off on this yet, so this section should be blank

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update, thanks!


# Abstract

This SIP proposes a small but important change to enable mining payouts to Taproot scripts. Taproot scripts were enabled at block 709,632 on the Bitcoin Network on November 14, 2021.
Copy link
Contributor

@jcnelson jcnelson May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is proposing a hard fork, which is a very disruptive change, I don't think the text should characterize it as "small." It's going to be a lot of work to do this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood and I can update it accordingly!


This SIP proposes a small but important change to enable mining payouts to Taproot scripts. Taproot scripts were enabled at block 709,632 on the Bitcoin Network on November 14, 2021.

We believe that with this change, mining pools are more realistic where people can pool their mining bids into a Taproot script while running independent miners. Doing so further increases the number of independent miners and aids decentralization. Taproot scripts alleviate bandwidth issues on the Bitcoin network since the pool resembles a single miner. Furthermore, we’d like to implement the optionality to send Taproot payments scripts to both Stacks wallets or Stacks smart contracts to streamline operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this SIP is calling for two things:

  • Miners can mine via Taproot transactions
  • PoX payouts can be Taproot addresses

The former can be achieved without a hard fork today. To do so, miners would use the second input in a block-commit transaction to spend a taproot UTXO, and then use the fifth output in the block-commit to collect the change to a new taproot UTXO. The current specification for block-commits only mandates that the first input and the fourth output be an address that the network can currently process (i.e. p2pkh, p2sh, p2wpkh-p2sh, p2wsh-p2sh). I've written more about this here: stacks-network/stacks-core#3146

The latter requires a hard fork. It's already scheduled for inclusion in the 2.1 proposal to add taproot and native segwit support to PoX outputs (see stacks-network/stacks-core#3096). The SIP text for this will be included in SIP-015 (#53).

Would you be willing to merge this SIP with SIP-015, which will describe the breaking changes proposed in 2.1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll need guidance as to how to merge this appropriately, please.


# Modification

This SIP proposes to integrate Taproot script payments to the Stacks blockchain. Additionally, this SIP also proposes to allow the option to send Taproot script payments to Stacks Smart Contracts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taproot script payments to Stacks Smart Contracts.

I'm confused by what you mean here. I thought earlier this was PoX payouts, but this reads like something else? In general, you can't send BTC to a Stacks smart contract -- at least, not directly, since they live on separate chains. You'd be able to send BTC to a taproot address, submit the BTC transaction and a Merkle proof to a smart contract, and have the smart contract instantiate a wrapped BTC asset that represents the BTC you sent. Is that what this SIP is proposing?


This SIP proposes to integrate Taproot script payments to the Stacks blockchain. Additionally, this SIP also proposes to allow the option to send Taproot script payments to Stacks Smart Contracts.

# Rationale
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a 2nd level header or lower. SIP-000 describes the 1st-level headers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now that I've read through it a couple times, I think the contents of this section belong in the Introduction. It's very informative!

<img width="1175" alt="Onstacks Mining Stats 5-24-2022" src="https://user-images.githubusercontent.com/46361137/170338141-28ddbd5f-efe8-4e73-87b2-afb509fda8ab.png">
**Source:** [OnStacks](https://app.onstacks.com/), accurate as of 24 May 2022

In the event that these ~5 miners go offline, Stacks blockchain is open to vulnerabilities. Allowing independent miners to pool together through Taproot scripts further decentralizes the mining of Stacks. In general, greater miner numbers increase resiliency and decentralization of the Stacks blockchain which is a favorable outcome for the ecosystem.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these ~5 miners all go offline, the chain dies ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly - the thought process was that a taproot integration might make it simpler to create mining pools to add further decentralization.


In the event that these ~5 miners go offline, Stacks blockchain is open to vulnerabilities. Allowing independent miners to pool together through Taproot scripts further decentralizes the mining of Stacks. In general, greater miner numbers increase resiliency and decentralization of the Stacks blockchain which is a favorable outcome for the ecosystem.

A new Stacks block may be mined once per Bitcoin block, amassing 144 blockers per day. To be considered for mining a block, a miner must have a block commit included in a Bitcoin block. This is determined by the amount of Bitcoin the miners have sent to be burned. Oftentimes, independent miners will not “win” the block as they do not have enough Bitcoin committed. However, with Taproot payments, independent miners can form something akin to a mining pool with a single transaction commitment. This update avoids many Bitcoin bandwidth bottleneck issues because to the Bitcoin network, the pool just looks like a single miner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, the BTC isn't burnt most of time. It's sent to Stacks holders via PoX, and only burnt in the PoX prepare phase, and in case of emergencies where PoX cannot happen (per SIP-007).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I change "burned" to "committed" would that be a better word choice?


Integrating Taproot scripts could have a positive impact on the Stacks ecosystem. Taking this a step further to incorporate optionality for Taproot script payouts to smart contracts aids new mining pools to start mining.

Please comment below if you are in favor, against, and/or have concerns. Your input will help the feature be ranked against other work in progress for the Stacks blockchain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SIP process is meant for submitting and reviewing formal proposals. If you want to take a poll on what should go into a SIP, that should happen before you submit it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and strike it - it was carried over the Stacks Forum post. My apologies, still learning.

@jcnelson
Copy link
Contributor

Thank you for writing this up @renashah! I think taproot has a lot of interesting use-cases for Stacks, and I'm glad we have a SIP proposing adding them. My two biggest asks are as follows:

  • Can you further clarify whether or not this SIP is calling for a hard fork to add native taproot support for miners? If you can accept using a legacy address for the miner UTXO chain, and use a taproot address for funding miner block-commits, then no hard fork is needed. I think ultimately we will want native support, but if so, the SIP should describe the usage of legacy addresses as related work (since it can be done today), and should clarify why this is not good enough -- i.e. what new features native support will gain for the system that cannot be had in any other way.

  • I'm not sure what the other rationale for this SIP is, regarding using taproot to somehow pay to Stacks smart contracts? Could you provide more detail and clarity on what you mean by this, such as (but not limited to) including real-world examples of what you're proposing?

@jcnelson jcnelson added the Draft SIP is in draft status label Jun 9, 2022
@renashah renashah closed this Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Draft SIP is in draft status
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants