LUKSO WEBSITE TAGS — Token icons
This post is part of a series where DROPPS breaks down the meaning of the keywords in the LUKSO website section about Universal Profiles, NFTs and Cultural Currencies.
Right now you might be thinking: Token Icons? That’s no big deal, I’ve always seen Token Icons on Etherscan or Uniswap. Yet, this is but another centralized magic trick. Web3 platforms conveniently store icons on their servers (like Etherscan does) or get them from someone else’s centralized server (i.e. Uniswap with Trust Wallet’s Asset Repository).
This means that, for the vast majority of projects, there’s no on-chain link between a token contract and the corresponding Metadata, i.e. when it’s represented on platforms such as Etherscan, Uniswap etc. It is ultimately up to a human being to establish this connection.
Deconstructing LUKSO’s technology
The Digital Asset standards on LUKSO include an ERC725Y storage contract, which is a very flexible, extensible and controllable way of storing information in a smart contract.
Notice that the Metadata of the Digital Asset (same as Token) is not set in the contract code and thus its structure is not rigid. Instead, the metadata is added upon deployment, by calling a function named setData() on the ERC725Y storage of the Token contract. The key names and values should follow LUKSO’s standards in order to be correctly displayed on LUKSO-compatible platforms.
Every Token you deploy adhering to LUKSO’s standards will have a Key/Value pair of the following type:
In the example above, the key “LSP4Metadata” has a JSONURL type of value, which means that it links to a JSON file stored somewhere on the web (hopefully a decentralized service).
For those of you who are developers or simply more tech savvy, follow along as we go step-by-step, retrieving the metadata of a Token deployed on LUKSO.
Step 1: Choose the token
Let’s pick the RenaiXance Sneaker. Notice that the platform displays many images and also a short description text.
Step 2: Extract the metadata URL from the Token contract
In order to do this, we’ll use a tool provided by LUKSO that allows us to read ERC725Y storages.
As parameters, we input the Sneakers contract address and select the key we want to retrieve from storage. In this case, the key is the LSP4Metadata key. Notice that the Sneakers asset was distributed in the L14 network, which requires us to change to the L14 settings in the Inspect Tool.
Now that we have our complete JSON URL value, let’s get rid of the hash part and isolate the actual URL we need to fetch the file:
Step 3: Fetch the Metadata file from the extracted URL
The URL we get is prefixed with IPFS which tells us that, in this case, the Token’s metadata file was uploaded to the IPFS network. All we need to do is to access (and submit a request) to an IPFS node to get it to “hand over” the file.
For now, we can use LUKSO’s development node. In the browser’s address bar we type in the node’s address + slash + the URL we just got from the contract: https://2eff.lukso.dev/ipfs/QmVoKAaE3Zmt8XvwGyUydFgDczLrAeYNKMm7QjVqhkiBPX
Which leads us to the above result. Not pretty? To turn this document into a more readable format we use a simple JSON formatter tool:
As you can see, the metadata includes a description, a video (under the “assets” attribute), and a set of images including different sizes for the same image. Naturally, the smaller size can be used for the Token Icon while the bigger size might be used to display the asset on digital galleries!
Having such a degree of flexibility in updating the metadata of a Token might go against the immutability principles of Blockchain purists, but it’s important to keep in mind that this is merely a possibility. Access control will ultimately determine if the metadata is open to change or not. If nothing/nobody has the permissions to change it, then it’s locked forever.
Some might interpret the reliance on external storage networks as a disadvantage. This is mainly for gas-saving purposes, as typical EVM blockchains are not designed to store media, but instead to save sensitive information that requires a consensus to be retrieved.
All in all, LUKSO has clearly come up with the most flexible approach for storing Token metadata within the new creative economy, one where the power of choice is placed in the hands of dApp developers and even users.
Stay with us for our next piece where we’ll delve into the “Visual” aspect of Universal Profile and the ramifications this entails!