A provably fair NFT reveal works in two steps: the team publishes a hash of the finished collection before the sale, and after the sale a random number shifts every token onto its final artwork. Collectors can then recompute the hash and the shift themselves, so the result holds up only while nobody can choose or preview that random number.
Most of the risk comes from how the contract picks the random number and from the metadata controls around it.
Committing to the art before the sale
The team generates every image and its traits first, then combines the images in their original order into one hashed string. The Squirrelly Squirrels distribution page describes this concatenated string as generated before deployment and unchangeable, with a final proof hash provided at deployment as proof of the original order.
After the sale, the contract picks a startingIndex, and each token takes the image at this position in the original sequence:
originalPosition = (tokenId + startingIndex) % 10000
The formula comes from the same Squirrelly Squirrels page. With a known order and a known offset, anyone can rebuild the full token-to-image mapping and compare it with the hash published before the sale.
Choosing the offset from a block hash
A thread on the OpenZeppelin forum uses Bored Ape Yacht Club as its example and walks through code in the same style, which derives the offset from a block hash:
- The contract records
startingIndexBlockat the last mint, or at the first mint after a reveal timestamp. The owner can also set it early throughemergencySetStartingIndexBlock(). setStartingIndex()readsblockhash(startingIndexBlock) % MAX_SUPPLY.- When the call comes more than 255 blocks later, the code falls back to
blockhash(block.number - 1), because the EVM keeps only the last 256 block hashes. - A result of zero becomes 1, so the collection never keeps its default order.
Posters in the same thread list the gaps around this code:
- When a team uploads the metadata only after the index is set, it can arrange the mapping as it likes.
- An owner-only
setBaseURIcan change the allocation later, unless the contract locks it. - Metadata on a project's own server can be replaced or taken down.
A worked example of the 255-block fallback
Take a 10,000-piece collection and a holder targeting the single rarest image for a token they already hold. Each possible offset puts a different image on that token, so a single unbiased draw gives the holder a 1 in 10,000 chance, or 0.01%.
Now suppose setStartingIndex() has gone uncalled for more than 255 blocks and any address can call it. The fallback hash belongs to the previous block, which is already public when the transaction runs. A helper contract can compute the offset in the same transaction and revert unless the token gets the target image. Each new block brings a fresh hash, so the holder gets a fresh draw per block for the cost of a reverted call:
| Draws available | Target | Chance of success |
|---|---|---|
| 1 block | 1 rarest image | 0.01% |
| 2 outcomes (1 bit of influence) | 1 rarest image | 0.02% |
| 300 blocks | 1 rarest image | 2.96% |
| 300 blocks | any of the 10 rarest images | 25.93% |
Each row uses 1 - (1 - k/10,000)^n, with k target images and n draws. The 2-outcome row applies to offsets taken from prevrandao, since EIP-4399 gives each Ethereum block proposer 1 bit of influence per slot over it. A team using the block-hash pattern can close the 300-block rows by calling setStartingIndex() right after the trigger block, or by restricting who can call it.
The forum thread also points to the Meebits exploit. An excerpt quoted there says the attacker rerolled mints, cancelling their own transactions by resending the same nonce with a higher gas price, until a wanted token ID came up.
Reveal methods compared
| Method | Who supplies the randomness | Who can still bias the result | What a collector can check |
|---|---|---|---|
Team-triggered reveal with an owner-only reveal() or setBaseURI |
The team | The team, by uploading or swapping metadata (Chainscore, OpenZeppelin forum) | Little, unless a hash came first |
Random traits at mint from block.timestamp or block.difficulty |
The block | Minters, who can cancel a bad result (OpenZeppelin forum) | The inputs, after the fact |
| Provenance hash plus block-hash offset | A future block | The owner through the emergency setter, and the caller after 255 blocks | The hash and the offset |
| Provenance hash plus a VRF oracle | The oracle, with a proof checked on-chain (Quip blog) | The operator can withhold a response | The hash, the offset and the proof |
| Provenance hash plus QVRF | Quantum measurements committed on-chain before delivery (QVRF docs) | Quip, as operator of the generator and delivery | The hash, the on-chain commitment and the later audit record |
QVRF for reveals
QVRF supplies random numbers from measurements on a quantum computer, with a commitment posted on-chain before any value goes out, according to the QVRF developer docs. Quip's Quantum Echoes collection uses it this way. The QVRF page describes Quantum Echoes artwork as coming from QVRF output, "with the seed committed before any of the images exist", and the Quantum Echoes site says each artwork's art and traits are determined at reveal.
Teams weighing QVRF for a reveal should plan around its current limits:
- Quip runs the service. The QVRF page states that Quip operates both the oracle and the trustee, and lists splitting those roles as the next step.
- The quantum audit runs off-chain, after delivery. The docs describe verification as asynchronous, with the record catching up after a value arrives. The QVRF page lists on-chain verification as in development.
- The operator keeps some choice. According to the flow notes in Quip's QVRF contract repository, the dispenser contract checks each value against the posted commitment and allows each value to be spent once. The trustee still decides which committed value serves which request, and the oracle reads a round before committing to it and can drop the round. A team using QVRF for a reveal trusts Quip on these points.
Checks before minting
A collector can work through these on the contract and the project page:
- Find the provenance hash, and confirm it was published before the sale started.
- Read the function setting the offset. Note who can call it, and whether a fallback uses a recent block hash.
- Look for an owner-only
setBaseURIorreveal, and whether the contract locks it after reveal. - Check where the metadata lives. An IPFS address fixed at deployment leaves the team less room than a URL on its own server.
- For an oracle, confirm the request went out after the sale closed and the proof or commitment is on-chain.
To request quantum randomness for a collection, see quip.network/qvrf, and read the QVRF concepts page for the trust model.
