Skip to content

How to prepare an entry for the registry (Plutus script)

Cardano Foundation Team edited this page Aug 17, 2021 · 7 revisions

Pre-Requisites

For a Plutus script, you will need the following to proceed with the steps to generate a mapping for the registry:

  • Serialized Plutus script
  • A set of trusted keys managed by the user, to sign your registry entries.
  • Install offchain-metadata-tools (see offchain-metadata-tools).

Step 1: Generate the 'subject'

To create a new mapping, you must first obtain your metadata subject. For a Plutus script, the subject is defined as the blake2b-224 hash of the serialized Plutus script.

For this example, we will consider the following subject:

19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0

Step 2: Prepare a draft entry

  • Initialise a new draft entry for the subject using token-metadata-creator
token-metadata-creator entry --init 19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0

This creates a draft JSON file named after your subject.

Step 3: Add required fields

token-metadata-creator entry 19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0 \
  --name "My Gaming Token" \
  --description "A currency for the Metaverse." \

Step 4: Add optional fields

token-metadata-creator entry 19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0 \
  --ticker "TKN" \
  --url "https://finalfantasy.fandom.com/wiki/Gil" \
  --logo "icon.png" \
  --decimals 4         

Step 5: Sign your metadata

Each metadata item must be signed with a set of trusted keys managed by the user.

token-metadata-creator entry 19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0 -a owner.skey

Step 6: Finalize your mapping

This will run some additional validations on your submission and check that it is considered valid.

token-metadata-creator entry 19309eb9c066253cede617dc635223ace320ae0bbdd5bd1968439cd0 --finalize

Your finalized metadata file is now ready to submit to the cardano-token-registry. Follow these steps to proceed with the submission.