EIPs Explained

ERC-5633 · Stagnant · ERC · 2022-09-09

ERC-5633: Composable Soulbound NFT, EIP-1155 Extension

An ERC-1155 extension that marks individual token IDs as soulbound (non-transferable), so one contract can hold both tradable items and bound ones.

What problem does it solve?

Games and community projects often want a mix of items: some can be traded freely, others are "bound" to the account that earned them, like a World of Warcraft soulbound item. Single-token soulbound standards such as ERC-5192 target ERC-721, where every token is its own NFT. With ERC-1155, a single contract manages many token types, so you need a per-type switch.

ERC-5633 adds that switch: each token ID can be soulbound or not, and wallets can check before trying to move it.

How it works

The extension adds one view function and one event to an ERC-1155 contract:

  • isSoulbound(uint256 id) returns true if the token type id is soulbound.
  • Soulbound(uint256 indexed id, bool bounded) is emitted when a token type is set to (or released from) soulbound.

The rule is simple: if isSoulbound(id) is true, every ERC-1155 function that moves that token from one account to another must revert. Minting (from the zero address) and burning (to the zero address) are still allowed, so issuers can grant and remove bound items.

Contracts must implement ERC-165 and return true for interface ID 0x911ec470, so a wallet or marketplace can detect support and grey out the "transfer" button for bound IDs.

If every token in a collection is meant to be bound, the spec suggests isSoulbound simply returns true by default.

Sample code

Enforcing the rule in an OpenZeppelin v5 ERC-1155 via the _update hook:

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

import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

interface IERC5633 {
    event Soulbound(uint256 indexed id, bool bounded);
    function isSoulbound(uint256 id) external view returns (bool);
}

contract GameItems is ERC1155, IERC5633 {
    mapping(uint256 => bool) private _bound;

    constructor() ERC1155("https://example.com/items/{id}.json") {}

    function isSoulbound(uint256 id) public view returns (bool) {
        return _bound[id];
    }

    function _setSoulbound(uint256 id, bool bounded) internal {
        _bound[id] = bounded;
        emit Soulbound(id, bounded);
    }

    function _update(address from, address to, uint256[] memory ids, uint256[] memory values)
        internal override
    {
        if (from != address(0) && to != address(0)) {
            for (uint256 i; i < ids.length; ++i) {
                require(!_bound[ids[i]], "ERC5633: soulbound");
            }
        }
        super._update(from, to, ids, values);
    }

    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return interfaceId == type(IERC5633).interfaceId || super.supportsInterface(interfaceId);
    }
}

(Access control for minting and _setSoulbound is omitted for brevity.)

Things to know

  • Status: Stagnant. The proposal has not progressed and is not a finalized standard. For ERC-721 collections, the Final ERC-5192 (locked(tokenId)) is the more widely recognized soulbound signal; ERC-5484 adds burn-authorization rules.
  • "Soulbound" only blocks transfers. It does not stop the holder's key from being compromised, and there is no built-in recovery.
  • Approvals (setApprovalForAll) still work at the ERC-1155 level, but any transfer of a bound ID will revert regardless.

#nft #soulbound #erc1155 #extension

Details

Authors
HonorLabs (@honorworldio)
Status
Stagnant
Type
Standards Track / ERC
Created
2022-09-09
Requires

Machine-readable: Markdown · JSON