There are three steps involved in registering an ENS name that is intended to mitigate the problem of front-running.
Front-running an ENS name would be possible if registration happened in one transaction.
Someone could “see” the single registration transaction in the mempool, and send the same transaction but with higher gas so the transaction they sent settles first.
In essence, “sniping” the name before registration completes. For this reason, ENS name registrations rely on a
Step 1: Request to register
The commit in Step 1 hashes a secret key generated and stored in your browser's local storage and hashes it with your wallet address and ENS name so that you can later register it without revealing it publicly.
Only the user knows the values of the cryptographic hash.
Once you've performed the
Request to Register you have 1 day to complete Step 3 until the
Request to Register becomes invalid.
Step 2: Wait for 1 minute
A 1 minute waiting period begins to prevent the front-running of the ENS name registration. This wait period acts as a “buffer” so that in the final step, the revealed ENS name’s registration cannot be front-run with a higher gas transaction.
Step 3: Register
The ENS name registration is revealed on-chain. Once the registration transaction is performed and the ENS name is registered; the ERC-721 NFT for the ENS name is minted and transferred into the owner's wallet.
If a miner wanted to try and front-run this process, they would have to send their own hashed secret, wait 1 minute and then register the name. Since The 3 step registration process works because they can't hold back your transaction for one minute, they will fail to do so, and the miner can't use the secret compared to the earlier hash.