Conditional Rendering
Conditional rendering uses jsonlogic to define client-only render alterations to the NFT based on certain on and off chain conditions.
For example, an NFT depicting an image of a moon might change to a halfmoon with a rocket landing on it if it gets 50 ๐ and 30 ๐ emojis on it.
An NFT of an apple might rot after a certain block, turning into an image of a rotten apple, or if consumed in time by means of ๐ด emoji, it becomes just an apple core.
An NFT image of a bicycle can show signs of deterioration and dilapidation if it was sold more than, say, 50 times.
A wolf image could show a pack if people have minted more than 50 wolves into this collection, or even sent wolves into the original wolf.
These interactions can have in-game effects, but can also be community-driven art. A collaborative experience where if enough people interact with an NFT in some way, its essence changes.
A logic block of an NFT might look something like this:
In the above example, you can see three scenarios playing out:
- if the NFT gets more than 50 rocket emotes, it would show a different asset as top priority. So, a moon shows a moon landing if 50 rockets are on it.
- if the NFT gets more than 50 snow emoji, the default background of the first asset will be overridden and show a snowy mountain instead.
- if the NFT has its mutable attribute set to "rain" then the background becomes a rainy image
#
ImplementationsThere are no live implementations of this specification yet.
- Kusama (research phase)
- EVM (research phase)
- Pallets (research phase)