Toncoin
Overview
Toncoin (TON) is the native asset of the The Open Network (TON) blockchain. It utilizes:
- Account model
- EdDSA signature algorithm
Explorerhttps://tonscan.org/
Wallets Types
BitGo enables holding Toncoin in the following wallet types:
Multisig Cold | Multisig Hot | MPC Cold | MPC Hot | |
---|---|---|---|---|
Custody | ❌ | ❌ | ✅ | ✅ |
Self-Custody | ❌ | ❌ | ✅ | ✅ |
Ticker Symbols
Mainnet | Testnet |
---|---|
TON | TTON |
Faucet
You can use a faucet to obtain free testnet Toncoin for development and testing purposes.
Faucet: https://ton.app/utilities/faucet
Units
Toncoin is divisible by 10-[9] and the base unit is a nanoton (nton):
- 1 Ton = 1000000000 nanoton
- 1 nanoton = 0.000000001 Ton
Toncoin v1 Wallets
Older Toncoin wallets only support the EQ address format and withdrawals to EQ addresses. If the destination address is uninitialized, withdrawing to an EQ address results in a bounce back.
Currently, BitGo uses Toncoin v1 wallets with UQ address format. These wallets support withdrawing to both EQ and UQ addresses.
Toncoin v1 wallets with UQ address format don't require on-chain initialization before they can receive deposits, because these addresses are memoId
based. When using these wallets, BitGo recommends using UQ addresses for withdrawing and using memo IDs for depositing.
Create Wallet
Note: To enable Toncoin v1 wallets in your enterprise, you may need to contact support@bitgo.com.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>" export COIN="tton" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export LABEL="<DESIRED_WALLET_NAME>" export PASSPHRASE="<YOUR_BITGO_LOGIN_PASSPHRASE>" export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>" curl -X POST \ http://$BITGO_EXPRESS_HOST:3080/api/v2/$COIN/wallet/generate \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "label": "'"$LABEL"'", "passphrase": "'"$PASSPHRASE"'", "enterprise": "'"$ENTERPRISE_ID"'", "disableTransactionNotifications": true, "disableKRSEmail": true }'
Create Address
Note: Receive addresses for Toncoin v1 wallets have the same root address, but use an incremental memo ID as a differentiator.
1 2 3 4 5 6 7 8
export COIN="tton" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" curl -X POST \ https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/address \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN"
Note: Toncoin wallets require on-chain initialization before you can use them. Fund a ton wallet with a small amount and make a withdrawal transaction for the wallet to be initialized on chain. BitGo generates EQ addresses for Ton wallets. Any funds sent to this address before initializing will bounce back to the sender. Send the funds to the UQ version of the wallet address to ensure that funds sent to uninitialized wallets don't bounce back. For more info, read https://docs.ton.org/learn/overviews/addresses#bounceable-vs-non-bounceable-addresses
Consolidate Balance
Consolidation isn't required for Toncoin v1 wallets that use memo IDs for receive addresses.
Toncoin is an account-based asset and therefore requires consolidating to the base address in order to use the maximum spendable amount.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>" export COIN="tton" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export ADDRESS_1="<DESTINATION_ADDRESS_1>" export ADDRESS_2="<DESTINATION_ADDRESS_2>" export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>" curl -X POST \ http://$BITGO_EXPRESS_HOST:3080/api/v2/$COIN/wallet/$WALLET_ID/consolidateAccount \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "consolidateAddresses": [ { "address": "'"$ADDRESS_1"'" }, { "address": "'"$ADDRESS_2"'" } ], "walletPassphrase": "'"$WALLET_PASSPHRASE"'" }'
Estimate Fee
1 2 3 4 5 6 7
export COIN="tton" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" curl -X GET \ https://app.bitgo-test.com/api/v2/$COIN/tx/fee \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN"
Transact
BitGo's Toncoin (TON) multisig contract currently only supports one sender and one recipient so the sendMany
is not supported.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>" export COIN="tton" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export ADDRESS="<DESTINATION_ADDRESS>" export AMOUNT="<AMOUNT_IN_BASE_UNITS>" export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>" curl -X POST \ http://$BITGO_EXPRESS_HOST:3080/api/v2/$COIN/wallet/$WALLET_ID/sendcoins \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "address": "'"$ADDRESS"'", "amount": "'"$AMOUNT"'", "walletPassphrase": "'"$WALLET_PASSPHRASE"'" }'