---
eip: 6239
label: ERC-6239
title: Semantic Soulbound Tokens
status: Final
type: Standards Track
category: ERC
created: 2022-12-30
requires: 165, 721, 5192
official: https://eips.ethereum.org/EIPS/eip-6239
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6239.md
canonical: https://eips.huatuo.xyz/eip-6239/
lang: en
tldr: Soulbound tokens whose metadata carries RDF subject-predicate-object triples, so social facts like follows or memberships become linked, machine-readable data on chain.
tags: [sbt, soulbound, identity, rdf, metadata]
---

# ERC-6239: Semantic Soulbound Tokens

> Adding RDF triples to ERC-5192 token metadata to capture social meaning

**TL;DR:** Soulbound tokens whose metadata carries RDF subject-predicate-object triples, so social facts like follows or memberships become linked, machine-readable data on chain.

## What problem does it solve?

Soulbound tokens (non-transferable NFTs, see [ERC-5192](/eip-5192/)) are a natural way to record credentials, memberships and relationships on chain. But each project encodes the meaning of its tokens in its own ad-hoc metadata, so a different app cannot easily combine "Alice follows Bob" from one contract with "Bob is a member of DAO X" from another.

ERC-6239 adopts the W3C **Resource Description Framework (RDF)** as a common data model. Every Semantic SBT carries RDF statements describing what it means, so on-chain social data can be linked, queried and reasoned over like any other linked-data graph.

## How it works

A Semantic SBT must implement [ERC-165](/eip-165/), [ERC-721](/eip-721/) with the metadata extension, and ERC-5192. On top of that it adds:

- `rdfOf(tokenId)` returning the token's RDF statements as a string.
- Events emitted when the RDF data is created (mint), updated, or removed (burn or revoke): `CreateRDF`, `UpdateRDF`, `RemoveRDF`. Indexers listen to these to maintain a graph.
- Optionally, `schemaURI()` pointing to an RDF Schema describing the vocabulary used. Storing it on IPFS or Arweave is recommended.

An RDF statement is a **triple**: subject, predicate, object. For example, "user1 has name Alice".

Statements default to the **Turtle** (`ttl`) format. Other formats are allowed if prefixed with a format tag in square brackets:

| Tag | Format |
| --- | --- |
| *(none)* or `[ttl]` | Turtle |
| `[nt]` | N-Triples |
| `[nq]` | N-Quads |
| `[trig]` | TriG |
| `[rdf]` | RDF/XML |
| `[rj]` | RDF/JSON |

The ERC-165 interface id for `ISemanticSBT` is `0xfbafb698`.

## Sample code

The core interface:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface ISemanticSBT {
    event CreateRDF(uint256 indexed tokenId, string rdfStatements);
    event UpdateRDF(uint256 indexed tokenId, string rdfStatements);
    event RemoveRDF(uint256 indexed tokenId, string rdfStatements);

    function rdfOf(uint256 tokenId) external view returns (string memory rdfStatements);
}

interface ISemanticRDFSchema {
    function schemaURI() external view returns (string memory);
}
```

Example RDF payloads a token might return (Turtle default, then N-Triples with its tag):

```text
@prefix : <http://example.org/entity/> .
@prefix p: <http://example.org/property/> .
:user1 a :User ;
       p:name "Alice" .
```

```text
[nt]<http://example.org/entity/user1> <http://example.org/property/follows> <http://example.org/entity/user2> .
```

Reading it with ethers v6:

```ts
const sbt = new Contract(addr, ["function rdfOf(uint256) view returns (string)"], provider);
console.log(await sbt.rdfOf(1n));
```

## Things to know

- **Status: Final.**
- The ERC fixes the container and formats, not the vocabulary. Interoperability between projects still depends on agreeing on predicates and schemas (hence `schemaURI`).
- RDF strings stored on chain are public and can be expensive to write; keep statements compact.
- Because the tokens are soulbound, statements describe the holder permanently unless the issuer revokes them. Think about what personal or social data you actually want to publish.


---

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