Security Tokens and Stablecoins Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Smart contract

In 1994, Nick Szabo first used the term smart contract. Szabo is a computer scientist and the inventor of Bit Gold. In his blog, Nick Szabo describes it as similar to the vending machine, which is the granddaddy of all smart contracts. A vending machine is built with hard-coded rules that define what actions are to be executed when certain conditions are fulfilled. For example:

  • If Susan inserts a dollar bill, then she will receive a bag of pretzels
  • If Tom inserts a five-dollar bill, then Tom will receive a bag of pretzels and change of four dollars

In other words, rules are defined and enforced by a vending machine physically. Similarly, a smart contract contains rules in program code that are triggered and run on the Ethereum platform when certain conditions are met.

Some important facts about smart contracts are summarized as follows:

  • A smart contract is immutable.
  • A smart contract is permanent.
  • A smart contract is timestamped.
  • A smart contract is globally available.
  • A smart contract is a digitized legal document.
  • A smart contract defines the protocol for facilitating, verifying, or enforcing an agreement among trading parties.
  • Smart contracts allow for the execution of transactions without an intermediary. The transactions are auditable and irreversible.
  • Smart contracts are applicable in many cases.
  • For deploying and running a smart contract, you need to sign it digitally.
  • Smart contract code is visible to everyone. This makes smart contracts vulnerable, as a hacker can tap the flaws in the code and initiate vicious attacks.