ICRC‐7 Dynamic Soulbound Token Extension - ava-vs/reputation GitHub Wiki
ICRC | Title | Author | Discussions | Status | Type | Category | Created |
---|---|---|---|---|---|---|---|
7ext | Dynamic Soulbound Token | Ilia Agafonov (@ilialor) | -- | Draft | Extension | ICRC-7 | 2023-10-14 |
ICRC-7-dSBT: Dynamic Soulbound Tokens on Internet Computer
Minimal Interface for Dynamic Soulbound Tokens (dSBT) Based on ICRC-7
Abstract
This standard is an extension of ICRC-7 and proposes a minimal interface for creating dynamically soulbound tokens (dSBT) using the feature detection functionalities provided by ICRC-7. A dSBT is a non-fungible token that is bound to a single account and has dynamically changeable properties.
Motivation
The Internet Computer community has expressed a need for non-transferable, non-fungible tokens with social pricing mechanisms, similar to World of Warcraft's soulbound items. However, the lack of a token standard leads many developers to block token transfers, which will lead to fragmentation and decreased composability in the long run.
In this document, we outline a minimal addition to ICRC-7 that allows for the verification of a token's permanent non-transferability using ICRC-7's features.
Contract Interface
This extension introduces three specific methods: burn, update_metadata, and badge_uri for dSBT tokens.
module type ICRC7_dSBT = {
// @notice Burns a soulbound token.
// @param token_id The token identifier.
function burn(nat token_id) : async (Nat, Error);
// @notice Updates the metadata of a soulbound token.
// @param token_id The token identifier.
// @param new_metadata The new metadata.
function update_metadata(nat token_id, Metadata new_metadata) : async ();
// @notice Returns the URI for the badge associated with the soulbound token.
// @param token_id The token identifier.
function badge_uri(nat token_id) : async (Text);
};
Methods
Preventing token from being transferred
The burn method should be implemented instead of ircr7_transfer method.
burn : (tokenId: nat) -> variant { Ok: nat; Err: Error; };
Method to retrieve the URI containing collection information
Optional method for pre-formatted collections.
update_metadata: (token_id: nat, Metadata new_metadata : [(Text, Value)]) -> variant { Ok: { nat; [(Text, Value)]}; Err: Error; };
Method to retrieve the URI containing specific token instance information
The method returns the badge format and content.
badge_uri : (tokenId: nat) -> variant { Ok: text; Err: Error; };
Metadata is a type representing the metadata of a token, structured as needed.
The data model for metadata is based on the generic Value type which allows for encoding arbitrarily complex data for each metadata attribute.
The metadata attributes are expressed as (text, value) pairs where the first element is the name of the metadata attribute and the second element the corresponding value expressed through the Value type.
Rationale
The inclusion of burn, update_metadata, and badge_uri methods provides a flexible and dynamic approach to managing soulbound tokens. These methods align with the community's need for non-transferable, customizable tokens.
Backward Compatibility
This proposal is fully backward compatible with ICRC-7.
Security Considerations
There are no direct security considerations related to the implementation of this standard.
SBT Sample
See SBT Badge