How Does a Commit-Reveal Scheme Protect a Trade from Being Front-Run?
A commit-reveal scheme works in two phases. In the "commit" phase, a trader submits a cryptographic hash of their transaction (the commitment) to the blockchain, but the actual trade details are kept secret.
In the later "reveal" phase, the trader submits the original, unhashed transaction data. Since the front-runner only sees the hash in the mempool, they cannot determine the trade's details or profitability to exploit it, thus ensuring the trade is executed fairly.