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 · 12 comments
Closed

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

setzeus opened this issue Sep 21, 2023 · 12 comments
Assignees

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.

@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
@MarvinJanssen
Copy link
Member

Open a discussion: #4134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants