Design a Web3 Identity & NFT Marketplace

Hard45 min
1 / 30
System design answer

Design a Web3 Identity & NFT Marketplace

Hard45 min30 sections
understanding•9 min read

Problem Statement: A Marketplace Whose Source of Truth Lives on Someone Else's Chain

Frames the system as a fast off-chain coordinator around a slow authoritative ledger and names the five hard problems.

What the interviewer is really asking

"Design a Web3 identity and NFT marketplace" sounds like an e-commerce question with a crypto skin. It is not. In a normal marketplace your own database is the source of truth for who owns what and who paid whom. Here the source of truth for ownership, settlement and identity keys is a public blockchain that you do not operate, cannot roll back, and can only write to by paying gas and waiting for a block. Your whole backend is a fast, eventually consistent replica and coordinator around that slow, authoritative ledger.

So the problem splits into two halves that must agree with each other:

  • On-chain half (slow, final, expensive): token contracts (ERC-721 and ERC-1155), a settlement contract that swaps an NFT for payment atomically, and identity records such as ENS names and attestations. Ethereum mainnet produces one block every 12 seconds and reaches economic finality after two epochs, which is about 12.8 minutes.
  • Off-chain half (fast, cheap, rebuildable): a signed order book, a chain indexer that mirrors ownership, a metadata and media pipeline, wallet-based sign-in, a transaction queue for congested periods, search, and a risk and compliance layer.

Why this is hard

  1. You sell things you cannot lock. A listing is only a signed promise. The seller can move the NFT in their own wallet at any second without telling you. The order book must notice from chain events and stop showing the listing before a buyer wastes gas on a failing transaction.
  2. The ledger can change its mind. Recent blocks can be reorganised. An ownership change you indexed two blocks ago may disappear. Every projection needs a clean rollback path.
  3. Users have no password. Identity is a key pair in MetaMask or another wallet. Sign-in, account linking, reputation and KYC all hang off signatures, and smart contract wallets do not even produce ordinary signatures.
  4. Load arrives as a stampede. A popular drop can bring hundreds of thousands of users in a few minutes. During the Otherdeed mint in 2022, Ethereum gas prices rose into the thousands of gwei and users were widely reported to have spent well over 150 million US dollars on gas. The system must queue, shape and sometimes refuse work.
  5. Fraud is the default, not the exception. OpenSea said in January 2022 that more than 80 percent of items created with its free minting tool were plagiarised works, fake collections or spam. Double mints, copied art, stale listings and phishing signatures are core design inputs.

The mental model to keep for 45 minutes

Think of four planes. The chain plane is the judge: it decides ownership and settles trades. The order plane is the shop window: signed listings and bids held off-chain. The index plane is the mirror: it copies chain state into queryable stores, with a known lag. The identity plane is the passport office: it proves which wallet is talking, links wallets into one account, and attaches reputation and KYC tier.

Every later decision comes back to one rule: never trust the mirror for something only the judge can decide, and never make the judge do work the mirror can do. Showing a profile page reads the mirror. Releasing a high-value payout waits for the judge to be final.

Key Highlights

  • •Ethereum mainnet: 12 s slots, economic finality after 2 epochs (about 12.8 minutes); the backend is a replica with bounded lag.
  • •A listing is a signed promise (EIP-712), not a lock: the seller can move the NFT at any time.
  • •Four planes: chain (judge), order (shop window), index (mirror), identity (passport office).
  • •Rule of the design: never trust the mirror for what only the chain can decide.
Open With the Source-of-Truth Statement
Say in the first minute that ownership and settlement are decided on-chain and that everything you build is a replica or a coordinator with bounded lag. It tells the interviewer you will not design a normal CRUD marketplace by mistake.
Treating the Order Table as Inventory
In e-commerce you decrement stock in your own database. Here a seller can transfer the NFT outside your platform. If you treat your order row as inventory, buyers pay gas for transactions that revert.

Section Rescue Kit

Buzzwords to use:

Off-chain order book, on-chain settlementEconomic finality

Safe statements:

  • "Let me first separate what the chain decides from what our backend only mirrors, because that boundary drives every later choice."
  • "I will treat the blockchain as an external system of record with a 12 second write latency and design the off-chain side around that."
Design a Web3 Identity & NFT Marketplace - System Design | WinJob | WinJob