A decentralized bridge that enables seamless conversion between TON (The Open Network) and ckTON (ICRC-1 token on Internet Computer). This project provides a user-friendly dashboard and robust backend infrastructure for cross-chain token transfers.
ckTON is a bridge protocol that allows users to:
- Mint ckTON: Convert native TON tokens to ckTON (ICRC-1 tokens) on the Internet Computer
- Burn ckTON: Convert ckTON back to native TON tokens
- Deploy TON Wallets: Automatically deploy and manage TON wallets for users
- Cross-chain Operations: Seamlessly move value between TON and Internet Computer ecosystems
The project consists of two main components:
- Location:
src/ckton_minter/ - Purpose: Core bridge logic for TON-ICRC conversions
- Features:
- TON wallet deployment and management
- Minting ckTON tokens when TON is received
- Burning ckTON tokens to send TON
- Admin controls for ledger and indexer setup
- Secure transaction verification
- Location:
src/ckton_dashboard/ - Purpose: User interface for bridge operations
- Features:
- Internet Identity authentication
- Balance tracking (TON and ckTON)
- Mint/withdraw operations
- TON wallet deployment
- Real-time transaction status
- π Secure Authentication: Internet Identity integration
- π° Multi-token Support: TON and ckTON balance management
- π One-click Operations: Simple mint/withdraw interface
- π§ Auto-wallet Deployment: Automatic TON wallet creation
- π Real-time Updates: Live balance and transaction tracking
- π Cross-chain: Seamless TON β IC conversions
- Start the Internet Computer replica:
dfx start --background- Deploy the canisters:
dfx deploy- Start the dashboard development server:
npm startThe dashboard will be available at http://localhost:3001 and will automatically proxy API requests to the replica.
- Connect to Internet Identity: Click "Connect to Internet Identity" in the dashboard
- Generate Addresses: Click "Generate All Addresses" to create your TON and IC addresses
- Fund Your TON Wallet: Send TON tokens to your generated TON address
- Deploy Wallet: Click "Deploy Wallet" to initialize your TON wallet on the blockchain
- Mint ckTON: Enter an amount and IC address to convert TON to ckTON
- Withdraw to TON: Send ckTON to the burn address, then withdraw to a TON address
- Automatic Generation: Each user gets a unique TON wallet derived from their IC principal
- V4R2 Wallet Standard: Uses the latest TON wallet version for optimal security
- Deployment Process: Wallets are deployed on-demand when users have sufficient TON balance
- State Management: Wallet deployment status is tracked and verified
- User sends TON to their generated TON wallet address
- System detects the incoming transaction via TON API
- TON is transferred to the minter's main TON wallet
- Equivalent ckTON is minted to the user's IC account
- Transaction is verified and recorded
- User sends ckTON to the burn address (minter's IC account)
- System detects the burn transaction
- TON is sent from the minter's wallet to the user's specified TON address
- Transaction is verified and recorded
- Transaction Verification: All TON transactions are verified before processing
- Retry Logic: Failed operations are automatically retried with exponential backoff
- Fee Management: Configurable fees for both TON and ckTON operations
- Admin Controls: Secure admin functions for system configuration
If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:
- set
DFX_NETWORKtoicif you are using Webpack - use your own preferred method to replace
process.env.DFX_NETWORKin the autogenerated declarations- Setting
canisters -> {asset_canister_id} -> declarations -> env_override to a stringindfx.jsonwill replaceprocess.env.DFX_NETWORKwith the string in the autogenerated declarations
- Setting
- Write your own
createActorconstructor
- Prepare for deployment:
./prep.sh
dfx deploy --ic- Admin Setup (Required for Production):
# Set up the ledger and indexer canisters
dfx canister call ckton_minter admin_setup '(record {
ckton_transfer_fee=null;
indexer_canister=principal "YOUR_INDEXER_CANISTER_ID";
ledger_canister=principal "YOUR_LEDGER_CANISTER_ID";
ton_fee=null
})' --ic- Get the minter's TON address:
dfx canister call ckton_minter minter_ton_address --ic-
Fund the minter TON address:
- Send TON tokens to the address returned in step 3
- This address will be used for all TON operations
-
Deploy the minter's TON wallet:
dfx canister call ckton_minter admin_mint_wallet_deploy --icThe admin setup requires:
- Ledger Canister: ICRC-1 ledger for ckTON token management
- Indexer Canister: Transaction indexing and history
- Transfer Fees: Configurable fees for ckTON transfers
- TON Fees: Configurable fees for TON operations
- Security: Ensure proper access controls for admin functions
- Monitoring: Set up monitoring for transaction processing
- Backup: Regular backups of canister state
- Updates: Plan for canister upgrades and migrations
- Internet Computer Developer Docs
- TON Documentation
- ICRC-1 Standard
- Vue.js Documentation
- Rust Canister Development
ckTon/
βββ src/
β βββ ckton_minter/ # Rust minter canister
β β βββ src/ # Rust source code
β β βββ Cargo.toml # Rust dependencies
β βββ ckton_dashboard/ # Vue.js dashboard
β βββ src/ # Vue.js source code
β βββ package.json # Node.js dependencies
βββ dfx.json # DFX configuration
βββ package.json # Workspace configuration
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Β© 2025 ICON Worldwide AG, Switzerland. All rights reserved.