December 29, 2024

đź’ŽWhere NFTs meet privacy: Building private NFTs with Leo

NFT collectors, like art collectors, shouldn't have to make their holdings public, as this exposes them to scams and theft. Privacy is essential for the NFT space to mature properly.

Arcane Finance addressed this with their Cyber Wizards NFT collection on the Aleo Mainnet. This collection of 10,000 NFTs leverages Aleo’s privacy and security technology, along with innovative smart contract design using the Leo programming language and the DokoJS framework.

Max Sultakov, co-founder of Arcane Finance, emphasized that privacy is a fundamental right, and Cyber Wizards aims to give users real control over their assets through Aleo’s technology. The article explores the technical creation, tools, contract architecture, and privacy mechanisms behind the collection.

From ID generation to storage: How to mint a private NFT

When minting a private NFT, the process starts with the client generating a unique 32-character token ID. They then receive signed pricing data from a REST API and submit both the token ID and pricing data to the contract. A blockchain-based random number generator ensures fair NFT distribution.

The token ID and random number are stored in a mint_history mapping in the contract. A backend indexer watches this mapping and links the token ID to its corresponding metadata in S3 storage.

Arcane Finance used DemoxLabs' ArtFactory as a base, taking advantage of its modular and decentralized architecture to ensure a trustless, permissionless system with strong cryptographic integrity enforced by Aleo programs.

Aleo enables private ownership by default

Aleo allows developers to choose which information remains public and which stays private. Public states are stored like in Ethereum, while private states use the record model. For Cyber Wizards, NFTs are confirmed through NFT records, allowing confidential storage and transfers. Users can switch between private and public modes, controlling their privacy level.

Optimized for efficiency and user experience

Cyber Wizards focuses on user-friendly, efficient interactions while prioritizing privacy. Transaction complexity is reduced, optimizing gas costs, and providing flexible NFT management. Initial implementations required three transactions, but optimizations lowered this number, improving user experience and reducing fees.

Managing rarity and traits off-chain for efficiency

Rarity and traits are managed off-chain to reduce gas costs and lighten the contract’s load, optimizing performance and making minting more efficient. Metadata is stored in Amazon S3, with a flexible URL for updates.

Planned multi-mint via external helper contract

Arcane plans a multi-mint feature to allow minting multiple NFTs in one transaction, further reducing network load and gas fees. This will be introduced in upcoming updates.

Conclusion

Privacy in NFTs addresses critical challenges in digital ownership. Cyber Wizards, as the first collection on Aleo Mainnet, sets new standards for private and secure digital collectibles. Arcane Finance uses innovative technology for privacy and flexibility, continuing to enhance functionality and drive NFT space innovation. Follow our progress on X