Learn
Jetton contract
Jetton standard explanation

Jetton contract

Jetton standard explanation

Reveal the Jetton

In TON digital tokens was named Jettons. Now, we will walk through the Jetton standard and see how problems we met previously were solved.

Because of sharding, where payload on Blockchain will split to different nodes, we need keep our contracts as small blockchains.

📚 Every time you noticed, that your contract keep growing to infinity map in your contract-like-big-monolith - something in designing of service went wrong.

To keep possibility make our smart contracts split shards we want keep all smart contracts as small blockchain.

Let's take a look how regular transfer Jetton works according to standard. jetton-6

Here scheme of transfer tokens from user of Wallet App A to user Wallet App B:

  1. Wallet App A requests Wallet A to send Jetton transfer request message.
  2. Wallet A sends to Jetton_A wallet message with request of sending jettons.
  3. Jetton A sends to Jetton B value of jetton we want to transfer. Decrease his own balance of jettons.
  4. Jetton B get incoming message, increase its jetton balance, send notification to wallet contract Wallet B.

📚 Notification necessary to find out what is balance of Jetton contract, because you have no option to get(use get method) information from contract.

If we will scale our user base, we just get growing of little blockchains. THere will not appear big monolith entity now. jetton-7

When quantity of actual contracts become to large, they will split to different shardchains. Each of these contracts has fixed size state and each contract may live in own shardchain. In this way contracts can live in one shardchain(i.e. Shard 1) and never touch other smart contracts.

jetton-8