How to deploy mintless jetton
Introduction
Mintless jettons represent a revolutionary approach to token distribution on the TON blockchain. This guide provides a comprehensive walkthrough for deploying mintless jettons, from initial setup to production deployment and ongoing maintenance.
Before deploying a mintless jetton, ensure you understand the basic concepts and have experience with standard jetton deployment.
Prerequisites
Before starting the deployment process, ensure you have:
- A TON wallet with sufficient funds for deployment
- Understanding of Merkle trees and cryptographic proofs
- Access to hosting infrastructure for off-chain data
- List of airdrop recipients with their allocated amounts
- Development environment set up for TON smart contracts
Step-by-Step Deployment Guide
Deploying a mintless jetton involves several critical steps:
1. Prepare the Merkle Tree
The foundation of any mintless jetton is a properly constructed Merkle tree containing all airdrop data.
Data Collection
- Compile recipient list: Gather all wallet addresses eligible for the airdrop
- Determine allocations: Assign token amounts to each recipient based on your distribution criteria
- Set time constraints: Define
start_fromandexpired_attimestamps for claim availability
Tree Generation Process
AirdropItem Structure:
- amount: Coins (allocated tokens)
- start_from: uint48 (Unix timestamp for claim start)
- expired_at: uint48 (Unix timestamp for claim expiry)- Generate a Merkle tree with all airdrop recipients and their respective amounts
- Each leaf contains an
AirdropItemwith amount, start time, and expiry - Compute the root
merkle_hashthat will be stored on-chain
Best Practices
- Validate addresses: Ensure all recipient addresses are valid TON addresses
- Check allocations: Verify total allocation doesn't exceed intended supply
- Test tree generation: Use small datasets first to validate your tree construction process
2. Deploy the Jetton Master Contract
The jetton master contract must be extended to support mintless functionality.
Contract Requirements
- Include the
merkle_hashin the contract's storage - Implement the
get_mintless_airdrop_hashmap_rootget-method - Ensure compatibility with TEP-177 standard
- Use the mintless jetton standard implementation as a reference
Storage Extensions
Standard jetton storage + {
merkle_hash: uint256 // Root hash of the Merkle tree
}Deployment Checklist
- Contract includes merkle_hash in storage
- All standard jetton methods are implemented
- Mintless-specific get-methods are available
- Contract has been thoroughly tested
- Deployment transaction has sufficient gas
3. Set Up Off-Chain Infrastructure
Mintless jettons require robust off-chain infrastructure to serve Merkle proofs and tree data.
Merkle Tree Hosting
- Storage options: TON Storage, IPFS, AWS S3, or other reliable hosting
- File format: Store complete tree as BoC (Bag of Cells) file
- Accessibility: Ensure high availability and fast access times
- Redundancy: Consider multiple hosting locations for reliability
Custom Payload API Implementation
Implement an API endpoint that provides:
- Individual Merkle proofs for specific addresses
- Initialization data for Jetton wallet deployment
- Verification of claim eligibility
API Endpoints:
GET /api/v1/proof/{address}
Response: {
"proof": "base64_encoded_merkle_proof",
"init_data": "base64_encoded_init_data",
"amount": "1000000000",
"start_from": 1699123200,
"expired_at": 1699209600
}Performance Considerations
- Caching: Implement aggressive caching for frequently requested proofs
- Load balancing: Use CDN or load balancers for high-traffic scenarios
- Rate limiting: Protect against abuse while ensuring legitimate access
4. Configure Metadata
Update your jetton's metadata to include mintless-specific fields.
Required Metadata Fields
According to the metadata standard:
{
"name": "Your Mintless Token",
"symbol": "YMT",
"decimals": "9",
"description": "Description of your token",
"image": "https://example.com/token-logo.png",
"mintless_merkle_dump_uri": "https://example.com/merkle-tree.boc",
"custom_payload_api_uri": "https://example.com/api/v1/"
}Key Considerations
- mintless_merkle_dump_uri: Direct link to the complete Merkle tree data
- custom_payload_api_uri: Base URL for the custom payload API
- Hosting reliability: Ensure these URIs remain accessible long-term
- HTTPS requirement: Use secure connections for all external resources
Development Tools and Utilities
Several specialized tools can assist with mintless jetton development and auditing.
mintless-proof-generator (TON Core)
Official utility from the TON blockchain core team for Merkle proof generation and verification.
Installation
- Clone and build:
git clone https://github.com/ton-blockchain/ton
cd ton
git checkout testnet
mkdir build && cd build
cmake ../
make mintless-proof-generatorThe compiled utility is located at build/crypto/mintless-proof-generator.
Usage
Parse and verify Merkle tree:
build/crypto/mintless-proof-generator parse <input-boc> <output-file>This command:
- Prints the mintless Merkle dump cell hash
- Stores the airdrop list in
<output-file> - Format:
<address> <amount> <start_from> <expired_at>(one per line)
Generate all Merkle proofs:
build/crypto/mintless-proof-generator make_all_proofs <input-boc> <output-file>Use this for creating the complete proof set needed for custom_payload_api_uri.
mintless-toolbox (Tonkeeper)
Community-developed utility from the Tonkeeper team with additional features.
Installation
git clone https://github.com/tonkeeper/mintless-toolbox.git
cd mintless-toolbox
makeUsage
Dump airdrop data:
./bin/mintless-cli dump <airdrop-filename>This utility:
- Reads airdrop files in various formats
- Outputs data in CSV format:
address,amount,start_from,expired_at - Provides additional validation and formatting options
Last updated on