Crecodiles Reveal 🎁->🐊

Creco
CreCo XYZ
Published in
6 min readMay 2, 2022

The Crecodiles mint has already been a wild ride! Now, we are all looking forward to the reveal.

🐊 Reveal Ceremony

Our reveal ceremony is scheduled for Tuesday, 3 May 2022 21:00:00 UTC.

We will mint token #8888 which will unlock the finalization method.

After the last mint we will wait 3 minutes and submit the finalization call from our deployer account, unless the method has been called by someone else.

The random finalization index will determine the final metadata order and will reveal all Crecodile NFTs simultaneously.

If you want to know why we decided on this approach read on.

Reveals in common NFT drops

Many other off-chain NFT projects have the following drop and reveal mechanic:

  1. someone mints a token and receives a token ID
  2. the ERC721 tokenURI method will not return anything or point to placeholder data
  3. during reveal the final URL is set and points to a server API or IPFS directory which reveals the final metadata and associates IDs with a metadata file

The problem with this approach is that it is neither fair nor trustless. The team could e.g. set metadata for special tokens to the IDs they own.

The leaked metadata files for Meebits: file name corresponds to token ID

To combat this, a variation of the above approach exists which uses a provenance hash. With this approach the metadata and order is hashed and the hash is posted pre mint. This way the order and integrity becomes provable and “random” because the mint order and token ID are not predictable under optimal(!) conditions.

Hashmasks provenance records

However, even with this approach the information about rare NFTs is known to the team in advance and metadata APIs and even IPFS carry a risk to leak this information. During a slow mint, skilled collectors with inside knowledge can aim for certain IDs. This can e.g. be done with a smart contract which mints and reverts until it has a desired token ID or with bots that analyze the mempool and place transactions with specific gas between other transactions into the pool. The other option is to buy the rare IDs on secondary pre-reveal which has happened countless times in the past.

Crecodiles Reveal Mechanic

Crecodiles have on-chain metadata. If you are wondering what this is — here is our on-chain metadata guide:

https://medium.com/creco-xyz/nft-on-chain-metadata-and-why-someone-would-want-to-pay-37k-usd-for-it-6996bf4aba5f#4f5f

The challenge with on-chain metadata is that information is constantly leaked. With every mint a piece is added to the puzzle and after all tokens are minted the rarity distribution can be calculated. One could say that this is a problem but we believe it actually allows for extremely fair drops because it eliminates information asymmetry.

How can I read the metadata information?

In one of our previous blog posts we described the metadata encoding in depth. Here are the exact steps again to derive metadata information.

To follow along, you can visit our verified contract: https://etherscan.io/address/0x2CA113E1aA37d83662A1D3F84e209f7068700fa6#code

Let’s say we are interested in the metadata of token 100.

One can go to Etherscan to query our contract for the pre-reveal metadata using the “getDNA(tokenID)” method.

Reading the DNA from the contract

The result is a uint256 bitfield representation of the DNA. When this number is converted to binary it will result in some output similar to this:

Trait data as bitfield

We can see that each byte represents one trait type and the bits set represent a specific trait value. So for the bits highlighted in red in the above example we would get 0000 0011 as the trait value.

Google can help with conversions

Which is trait value 3 in decimal notation. This means the Eyes trait in the above example is set to 3.

On its own this information is not really useful because it does not reveal if the value “3” is rare or if it is a desired trait or even how it looks. What is possible however is to do this for all tokens and derive a rarity distribution.

This way one could for example learn that the value “3” on bitfield position 5 might exist exactly once in the whole collection. And even without knowing how the result looks like they could try to obtain this NFT. Moreover, having data on-chain does not change the fact that team members could try to write this information to a specific position.

Random shifting

To ensure fair randomness Crecodiles have a shifting mechanic implemented in the contract.

When the last Crecodile is minted, anyone can call the finalizeStartIndex() method.

function finalizeStartIndex() public {
require(!isStartingIndexSet, “startIndex has already been set”);
require((tokenTracker == MAX_NFT_SUPPLY), “Not all tokens minted”);
isStartingIndexSet = true;
uint256 rand = uint256(keccak256(abi.encodePacked(block.timestamp, _msgSender(), blockhash(block.number — 1))));
startIndex = rand % MAX_NFT_SUPPLY;
}

What this method does is it computes a random value by hashing(!) the timestamp of the block, a hash of all transactions of the previous block and the address of who calls it into one large number. All of these values are not known in advance and can not be guessed. A small change in any of the values e.g. who successfully calls it will drastically change the output.

The random start index will shift all the metadata by a random offset. So if token 100 was associated with metadata 4222249976725509 before, it will change to a different position unless the start index turns out to be 0. One can think of it that if a certain DNA was at token position 1 and the offset is 8800 it will be moved to the end of the collection.

We implemented this mechanism for people so that they worry less about the integrity of the collection compared to other drops and have more fun during the reveal. The transparency and strict rules create a provably fair drop. If someone is sceptical they can read the code, call our public finalizeStartIndexTest() method to familiarize with this randomness or even try to call the finalization method themselves. And if someone wants to find out information in advance they can do this but definitely don’t have to. Remember, no one knows which tokens will have which DNA and after reveal we will all know simultaneously. If tokens are listed on secondary markets it is assumed that these are meant to sell regardless of the reveal outcome and rarity, which in turn means we can not avoid that people will acquire them when information becomes available.

We hope that you are as excited for the reveal as we are, we love all crocs the same regardless of rarity.

Good luck for the reveal. 🍀🍀🍀

See you in a while.. Crecodile!

🐊

--

--