Home › Flowers & Gardening › Article

What Is a Smart Contract? A Guide to Understanding It

Flowers & Gardening 0 views
By DaDa. Let's take a look at what smart contracts, which sound so impressive, actually are. What follows may be a bit brain-bending, so be prepared. As early as the 1990s, cryptography master Nick Szabo proposed the idea of smart contracts, and smart contracts were almost born alongside the internet. However, because there was no trusted execution environment at the time, smart contracts were not applied to actual industries. Since the birth of Bitcoin, people began to realize that blockchain, the underlying technology of Bitcoin, is inherently capable of providing a trusted execution environment for smart contracts. Ethereum was the first to see the fit between blockchain and smart contracts, publishing the white paper "Ethereum: The Next-Generation Smart Contract and Decentralized Application Platform," and has been committed to building Ethereum into the best smart contract platform. It can be said that Bitcoin led the way for blockchain, while Ethereum revived smart contracts. As for what Ethereum is, the editor will explain it in detail next time. Today, let's first understand:

By DaDa

Let's take a look at what smart contracts, which sound so impressive, actually are. What follows may be a bit brain-bending, so be prepared.

As early as the 1990s, cryptography master Nick Szabo proposed the idea of smart contracts, and smart contracts were almost born alongside the internet. However, because there was no trusted execution environment at the time, smart contracts were not applied to actual industries. Since the birth of Bitcoin, people began to realize that blockchain, the underlying technology of Bitcoin, is inherently capable of providing a trusted execution environment for smart contracts. Ethereum was the first to see the fit between blockchain and smart contracts, publishing the white paper "Ethereum: The Next-Generation Smart Contract and Decentralized Application Platform," and has been committed to building Ethereum into the best smart contract platform. It can be said that Bitcoin led the way for blockchain, while Ethereum revived smart contracts. As for what Ethereum is, the editor will explain it in detail next time. Today, let's first understand:

What is a smart contract?

In plain terms, a smart contract is a contract on a computer system that can be automatically executed when certain conditions are met. Compared with Bitcoin, the transaction scope of smart contracts is not limited to digital currency. Through blockchain developers writing code for the contract, the code contains certain conditions that can trigger automatic execution of the contract. By executing the code, smart contracts can be used for any exchange behavior between two or more parties to a transaction.

From the user's perspective, a smart contract is usually regarded as an automatic escrow account. For example, when specific conditions are met, the program will release and transfer funds. For example: Zhang San has an idle house he plans to rent out, and Li Si wants to rent a house. Then Zhang San and Li Si can have a blockchain developer write a smart contract about a house rent agreement. Only after Zhang San receives the rent can the smart contract automatically execute and send the house's security key to Li Si. As required, the smart contract can ensure that the rent is paid on time and restarts every month.

From a technical perspective, smart contracts are regarded as network servers, except that these servers are not set up on the internet using IP addresses, but are set up on the blockchain. In this way, specific contract programs can run on them, so there is still a certain difference between smart contracts and traditional network servers.

A smart contract itself is also a participant in the system. It can respond to information it receives, can receive and store value, and can also send information and value outward. This program is like a trustworthy person jointly recorded by individual nodes. It can temporarily hold assets and always executes operations according to preset rules.

What are the advantages of smart contracts?

The biggest advantage of smart contracts is security. Their security lies in how they differ from network servers: smart contracts can be seen by everyone, because if the code and state of these smart contracts are all placed on a public blockchain, every node on the blockchain will record the contract, thereby establishing a complete third-party trust mechanism.

The schematic diagram below is a smart contract model (it is a computer program running on a replicable, shared ledger that can process information and receive, store, and send value). Smart contracts are deployed in the form of code on a shared, replicated ledger. They can maintain their own state, control their own assets, and respond to external information or assets they receive.

Smart contract model:

What uses do smart contracts have?

1. Securities registration and clearing. The contract state contains information about securities ownership. If the registered securities owner notices that the securities in the contract have already been sold to other participants, the other participants will send cryptocurrency to the escrow account, then the securities registration information will be updated, and the currency will be forwarded to the original securities holder. Depending on which information arrives first, either the securities or the currency will be kept in an escrow account to avoid double use. When the transaction is canceled or becomes outdated, the escrow will also be canceled.

2. Existing bank accounts. Blockchain itself already uses cryptocurrency accounts, so smart contracts are not needed here. However, people in real life want to talk about euro or US dollar accounts, which is similar to the securities registration accounts mentioned above. Using contracts involves counterparty risk, just like any bank in the real world. This risk can be transferred through counterparty risk supervision, or eliminated through escrow.

3. Derivatives and betting. Suppose the counterparties agree on a data source accessible on the internet; they can then create derivative contracts or bets on the value of the data source.

4. Prepayment and top-up. Contracts can be bound to mobile SIM cards, prepaid electricity cards, and so on. When cryptocurrency is received, top-up can be carried out. Smart contracts have many other uses, and the editor will not list them one by one. Emerging things always have flaws, and smart contracts are no exception. Below, the editor will explain the current problems facing smart contracts.

Problems facing smart contracts

At present, smart contracts are not particularly smart, nor are they contracts in the strict sense. In theory, smart contracts can transfer away the problem of fraudulent counterparties, and this is precisely one of the reasons smart contracts were designed: no matter when, the contract can reliably monitor the performance of the participating parties in the contract, and the participants cannot cheat. Smart contracts have many other uses, and the editor will not list them one by one.

It is just that smart contracts are still at an early stage and have not yet made substantial progress. The key issue is the issue of trust, which is similar to the issues affecting blockchain implementation: these systems are all designed as trustless environments, which means errors that occur cannot be corrected. For example, in blockchain, if you send currency to a certain address, this operation cannot be revoked. Therefore, if you trade with a fraudster - or you have already sent currency to the wrong address - then the monetary loss cannot be recovered. In addition, when designing a contract, you must ensure that the contract itself has no fraudulent behavior, and truly achieving this is hard to imagine.

For now, the issue of trust has not yet been well resolved. However, with the development of blockchain, the various problems in the development process will certainly be resolved. After all, what we see at this moment is only a glimmer of dawn from the future. The editor believes that that little glimmer of dawn will eventually become the blazing sun at noon!





Related Articles