What’s Smart Contract?
A smart contract is a computer program, essentially a string of machine-readable codes which is intended to automatically execute, control or document legally relevant events and actions. It can be considered as a digital contract upgraded from the paper one. The digital version is built with codes representing the specific dealing content and can be executed automatically once the condition is being satisfied without the third party’s participation.
Take a real-world case for example, you made a deal with your friends that the one who is late for the movie on the weekend will pay $10 for the other. You embed the meeting date, penalty of $10 and conditions for punishment into the blockchain with codes, thus generating a smart contract. The smart contract will atomically transfer the $10 penalty into the account of the one who is punctual for the meeting when the dating time is up.
Smart contracts were first proposed in the early 1990s, before the advent of blockchain technology, by Nick Szabo, a scholar in law, who coined the term. Since the generation of blockchain technology, specifically, the Ethereum blockchain created by Vitalik Buterin, smart contracts have been put into practice for public usage. The smart contracts known to us now mainly refer to the considerable applications built on Ethereum.
Bitcoin also provides support for smart contracts, such as payment channels and more. However, compared with Ethereum, its smart contract creation performance is not up to par. Although there are many competitors, Ethereum remains the most appealing platform whose expertise focuses on smart contract deployment and application.
How It Works?
A smart contract operates in the logic coding “if…then…” and its actions will be executed securely if conditions are satisfied.
Let’s take the above example to see how a smart contract works. You can set a meeting time, place, and action to represent the on-time arrival in the smart contract, such as punch at 3:00 PM in front of a cinema. If you don’t arrive and punch on time, $10 from your account balance will be transferred to the other’s account, which will be executed by the smart contract automatically. In the smart contract, you can even set the action of transferring penalties back to each participant’ account if no one arrives and punches on time.
Advantages and Risks
Smart contracts have clear advantages like high execution efficiency and lower labor costs due to code-based automatic execution, as well as accurate and tamper-proofing of transactions, and decentralization.
Smart contracts’ risks lie in human errors of coding, such as code bugs. With human error, smart contracts' advantages of tamper-proofing and accurate execution become risky factors.