Explain ethereum > nfts

Non-Fungible Tokens (NFTs)

Non-fungible tokens (NFTs) are smart contracts that track ownership of unique, indivisible items. Unlike fungible tokens (like ERC-20), each NFT has a unique ID.

The most common standard is ERC-721, which defines how these tokens can be minted, transferred, and owned by addresses.

NFTs can represent art, domain names, or any asset where uniqueness matters, making Ethereum a world computer for digital ownership.

contract MyNFT {
    mapping(uint => address) public ownerOf;
    string public name = "MyNFT";

    function mint(address to, uint tokenId) public {
        require(ownerOf[tokenId] == address(0), "Already minted");
        ownerOf[tokenId] = to;
    }

    function transfer(address from, address to, uint tokenId) public {
        require(ownerOf[tokenId] == from, "Not the owner");
        ownerOf[tokenId] = to;
    }
}

Mint a Unique Token (tokenId)

Transfer NFT

Minted Tokens & Owners