Explain How a Commit-Reveal Scheme Prevents a Transaction’s Content from Being Front-Run.
A commit-reveal scheme involves two steps. First, the user submits a "commitment" (a hash of their intended transaction plus a random secret) to the blockchain.
This commitment is public but reveals nothing about the actual trade. Second, after a set time, the user submits the "reveal" (the original transaction and the secret).
The smart contract verifies the hash matches the commitment, then executes the trade. Since the trade details are hidden during the commit phase, front-running is impossible.