Skip to main content

How Does the Blockchain Verify That the ‘Reveal’ Matches the Original ‘Commitment’?

The verification is performed by a smart contract on the blockchain. When the user submits the 'reveal' (the original transaction details plus the secret salt), the smart contract executes the same hashing algorithm used in the commitment step.

It hashes the revealed details and the salt. If the newly calculated hash matches the original 'commitment' hash stored on the blockchain, the contract verifies the authenticity and executes the transaction.

How Do Smart Contracts on a Private Blockchain Differ from Stored Procedures in a Traditional Database?
How Does a Commit-Reveal Scheme Protect a Trade from Being Front-Run?
What Is the Cryptographic Basis for a ‘Commit-Reveal’ Scheme?
How Is the Merkle Root Calculated from the Individual Transaction Hashes?