Creating and deploying Non-Fungible Tokens (NFTs) has become a cornerstone of blockchain innovation, especially within digital art, gaming, and decentralized applications. The ERC-721 standard is the foundation for most NFTs on Ethereum and EVM-compatible blockchains. This guide walks you through the entire process—from understanding the standard to minting your first token—using accessible tools like Remix IDE and IPFS.
Understanding ERC-721: The NFT Standard
ERC stands for Ethereum Request for Comment, with 721 being the unique identifier for this proposal. Unlike fungible tokens such as ERC-20, ERC-721 defines a standard for non-fungible tokens—each with unique properties and ownership tracking.
Built for the Ethereum Virtual Machine (EVM), ERC-721 enables developers to create tokens that represent distinct assets like digital art, in-game items, or real estate. While other standards like ERC-1155 support both fungible and non-fungible tokens, ERC-721 remains the most widely adopted for pure NFT use cases.
Core Functions of ERC-721
The standard includes a set of mandatory and optional functions that ensure interoperability across wallets, marketplaces, and platforms.
ERC-20 Compatible Functions
These familiar functions help wallets display basic token information:
- name(): Returns the token’s full name.
- symbol(): The shorthand ticker (e.g., "ART").
- totalSupply(): Total number of minted tokens.
- balanceOf(address): Number of NFTs owned by an address.
Ownership Management
Critical for secure transfers:
- ownerOf(tokenId): Retrieves the owner of a specific token ID.
- approve(address, tokenId): Grants transfer rights to another address.
- transferFrom(from, to, tokenId): Executes the actual transfer.
- takeOwnership() (optional): Allows approved users to claim tokens.
Metadata & Discovery
Enables rich data attachment:
- tokenURI(tokenId): Returns a link to JSON metadata containing name, description, and image URI.
Events for Transparency
Smart contracts emit these events to track activity:
- Transfer(from, to, tokenId): Triggered on ownership change.
- Approval(owner, approved, tokenId): Fired when approval is granted.
👉 Learn how blockchain standards power next-gen digital ownership
Real-World Use Cases of NFTs
NFTs extend far beyond profile pictures and digital collectibles. Their ability to represent unique ownership unlocks diverse applications:
- Digital Art & Collectibles: Artists tokenize original works, enabling provenance tracking and royalties.
- Gaming Assets: Players truly own in-game items (weapons, skins) that can be traded across platforms.
- Real Estate Tokenization: Physical properties can be represented as NFTs, streamlining title transfers.
- Event Tickets: Fraud-proof concert or sports tickets stored on-chain.
- Identity & Credentials: Secure digital IDs or KYC tokens that users control.
- Software Licensing: Prevent piracy by issuing verifiable license NFTs.
These applications highlight why mastering ERC-721 deployment is valuable for developers and creators alike.
Setting Up: Test Network and Wallet
Before deploying to the main Ethereum network, it's essential to test your contract on a testnet. We’ll use Ropsten, though it's now deprecated in favor of newer testnets like Sepolia. For learning purposes, Ropsten still serves as a solid example.
Step 1: Install MetaMask
Download the MetaMask browser extension and create a wallet. Ensure you back up your seed phrase securely.
Step 2: Switch to Ropsten Testnet
In MetaMask:
- Click the network dropdown.
- Select "Ropsten Test Network" (or add it manually if not listed).
- Visit a Ropsten faucet (e.g., faucet.ropsten.be) to get free test ETH.
- Paste your wallet address and request funds.
Note: Ropsten was one of Ethereum’s earliest testnets, designed to mirror Mainnet behavior for development and testing. Due to recent network changes, consider using Sepolia or Goerli for new projects.
With test ETH in hand, you’re ready to deploy.
Hosting NFT Assets on IPFS
Storing metadata and media off-chain ensures permanence and reduces gas costs. IPFS (InterPlanetary File System) is a decentralized file storage protocol ideal for NFTs.
Step 1: Initialize IPFS Repository
Open your terminal and run:
ipfs initThis creates a local node repository where files are stored.
Step 2: Start the IPFS Daemon
Run:
ipfs daemonThis connects your node to the IPFS network.
Step 3: Add Your Artwork
Upload your image (e.g., art.png):
ipfs add art.pngYou’ll receive a content identifier (CID) starting with Qm. Form the public URL:
https://ipfs.io/ipfs/QmYourImageHashStep 4: Create and Upload Metadata
Create a nft.json file:
{
"name": "My First NFT",
"description": "A simple ERC-721 token created for learning.",
"image": "https://ipfs.io/ipfs/QmYourImageHash"
}Upload it:
ipfs add nft.jsonSave the resulting JSON URL—you’ll use it during minting.
Why IPFS? Files on IPFS are content-addressed. Any change alters the hash, ensuring immutability and trustless verification.
Writing and Deploying Your ERC-721 Contract
We’ll use Remix IDE, a browser-based Solidity development environment, to simplify coding and deployment.
Step 1: Set Up Remix
Go to remix.ethereum.org and create a new file: NFT.sol.
Step 2: Write the Smart Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/ownable.sol";
contract MyNFT is NFTokenMetadata, Ownable {
constructor() {
_initializeNFToken("MyNFT", "MNFT");
}
function mint(address _to, uint256 _tokenId, string calldata _uri) external onlyOwner {
super._mint(_to, _tokenId);
super._setTokenUri(_tokenId, _uri);
}
}Step 3: Compile and Deploy
- In Remix, go to the Solidity Compiler tab and compile.
- Navigate to Deploy & Run Transactions.
- Select Injected Web3 (connects to MetaMask).
- Choose your contract (
MyNFT) and click Deploy.
Approve the transaction in MetaMask.
Minting Your First NFT
After deployment:
- Expand the deployed contract in Remix.
- Find the
mintfunction. Enter:
_to: Your wallet address._tokenId: e.g.,1._uri: The IPFS link to yournft.json.
Click transact and confirm in MetaMask.
👉 See how leading platforms streamline NFT creation and trading
Frequently Asked Questions (FAQ)
Q: What’s the difference between ERC-721 and ERC-1155?
A: ERC-721 assigns one unique token per ID, while ERC-1155 supports multiple token types (fungible, non-fungible) in a single contract—ideal for games with mixed assets.
Q: Is IPFS truly permanent?
A: IPFS stores files only as long as at least one node hosts them. For permanence, use services like Pinata or Filecoin for long-term pinning.
Q: Can I update my NFT after minting?
A: No—NFTs are immutable once deployed. However, metadata can be updated if the contract allows dynamic URI changes.
Q: How much does it cost to mint an NFT?
A: Gas fees vary based on network congestion. On Ethereum Mainnet, costs can range from $10–$100+. Testnets use free test ETH.
Q: Can I sell my NFT after minting?
A: Yes—once minted, you can list it on marketplaces like OpenSea or LooksRare by connecting your wallet.
Q: Do I retain copyright after selling an NFT?
A: Typically no—unless specified in metadata or external agreement. Ownership of the token doesn’t automatically grant IP rights.
Final Steps and Next Actions
Congratulations! You’ve successfully created, deployed, and minted your first ERC-721 NFT. From here:
- Explore adding royalty mechanisms using EIP-2981.
- Integrate with marketplaces via OpenSea’s metadata standards.
- Experiment with lazy minting to reduce upfront costs.
Whether you're an artist, developer, or entrepreneur, mastering NFT creation opens doors to innovative digital economies.
👉 Discover tools that simplify blockchain development and deployment