FPE Map is releasd under MIT opensource licence and free to use. If you need commercial support/service regarding FPE Map, feel free to contact ctor.xyz
FPE Map is a framework for efficently create unpredicatable mappings between NFT token ID and metadata and can be used for creating fair NFT mysterybox revealing.
Powered by the encryption algorithm, any small change in the supplied random number results in a drastically different mapping between token IDs and the metadata, making rarity snipping impossible. FPE Map requires storing only one random number on-chain, regardless of the size of the NFT collection. This is the reason why it is extremely gas efficient. (20000x more efficient than Clone X's approach)
npm install fpe-map
yarn add fpe-map
The easiest way to use FPE Map is using fpeMappingFeistelAuto
which automatically configure the block size of the encryption core and other parameters within the algorithm.
uint256 metadataId = FPEMap.fpeMappingFeistelAuto(tokenId, randomSeed, maxSupply)
If the token ID is not starting from 0
, one can do a simple modification to include that.
uint256 metadataId = startTokenId +
FPEMap.fpeMappingFeistelAuto(tokenId - startTokenId, randomSeed, maxSupply)