On-chain Metadata Standard
P
Potatoe
Hear me out...
Raindrop protocol is awesome, but what if we had an actual standard?
I propose a very simple,elegant, and flexible solution for an on-chain metadata standard.
Our current standard has a uri field that points to an off-chain json with a standard structure.
What if we did the same, with an on-chain PDA?
If this PDA had a standard structure (think single vector where each element is an attribute and value pair) then it could be deserialized by anyone easily.
This also allows projects to freely control the PDAs contents and change NFT attributes on-chain through their own program.
Therefore, I propose adding a single field to the current metadata structure that points to this PDA.
Projects that do not care about this can leave the field blank and use the old standard, while those who want to update NFT attributes in a verifiable way on-chain can do so.
I pitched this at Breakpoint with some positive reception, would love to make it a reality.
K
Kartik Soneji
I think this can be done with no additional cost:
individual NFTs can store attributes in the master edition struct (which is literally empty)
each trait has several possible values
traits and values are ordered canonically (may be sorted)
the collection nft stores the attribute list
the master edition stores the value index in order of the traits
the number of bits taken by each trait is ceil(log2(value count))
that can be calculated from the attribute_list
eg:
{
"eye color": ["brown", "green"],
"fur color": ["white", "brown", "black"],
}
nft attributes: 1 00
first attribute is eye color, with 1 bit = green
second attribute is fur color, with 2 bits = white
P
Potatoe
Kartik Soneji: yes, we could do something like this.
The only issue is that it adds more accounts you need to call and parse (collection + Master edition) where as the simple PDA solution would be one call.
However, the amount of rent/cost saved with your recommendation would definitely be worth it IMO.
K
Kartik Soneji
Potatoe: The master edition _is_ a PDA, so a program would have to fetch and parse the same number of accounts as now.
The space in the master edition for normal NFTs is unused so adding attributes there would make use of that space.
Fedor Timokhov
Agree. This might open up a lot of new possibilities in building stuff with NFTs.
NFT projects were using URI data, especially NFT attributes, with many different purposes for months.
There are "subdaos" based on traits. There are NFT art upgrades. There are additional perks for NFTs within the collection with certain attribute. There are collections with 'trait swap' mechanics.
At least partially moving URI data to the blockchain will be a great step for NFTs ecosystem.
P
Potatoe
Fedor Timokhov: right! It would definitely need to be optional because of costs, but there are so many use cases, it should be an option