StarknetByExample icon indicating copy to clipboard operation
StarknetByExample copied to clipboard

Commit reveal #77

Open LamsyA opened this issue 1 year ago • 6 comments

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.sh successfully
  • [x] Contract Tests: Added tests to cover the changes

LamsyA avatar May 20 '24 15:05 LamsyA

Okay, am on it.

LamsyA avatar May 23 '24 13:05 LamsyA

@LamsyA Hello, did you have the time to review and apply the changes in the last comments? Let me know if you need help.

julio4 avatar Jun 04 '24 14:06 julio4

@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 avatar Jun 05 '24 07:06 LamsyA

@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?

julio4 avatar Jun 08 '24 07:06 julio4

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.

LamsyA avatar Jul 19 '24 22:07 LamsyA

Hi @julio4, kindly review this PR.

LamsyA avatar Aug 12 '24 05:08 LamsyA