TECHNOLOGY

What is a smart contract? How it works and application?

What is a smart contract?

Smart Contract (Smart Contract) is a term that describes a special set of protocols capable of automatically implementing the terms and agreements between the parties in the contract (in this case, computer systems). computer) thanks to the support of Blockchain technology.

The entire operation of Smart Contract is performed automatically and without outside intervention, or through an intermediary third party. Transactions made using smart contracts are transparent, easily traceable, and cannot be tampered with or reversed. The terms in a Smart Contract are equivalent to a legal contract and are written in the programming language.

The most outstanding feature of  Smart Contract  is that it allows two parties to perform the contract accurately, safely and quickly; without the need for the parties to know each other before, no need to meet in person to be able to work with each other, or a third-party intermediary that just needs an Internet connection. The concept of Smart Contract was first known by Nick Szabo in 1993.

Smart contracts were first described by Nick Szabo in the 1990s. At the time, he defined a smart contract as a tool to formalize and secure computer networks by combining protocols. with user interface. Szabo discussed the possibility of using smart contracts in various areas related to contractual arrangements – such as credit systems, payment processing and content copyright management.

In the world of cryptocurrencies, we can define a smart contract as an application or program that runs on the blockchain. A smart contract is like a digital contract that is enforced by a specific set of rules. These rules are predefined by computer code, and all nodes in the network must copy and enforce those rules.

In essence, smart contracts on the blockchain allow the creation of trustless protocols. That is, two parties to a contract can make commitments through the blockchain without having to know or trust each other. They can ensure that if the conditions of the contract are not satisfied, the contract will not be enforced. In addition, the use of smart contracts eliminates the need for intermediaries, greatly reducing operational costs.

Although the Bitcoin protocol has supported smart contracts for many years, they were made popular by Vitalik Buterin, the creator and co-founder of Ethereum. However, each blockchain has a different smart contract implementation method.

At that time he outlined the main operating principles, but at that time there was not enough technology and the right environment to realize it. But everything has changed with the advent and development of  Blockchain technology.

Bitcoin  has laid the basic foundations for the establishment of smart contracts on the Blockchain or “ Smart Contract Blockchain ” for short. However, it is not yet able to satisfy all smart contract requirements. It was only when  Ethereum  and  Smart Contract Ethereum  appeared that the smart contract idea was popularized to all users, providing us with a new way to set up contracts.

This article will focus on smart contracts that run on top of the Ethereum Virtual Machine (Ethereum Virtual Machine, EVM), an essential part of the Ethereum blockchain. And I would like to highlight three main points that you should read and try to remember what a Smart Contract is:

  • A smart contract is an agreement between two people in the form of computer code. They run on the blockchain, so they are stored on a public database and cannot be changed.
  • Transactions that occur in smart contracts are processed by the blockchain, which means they can be sent automatically without the need for a third party. This requires no trusted third party presence!
  • Transactions happen only when the conditions in the agreement are met – there are no third parties, so there are no issues with trust.

How do smart contracts work?

Simply put, a smart contract acts as a deterministic program. It executes a specific task in case certain conditions are satisfied. Therefore, a smart contract system usually follows “if…then…” statements. Despite its name, a smart contract is not actually a legal contract, nor is it smart. They are just a piece of code that runs on a distributed system (blockchain).

On the Ethereum network, smart contracts are responsible for executing and managing the activities that take place on the blockchain when users (addresses) interact with each other. Any address that is not a smart contract is called an externally owned account (EOA). Thus, the smart contract is controlled by the computer and the EOA is controlled by the user.

Essentially, an Ethereum smart contract consists of a contract code and two public keys. The first public key is the one provided by the contract creator. The other key represents the contract itself, which acts as a unique digital identifier for each smart contract.

Smart contracts are deployed via blockchain transactions, and they are only activated when an EOA (or other smart contracts) invokes them. However, the first trigger is always from the EOA (user) side.

Example to make it easier for you to understand:

Let’s say you want to rent an apartment from me. You can pay your rent in cryptocurrency via Blockchain. The receipt will then be included in one of our smart contracts; I will give you the password to the apartment on a certain date. If that token does not arrive on time agreed between the two parties, the smart contract will return the money. If it arrives before maturity, the system will keep both the money and the cryptography until maturity. The system works based on the “If – Then” clause   and is supervised by hundreds of people, so there will be no mistakes in the delivery.

What is a smart contract? How it works and application?

What are the benefits of Smart Contracts?

Smart Contract  is an application that takes advantage of all the strengths of Blockchain technology so it has a lot of benefits, below are its main benefits.

  • Automation:  The process by which the contract is executed is automatically equal. At the same time, you are the creator of the contract, no longer having to depend on brokers, lawyers or anyone else. As such, it also removes the risks from third parties
  • No Loss: Your  documents are encrypted on a shared ledger, which means they can’t be lost. With Blockchain, all your friends have a record of your documents.
  • Safety:  Blockchain will ensure the safety of your documents. No hacker can threaten them.
  • Speed:  Smart contracts use programming languages, software code to automate terms, saving hours of unnecessary work.
  • Savings:  Smart contracts save you tons of money by eliminating the middleman.
  • Accurate:  Automated contracts are not only faster and cheaper, but they also avoid common mistakes when writing paperwork.
What is a smart contract?  How it works and application?

Pros and cons of Smart Contracts

1. Advantages of Smart Contract:

  • The application of  Smart Contracts  can be used in many fields in the future, currently some fields have implemented smart contracts including: Cryptocurrency, logistics, banking, real estate, even elections. .
  • Freedom: Not controlled by any authority
  • Disperse. Smart contracts are copied and distributed in all nodes of the Ethereum network. This is one difference from other solutions based on centralized servers.
  • Determined. Smart contracts only perform the actions they are designed to perform in the event that the conditions are satisfied. Besides, the results of smart contracts remain the same no matter who the executor is.
  • Automatic. A smart contract can automate all kinds of tasks, it acts like a self-executing program. However, in most cases, if the smart contract is not activated, it will remain “inactive” and will not take any action.
  • Cannot modify. Smart contracts cannot be modified after deployment. They can only be “deleted” if this function has been added before. Therefore, it can be said that a smart contract is like a tamper-proof code.
  • Customizable. Before deployment, smart contracts can be encoded in a variety of ways. So they can be used to create many types of decentralized applications ( Dapps ). This is because Ethereum is a blockchain that can be used to solve any computational problem (Turing complete).
  • There is no need to rely on trust . Two or more parties to a contract can interact through a smart contract without knowing or trusting each other. In addition, blockchain technology ensures the accuracy of data.
  • Transparency . Since smart contracts are based on a public blockchain, no one can change their source code, although anyone can view it.

2. Disadvantages of Smart Contract:

  • Legality:  You will not be protected when an error occurs because the laws of the countries currently do not have a policy to exploit and manage smart contracts.
  • Deployment costs:  Need to pay for the infrastructure system, computers, and good programmers for them to deploy.
  • Risks from the internet:  The nature of Smart Contracts is very safe, but if you reveal some sensitive information or are exploited by hackers, you will definitely encounter problems.

What does it take to create a Smart Contract?

To create a  Smart Contract , you need to have the following requirements:

  •  Contract subject : Smart Contract must be granted access to the products/services listed in the contract to be able to automatically lock or unlock them.
  • Digital Signature:  All parties involved in a Smart Contract must agree to implement the agreement using their private keys (electronic signatures).
  • Terms of the contract : Provision in Smart Contract form is a series of activities. And all parties to the contract must sign to accept it.
  • Decentralized platform: The completed  Smart Contract will be uploaded to the Blockchain of the respective decentralized platform and distributed to the nodes of that platform.

ERC-20 . smart contract

Tokens issued on the Ethereum blockchain follow a standard known as ERC-20. This standard describes the core functions of all Ethereum-based tokens. As a result, these digital assets are often referred to as ERC-20 tokens, and the majority of cryptocurrencies today use this standard.

Many blockchain companies and startups have implemented smart contracts to issue their digital tokens on the Ethereum network. Following the release, the majority of these companies distributed their ERC-20 tokens through Initial Coin Offering (ICO) events. The use of smart contracts largely helps companies to hand out and distribute tokens in a trustless and efficient manner.

Applications of smart contracts

According to Jerry Cuomo, vice president of blockchain technology at IBM, believes that Smart Contracts can be used in many cases, from financial services, healthcare to insurance. Here are some examples of its applications:

1. Use for Elections

Manipulating election results is very difficult, but still possible, but smart contracts will never be able to manipulate. Because the votes are protected by the ledger that will need to be decrypted and a strong enough access authority is required to access it. And the truth is that no one holds such power in the blockchain.

2. Use for Managers

Blockchain  not only provides a reliable ledger, but also eliminates risks thanks to an automated, transparent and accurate system. Often, business operations are often not always favorable due to waiting for consensus or resolving external and internal issues. The Blockchain Ledger will solve this.

In 2015, the Trust & Clearing Corporation (DTCC) used a blockchain ledger to store information about $1,500 trillion worth of securities assets, which translates to 345 million transactions.

3. Logistics (Supply Chain)

The supply chain  in any business is an elongated system consisting of many different parts. Each department has certain jobs, which must be done sequentially. And it must be recorded so that when it occurs, you know where the problem is

This is a long and inefficient process, but with Smart Contract, each participating department can monitor the work progress to complete the task on time. Smart contract ensures transparency in contract terms, anti-fraud.

It can also provide the ability to monitor the supply process if integrated with the Internet of Things (Internet of Things).

4. Medical services

With  Smart Contract  , the patient’s medical record will be encrypted and stored on the Blockchain with a private key, only those who have that key can access to view the records. At the same time, bills for surgeries are stored on the Blockchain and automatically transferred to the insurer. The ledger can also be used in the management of medical care, for example monitoring medications, test results and managing medical supplies.

Besides, Smart contracts also have countless other applications, such as in management, banking services, insurance, real estate, ……

Epilogue

Above is the article “What is a Smart Contract? How it works, Application, What are its benefits? ”, hope to help you get more useful things about  smart contract –  Smart Contract .

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button