News

What is a Smart Contract?

Ngoc Phuong

Ngoc Phuong

06-09-2021 . 55 view

The concept of smart contracts was first introduced by Nick Szabo in the 1990s. At that time, he defined a smart contract as a tool to formalize and secure computer networks by combining protocols with a user interface.

Nick Szabo believed that smart contracts could be applied in various fields such as credit systems, payment processing, and content rights management. What he discussed at that time could be considered a future trend, however, at that time the technology was not sufficient to develop it. It was not until later, with the advent of blockchain technology, that we could develop widely used smart contract applications like today. So, what is a Smart Contract?

I. What is a Smart Contract?

A Smart Contract is an application or program that runs on the blockchain technology platform capable of automatically executing the terms, the agreements between the parties in the contract.

A smart contract can be seen as a digital contract accompanied by specific mandatory rules. These rules are determined by computer code, and all nodes in the network must copy and execute them.

Each blockchain network has a different method of deploying smart contracts, however, the most famous and popular are smart contracts running on the Ethereum blockchain. Therefore, today's article will talk about smart contracts running on the Ethereum blockchain platform.

II. How do Smart Contracts work?

Smart contracts operate as a program with programmed conditional statements, it will only perform a specific task in that case if the conditional statements “if… then…” are satisfied.

In fact, smart contracts are not legally binding contracts and they are not as smart as their name suggests. Essentially, they are just a piece of code running on a distributed system (blockchain).

On the Ethereum blockchain network, smart contracts are responsible for executing and managing transactions when users interact with each other. Any address that is not a smart contract is called an externally owned account (EOA). Thus, smart contracts are controlled by computers, and EOAs are controlled by users.

The basic components of a smart contract include a contract code and two public keys. The first public key is provided by the contract creator. The other represents the contract itself, which can be seen as a unique digital identification code for each smart contract.

Smart contracts are deployed through blockchain transactions, and the first activation always comes from an EOA (user).

III. Characteristics of Smart Contracts

Smart contracts built on the Ethereum blockchain platform thus also have characteristics similar to other blockchain applications today.

1. Decentralized

The smart contract data is copied and stored distributedly across the Ethereum network. This is the main difference compared to conventional contracts.

2. Deterministic

Smart contracts only perform tasks that have been pre-programmed to execute in cases satisfying the condition statements. Along with that, the results of smart contracts will never change, no matter who performs them.

3. Automatic

Smart contracts can automatically execute tasks under predefined conditions. In some cases, if the smart contract is not triggered, it will remain inactive and will not perform any task at all.

4. Immutable

Smart contracts cannot be modified after deployment. They can only be "deleted" if this functionality has been previously added.

5. Trust-independent

Both parties do not need to know who the other is, as long as both sides interact through the smart contract is enough.

6. Transparent

Smart contracts are developed on a public blockchain, so anyone can view them.

7. Customizable

Before deployment, smart contracts can be programmed in many different ways. Therefore, they can be used to create various decentralized applications (Dapps). This is because Ethereum is a blockchain that can be used to solve any computational problem (Turing complete).

IV. Can Smart Contracts be Changed or Deleted?

Once a smart contract is deployed, you can no longer change its functionalities. However, if the creator of the contract has previously introduced a function called SELFDESTRUCT in the code, they may delete the smart contract in the future and replace it with a new one.

V. Advantages and Disadvantages of Smart Contracts

1. Advantages

Smart contracts have the potential to be applied in many fields in the future, currently, some areas have used smart contracts such as: cryptocurrency, logistics, banking, real estate, gaming, mobile applications, decentralized exchanges, even the electoral system.

Smart contracts help increase transparency and reduce operational costs.

Smart contracts are not regulated by any agency or state, which is an advantage but also a disadvantage, depending on the purpose of each user.

2. Disadvantages

Currently, the laws of many countries around the world, including Vietnam, do not yet have policies to protect the rights of users when errors occur.

Smart contracts are created from computer code written by humans, so they carry many risks of being hacked. Therefore, they need to be deployed by highly experienced professionals.

Smart contracts cannot be modified. However, to address this, a mandatory software update (hard fork) creates a second Ethereum chain that has been updated. The second Ethereum chain can be considered as the chain that restores the attack to allow returning money to the rightful owners (this chain is a part of the current Ethereum blockchain). Of course, the first chain defaults not to be allowed to intervene and change anything on the smart contracts at all (this chain is now called Ethereum Classic).

Ngoc Phuong
Ngoc Phuong

Web Developer

Thank you for visiting my website. My name is Ngoc Phuong, and I have over 10 years of experience in website development. I am confident in stating that I am an expert in creating impressive and effective websites. If you need a website designed, please feel free to contact me via email at [email protected].

0 feedback

Related article