Core Concepts
Sharded Messages
Learn about sharded messages in TAC SDK
Due to the specific architecture of TVM (TON Virtual Machine), it’s not possible to send multiple tokens in a single transaction. The TAC-SDK uses a sharded messaging system to handle this limitation, where each token transfer is treated as a separate message.
How It Works
Each message in the sharded system is linked on the validator side using a unique triplet:
caller
: The address initiating the transactionShardId
: Unique identifier for the message shardShardCount
: Total number of shards in the transaction
Use Cases
Single Token Transfer
For simple operations like token swaps:
- One token is transferred
- Single sharded message is created
- Message is processed individually
Multiple Token Operations
For complex operations like liquidity providing:
- First token transfer is sent as one sharded message
- Second token transfer is sent as another sharded message
- Validators process and link these messages together using the unique triplet
Example: Adding Liquidity
In this example:
- Each token transfer becomes a separate sharded message
- Both messages share the same caller and ShardCount
- Each message has a unique ShardId
- Validators link these messages together for the complete operation
Message Processing
- Messages are generated separately for each token
- Each message contains:
- Token transfer details
- Unique shard identification
- Link to the overall transaction
- Validators collect and process messages
- Messages are linked based on their unique triplet
- Complete operation is executed once all shards are processed