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

[clarity] Clarity-Bitcoin v5 (generalized commit-reveal) #3961

Closed
setzeus opened this issue Sep 21, 2023 · 13 comments
Closed

[clarity] Clarity-Bitcoin v5 (generalized commit-reveal) #3961

setzeus opened this issue Sep 21, 2023 · 13 comments
Assignees
Labels

Comments

@setzeus
Copy link
Collaborator

setzeus commented Sep 21, 2023

Feature Description
This issue is a marker for visibility on the tremendous job that @MarvinJanssen is doing updating the Clarity-Bitcoin contract. One of the main goals of Sprint 6 (& possibly 7) is to create a v5 of the Clarity-Bitcoin library.

One of these updates consist of generalized commit-reveal logic for multiple use-cases.

Proposed Solution
I believe the current solution is to split up commit-reveal into two smaller contracts. Does that mean that the Clarity-Bitcoin library has now expanded to three files? (4 including mini).

Additional Context
Due to the lack of a central home (first Jude's repo, now Friedgers), I'm not entirely sure where this v5 will live so we must make sure to link that repo back here to appropriately track & close this issue.

@setzeus
Copy link
Collaborator Author

setzeus commented Sep 26, 2023

Draft completed here: https://github.com/MarvinJanssen/clarity-commit-reveal

Next task is to start creating unit tests. Priority is getting feedback from @FriendsFerdinand for required changes.

@friedger friedger moved this from Status: 🆕 New to Status: 💻 In Progress in Stacks Core Eng Sep 26, 2023
@setzeus
Copy link
Collaborator Author

setzeus commented Sep 28, 2023

  • Asked Friedger for write permission
  • TXID calculation for SG transactions
  • Additional guards
  • Checking that nothing is left-over

@setzeus
Copy link
Collaborator Author

setzeus commented Oct 5, 2023

Will switch focus to writing tests.

@setzeus
Copy link
Collaborator Author

setzeus commented Oct 10, 2023

In process of handing-off logic from @MarvinJanssen to @FriendsFerdinand but blocked by 256-bit operations atm.

@FriendsFerdinand
Copy link

FriendsFerdinand commented Oct 17, 2023

We can generate the scriptpubkey that would show in a commitment transaction using the signers pubkey and the script contained in the transaction. This function can generate the scriptpubkey:

https://github.com/FriendsFerdinand/clarity-tapscript/blob/main/contracts/tapscript.clar#L7

Limited by the runtime. To test it, have to store the state in disk then continue running in separate transactions.

@setzeus
Copy link
Collaborator Author

setzeus commented Oct 17, 2023

Do we know costs for ClarityWASM? @obycode will there be 256-bit numbers / any way the work you guys can help here?

@setzeus
Copy link
Collaborator Author

setzeus commented Oct 17, 2023

@MarvinJanssen generating a ton of test transactions for generalized commit-reveal. What examples can we show in sBTC?

@obycode
Copy link
Contributor

obycode commented Oct 17, 2023

Do we know costs for ClarityWASM? @obycode will there be 256-bit numbers / any way the work you guys can help here?

We don't know cost numbers yet. @AshtonStephens mentioned that you might need 256 bit arithmetic. We can definitely add that to our list, and it shouldn't be terribly difficult, but it will still be some time before we have a complete VM ready for you to test it out. In the meantime, you could run a testnet with modified costs or block-limits as a workaround. What kind of cost numbers are you seeing currently?

@setzeus
Copy link
Collaborator Author

setzeus commented Oct 24, 2023

As discussed by @MarvinJanssen for the DR release if this isn't feasible then we could not check for commit & only check a reveal if it fits a previously-known / accepted script template.

@MarvinJanssen
Copy link
Member

Can this be closed? From what I understand generalised commit reveal is no longer necessary? Although I would opt for providing the ability to have nodes reveal custom messages for dapps. (That is a separate different discussion though.)

@setzeus
Copy link
Collaborator Author

setzeus commented Dec 5, 2023

Initial thoughts I dig that idea too - please open up discussion when you have a few minutes.

@setzeus setzeus closed this as completed Dec 5, 2023
@github-project-automation github-project-automation bot moved this from Status: 💻 In Progress to Status: ✅ Done in Stacks Core Eng Dec 5, 2023
@MarvinJanssen
Copy link
Member

Open a discussion: #4134

@blockstack-devops
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

No branches or pull requests

5 participants