Build a Token-Gated NFT Minting dApp with Thirdweb and RootstockCollective
In this guide, we’ll build a token-gated platform using Thirdweb and RootstockCollective, this dApp will enable members of the platform to mint unique collectibles based on the amount of stRIF tokens they hold. We will learn how to integrate Web3 wallets authentication, use Thirdweb to mint NFT drops, verify token balances, and enable NFT minting.
This guide will also demonstrate how token ownership can be used to control access. We’ll use stRIF, the governance token of the RootstockCollective, to determine which NFTs users can mint. Holding stRIF will enable members to mint unique collectibles based on the amount of stRIF tokens they hold, they will be granted access to mint two ERC-721 collections: Rooties (Level 1) and Legends (Level 2). This ensures that only engaged community members can participate, creating an exclusive and verifiable experience.
What we’ll cover
- Understanding Tokenization and Token-gating
- Set up the development environment
- Implement Web3 authentication with Sign-In With Ethereum (SIWE) using Thirdweb Auth.
- Create a token-gating mechanism to verify ERC-20 (stRIF) balances using Thirdweb.
- Create and Mint NFT drops using Thirdweb platform
- Deploy smart contracts for stRIF, Rooties (ERC-721), and Legends (ERC-721).
- Integrate NFT minting functionality using Thirdweb’s prebuilt React components.
- Implement conditional media rendering based on token ownership and levels.
Prerequisites
- Node v18+
- Bun package manager
bun install
- MetaMask or a compatible Web3 wallet
- Thirdweb account. Create an account.
Bun is used in this article but you could use your preferred package manager.
Understanding Tokenization & Token-Gating
Tokenization refers to the process of converting real-world assets into digital tokens on a blockchain. These tokens can represent anything of value—real estate, art, commodities, or even financial instruments—and make them tradable, divisible, and accessible globally.
Token-Gating leverages this by granting exclusive access based on token ownership, it provides a way to restrict access based on a user’s token holdings, ensuring that only eligible users can interact with certain features or content. This method, common in dApps, governance (DAOs) and NFT platforms, enables communities to reward loyalty and manage privileges transparently. Token-gating moves access control from central authorities to on-chain proof of ownership, linking digital asset value to real-world utility.
RootstockCollective, or The Collective, is a DAO (Decentralized Autonomous Organization) designed to develop the Rootstock ecosystem by empowering and rewarding builders and users of Rootstock, and RIF token holders. Members of the RootstockCollective gain access exclusive voting rights and participation in the DAO’s governance and decision-making process on Rootstock.
Thirdweb’s pre-built contracts to avoid writing the smart contracts from scratch, this makes the deployment fast and hassle-free. These contracts are fully compatible with Rootstock and allows us focus on configuring the logic of the platform rather than low-level implementation details. This guide will show how to use the Thirdweb SDK to handle key actions like connecting wallets, check token holdings, and mint NFTs. We’ll also use Thirdweb’s UI components to manage media rendering and user interactions with transactions on Rootstock.
Getting Started
Clone the RootstockCollective rewards sample repository and open in code editor.
git clone https://github.com/rsksmart/rootstock-collective-rewards.git