Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Nightly /
Src 9 Metadata Keys

Icon LinkSRC-9: Native Asset

The following standard attempts to define the keys of relevant on-chain metadata for any Native Assets Icon Link. Any contract that implements the SRC-9 standard MUST implement the SRC-7 and SRC-20 standards. This is a living standard where revisions may be made as the ecosystem evolves.

Icon LinkMotivation

The SRC-9 standard seeks to enable relevant data for assets on the Fuel Network. This data may include images, text, contact, or all of the above. All metadata queries are done through a single function to facilitate cross-contract calls.

Icon LinkPrior Art

The use of generic metadata for Native Assets Icon Link is defined in the SRC-7 standard. This standard integrates into the existing SRC-7 standard.

Icon LinkSpecification

The following keys are reserved for the SRC-9 standard. Use of the keys should follow the SRC-9 specification.

All keys SHALL use snake case.

Icon LinkSocial

The social prefix SHALL be used for any social media platform and SHALL return usernames.

Any social media metadata keys SHALL follow the following syntax social:site where:

  • The social keyword must be prepended to denote this is a social platform
  • The site keyword must be the website or platform of the social

Icon Linksocial:discord

The key social:discord SHALL return a String variant of a username for the Discord platform.

Icon Linksocial:facebook

The key social:facebook SHALL return a String variant of a username for the Facebook platform.

Icon Linksocial:farcaster

The key social:farcaster SHALL return a String variant of a username for the Farcaster platform.

Icon Linksocial:friend.tech

The key social:friend.tech SHALL return a String variant of a username for the Friend.tech platform.

Icon Linksocial:github

The key social:github SHALL return a String variant of a username for the Github platform.

Icon Linksocial:instagram

The key social:instagram SHALL return a String variant of a username for the Instagram platform.

Icon Linksocial:lens

The key social:lens SHALL return a String variant of a username for the Lens Protocol.

Icon Linksocial:linkedin

The key social:linkedin SHALL return a String variant of a username for the LinkedIn platform.

Icon Linksocial:reddit

The key social:reddit SHALL return a String variant of a username for the Reddit platform.

Icon Linksocial:signal

The key social:signal SHALL return a String variant of a username for the Signal platform.

Icon Linksocial:telegram

The key social:telegram SHALL return a String variant of a username for the Telegram platform.

Icon Linksocial:tiktok

The key social:tiktok SHALL return a String variant of a username for the TikTok platform.

Icon Linksocial:x

The key social:x SHALL return a String variant of a username for the X or formerly Twitter platform.

Icon Linksocial:wechat

The key social:wechat SHALL return a String variant of a username for the WeChat platform.

Icon Linksocial:whatsapp

The key social:whatsapp SHALL return a String variant of a username for the WhatsApp platform.

Icon Linksocial:youtube

The key social:youtube SHALL return a String variant of a username for the YouTube platform.

Icon LinkContact

The contact prefix SHALL be used for any contact information on a particular project's team for an asset.

Any contact information metadata keys SHALL follow the following syntax contract:type where:

  • The contact keyword must be prepended to denote this is contact information
  • The type keyword must be the method of contact

The key SHALL use snake case.

Icon Linkcontact:email

The key contact:email SHALL return a String variant of an email.

Icon Linkcontact:mailing

The key contact:mailing SHALL return a String variant of a mailing address. All mailing addresses MUST follow the UPU addressing format.

Icon Linkcontact:phone

The key contact:phone SHALL return a String variant of a phone number. All phone numbers SHALL follow the E.164 standard.

Icon Linkcontact:company

The key contact:company SHALL return a String variant of a company name.

The link prefix SHALL be used for any external webpage hyperlink associated with an asset.

Any external webpage metadata keys SHALL follow the following syntax link:site where:

  • The link keyword must be prepended to denote this is an external webpage
  • The site keyword must be an external website

Icon Linklink:home

The key link:home SHALL return a String variant of the asset's project homepage.

Icon Linklink:contact

The key link:contact SHALL return a String variant of the asset's project contact information webpage.

Icon Linklink:docs

The key link:docs SHALL return a String variant of the asset's project documentation webpage.

Icon Linklink:forum

The key link:forum SHALL return a String variant of the asset's project forum webpage.

Icon Linklink:blog

The key link:blog SHALL return a String variant of the asset's project blog.

Icon Linklink:linktree

The key link:linktree SHALL return a String variant of the asset's project linktree information webpage.

Icon LinkResources

The res prefix SHALL be used for any resources or general information on an asset.

Any resource metadata keys SHALL follow the following syntax rec:type where:

  • The res keyword must be prepended to denote this is a resource
  • The type keyword must be the type of resource

Icon Linkres:license

The key res:license SHALL return a String variant of the asset's project license.

Icon Linkres:tos

The key res:tos SHALL return a String variant of the asset's project Terms of Service.

Icon Linkres:author

The key res:author SHALL return a String variant of the asset's project author. This MAY be a full name or pseudonym.

Icon Linkres:about

The key res:about SHALL return a String variant about the asset's project up to 2048 characters.

Icon Linkres:description

The key res:description SHALL return a String variant describing the asset's project up to 256 characters.

Icon Linkres:date

The key res:date SHALL return a Int variant of a UNIX timestamp.

Icon Linkres:block

The key res:block SHALL return a Int variant of a block number.

Icon LinkImages

The image prefix SHALL be used for any image files associated with a singular asset.

Any image metadata keys SHALL follow the following syntax image:type where:

  • The image keyword must be prepended to denote this is an image
  • The type keyword must be the file type of the image

Icon Linkimage:svg

The key image:svg SHALL return a String variant of an SVG image.

Icon Linkimage:png

The key image:png SHALL return a String variant of a URI for a PNG image.

Icon Linkimage:jpeg

The key image:jpeg SHALL return a String variant of a URI for a JPEG image.

Icon Linkimage:webp

The key image:webp SHALL return a String variant of a URI for a WebP image.

Icon Linkimage:gif

The key image:gif SHALL return a String variant of a URI for a GIF image.

Icon Linkimage:heif

The key image:heif SHALL return a String variant of a URI for a HEIF image.

Icon LinkVideo

The video prefix SHALL be used for any video files associated with a singular asset.

Any video metadata keys SHALL follow the following syntax video:type where:

  • The video keyword must be prepended to denote this is a video
  • The type keyword must be the file type of the video

Icon Linkvideo:mp4

The key video:mp4 SHALL return a String variant of a URI for an MP4 video.

Icon Linkvideo:webm

The key video:webm SHALL return a String variant of a URI for a WebM video.

Icon Linkvideo:m4v

The key video:m4v SHALL return a String variant of a URI for a M4V video.

Icon Linkvideo:ogv

The key video:ogv SHALL return a String variant of a URI for an OGV video.

Icon Linkvideo:ogg

The key video:ogg SHALL return a String variant of a URI for an OGG video.

Icon LinkAudio

The audio prefix SHALL be used for any audio files associated with a singular asset.

Any audio metadata keys SHALL follow the following syntax audio:type where:

  • The audio keyword must be prepended to denote this is audio metadata
  • The type keyword must be the file type of the audio

Icon Linkaudio:mp3

The key audio:mp3 SHALL return a String variant of a URI for an MP3 file.

Icon Linkaudio:wav

The key audio:wav SHALL return a String variant of a URI for a WAV file.

Icon Linkaudio:oga

The key audio:oga SHALL return a String variant of a URI for an OGA file.

Icon LinkMedia

The media prefix SHALL be used for any media associated with a particular singular asset.

Any media metadata keys SHALL follow the following syntax media:type where:

  • The media keyword must be prepended to denote this is a video
  • The type keyword must be the file type of the media

Icon Linkmedia:gltf

The key media:gltf SHALL return a String variant of a URI for a glTF file.

Icon Linkmedia:glb

The key media:glb SHALL return a String variant of a URI for a GLB file.

Icon LinkLogos

The logo prefix SHALL be used for any images associated with a particular asset or project.

Any logo metadata keys SHALL follow the following syntax logo:type where:

  • The logo keyword must be prepended to denote this is a logo
  • The type keyword must be the type of logo

Icon Linklogo:svg

The key logo:svg SHALL return a String variant of an SVG image of a logo.

Icon Linklogo:svg_light

The key logo:svg_light SHALL return a String variant of an SVG image of a logo for light themes.

Icon Linklogo:svg_dark

The key logo:svg_dark SHALL return a String variant of an SVG image of a logo for dark themes.

Icon Linklogo:small_light

The key logo:small_light SHALL return a String variant of a URI for a 32x32 PNG image of a logo for light themes.

Icon Linklogo:small_dark

The key logo:small_dark SHALL return a String variant of a URI for a 32x32 PNG image of a logo for dark themes.

Icon Linklogo:medium_light

The key logo:medium_light SHALL return a String variant of a URI for a 256x256 PNG image of a logo for light themes.

Icon Linklogo:medium_dark

The key logo:medium_dark SHALL return a String variant of a URI for a 256x256 PNG image of a logo for dark themes.

Icon Linklogo:large_light

The key logo:large_light SHALL return a String variant of a URI for a 1024x1024 PNG image of a logo for light themes.

Icon Linklogo:large_dark

The key logo:large_dark SHALL return a String variant of a URI for a 1024x1024 PNG image of a logo for dark themes.

Icon LinkAttributes

The attr prefix SHALL be used for any attributes associated with a singular asset.

Any attribute metadata keys SHALL follow the following syntax attr:type where:

  • The attr keyword must be prepended to denote this is an attribute
  • The type keyword must be the type of attribute

There are no standardized types of attributes. Example: attr:eyes.

Icon LinkRationale

The SRC-9 standard should allow for standardized keys for metadata on the Fuel Network. This standard builds off existing standards and should allow other contracts to query any relevant information on the asset.

Icon LinkBackwards Compatibility

This standard is compatible with Fuel's Native Assets Icon Link, the SRC-20 standard, and the SRC-7 standard.

Icon LinkSecurity Considerations

This standard does not call external contracts, nor does it define any mutations of the contract state.

Icon LinkExample

impl SRC7 for Contract {
    fn metadata(asset: AssetId, key: String) -> Option<Metadata> {
        if (asset != AssetId::default()) {
            return Option::None;
        }
 
        match key {
            String::from_ascii_str("social:x") => {
                let social = String::from_ascii_str("fuel_network");
                Option::Some(Metadata::String(social))
            },
            _ => Option::None,
        }
    }
}