mint-chocolate-chip is a simple one-time mint, any-time burn script
for creating tokens on the Cardano blockchain. This package allows you
to mint any token once, and then burn any amount of it at any time. Each
minting operation generates a unique policy ID, ensuring the uniqueness
of each token batch. You can use this tool to mint various types of
tokens.
This project is a fork of SundaeSwap-finance/mint-chocolate-chip and builds upon the work of MynthAI/token-minter.
To install the package, use pnpm:
pnpm installTo mint tokens, run the following command:
pnpm run mint <address> <token_name> <amount>pnpm run mint addr_test1qzhvmeq0d4hpfsakgx6y9fg0c060qt2lgkvd8suz6p7qrv5h4ygl4jl2rg5zn0cfgv7la58hgn9xwqu3eflc28yqd7nq2ck7fk demo 1000This will output CBOR for 3 transactions that can be signed and submitted. It will also output a reference that needs to be saved for burning. Each time you call this command, it will mint a new token with a new reference.
To burn tokens, run the following command:
pnpm run burn <address> <reference> <amount>pnpm run burn addr_test1qzhvmeq0d4hpfsakgx6y9fg0c060qt2lgkvd8suz6p7qrv5h4ygl4jl2rg5zn0cfgv7la58hgn9xwqu3eflc28yqd7nq2ck7fk 3dcebf74fe00edc5d7795a02891f6d32b3f235fc7990b05b9c08e293dcadc622 1000Pass in the reference and how much you want to burn. This will output CBOR that you can sign and submit.
- Run Mint Command: Use the
pnpm run mintcommand with the appropriate arguments.<address>: The Cardano address where the tokens will be sent.<token_name>: The name of the token you want to mint.<amount>: The amount of tokens you want to mint.
- Output: The script will generate CBOR for 3 transactions.
- Save the Reference: Ensure you save the reference output by the script. This is crucial for future burning operations.
- Sign and Submit Transactions: Use a Cardano wallet or tool to sign and submit the generated CBOR transactions.
-
Run Burn Command: Use the
pnpm run burncommand with the appropriate arguments.<address>: The Cardano address associated with the tokens.<reference>: The reference output from the minting operation.<amount>: The amount of tokens you want to burn.
-
Output: The script will generate CBOR for the burn transaction.
-
Sign and Submit Transactions: Use a Cardano wallet or tool to sign and submit the generated CBOR transaction.
- One-Time Minting: Each minting operation is a one-time event. Once you have minted tokens, you cannot mint more with the same policy.
- Any-Time Burning: Tokens can be burned at any time, as long as you have the reference from the minting operation.
- Unique Policy IDs: Each minting operation generates a new policy ID, ensuring the uniqueness of each token batch.
To generate metadata for your token to be included in the Cardano Token Registry, follow these steps:
- Download and Extract
token-metadata-creator:-
Download
token-metadata-creator.tar.gzfrom the offchain-metadata-tools releases. -
Extract the downloaded tarball:
tar -xvzf token-metadata-creator.tar.gz
-
Add the extracted
token-metadata-creatorto your PATH. You can do this by adding the following line to your~/.bashrcor~/.zshrcfile:export PATH=$PATH:/path/to/extracted/token-metadata-creator
-
Reload your shell configuration:
source ~/.bashrc # or source ~/.zshrc
-
- Install
cardano-cli:- Follow the instructions in the official Cardano
documentation
to install
cardano-cli.
- Follow the instructions in the official Cardano
documentation
to install
- Install
yq:-
Install
yq, a lightweight and portable command-line YAML processor:# On macOS using Homebrew brew install yq # On Ubuntu using Snap sudo snap install yq
-
-
Prepare Metadata File: Create a
metadata.ymlfile with the following details:minted_name: My Example Token name: My Example Token description: This is a demo token ticker: DEMO url: https://www.mynth.ai/ logo: logo.png decimals: 6 policy: 82038d92eb9da4d45dd594171332fd13ed58232a5430f836b4db7a14
- minted_name: The name of the token as minted on the blockchain.
- name: The name of the token for display purposes.
- description: A brief description of the token.
- ticker: The ticker symbol for the token.
- url: The website URL associated with the token.
- logo: The file name of the token’s logo (ensure the file is available in the specified directory).
- decimals: The number of decimal places for the token.
- policy: The policy ID under which the token was minted.
-
Generate Metadata: Run the following command to generate the metadata:
bash metadata.sh
-
Save the Signing Key: The command will generate a
sign.vkeyfile. It is crucial to save this key securely as it will be required for updating the metadata in the future. -
Submit Metadata: After running the command, a JSON file starting with your specified policy ID will be generated. Submit this JSON file as a Pull Request (PR) to the Cardano Token Registry.
By following these steps, you can generate and submit the necessary metadata to have your token recognized and included in the Cardano Token Registry.
To edit existing metadata, you can use the --edit flag:
bash metadata.sh --editThis will pause the script before signing you you can edit the
.json.draft file. After finished, press enter and the final json file
will be generated and signed.
This project is licensed under the GNU Lesser General Public License (LGPL). By using or contributing to this project, you agree to the terms and conditions of LGPL.
If you encounter any issues or have questions, feel free to reach out for support.
Happy minting and burning!