OpenZeppelin Blog

Building an NFT Merkle Airdrop - OpenZeppelin blog

Written by OpenZeppelin Security | May 13, 2021

The workshop was recorded on the 6th May 2021 and led by Hadrien Croubois, Smart Contracts Engineer at OpenZeppelin

The workshop covers the following:

  • ECDSA signatures generation and verification
  • ERC712 signatures generation and verification
  • Merkle-tree generation and usage
  • ERC721 minting

You can watch the video, view the slides, how to use ECDSA signature and Merkle-proofs for minting NFTs.

What is Lazy Minting?

Non Fungible Tokens, also known as NFTs, are very popular kinds of assets. They are used to represent many kinds of assets, from art pieces and domain names to financial positions. Depending on the application, the minting process can vary greatly.

Minting a token is not free. Considering the current gas prices and ETH value, minting a single NFT can cost over $50. This cost is too high for many use-cases, particularly if an artist or system administrator is considering minting hundreds or thousands of NFTs. On the other hand, some users might be ready to pay the price of minting themselves, if that is what it takes to have an on-chain certificate of ownership.

Using cryptographic primitives, the artist can sign “minting authorizations” that later allow a user to do the minting themselves. These signatures are free to produce, as they do not require an on-chain transaction. They guarantee that the artist or system administrator keeps total control over the NFTs, and ensure no token can be minted without prior approval.

Video

Slides

https://github.com/OpenZeppelin/workshops/tree/master/06-nft-merkle-drop/slides

How to use ECDSA signature and Merkle-proofs for minting NFTs

Each case was documented with contracts, test scripts, and gas usage reports. All code examples are available; https://github.com/OpenZeppelin/workshops/tree/master/06-nft-merkle-drop

Learn more

Learn more about OpenZeppelin Contracts: openzeppelin.com/contracts

See the documentation: docs.openzeppelin.com/contracts

Sign up for a free OpenZeppelin Defender account: https://defender.openzeppelin.com/

Be part of the community