Book a free call

How to Build a Decentralized NFT Marketplace

A decentralized NFT marketplace settles trades through smart contracts, not a company server. Here is how the on-chain parts fit together and what to build first.

Hertiv engineering teamReviewed by a senior engineer
8 min read
How to Build a Decentralized NFT Marketplace
On this page

Short answer

A decentralized NFT marketplace is a trading platform where NFT sales settle through smart contracts instead of through a company server. Sellers sign price offers, buyers accept them with a transaction, and the contract swaps the payment for the token in one step. The platform never holds funds or keys, so the contracts, the order data and the storage must all be built to work without a central operator.

What is a decentralized NFT marketplace?

A decentralized NFT marketplace is a trading platform where buys and sales settle through smart contracts instead of through a company server. The marketplace code holds no user funds, stores no private keys and cannot move an NFT on its own.

A trade happens only when a buyer and a seller both sign, and the contract swaps the payment for the token in one step. That single rule is what makes the marketplace decentralized: no company sits between the two sides of a trade.

The word decentralized describes how much of the trade the platform controls. In a fully decentralized design, the order book, the escrow and the settlement all live in contracts or in signed messages that anyone can check. In practice most marketplaces are mixed: the contracts settle trades, while a website or an indexer handles search, images and sorting.

That split matters for builders. You do not need to run a payment system or hold other people's assets, but you do need contracts that behave correctly when a trade fails, a listing is cancelled or a buyer walks away. The rest of this guide follows that split: contracts first, then the parts around them.

How is a decentralized marketplace different from a regular one?

A regular NFT marketplace runs on company servers. The company holds the order book, matches buyers and sellers, takes custody of funds during a sale and can freeze an account or remove a listing. A decentralized marketplace replaces most of that with code that anyone can read.

AspectRegular marketplaceDecentralized marketplace
Who holds fundsThe company, during a saleSmart contract escrow, only during settlement
Who can stop a tradeThe companyOnly the buyer, seller or contract rules
Order bookPrivate company databaseOn-chain records or signed messages
Listing removalCompany decisionOwner cancels; no central delete
FeesSet by the companySet in the contract, visible to all
UptimeDepends on company serversDepends on the chain and the contracts

The trade-off is control. A company-run marketplace can refund a buyer, block a stolen item quickly and fix a mistake by hand. A decentralized marketplace cannot do any of that once a trade settles, because no one holds the keys to reverse it. Builders should plan for that from the start, with clear rules for disputes and a way to flag problem listings before they sell.

If you have not built a marketplace before, start with the general steps in our guide to developing an NFT marketplace, then return here for the parts that change when no company runs the trade.

What parts does a decentralized marketplace need?

A decentralized marketplace needs six parts, and only two of them live fully on chain. The contracts handle listing, buying and settlement. Everything else, search, images, wallets and moderation, runs in normal software that talks to the chain.

PartWhat it doesWhere it runs
Listing contractHolds offers and checks ownershipOn chain
Settlement contractSwaps payment for the NFTOn chain
Order indexFinds listings and shows pricesOff-chain indexer
Metadata storeHolds images and item detailsIPFS or Arweave
Wallet flowSigns trades and shows balancesUser wallet
Discovery and moderationSearch, filters and problem flagsWebsite or app

The contract parts are the smallest piece of the build and the hardest to change later. A bug in a listing contract can lock funds or let an item sell twice, and fixing it means deploying a new contract and moving every listing. The off-chain parts are easier: an indexer can be rebuilt, a search page can be redesigned and a moderation list can be updated without touching a trade.

Teams often start with the website and add contracts last. That order causes trouble, because the contracts decide what the website can show and what a trade can do. Build a small contract that lists and sells one item first, then add the website around it.

How do orders work without a central server?

Orders in a decentralized marketplace are signed messages, not database rows. A seller signs a message that says: this NFT, at this price, until this time. The message can sit anywhere, on the marketplace site, in an indexer or on a public feed, because the signature proves who made it and the contract checks it at settlement.

A buyer accepts the offer by sending a transaction to the settlement contract with the payment and the signed message. The contract checks four things: the seller still owns the NFT, the offer has not expired, the price matches and the signature is valid.

If all four pass, the contract moves the NFT to the buyer and the payment to the seller in the same step. If any check fails, the whole trade stops and nothing moves.

Cancelling is just as simple: the seller sends a cancel transaction, or the offer expires on its own. This signed-order model is the same one used by community-run marketplaces, as shown in our guide to building a LooksRare-style marketplace.

Where does the data live: on chain, off chain, or both?

Only the facts a trade depends on need to live on chain: who owns the NFT, what the price is, and whether an offer is still open. Everything else, the image, the description, the search index and the seller history, lives off chain, because storing it on chain would cost too much and add nothing to the trade.

Images and item details usually live on IPFS or Arweave, addressed by a content hash that the token stores. The hash means the file cannot be swapped quietly: if the image changes, the hash changes, and the token points at the old one.

The team still has to keep the file available, though. A hash that points at a file no one hosts is a broken picture, so most teams pin their files with a hosting service as well.

The same split applies when a marketplace grows to more than one chain: the contracts and the storage rules stay per chain, while the index and the website join them up. Our guide to multi-chain marketplace development covers how listings, sales and royalties work when a collection spans chains.

How to build a decentralized NFT marketplace in 7 steps

Build in the order that keeps risk low: contracts first, then the website, then the extras. Each step below has a clear test before you move on.

  1. Choose the chain and token standard. Pick a chain your buyers already use, and use ERC-721 for one-of-one items or ERC-1155 for editions.
  2. Write the listing and settlement contracts. Cover listing, buying, cancelling and royalty payment, and keep the fee logic in one place.
  3. Audit the contracts before they touch real money. Fix every high-severity finding, then re-test the changed code.
  4. Add metadata storage. Store images and details on IPFS or Arweave, and pin the files so they stay available.
  5. Build the indexer and the website. The indexer reads chain events and powers search, filters and price history.
  6. Add the wallet flow. Support the wallets your buyers use, show the exact trade before signing, and handle rejected transactions cleanly.
  7. Launch small and watch the first trades. Start with a few collections, check every settlement, and fix problems before opening up.

The build steps match the general marketplace build closely. The difference is what the contracts must do. A comparison with a community-run model, in our guide to building a Rarible-like marketplace, shows which parts change when the protocol is open.

Example (hypothetical): a first month of trades

Example (hypothetical): a small team launches a decentralized marketplace for digital art on one chain. In the first month, sellers list 300 items. Of those, 60 sell at an average price of 0.4 ETH, so total volume is 60 x 0.4 = 24 ETH.

The marketplace charges a 2.5% protocol fee, so fee income is 24 x 0.025 = 0.6 ETH. Royalties of 5% go straight to creators, which is 24 x 0.05 = 1.2 ETH. The team spends 0.3 ETH on pinning, indexing and hosting, leaving 0.6 - 0.3 = 0.3 ETH to cover the audit share and the next month's running costs.

The lesson is scale, not fees. At 60 sales the fee income barely covers costs, but at 600 sales the same 2.5% fee brings 6 ETH against roughly the same running costs. The team should spend the first month on trust, working trades, correct royalties and honest listings, because volume follows trust, not the other way round.

What are the common mistakes?

Most decentralized marketplace failures come from treating the contracts as an afterthought, or from copying a company-run marketplace and removing the company without replacing what it did.

  • Skipping the contract audit to save money. A marketplace that settles trades in unaudited contracts puts every buyer and seller at risk.
  • Storing images on a single server. If the server goes down, every listing shows a broken picture, even though the tokens still exist.
  • Letting anyone list anything with no checks. Stolen art, fake collections and spam drive buyers away faster than any missing feature.
  • Hiding the fee and royalty rules. Buyers and creators should see the exact split before they sign, not after.
  • Launching on a chain your buyers do not use. Low fees mean nothing if the collectors and their wallets are somewhere else.

Key takeaways

  • A decentralized marketplace settles trades in smart contracts, not on company servers.
  • Orders are signed messages; the contract checks ownership, price, expiry and signature before swapping.
  • Only ownership, price and offer status need to live on chain; images and search live off chain.
  • Build and audit the contracts first, then add the indexer, website and wallet flow.
  • Volume follows trust: working trades, correct royalties and honest listings come before growth.

Frequently asked questions

What makes an NFT marketplace decentralized?

A marketplace is decentralized when trades settle through smart contracts and no company holds funds, keys or the order book. The website and search can still run on normal servers, but a trade must not need them to complete. If the site goes down, the contracts should still let buyers and sellers trade.

Do decentralized marketplaces charge fees?

Yes, most charge a small protocol fee set in the contract, plus any royalty the creator set. The fee is visible in the contract code, so buyers can check it before they sign. Unlike a company fee, it cannot be changed quietly; changing it means deploying new contract code.

Can a decentralized marketplace block stolen NFTs?

It cannot freeze a trade the way a company can, because no one holds the keys to reverse a settled sale. What it can do is flag a listing, hide it from search and warn buyers before they sign. Sellers and buyers should still check provenance themselves before trading.

What is the difference between on-chain and off-chain orders?

An on-chain order is stored in a contract, which costs gas for every listing and change. An off-chain order is a signed message kept by an indexer, which costs nothing until a buyer accepts it. Most marketplaces use signed off-chain orders and settle on chain, which keeps listing free and trades safe.

Do I need a token to run a decentralized marketplace?

No. A marketplace can run on the chain's native coin for payments and a simple fee split in the contract. Some marketplaces add a token for governance or rewards, but that adds legal and design work. Start without one, and add it only if the community needs a way to vote on rules.

Which chain should a decentralized NFT marketplace use?

Use the chain where your buyers and creators already are, and where wallets, indexers and price feeds work well. A cheap chain with no collectors is worse than a busy chain with higher fees. Check wallet support and tooling before you commit, since moving a live marketplace to another chain is slow work.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a decentralized marketplace?

A senior engineer replies within one business day. Or see our Blockchain Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call