This is an educational projects to learn more about the sharing secrets on a blockchain.
How to simultaneously broadcast secrets on a public blockchain?
The difficulty on the blockchain is that participants can't share their values at the same time, the first participant must broadcat their value, meaning other participants can act accordingly.
SOLUTION__ Commitment Scheme Cryptographic algorithm that allows someone to commit to a value while keep it hidden from others with the ability to reveal it later. Phase 1: commit Phase 2: reveal
The following contract implements commit-and-reveal for a game of rock-paper-scissors.
This commit-and-reveal exploratory project uses solidity to implement rock-paper-scissors game logic. A simple React interface was built to manage connecting and deploying to the replit testnet, as well as providing an interface to invoke the rock-paper-scissors slidity contract.