NFTs & Semi-Fungibles
On Solana, NFTs are often thought of as SPL Tokens with 0 decimals and a supply of 1. According to the Token Metadata Standard, however, it is possible for a range of different tokens to have NFT-like characteristics. Phantom refers to all NFT-like tokens as collectibles and will display them separately from Fungible
tokens that appear on the Home tab. Specifically, Phantom will display all FungibleAsset
, NonFungible
, NonFungibleEdition
and ProgrammableNonFungible
tokens on their own Collectibles tab.
Grouping Collectibles
Phantom groups collectibles by their Certified Collections introduced in v1.1.0 of the Token Metadata Standard. In order to be grouped together, individual NFTs should all reference the same verified collection mint address. This mint address is itself home to an NFT with metadata that describes the collection (Example). Creators must ensure that this collection is verified on-chain (i.e. that verified
is set to true
).
If no verified collection is found, Phantom will fallback to grouping NFTs by the first verified creator's address in the on-chain creators
field. If two unverified items share the same creator address at the 0 index of their creators
array, they will be grouped into the same collection.
Naming Grouped Collectibles
When a group is created, a best-effort process is used to determine that groupβs name. Phantom will look to these fields in the following order of preference:
name
of the verified on-chain collection NFTcollection.name
collection.family
external_url
(parsed to remove url parts)name
(of a single collectible)symbol
address of the first verified creator in the
creators
array (also used to group the collection)
Displaying an Individual Collectible
When displaying the detail view of an individual collectible, Phantom will prioritize on-chain data in the Metadata Account over off-chain JSON linked via the uri
field. This impacts both the name
and symbol
field which appears in both locations.
Rendering Collectible Media
Supported Media Types
Phantom supports a wide-range of media types. For a full list, please refer to:
Selecting Media
When determining what media to display for a given collectible, Phantom will search the off-chain JSON for data in the following order of preference:
animation_url
βΒ Phantom will select the media source at the collectible'sanimation_url
field.properties.files
β If noanimation_url
is found, Phantom will choose the first file where thecdn
property is set totrue
. Otherwise, a file will be chosen based on the media type in the following order of preference:image
audio
video
vr
ormodel
image
β Finally, if Phantom still cannot find media to display, it will fallback to the media source at the collectible'simage
field.
Determining Media Type
If a media source is found in properties.files
, and that source is defined as an object, Phantom will determine the media type based on that file's type
property. Under the Token Metadata Standard, file objects are defined with the following structure:
type
string
The media type of the file. If selected, Phantom will use this to determine the media type (Example: "image/png").
uri
string
cdn
boolean (optional)
An optional flag that dictates if the file is hosted on a cdn. If true
, Phantom will select this file as the primary source file.
In cases where Phantom cannot find a source from properties.files
, it may fallback to a media source that is defined as a string
(e.g. animation_url
or image
). In these cases, Phantom will look for data in the following order of preference:
The media source uriβs
?ext=
query string parameter (https://example.com/foo?ext=png
)The media source uriβs pathname extension (
https://example.com/foo.png
)If the media source uri comes from the
animation_url
, Phantom will infer the media type based on the collectible'sproperties.category
field.If the media source uri comes from the
image
field, Phantom will default to assume it is a png.
If no supported media type can be determined, no media will be selected, and users may see a placeholder image instead.
Resizing Images
Phantom will resize all collectible images to 256x256 pixels. For best results, we recommend images with a square aspect ratio and a power-of-2 dimension (e.g. 256x256, 512x512, or 1024x1024).
Last updated