---
eip: 6150
label: ERC-6150
title: Hierarchical NFTs
status: Final
type: Standards Track
category: ERC
created: 2022-12-15
requires: 165, 721
official: https://eips.ethereum.org/EIPS/eip-6150
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6150.md
canonical: https://eips.huatuo.xyz/eip-6150/
lang: en
tldr: An ERC-721 extension that arranges NFTs in a filesystem-like tree, where each token can have a parent and children, so one contract can model categories, forums or org charts as ownable nodes.
tags: [nft, erc-721, hierarchy, tree]
---

# ERC-6150: Hierarchical NFTs

> Hierarchical NFTs, an extension to EIP-721.

**TL;DR:** An ERC-721 extension that arranges NFTs in a filesystem-like tree, where each token can have a parent and children, so one contract can model categories, forums or org charts as ownable nodes.

## What problem does it solve?

Lots of applications are trees: folders in a filesystem, categories in a shop (Home → Electronics → Video Games), subreddits and posts, departments in a company. Building these on-chain usually means custom data structures with no common interface, so explorers and front ends cannot read them generically.

ERC-6150 standardises a **hierarchy of NFTs inside a single [ERC-721](/eip-721/) contract**. Each node in the tree is a token: it can be owned and transferred like any NFT, and its position in the tree can be queried with a small, filesystem-like API. Owning a node could, for example, mean owning a forum category.

## How it works

The core interface (ERC-165 ID `0x897e2c73`):

| Member | Purpose |
| --- | --- |
| `parentOf(tokenId)` | Parent token ID; `0` for a root |
| `childrenOf(tokenId)` | Array of child token IDs |
| `isRoot(tokenId)` / `isLeaf(tokenId)` | Position checks |
| `Minted(minter, to, parentId, tokenId)` | Emitted on mint, recording where the node sits |

Because `parentId == 0` means "root", **token ID 0 cannot be a real node**; IDs start at 1.

Optional extensions, each with its own [ERC-165](/eip-165/) ID:

- **Enumerable** (`0xba541a2e`) – `childrenCountOf`, `childOfParentByIndex`, `indexInChildrenEnumeration` for paging through large trees.
- **Burnable** (`0x4ac0aa46`) – `safeBurn` / `safeBatchBurn`, which only work on leaf tokens.
- **ParentTransferable** (`0xfa574808`) – `transferParent` / `batchTransferParent` to move a node (like `mv` on a directory), emitting `ParentTransferred`.
- **AccessControl** (`0x1d04f0b3`) – `isAdminOf`, `canMintChildren`, `canBurnTokenByAccount` for per-node permissions.

Note the difference between *owning* a node (ERC-721 ownership) and its *position* (parent/child links); transferring the NFT does not move it in the tree.

## Sample code

Walking a tree from the root down (ethers v6):

```ts
import { Contract } from "ethers";

const tree = new Contract(treeAddress, [
  "function childrenOf(uint256) view returns (uint256[])",
  "function ownerOf(uint256) view returns (address)",
  "function isLeaf(uint256) view returns (bool)",
], provider);

async function print(id: bigint, depth = 0): Promise<void> {
  const owner = await tree.ownerOf(id);
  console.log(`${"  ".repeat(depth)}#${id} owned by ${owner}`);
  if (await tree.isLeaf(id)) return;
  for (const child of await tree.childrenOf(id)) await print(child, depth + 1);
}

await print(1n); // assuming token 1 is a root
```

## Things to know

- **Status: Final.**
- `childrenOf` returns an unbounded array. For wide nodes, prefer the Enumerable extension to page through children instead of loading them all on-chain.
- The spec defines no rules for who may mint children or move nodes; that is left to the implementation or the optional AccessControl extension.
- Compare [ERC-6059](/eip-6059/), where NFTs (possibly from different collections) are nested and parents control their children, and the older [ERC-998](/eip-998/) composable tokens. ERC-6150 is about a tree of tokens within one contract.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-6150
