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

[Research]: Sponsored-Tx Fee Market #38

Closed
1 of 3 tasks
setzeus opened this issue Apr 5, 2024 · 5 comments
Closed
1 of 3 tasks

[Research]: Sponsored-Tx Fee Market #38

setzeus opened this issue Apr 5, 2024 · 5 comments
Assignees
Labels
research consolidating information. sponsor api API that signs Stacks transactions for sponsorship.

Comments

@setzeus
Copy link
Collaborator

setzeus commented Apr 5, 2024

Completing the issue description and arriving at a conclusion is the deliverable of this issue.

Research - Sponsored Tx Fee Market

1. Summary

This ticket holds the research relating to the exact setup required to stand-up & maintain an sBTC sponsored fee market to support sBTC withdrawal requests strictly in sBTC (aka no STX required).

2. Context & Relevance

We have work on implementing the sponsored transaction from the Clarity side, so this issue mainly pertains how we dynamically provide liquidity to this market.

3. Research

3.1 Proposed Research Conclusions

After discussing this ticket async we determined:

  1. Transaction sponsorship after depositing into the sBTC system is how users should get STX to pay for gas (as opposed to there being some faucet).
  2. A full dynamic market is out of scope for sBTC-v1, but should be feasible for a third party to implement in sBTC-v2.

3.2 External Resources

3.3 Areas of Ambiguity


Closing Checklist

  • The takeaway from this issue is clearly documented in the description of this ticket.
  • Everyone necessary has reviewed the resolution and agrees with the takeaways.
  • This ticket has or links all the information necessary to familiarize a contributor with the topic and how it was resolved.
@setzeus setzeus added the research consolidating information. label Apr 5, 2024
@setzeus setzeus self-assigned this Apr 5, 2024
@hstove
Copy link
Contributor

hstove commented Apr 8, 2024

I've built a sponsoring server in the past, but not a "pay me in token X and I'll sponsor your STX fees". The generic "how do you sponsor a tx" part is easy, and I think supporting a dynamic fee market is more tricky.

One question that needs to be answered is: what exactly is the market dynamic here? Is this a service we maintain, and we intend to only pay "fair market value" for the user's sBTC? Is the intention that anyone can run this sponsoring service?

I see two high-level approaches that can work here. In both cases, the user needs to do a custom action before making the sBTC withdraw.

  1. The user sends us sBTC directly, and then they make a withdraw. Our backend service does some calculation to determine the amount of STX to sponsor.
  2. The user swaps some sBTC for STX, transfers the STX to us, then makes the withdraw. Our backend service uses this exact STX amount for the sponsored transaction.

In this case, I think 2 is much more elegant, as the sponsoring server doesn't take on market risk. In approach 1, there is some amount of time where the sponsor holds sBTC before swapping it to STX. In either case, someone is swapping sBTC for STX, and the question is just on who does the swap.

One approach on the Clarity side could be to make a custom contract that makes this easy. We could even do a generic trait-based approach, which would support paying for STX fees in sBTC for any contract call, not just withdraws.

@hstove
Copy link
Contributor

hstove commented Apr 8, 2024

One other point I want to make here: I think this is an excellent feature, but I personally would argue very strongly for us to not prioritize working on this until after launch. A few reasons:

  1. This requires a market for sBTC-STX trades. That obviously won't exist before we launch.
  2. This doesn't require custom logic in sBTC contracts - anyone can implement this using just the SIP10
  3. Anyone can build and run this - we could even sponsor a grant for it

@AshtonStephens
Copy link
Collaborator

Relates to this conversation from Marvin: stacks-network/stacks-core#4235

@AshtonStephens
Copy link
Collaborator

AshtonStephens commented Apr 8, 2024

Questions:

  1. What external practical support is needed for this?
  2. What specific contracts are needed for this to work with sBTC?

We should make a design discussion for including this. All the external details should be included there.

@AshtonStephens
Copy link
Collaborator

Conclusion: We will use transaction sponsorship instead of a STX faucet to enable users to make Stacks contract calls with only sBTC.

@AshtonStephens AshtonStephens added the sponsor api API that signs Stacks transactions for sponsorship. label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research consolidating information. sponsor api API that signs Stacks transactions for sponsorship.
Projects
Archived in project
Development

No branches or pull requests

3 participants