What is a smart contract?
In this part, we will look at what a smart contract is.
It was mentioned earlier that blockchain is like a data store in a banking system. A smart contract is like a program in a banking system. You may be wondering what this means, we'll try to explain it well, so please continue reading. And at the end of this article, you'll be saying "A-ha!, that's why it's called a smart contract".
In the previous example of the banking system, you(A) with 100 in your account want to transfer 50 to someone(B) through the bank. You fill out a transaction and send it to the bank, which then verifies the transaction and records it in a data store. It was mentioned that the user's balance will then be changed.
In a slightly more advanced way, you want to place an order that says "Transfer 50 to B at 5:00 PM on September 23, 2021." In this case, other than the data storage where the transaction details are stored, the system would also need a separate data store for recording such reservations. In the banking system, this can be configured to a program with the function of transfer to B at 2021.09.23. at PM 5:00.(time) so that it can be processed automatically. If a human does it, it has to be memorized and executed when the time comes, but it is automated by putting a program called reservation transfer.
The same is true for blockchain. If you(A) have 100BTC and want to transfer 50BTC to (B), you can transfer automatically later if you implement the reservation function and write the current transaction history. Unfortunately, Bitcoin has very limited functions and it is difficult to implement such a program, so there have been attempts to introduce such a function. This is when a smart contract is introduced as a concept that makes the program very easy to implement. If you map the banking system and the blockchain network, you can say that the data storage is a blockchain, and the program that implements the function is a smart contract. So far, you've learned the principle, but why is this a smart contract?
First, let's think about why we make contracts. A contract is drawn up to fulfill mutual promises and to have legal effect in the event of a problem later. In other words, it is a contract that has the effect of forced execution. A smart contract, a program uploaded to the blockchain, guarantees that the program is executed as it is written because due to the nature of the blockchain, it cannot be forged or tampered with. It's like writing a digital contract, so it's called a smart contract.
In the description, we briefly use the banking system as an example, but there are many digital programs that you may use. From portal sites accessed several times a day, SNS and messenger, to exchanges for cryptocurrency holders, all systems have a server program. All of these can be implemented with smart contracts, imagine all the changes this will bring in the future.
While existing systems are centralized, systems implemented with smart contracts are decentralized, so it can be a very transparent and clean system without cheating, information manipulation, or censorship. In the next article, we will look at Ethereum, the most popular platform for building such a system.
Copy link