How NFT Smart Contracts Work
The parts of an NFT smart contract in general terms: ownership records, transfers, token standards, metadata, admin powers and royalties.
An NFT contract is a program deployed to a blockchain at a fixed address. Anyone can call its functions. Some calls just read data. Others change it, and those cost a network fee.
The ownership record
At its heart is a table: token ID on one side, holder address on the other. When you buy, the table is updated so your address sits next to that ID. That is what owning the token means on-chain.
Transfers and approvals
Holders can move tokens directly or approve another address, such as a marketplace, to move them on their behalf. Approvals are powerful. An approval granted to a malicious contract can let it take tokens later.
Token standards
Standards like ERC-721 and ERC-1155 define the functions every compatible contract must offer. They make tokens portable between wallets and markets. Read what a token standard is.
Metadata
The contract usually stores a link, not the image. The link leads to a small file listing the name, description, traits and image location. Where that file lives decides how easily it can change.
Extra powers
- Minting more tokens
- Pausing or restricting transfers
- Changing the base link for metadata
- Upgrading logic through a proxy
- Withdrawing funds held by the contract
Each is a choice the project made. See whether a contract can be changed.
Royalties
Many contracts report a royalty percentage for resales. Whether a marketplace honors it is up to that marketplace. The contract alone usually cannot force payment.
Rights to the art
Holding a token and holding copyright are separate. Read does owning an NFT mean owning the art?.
General information only. Nothing here is financial, legal or investment advice.
What an NFT smart contract actually does, explained without hype