Pular para o conteúdo principal

Rarity Layers

Mirage Garden image soTokens can use frozen, fully on-chain rarity layers.

Each layer is a visual slot such as Background, Body, Face, Hat, or Effect. Each trait inside that layer has a weight. When an object is born, the renderer uses the object seed to pick one trait from every layer by weight, then composes the image and metadata on-chain.

The object format is not limited to 24 x 24 pixel art. A project can use larger pixel art, SVG, or compact raster layers as long as the stored assets remain practical for Base deployment and rendering.

Rarity layers are the image-media path. Animation, audio, and markdown use separate flat media storage today so those formats are not forced through image-layer rules.

What is stored on-chain​

The launch flow deploys:

  • a layered image storage contract with the layer names
  • image data for every uploaded trait
  • the MIME type for each trait image
  • the trait weight for every trait
  • a renderer that reads the frozen storage table

The renderer writes rarity_bps into object metadata attributes. Viewers can also read the selected trait indexes and rarity percentages directly from the renderer.

Why storage freezes​

Trait storage is frozen before the renderer is deployed. This prevents creators from changing weights or replacing art after collectors claim objects.

That freeze is part of the rarity guarantee: the object seed, layer table, image data, and weights are all on-chain and stable.

Assignment modes​

Layered image launches support the same assignment modes as the rest of the launch flow:

  • Random Roll uses each layer's weights to select one trait per layer from the object seed.
  • In Order uses the object ID to select a deterministic trait from each layer.
  • Duplicate uses the first trait in each layer for every object.

Weights matter in Random Roll. In Order and Duplicate ignore rarity weights.