HOKIE: The key to DeFi


Now our life is almost inseparable from the contract, generally speaking, work is signed with the company labor contract, buy a house is signed with the real estate company contract, buy insurance is signed with the insurance company insurance contract; At a small level, online shopping, ordering takeout, taking a taxi and buying lottery tickets are all contracts signed with relevant service providers. Where there are people, so to speak, contracts are used.

Even when we make a bet, it is a contract, but if one side reneges, it becomes difficult to keep the contract. If there is a contract, the rules are set in advance, and when the clause is triggered, the contract is automatically enforced without human intervention or fear of repudiation. Is there such a contract? Yes, there is. This is a smart contract.

1. What is a smart contract

Smart Contract is an idea proposed by the cryptographer Nick Saab in the 1990s. Due to the lack of a credible execution environment at that time, Smart Contract was not applied and developed until the emergence of Ethereal, which revived Smart Contract.

So what exactly is a smart contract? Simply put, smart contracts are contracts that replace written terms in legal language with computer language and are automatically executed by programs. In other words, smart contracts are digital versions of traditional contracts that run on a blockchain network and are automatically executed by programs.

Vending machines, ATMs, to some extent, can be understood as machines that execute smart contracts, but they're not really smart contracts.

2. What are the characteristics of smart contracts?

Compared with traditional contracts, smart contracts have three characteristics:

1). The contract content is open and transparent

Smart contracts are deployed on blockchain, and the contract content is naturally open and transparent.

2). The contract shall not be tampered with

Similarly, the content of a smart contract cannot be modified because it is deployed on a blockchain.

3), permanent operation

The smart contract running on the blockchain is also jointly maintained by the network nodes on the blockchain. As long as the blockchain is in place, the smart contract can run forever. There is a sense of brotherhood where the chain is and the contract is.

Smart contracts supported by three characteristics of blockchain have the following advantages compared with traditional contracts:

1. Trust.

Because smart contracts are blockchain-based, their contents are open, transparent and immutable. Code is law. Based on the trust of Code, traders can safely and safely trade in an environment of distrust.

2. Economic and efficient

Compared with traditional contracts, disputes are often caused by differences in understanding of the terms of the contract. Smart contracts do a good job of avoiding disagreements through the language of computation, creating few disputes and achieving consensus at a low cost. In terms of the smart contract, the arbitration result shall take effect immediately. Therefore, compared with traditional contracts, smart contracts have economic and efficient advantages.

3. No need for arbitration by cooperating manufacturers

If A and B are betting on whether it will rain tomorrow, the loser will have to pay the other party $100. If the loser denies it, the winner gets no reward. To this end, to find a cooperative manufacturer arbitration organization, inefficient and time-consuming. However, if the bet is written on the smart contract, when the bet is made, each party will put $100 into the smart contract address. The smart contract will be executed automatically according to the final result, and the winner will take all the rewards. It can be seen that the smart contract does not need to be arbitrated by the partner manufacturers.

Are smart contracts really smart?

All the advantages of smart contracts mentioned above, is smart contract really smart and without disadvantages? No, smart contracts have their drawbacks.

As mentioned above, the immutable nature of smart contracts makes it easy to build trust. But at the same time, there is also a bad side. If there are loopholes in the smart contract, hackers can take advantage of the loopholes in the smart contract to make profits for themselves.

Take a simple example, a vending machine, the original price of $5 drink, due to negligence, written 50 cents, the administrator found, can immediately correct. But if the vending machine invokes a smart contract on the blockchain, the error cannot be fixed until the drinks run out.

On the other hand, the intelligent contract itself cannot obtain (perceive) external information, involving that it needs external information to decide the contract, and relevant information needs to be written into it before it can make a decision. For example, A and B bet on whether it will rain tomorrow. The smart contract itself does not know whether it will rain the next day. It needs to provide it with information from other sources, such as the Central Meteorological Station.

On both counts, smart contracts are neither perfect nor smart.

4. Summary

To sum up, we know about smart contracts:

Smart contracts are programmatically executed contracts that use computer language instead of legal language. Deployed on the block, it also has the characteristics of open and transparent data of the block chain, non-tampering and permanent operation.

Compared with traditional contracts, smart contracts have the advantages of trust, security, efficiency and no need for arbitration by partner vendors. But the wisdom contract is not perfect, and it's not smart or it's not smart at all.