ERC-4341 An ordered NFT bundle standard (Ordered NFT Batch Standard)

Stagnant · NFTs & multi-token · created 2021-10-01

Preserves the original order when transferring multiple NFTs, so that tokenIds encoded in Unicode, such as Chinese characters or emoji, can be exchanged as meaningful phrases.

Why it is needed

Because ERC-721 and ERC-1155 treat NFTs as units of an asset, transferring multiple NFTs at once does not preserve or store their order; it is discarded. But when the tokenId itself is used as a Unicode character, as in EIP-3754, sending multiple tokens becomes the act of conveying a sentence or word. If the order changes, the meaning becomes completely different. For example, the Unicode values of the two characters meaning the Great Wall, (38271, 22478), and the reversed order (22478, 38271), read as '长城' and '城长' respectively, both real Chinese words but with different meanings. ERC-1155's batch transfer has no way to restore this order, so it has not been possible to standardize sending and receiving logographic characters like Chinese characters or emoji on the blockchain with their meaning intact.

What to implement

In depth

The phrase structure

A phrase consists of a few base characters, that is, an ordered Unicode sequence, and is stored as an array of unsigned integers. A phrase itself is not something that is circulated (transferred); it does not increase or decrease the balance of any NFT. A phrase cannot be transferred, but it can be looked up and decoded to restore the original Unicode sequence. Because this information is kept in contract storage, it requires additional storage beyond what ERC-1155 needs.

Why order determines meaning

The two Chinese characters in 长城 (the Great Wall) have Unicode decimal values of 38271 and 22478 respectively. Combining them in the order (38271, 22478) gives 长城, but combining them in the order (22478, 38271) gives 城长, an entirely different word. Both are words actually used in Chinese. This is presented as the core difference between this standard and ERC-1155.

The difference between safePhraseTransferFrom and a regular batch transfer

safeBatchTransferFrom takes ids and amounts arrays in the same way as ERC-1155 to transfer multiple tokens, but it provides no guarantee that order is preserved. safePhraseTransferFrom, by contrast, takes an ordered array called phrase as its argument and preserves and stores that order itself during the transfer. Separate functions, balanceOfPhrase and retrievePhrase, are added to query this.

Prerequisite standard EIP-3754

This standard requires EIP-3754 as a precondition. EIP-3754 is a standard that treats NFTs as basic units on the blockchain and proposes that a tokenId encoded in Unicode can carry abstract meaning. In other words, this standard builds on the assumption that each individual tokenId already represents a single Unicode character, adding on top of that a function for managing the order of multiple tokenIds.

Scope of application and limitations

This standard is described as suitable for logographic languages (languages in which a single character represents a word or morpheme) such as Chinese hanzi, Japanese kanji, and Korean hanja, as well as emoji. In these writing systems, only a few characters can convey rich meaning, which makes standardization worthwhile. Non-logographic languages like English, on the other hand, are stated to gain little practical benefit, since representing each individual letter as an NFT would be cumbersome.

Proposal status: Stagnant

This ERC is currently in Stagnant status, meaning the proposal is no longer actively discussed or advanced and has stalled. This should be taken into account when considering adoption or implementation of the standard.

Original ERC · ← ERCs