Commit reveal #77
Issue(s): Close #77
Description
This is an implementation of the commitment scheme in cairo.
The contract uses a commitment scheme where bidders first commit to their bids and later reveal them. This ensures bid privacy until the reveal phase.
Interface: ICommitmentRevealTrait The ICommitmentRevealTrait interface defines two essential methods:
commit(name: felt252, amount: felt252) -> felt252: Commits a bid with a name and amount, returning a hash. reveal(name: felt252, amount: felt252) -> bool: Reveals a previously committed bid, returning true if the commitment is valid.
Checklist
- [x] CI Verifier: Run
./scripts/cairo_programs_verifier.shsuccessfully - [x] Contract Tests: Added tests to cover the changes
Okay, am on it.
@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.
@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.
Yeah, I did
I will need your help to clarify something.
@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.
Yeah, I did
I will need your help to clarify something.
Yes, what points you would like me to clarify?
I have corrected the code;
-
Commitment Phase:
-
Off-chain: Compute the hash of the secret value.
-
On-chain: Store the hash (commitment).
-
-
Reveal Phase:
-
On-chain: Submit the original secret value.
-
On-chain: Verify that the hash of the submitted secret matches the stored commitment.
-
you can now review it.
Hi @julio4, kindly review this PR.