-
Notifications
You must be signed in to change notification settings - Fork 1.7k
How to prepare an entry for the registry (Plutus script)
For a Plutus script, you will need the following to proceed with the steps to generate a mapping for the registry:
- The Plutus script for your native asset.
- The assetName associated with the script.
- A set of trusted keys managed by the user, to sign your registry entries.
- Install
offchain-metadata-tools
(see offchain-metadata-tools).
To create a new mapping, you must first obtain your metadata subject. The subject is defined as the concatenation of the base16-encoded policyId and base16-encoded name of your asset. In case your assetName is empty, then the policyId is your subject.
First obtain the policyId:
cardano-cli transaction policyid --script-file <my_minting_script.plutus>
baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f
For this example, we will consider the following native asset:
policyId="baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f"
assetName="myassetname"
- Base16 encode your assetName:
$ echo -n "myassetname" | xxd -ps
6d7961737365746e616d65
- Concatenate the policyId with the base16-encoded assetName to obtain the 'subject' for your entry:
baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65
- Initialise a new draft entry for the subject using
token-metadata-creator
token-metadata-creator entry --init baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65
This creates a draft JSON file named after your subject.
token-metadata-creator entry baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65 \
--name "My Gaming Token" \
--description "A currency for the Metaverse." \
token-metadata-creator entry baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65 \
--ticker "TKN" \
--url "https://finalfantasy.fandom.com/wiki/Gil" \
--logo "icon.png" \
--decimals 4
Each metadata item must be signed with a set of trusted keys managed by the user.
token-metadata-creator entry baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65 -a owner.skey
This will run some additional validations on your submission and check that it is considered valid.
token-metadata-creator entry baa836fef09cb35e180fce4b55ded152907af1e2c840ed5218776f2f6d7961737365746e616d65 --finalize
Your finalized metadata file is now ready to submit to the cardano-token-registry. Follow these steps to proceed with the submission.