Sat. Nov 27th, 2021
    Free TON, smart contracts

    In this article, we’ll talk about smart contracts: what they are, what they’re for, and their evolution from the first generation of blockchains to the Free TON blockchain smart contract.

    Bitcoin is the first step in the evolution of blockchains. It allowed transactions that specified the amount in its native currency (bitcoins) and the text. Transaction information is stored on a huge number of computers. It is impossible to distort it or cancel the transaction. How does it work? If, for example, George transferred some amount of bitcoins to Agatha, this transaction is recorded by thousands of computers, and Agatha cannot claim that she did not receive the money.

    To emphasize: Bitcoin was a blockchain that recorded information only about transactions, a so-called distributed ledger, or if you prefer, a global ledger.

    Things have moved on. The second generation of blockchain appeared 6 years ago — Ethereum, a cryptocurrency, and platform for creating decentralized online services. Vitalik Buterin, one of the creators, suggested transferring not just numbers displaying amounts of money but also the built-in program code. This is how smart contracts appeared.

    What Is A Smart Contract

    A smart contract is an executable program that takes input data, performs computations, and stores the result on a blockchain. These can be transfers of certain cryptocurrency sums, sender and recipient addresses, as well as various conditions under which the transfer between the sender and the recipient can be made. In other words, the executable program has its internal logic with which it can perform complex financial operations.

    Such an opportunity gave birth to a new area — Decentralized Finance (DeFi).

    An important condition: for all blockchain users, the program works on the same principles, equally and transparently.

    The Purpose Of Smart Contracts

    They make it possible to enter into contracts on the blockchain network without notaries, banks, or other intermediaries. For example, you want to buy the book Revolution by Viktar Martinowich in an online shop. You need to create a program that makes it clear that as soon as you get the book, the money is sent to the wallet of the shop.

    A smart contract can only be created by a specialist who knows one of the programming languages — Solidity, Serpent, or Mutan. Solidity is a language based on JS, Python, and C++. The part of the blockchain node software that executes smart contracts is called EVM — Ethereum Virtual Machine. It is considered that the combination of codes makes an EVM Turing-complete. This means that EVM can implement any logic in the program if certain resources are available.

    A smart contract is executed inside an Ethereum blockchain virtual machine. Execution is fee-based — payment is deposited by the participants or a participant in the transaction.

    So Why Pay?

    The point is that when executing smart contracts, a situation may arise in which EVM will have to perform computations that will take decades to complete. If this happens, the blockchain will simply “freeze”. That is why they had to come up with a mechanism to control the complexity of the smart contract execution. To run it, you need to pay tokens. This is a kind of fee, the kind of gas. The logic is obvious: the more complex the computation, the higher the cost of gas. If an attacker decided to ”crash” the blockchain, he would not have succeeded: for such a complex computation, he would have to pay with so many tokens that simply do not exist on the network.

    Smooth Only In Theory …

    In theory, smart contracts offered a revolutionary solution, primarily in the financial area. But! However, several significant disadvantages have been identified in practice.

    • The speed of executing smart contracts in Ethereum is low.

    Ethereum is a blockchain that consists of a single chain of blocks. Each smart contract is calculated by all blockchain miners. That is why Ethereum is pretty slow — 15-20 transactions per second.

    • The gas price may be too high and not always acceptable when making micro-payments, for example.
    • There is not enough space in the blocks and high competition for computing power.

    So the next blockchain generation had to solve quite challenging tasks: to increase the speed of smart contracts execution, to reduce their cost (make it acceptable), to simplify the work with smart contracts, and finally, to reduce the competition for a space in the block.

    The next blockchain generation includes Free TON, whose creators have proposed original solutions to these problems.

    How Does Free TON Solve These Problems

    Problem #1. Speed

    As we have already explained, in Ethereum, computations are performed by all miners, and this reduces the speed of the smart contract execution. The Free TON blockchain solves this problem with scalability. Free TON has a multi-level structure and divided into threads that appear depending on the load on the network.

    Here is an example. Let’s say you want to refuel your car. There is only one pump running at the station, and you get in a long queue. This is how Ethereum works: the more users, the longer the queue and the same service speed. Free TON suggested a different concept – if there are a lot of customers at the gas station, then they should be split into threads, and open as many pumps as required.

    Shards are interconnected and can perform multiple smart contracts at the same time. This happens as follows: the executable code is computed by all validators in a given sub-blockchain chain, then a consensus is reached between them regarding the results of the computation according to the Byzantine Fault Tolerance principle. This solves the problem of speed — Free TON can perform several tens of thousand transactions per second.

    Problems #2 And #3. Cost And Competition

    In Free TON computations are performed by multiple threads, so the cost of “gas” does not increase, in addition, there is no competition for computing power.

    In Free TON — Everything Is A Smart Contract

    Free TON has features that need to be considered. In the blockchain, it is possible to transfer a coin — TON Crystal — from one address to another. However, to do this, there must be a code at a certain address to solve this task. This code is a smart contract. If there is no smart contract at the specified address, the sent Crystals will remain in a “suspended” state forever. And there’s nothing you can do about it.

    How To Determine The Address?

    A smart contract can only be deployed to a specific address. Different types of smart contracts are deployed at different addresses. The address itself is calculated based on the smart contract code and additional data. Each address is unique and cannot be deployed twice.

    If you try to restore your wallet address (in fact, a wallet is a smart contract) and make a mistake, for example, in the type of wallet, you will get a different address, and the money will remain in the old wallet.

    ________________________

    Free TON is an important step in the evolution of blockchains. It is important to emphasize that the network is constantly developing, and the philosophy of the platform differs from the philosophy of all previous blockchains. 85% of the issued crystals are received by those who strive to improve the Free TON ecosystem — working on the design, helping to increase the speed of transactions. Crystals are a reward for intelligence and hard work. Without a doubt, Free TON has excellent prospects.

    11
    0