How to create fractional NFTs: a step-by-step guide

GoldRush TeamUpdated 15 min read

Fractionalize an NFT step by step: lock an ERC-721 in a vault, mint ERC-20 shares with OpenZeppelin 5, add a buyout and redemption, and track share holders.

A fractional NFT is one non-fungible token split into many fungible ones. The NFT is locked in a smart contract, the vault, and the vault issues a fixed supply of ERC-20 shares against it. Each share is a claim on a slice of that one NFT: shares can be sent, sold or pooled like any ERC-20, while the NFT itself stays put until someone buys it out or one holder collects every share.

This guide builds that vault in Solidity on OpenZeppelin Contracts 5: lock an ERC-721, mint the shares, let anyone buy the NFT out at a reserve price, let share holders redeem the sale proceeds pro rata, and let a holder of every share take the NFT back. It then covers the risks, how ERC-1155 and ERC-404-style designs differ, and how to see who holds the shares with an API.

How NFT fractionalization works

Every fractional NFT design answers the same four questions:

  1. Custody. Where is the NFT while it is fractionalized? Here, in a vault contract that nobody can withdraw it from except through the rules below.
  2. Issuance. How many shares exist, and who gets them? Here, a fixed supply minted to whoever deposits the NFT. They can then sell or distribute the shares.
  3. Exit. How does the NFT leave the vault? Here, two ways: a buyout, where anyone pays the reserve price in ETH and receives the NFT, or a reclaim, where whoever holds every share burns them all and takes the NFT back.
  4. Settlement. What do share holders get after a buyout? Here, a pro-rata slice of the sale proceeds: burn n shares out of a total supply of S and receive n / S of the ETH in the vault.

Designs differ most in the exit. Fractional, renamed Tessera in 2022, let users buy and sell tokens representing fractions of NFTs; it shut down in May 2023, citing its financial position and economic model. The pattern itself is plain Solidity and needs no protocol: the vault below is under 100 lines.

Prerequisites for building a fractional NFT vault

  • Solidity and OpenZeppelin Contracts 5.4.0. The code targets pragma solidity ^0.8.24, was compiled with Solidity 0.8.28, and imports @openzeppelin/contracts 5.4.0 (ERC20, IERC721Receiver, ReentrancyGuard, Address).
  • A place to compile and deploy. Remix works with no install: its in-browser VM gives you funded test accounts, and writing the imports as @openzeppelin/contracts@5.4.0/... pins the version there. Foundry or Hardhat work the same way with the package installed at that version:
npm install @openzeppelin/contracts@5.4.0
  • An ERC-721 to lock. Any NFT you control on a testnet, or the small test collection in step 2.

Step 1: Write the fractional NFT vault contract

One vault holds one NFT. It is itself the ERC-20 share token, so the vault's address is the share token's contract address.

// SPDX-License-Identifier: MITpragma solidity ^0.8.24; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";import {Address} from "@openzeppelin/contracts/utils/Address.sol"; /// Locks one ERC-721 and issues a fixed supply of ERC-20 shares against it./// Anyone can buy the NFT out at the reserve price; share holders then redeem the ETH pro rata./// Whoever holds every share can instead burn them all and take the NFT back.contract FractionVault is ERC20, IERC721Receiver, ReentrancyGuard {    enum State { Empty, Locked, Sold, Reclaimed }     IERC721 public immutable collection;    uint256 public immutable tokenId;    uint256 public immutable shareSupply;    uint256 public immutable reservePrice; // buyout price, in wei     State public state;     event Fractionalized(address indexed owner, uint256 shares);    event BoughtOut(address indexed buyer, uint256 price);    event Redeemed(address indexed holder, uint256 shares, uint256 payout);    event Reclaimed(address indexed holder);     error WrongState(State current);    error WrongNft();    error WrongPayment();     constructor(        string memory name_,        string memory symbol_,        IERC721 collection_,        uint256 tokenId_,        uint256 shareSupply_,        uint256 reservePrice_    ) ERC20(name_, symbol_) {        collection = collection_;        tokenId = tokenId_;        shareSupply = shareSupply_;        reservePrice = reservePrice_;    }     /// Fractionalize: the NFT owner calls collection.safeTransferFrom(owner, vault, tokenId).    /// The transfer lands here, and the sender gets every share.    function onERC721Received(address, address from, uint256 id, bytes calldata)        external        returns (bytes4)    {        if (msg.sender != address(collection) || id != tokenId) revert WrongNft();        if (state != State.Empty) revert WrongState(state);        state = State.Locked;        _mint(from, shareSupply);        emit Fractionalized(from, shareSupply);        return IERC721Receiver.onERC721Received.selector;    }     /// Buyout: pay exactly the reserve price and receive the NFT. The ETH stays here for share holders.    function buyout() external payable nonReentrant {        if (state != State.Locked) revert WrongState(state);        if (msg.value != reservePrice) revert WrongPayment();        state = State.Sold; // effects before the external call        collection.safeTransferFrom(address(this), msg.sender, tokenId);        emit BoughtOut(msg.sender, msg.value);    }     /// After a buyout, burn shares for their slice of the sale proceeds.    function redeem(uint256 shares) external nonReentrant {        if (state != State.Sold) revert WrongState(state);        uint256 payout = (address(this).balance * shares) / totalSupply();        _burn(msg.sender, shares); // reverts if the caller holds fewer shares        Address.sendValue(payable(msg.sender), payout); // interaction last        emit Redeemed(msg.sender, shares, payout);    }     /// Before a buyout, whoever holds every share can burn them all and take the NFT back.    function reclaim() external nonReentrant {        if (state != State.Locked) revert WrongState(state);        _burn(msg.sender, shareSupply); // reverts unless the caller holds the full supply        state = State.Reclaimed;        collection.safeTransferFrom(address(this), msg.sender, tokenId);        emit Reclaimed(msg.sender);    }}

What each part does:

  • onERC721Received fractionalizes. The owner sends the NFT with safeTransferFrom, which calls this hook on the vault. The hook accepts only the configured collection and token ID, only once, and mints the whole share supply to the sender. One transaction, no separate approval, and the NFT and the shares can't get out of step.
  • buyout sells the NFT. Anyone who sends exactly reservePrice gets the NFT. The state flips to Sold before the transfer, and the ETH stays in the vault for the share holders.
  • redeem pays out. After a sale, burning n shares pays balance × n / totalSupply. Since the ETH balance and the supply shrink together, every redemption gets the same price per share, whatever the order. Integer division rounds down, so at most a few wei of dust stays behind.
  • reclaim undoes it. Before any sale, an address that has gathered every share can burn them and withdraw the NFT.
  • state makes each step happen once and in order: Empty → Locked → Sold or Empty → Locked → Reclaimed.

The reserve price is fixed at deployment to keep the example small. That is the main design choice to revisit before real use: see buyout designs below.

Step 2: Deploy a test NFT and the vault

To try the vault without a real NFT, deploy a throwaway ERC-721 with an open mint (for testing only: anyone can mint):

// SPDX-License-Identifier: MITpragma solidity ^0.8.24; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract TestNFT is ERC721 {    constructor() ERC721("Test NFT", "TNFT") {}     function mint(address to, uint256 id) external {        _mint(to, id);    }}

Then, from your first account:

  1. Deploy TestNFT and call mint(yourAddress, 1).
  2. Deploy FractionVault with the share token's name and symbol, the TestNFT address as collection_, 1 as tokenId_, the share supply and the reserve price. Both amounts are raw integers: 1,000 shares at the default 18 decimals is 1000000000000000000000 (1000e18), and a 10 ETH reserve price is 10000000000000000000 (10e18 wei).

Step 3: Fractionalize the NFT

Call safeTransferFrom(yourAddress, vaultAddress, 1) on TestNFT. In Remix, pick the three-argument overload. The transfer runs the vault's onERC721Received, so after this one call:

  • TestNFT.ownerOf(1) returns the vault's address.
  • FractionVault.balanceOf(yourAddress) returns the full supply, 1000e18.
  • FractionVault.state() returns 1 (Locked).

Sending any other token ID or collection to the vault reverts with WrongNft, and a second deposit reverts with WrongState. Use safeTransferFrom, not transferFrom: plain transferFrom skips the hook, so the NFT would arrive with no shares minted and be stuck.

Step 4: Distribute the shares

The shares are a standard ERC-20, so transfer works as usual. Send 100e18 to a second account and it now holds 10% of the NFT. You could equally list the shares on a DEX, airdrop them or sell them; the vault doesn't care who holds them.

Step 5: Buy out the NFT

From a third account, call buyout() with exactly 10 ETH attached. Any other amount reverts with WrongPayment. The NFT moves to the buyer, the 10 ETH stays in the vault and state() returns 2 (Sold).

Step 6: Redeem shares for ETH

Each holder now calls redeem(shares) with their balance. In our run on a local EVM, the second account redeemed 100e18 shares for 1 ETH and the first redeemed 900e18 for 9 ETH, leaving the vault empty and the share supply at zero. Calling redeem before a buyout reverts with WrongState.

If instead the first account had kept all 1,000 shares, it could have called reclaim() before any buyout and received the NFT back. With 100 shares elsewhere, its reclaim() reverts: the burn fails on an insufficient balance.

Buyout designs and their trade-offs

A fixed reserve price set by the deployer is the simplest buyout and the weakest. If it is too low, anyone can take the NFT cheaply; too high, and it never sells. Common alternatives, roughly from simple to complex:

  • Holder-set reserve price. Each share holder states a price and the vault uses a share-weighted average, so the people with money at stake set the floor.
  • Auction. A buyout bid at or above the reserve starts a timed auction; higher bids extend it, and the winner gets the NFT.
  • Buyout with a challenge window. A bidder offers a price for the NFT; share holders can reject it by buying the bidder's offer out, or let it go through.
  • No buyout. Shares are permanent claims and the NFT leaves only by reclaim. That suits collective ownership more than investment.

Whichever you choose, the settlement stays the same: proceeds sit in the vault and holders redeem pro rata. Keep it a pull (each holder calls redeem) rather than a push loop over every holder, which fails once there are too many holders for one transaction.

Risks to handle before mainnet

  • Reentrancy on redeem and buyout. Both send value or call into another contract: sendValue hands control to the holder's address, and safeTransferFrom calls the buyer's onERC721Received. The vault updates state first and guards both with nonReentrant. In our local test, a contract holder that tried to call redeem again from its receive function was reverted and got only its single payout.
  • The wrong NFT, or no shares. Only the configured collection and ID are accepted, and only through safeTransferFrom. An NFT sent with plain transferFrom mints nothing and has no way out of this vault.
  • Share concentration. Whoever gathers 100% of the shares can reclaim the NFT and void any buyout. That is by design here, but it means the price of the last few shares can be very high.
  • Pricing and governance. A fixed reserve price can't follow the market. Any vote or auction you add is new attack surface: flash-loaned shares voting on a price, or a bid sniped at the last block.
  • Metadata and royalties. The vault owns the NFT, so marketplaces show the vault as the owner, and royalties set by the collection don't apply to trades of the ERC-20 shares.
  • Regulation. Selling fractions of an asset to the public, especially marketed as an investment, may make the shares securities in some jurisdictions. Get legal advice before offering them; this guide is not legal advice.
  • Audit. The contract here is a teaching example, compiled and tested on a local EVM but not audited. Have production code audited.

Other ways to fractionalize: ERC-1155 and ERC-404

The vault keeps two standard tokens side by side: an ERC-721 and an ERC-20 that represents it. Two other designs merge them.

  • ERC-1155 with a supply above one. An ERC-1155 contract can mint, say, 1,000 copies of token ID 7, and each copy is an equal share of whatever ID 7 represents. That suits assets issued as fractional from the start, such as editions or tokenized real-world assets, but it doesn't fractionalize an NFT that already exists elsewhere, and it has no buyout or redemption unless you add one. ERC-1155 balances also aren't ERC-20s, so DeFi protocols that expect ERC-20 can't use them directly.
  • ERC-404-style hybrids. ERC-404 mixes an ERC-20 and an ERC-721 in one contract: holding a whole token gives you an NFT, and dropping below a whole token takes it away. Its README calls it "entirely experimental and unaudited", and it is not a finalized Ethereum standard, so wallets, marketplaces and indexers may show these tokens inconsistently.

Use the vault pattern when you want to fractionalize an existing NFT with a clear exit. Use ERC-1155 when you are issuing the asset yourself in equal parts.

Track a fractional NFT and its share holders with GoldRush

Once the shares are out, two questions come up: is the NFT still in the vault, and who owns the shares? Because the shares are an ordinary ERC-20 at the vault's address, GoldRush's token holders API lists every share holder and their balance, and the NFT ownership check for a specific token tells you whether the vault still holds the NFT. Both are part of the GoldRush Foundational API.

The token holders endpoint serves 16 mainnet chains (which ones serve past snapshots) and the ownership check 6. In credits, the holders list costs 0.02 per holder returned and the ownership check 1 per call. Neither covers testnets, so this part needs a vault on a supported mainnet. This script, run with Node 18 or later, reports both and each holder's share of a buyout at the reserve price:

const API = "https://api.covalenthq.com/v1";const headers = { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}` }; async function get(path) {    const res = await fetch(`${API}${path}`, { headers });    if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);    return (await res.json()).data;} // A fractional NFT's state: is the NFT still in the vault, and who holds the shares?// reservePriceWei is the vault's reservePrice(), as a BigInt.async function fractionalOwners(chain, vault, collection, tokenId, reservePriceWei) {    const owned = await get(`/${chain}/address/${vault}/collection/${collection}/token/${tokenId}/`);    const locked = owned.items.some((item) => item.token_id === String(tokenId) && BigInt(item.balance ?? 0) > 0n);     // The vault is the share token, so its holders are the fractional owners.    const holders = [];    for (let page = 0; ; page++) {        const data = await get(`/${chain}/tokens/${vault}/token_holders_v2/?page-size=1000&page-number=${page}`);        holders.push(...data.items);        if (!data.pagination.has_more) break;    }    const supply = holders.length ? BigInt(holders[0].total_supply) : 0n;     return {        locked,        holders: holders.map((h) => ({            address: h.address,            shares: h.balance, // raw, at contract_decimals            percent: supply ? Number((BigInt(h.balance) * 10_000n) / supply) / 100 : 0,            buyoutShareWei: supply ? ((reservePriceWei * BigInt(h.balance)) / supply).toString() : "0",        })),    };} const [vault, collection, tokenId, reserveWei] = process.argv.slice(2);console.log(await fractionalOwners("eth-mainnet", vault, collection, tokenId, BigInt(reserveWei)));

Run it as node fractional-owners.mjs <vault> <collection> <tokenId> <reservePriceWei>. locked is true while the NFT sits in the vault and false after a buyout or reclaim. Each holder comes back with their raw share balance, their percentage of the supply and what a buyout at the reserve price would pay them, in wei. After a buyout, the same holder list shows who still has proceeds to redeem. For snapshots at a past block, pagination and costs in more depth, see the guide to token holder data; for the ownership checks, the guide to verifying NFT ownership.

Handle errors from the GoldRush API

get throws on any non-2xx status with the body in the message. A failed call returns the same envelope as a successful one, with data set to null, error set to true and the reason in error_message; error_code is a JSON number equal to the HTTP status. The docs show this body for a chain name the API doesn't recognize:

{ "data": null, "error": true, "error_message": "Chain nosuchchain-mainnet not supported.", "error_code": 501 }

A 501 means the request was well formed but the chain or endpoint can't serve it, so retrying it unchanged won't help. The docs list an endpoint called on a chain it isn't served on among the 501 cases, so don't retry it: a vault on a testnet has to be on a supported mainnet before this script can read it. A 401 means the key is missing or wrong; with no Authorization header at all, the edge proxy returns an HTML 401 page rather than JSON, which res.text() still reads. Failed requests cost no credits. Every code is listed in the error handling docs.

Frequently asked questions

What is a fractional NFT?

A fractional NFT is a single NFT whose ownership is split into many fungible tokens. The NFT is locked in a vault contract, which issues a fixed supply of ERC-20 shares against it. Each share is a claim on part of that NFT, and shares can be transferred or traded like any ERC-20, while the NFT stays in the vault until a buyout or until one holder gathers every share.

How do you fractionalize an NFT?

Deploy a vault contract that is also an ERC-20 token, then send the NFT to it with safeTransferFrom. The vault's onERC721Received hook checks it is the expected NFT and mints the full share supply to you. From then on you can distribute or sell the shares, and the vault's rules decide how the NFT can leave: a buyout at a reserve price, an auction, or a reclaim by whoever holds every share.

What happens to share holders when a fractional NFT is bought out?

The buyer pays the vault, the vault sends the NFT to the buyer, and the payment stays in the vault. Each share holder then burns their shares to redeem a pro-rata slice: holding 10% of the supply returns 10% of the sale price. Redemption should be a pull that each holder calls, guarded against reentrancy, not a loop that pays everyone at once.

Can you fractionalize an NFT with ERC-1155 instead?

Partly. An ERC-1155 contract can mint many copies of one token ID, each an equal share, which works for assets you issue as fractional from the start. It doesn't fractionalize an existing ERC-721, it has no buyout or redemption built in, and ERC-1155 balances aren't ERC-20s, so DeFi protocols that expect ERC-20 can't use them directly. The vault pattern in this guide handles existing NFTs.

Is ERC-404 a standard for fractional NFTs?

ERC-404 is an experimental hybrid of ERC-20 and ERC-721 in one contract, in which holding a whole token gives you an NFT and dropping below a whole token takes it away. It is not a finalized Ethereum standard, and its own README calls it experimental and unaudited, so wallets, marketplaces and indexers may handle these tokens inconsistently.

How can I see who owns shares of a fractional NFT?

The shares are an ERC-20 whose contract address is the vault, so any token holder lookup for that address lists the fractional owners. GoldRush's token holders API returns every holder with their balance and the total supply, which gives each holder's percentage, and the NFT ownership check confirms whether the vault still holds the NFT.

Next steps

Get new guides by email

New tutorials and best practices for building with blockchain data, sent as they're published.