Learning Objectives – after this chapter you will be able to:
  • Distinguish fungible and non-fungible tokens.
  • Describe the ERC-721 interface, token IDs and metadata.
  • Explain how ERC-1155 manages many token types in one contract.
  • Evaluate NFT storage, royalty and ownership issues.
What is an NFT?
A Non-Fungible Token (NFT) is a token that is unique: each one has its own identifier (token ID) and cannot be swapped one-for-one with another token of the same contract. An NFT records who owns which token ID.
  • Fungible (ERC-20): one token = any other token – like currency notes.
  • Non-fungible (ERC-721): every token is distinct – like a numbered concert seat or a property deed.
  • Uses: digital art and collectibles, game items, event tickets, memberships, domain names, certificates and tokenized real-world assets.
ERC-721 – Non-Fungible Token Standard
Function / EventPurpose
balanceOf(owner)How many NFTs from this contract an address owns.
ownerOf(tokenId)Who owns a particular token.
safeTransferFrom(from, to, tokenId)Transfer and check that a receiving contract can handle NFTs.
transferFrom(from, to, tokenId)Transfer without the receiver check.
approve(to, tokenId) / getApproved(tokenId)Approve one address for one token.
setApprovalForAll(operator, bool) / isApprovedForAllApprove an operator (e.g. a marketplace) for all your tokens.
Events: Transfer, Approval, ApprovalForAllLogged for wallets and marketplaces.
Metadata extension: name(), symbol(), tokenURI(tokenId)Link to a JSON file describing the token (name, image, attributes).

ERC-721 contracts must also implement ERC-165 (supportsInterface) so other contracts can detect which standards they support.

ERC-1155 – Multi-Token Standard
  • One contract can manage many token types – fungible (e.g. 1,000 “gold coins”), non-fungible (a single “legendary sword”) or semi-fungible (100 identical tickets).
  • Balances are tracked per (account, id): balanceOf(account, id) and balanceOfBatch(...).
  • Batch transfers – safeBatchTransferFrom – move many token types in one transaction, saving gas. Events: TransferSingle, TransferBatch, ApprovalForAll, URI.
  • Popular in blockchain games and ticketing.
BasisERC-20ERC-721ERC-1155
Token typeFungibleNon-fungibleBoth, in one contract
Balance tracked asAmount per addressOwner per token IDAmount per (address, id)
Batch transferNoNoYes
Typical useCurrencies, governance tokensArt, collectibles, deedsGames, tickets, mixed assets
Metadata, Storage and Royalties
  • The blockchain usually stores only the token ID, the owner and a tokenURI. The image and description are in a JSON file stored off-chain.
  • If the metadata is on an ordinary web server, it can disappear or be changed. Content-addressed storage such as IPFS (where the link is the hash of the content) or fully on-chain storage makes NFTs more durable.
  • Owning an NFT gives ownership of the token; copyright and other rights in the artwork depend on the licence granted by the creator – they are not automatically transferred.
  • ERC-2981 defines a standard way for an NFT to report royalty information (royaltyInfo). Paying royalties depends on marketplaces honouring it; the standard itself does not enforce payment.
Key Takeaways
  • NFTs are unique tokens identified by (contract address, token ID).
  • ERC-721 = one unique token per ID; ERC-1155 = many fungible and non-fungible types with batch transfers.
  • Metadata is usually off-chain – durable storage and clear licences matter.
Question / Answer (15 questions)

Answer : An NFT is a unique blockchain token identified by its contract address and token ID. Unlike fungible tokens, one NFT cannot be exchanged one-for-one with another because each represents something distinct.

Answer : Fungible tokens are interchangeable units of equal value, such as ERC-20 stablecoins. Non-fungible tokens are unique, such as an ERC-721 token representing a specific piece of digital art or a numbered event ticket.

Answer : ownerOf(tokenId) returns the address that currently owns the specified token.

Answer : safeTransferFrom checks that if the recipient is a contract, it implements the ERC-721 receiver interface; otherwise the transfer reverts. This prevents NFTs from being locked in contracts that cannot handle them. transferFrom performs no such check.

Answer : It lets an owner approve an operator, such as a marketplace contract, to manage all of the owner’s tokens in that contract. It is convenient but must be granted only to trusted contracts.

Answer : tokenURI(tokenId), part of the ERC-721 metadata extension, returns a URI pointing to a JSON metadata file describing the token, typically containing a name, description, image link and attributes.

Answer : ERC-165 provides supportsInterface, which lets wallets, marketplaces and other contracts query whether a contract implements ERC-721 (and its extensions) before interacting with it.

Answer : ERC-1155 is the multi-token standard that lets a single contract manage many token types – fungible, non-fungible and semi-fungible – with balances tracked per account and token ID, and supports batch transfers.

Answer : A game can keep all its currencies and items in one contract and transfer many item types in one batch transaction, reducing deployment and gas costs.

Answer : TransferSingle for transfers of one token type and TransferBatch for transfers of multiple token types in one operation.

Answer : The server could go offline or the file could be changed, so the NFT might later point to missing or different content. Content-addressed storage such as IPFS or on-chain storage reduces this risk.

Answer : Not automatically. The buyer owns the token; rights to the underlying work depend on the licence or legal terms provided by the creator.

Answer : ERC-2981 is the NFT Royalty Standard. It defines royaltyInfo(tokenId, salePrice), which returns the royalty receiver and amount. Marketplaces can use it, but the standard does not force payment.

Answer : By the combination of the contract address and the token ID within that contract.

Answer : Event tickets, in-game items, membership or access passes, and certificates or tokenized ownership records for real-world assets.
MCQ Test : Check Your Understanding (5 questions)

Select an option and press Check Answer, or answer all questions and press Submit Test to see your score. Each answer comes with an explanation.

Q1. Which standard is designed for unique, non-fungible tokens?

Show Answer

Correct Answer : B. ERC-721
ERC-721 is the non-fungible token standard.

Q2. Which ERC-721 function returns the owner of a token?

Show Answer

Correct Answer : D. ownerOf
ownerOf(tokenId) returns the owner address.

Q3. Which standard supports batch transfers of multiple token types in one call?

Show Answer

Correct Answer : A. ERC-1155
ERC-1155 provides safeBatchTransferFrom.

Q4. NFT images are most commonly stored:

Show Answer

Correct Answer : C. Off-chain, referenced by a tokenURI
The chain stores a URI; metadata and images are usually off-chain (e.g. IPFS).

Q5. ERC-2981 deals with:

Show Answer

Correct Answer : D. NFT royalty information
ERC-2981 standardises how NFTs report royalty details.

Bibliography/References

The notes, questions and MCQs on this page are original explanations written for this course. The works listed below were consulted and are cited for attribution and further reading. Product names, logos and trademarks belong to their respective owners. Short quotations, where used, are marked and attributed.

  1. Ethereum Improvement Proposals. (2018). ERC-721: Non-Fungible Token Standard. https://eips.ethereum.org/EIPS/eip-721
  2. Ethereum Improvement Proposals. (2018). ERC-1155: Multi Token Standard. https://eips.ethereum.org/EIPS/eip-1155
  3. Ethereum Improvement Proposals. (2020). ERC-2981: NFT Royalty Standard. https://eips.ethereum.org/EIPS/eip-2981
  4. ethereum.org. (n.d.). Non-fungible tokens (NFT). https://ethereum.org/en/nft/
  5. ethereum.org. (n.d.). ERC-721 Non-Fungible Token Standard. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/standards/tokens/erc-721/
  6. ethereum.org. (n.d.). ERC-1155 Multi-Token Standard. Ethereum Developer Documentation. https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/
  7. IPFS Documentation. (n.d.). What is IPFS? https://docs.ipfs.tech/concepts/what-is-ipfs/