TON Payments

From Freetonwiki
Jump to: navigation, search

The last components of the TON Project is TON Payments, the platform for (micro)payment channels and “lightning network” value transfers. The full overhead of such instant payments is so small that one can use them for micropayments. For example, a TON file-storing service might charge the user for every 128 KiB of downloaded data, or a paid TON Proxy might require some tiny micropayment for every 128 KiB of traffic relayed.

The idea of a payment channel Suppose two parties, A and B, know that they will need to make a lot of payments to each other in the future. A contributes a coins, and B contributes b coins. This is achieved by creating a special smart contract in the blockchain, and sending the money to it. Before creating the “coins pool”, the two sides agree to a certain protocol. They will keep track of the state of the pool—that is, of their balances in the shared pool. Initially, the state is (a, b), meaning that coins actually belong to A, and b coins belong to B. Then, if A wants to pay d coins to B, they can simply agree that the new state is (a', b' ) = (a − d, b + d).

This smart contract, along with the network protocol used by A and B to update the state of the pool, is a simple payment channel between A and B.

In this way, the implementation of the verification code for smart payment channel blockchains turns out to be quite straightforward using TON Blockchain smart contracts. One might say that the TON Virtual Machine comes with built-in support for checking the validity of other simple blockchains.