Explanation of URI (Metadata structure)
A URI (Uniform Resource Identifier) is a unique identifier used for identifying and locating resources on the internet. In the context of blockchain tokens, URI is often employed to access metadata associated with a specific token. For example, the URL for an image, description, owner information, etc.
In this documentation, as an example, we will frequently refer to Meta assets utilized in the game Degen Youki to provide you with the most comprehensive understanding of the situation.
How to Retrieve URI Data?
To retrieve the URI data for a specific token, simply use the uri(uint256 id)
function available in the smart contract that implements the IERC1155MetadataURI interface. This function returns the URI address for a given token identifier.
Our metadata is inspired by the Enji metadata standard. To learn more about the Enji standard, click on the link.
Smart Contract: https://bscscan.com/address/0xa293d68684be29540838dc8a0222de0c43c6b5b4#code
This method on the Contract is Responsible for returning the token URI
You can also check the URI address directly by accessing the token contract. Below are the steps on how you can obtain such data from our platform:
Go to the blockchain explorer: https://bscscan.com/address/0xa293d68684be29540838dc8a0222de0c43c6b5b4#readContract
Scroll down the page to method "17" titled "uri"
Click on it, to expand the section
Enter the token ID in the input and click the 'Query' button. For example, you can enter ID: 1182
As a response, you will receive a link to the URI of the specific token
Value | Information |
---|---|
tokenId | ID of the Meta Asset on the specific contract. |
bucket_hash | Bucket hash where files are stored. |
description | Description of the Meta Asset. |
image | Image of the Meta Asset. |
minified_image | Compressed image of the Meta Asset. |
extra_files | Additional files showcasing the Meta Asset. |
name | Name of the Meta Asset. |
properties | Properties of the specific Meta Asset that distinguish it may display information about the values it provides more on this later. |
files_spec | Files and data related to the Meta Asset, including its license, assigned category, 2D and 3D files, and sound files. (more detailed information can be found in the next document) |
What is URI Data Used For?
URI data is crucial as it enables access to metadata associated with a specific token, which can be significant for users, trading platforms, exchanges, and applications that want to display information about the token.
How Can Token URI Benefit You?
Resource Preview:
Allows players to preview details of a resource, such as description, preview image, technical data, etc., before purchasing.
Game Integrations:
When creating a game, you can use URI data to integrate NFT resources directly into the game, enabling players to use unique characters, items, etc.
Resale and Trading:
URI data is crucial for NFT resale platforms, providing the necessary information to present the resource on an NFT trading platform.
In-Game Metadata Utilization:
Games can dynamically use resource metadata to customize game mechanics based on unique features owned by players.
Collections and Statistics:
URI data enables the creation of in-game NFT collections, tracking statistics of individual resources, and rewarding players for their collections.
Properties
Properties in our application play a significant role, extending beyond the visual aspect to provide real value in the game. Here's why using properties is essential in the context of real value in the game:
In the case of the discussed game Degen Youki: Properties allow precise specification of functions for each item. For example, a specific item might provide additional life or increase points earned for collecting items during gameplay. This is crucial for users who want to consciously choose items to increase their advantage in the game.
For the discussed asset, properties provide access to a unique map.
Another example of the Properties Parameters used
Check the Asset to see it live: New Era - Green Sword
Property Value | Description |
---|---|
Collection | A collection of a given asset serves as a set, enabling the creation of collections within a specific game, as in this case, Degen Youki. Collections can also be created to categorize Meta Assets of the game into various categories such as Weapons, Armors, Helmets, etc. |
Properties | Properties take three values: Feature Name, Feature Value, and Displayed Feature Value (an optional parameter that doesn't add any value). This metadata allows for a clear presentation of what a given item offers, for example, gender, damage, special ability, weapon type, etc. |
Levels | Levels take four parameters: Level Name, Value, Maximum Value, and Display Type. Levels are particularly useful when indicating that a certain asset provides access to a specific map at a defined level or determining the level of armament. |
Boosts | Boosts take three parameters, appearing in two variants: percentage values and numerical values. These metadata include Name, Value, and Display Type, allowing precise determination of what a given item provides. It is perfect for displaying information that a particular item, for example, offers a bonus to movement speed, increases jump height, etc. |
Using properties not only enhances the visual appeal of items but also introduces a strategic, economic, and functional dimension to the game world, which is crucial for user satisfaction and engagement. The provided example is just one of many possible options.
Last updated