Blockchain 19 min read

Understanding NFTs: Concepts, Blockchain Foundations, and ERC‑721 Smart Contracts

This article explains what NFTs are, how non‑fungible tokens differ from fungible assets, the underlying blockchain technology including Bitcoin and Ethereum, and demonstrates the ERC‑721 smart‑contract interface that enables unique digital ownership.

ByteDance ADFE Team
ByteDance ADFE Team
ByteDance ADFE Team
Understanding NFTs: Concepts, Blockchain Foundations, and ERC‑721 Smart Contracts

In recent years the term NFT (Non‑Fungible Token) has appeared frequently in media, prompting curiosity about its meaning. NFTs are digital certificates of uniqueness that cannot be copied, representing assets such as artwork, video clips, or any digital content.

Fungibility refers to items that are interchangeable, like phones or bottles of cola; non‑fungibility describes items that cannot be directly exchanged, such as a piece of art. An NFT therefore provides a unique, verifiable digital record that proves ownership and authenticity.

To understand NFTs, one must first grasp blockchain technology. A blockchain is a decentralized ledger that records transactions across many nodes without a central authority. Transactions are broadcast, validated, and grouped into blocks that are linked together, forming an immutable chain.

Bitcoin, introduced by Satoshi Nakamoto in 2008, uses a proof‑of‑work consensus where miners solve computational puzzles (double SHA‑256 hashes) to add new blocks and receive newly minted bitcoins as a reward. The longest‑chain rule ensures network consensus and protects against malicious tampering.

Ethereum, launched in 2015 by Vitalik Buterin, extends blockchain capabilities with a programmable virtual machine (EVM) and supports smart contracts written in Solidity. Smart contracts are self‑executing code that can manage token transfers, enforce rules, and interact with other contracts.

The most common NFT implementation follows the ERC‑721 standard, which defines a set of functions and events for creating, transferring, and querying unique tokens. Below is the Solidity interface for ERC‑721:

pragma solidity ^0.4.20;

interface ERC721 {
    // @dev Triggered when any NFT ownership changes (including creation and destruction).
    event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);

    // @dev Triggered when an NFT's approved address changes.
    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);

    // @dev Triggered when an operator is enabled or disabled for an owner.
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    // @notice Returns the number of NFTs owned by an address.
    function balanceOf(address _owner) external view returns (uint256);

    // @notice Returns the owner of a specific token ID.
    function ownerOf(uint256 _tokenId) external view returns (address);

    // @notice Safely transfers a token, checking for contract recipients.
    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;
    function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;

    // @notice Transfers a token without safety checks.
    function transferFrom(address _from, address _to, uint256 _tokenId) external payable;

    // @notice Approves another address to manage a specific token.
    function approve(address _approved, uint256 _tokenId) external payable;

    // @notice Enables or disables an operator for all of the caller's tokens.
    function setApprovalForAll(address _operator, bool _approved) external;

    // @notice Returns the approved address for a token ID.
    function getApproved(uint256 _tokenId) external view returns (address);

    // @notice Checks if an address is an authorized operator for another address.
    function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

Beyond digital art, NFTs can secure copyrights, identity information, source code, contracts, and other unique assets, both in the physical and virtual worlds. They enable verifiable ownership in the emerging metaverse, gaming items, collectibles, and more.

Blockchainsmart contractsEthereumNFTCryptocurrencyERC-721digital assets
ByteDance ADFE Team
Written by

ByteDance ADFE Team

Official account of ByteDance Advertising Frontend Team

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.