Blockchain - Smart Contracts

Published:

Lesson: 09
Topic: Blockchain
Author: Ashley Rosilier


One of the most significant changes to blockchain since it was first proposed by Nakomoto with Bitcoin is the addition of smart contracts. Some even refer to this advancement as “Blockchain 2.0” [11]. In its original implementation, blockchain was primarily useful in the cryptocurrency domain, but the ability to create a blockchain-based distributed computing platform allows for exponentially more use cases and applications. The first blockchain implementation proposed by Nakomoto did have limited programming ability via a scripting language but it was not until later implementations, such as Ethereum and Hyperledger, that programmers had access to a full Turing-complete language with which to write distributed programs.

Decentralized Applications

Smart contracts are a form of lightweight decetralized application (dAPP). They are programs (both code and data) that are stored on the blockchain and can be executed by the node on which they reside. Like other block data, the programs are tamper-proof, publicly visible to all particpants, and are validated as part of the consensus protocol. They are installed and instantiated on all blockchain participants and are triggerd by specific transactions.

Example Use Cases

Having the ability to invoke programs based on certain transactions creates a very powerful expansion of the use cases for blockchain. Smart contracts can be viewed as “autonomous agents” in that they have their own blockchain address, can send and receive messages and can independently enforce specific conditions or actions [6]. Some exmaples uses of smart contracts include:

  • Enabling automated transactions triggered by specific events
  • Enforcing multi-signature transactions where a specific percentage of particpants are in agreement
  • Providing storage space for application-specific data

Key Features

  • Autonomy - Since smart contracts are deployed and excecuted on the block chain, they can run automatically without any intervention by a third party.
  • Stable - Smart contrqcts are included in the block data stored within the blockchain, so a copy resides on every node in the network. This provides fault tolerance, ensuring a stable platform with zero-downtime for applications.
  • Traceable - Smart contracts are fully visible and traceable on the blockchain, just like other block data.
  • Secure - Security of smart contracts is ensured by the blockchain consensus algorithm along with public key cryptography.

Challenges

As with anything, there are always challenges that come along with advantages. The performance overhead for smart contracts is high, particularly on permissionless networks requiring a proof of work consensus. Code maintenance is also a challenge since code and data published to the blockchain is harder to modify [14].

It is also worth mentioning that the security risk caused by poorly designed smart contracts could be severe. With the additional complications of modifying deployed code on the blockchain, it is of utmost importance to follow sound programming design practices and review for known types of vulnerabilities [11].

References

[6] M. S. Ali, M. Vecchio, M. Pincheira, K. Dolui, F. Antonelli and M. H. Rehmani, “Applications of Blockchains in the Internet of Things: A Comprehensive Survey,” in IEEE Communications Surveys & Tutorials, vol. 21, no. 2, pp. 1676-1717, Secondquarter 2019, doi: 10.1109/COMST.2018.2886932.

[11] Li, X.; Jiang, P.; Chen, T.; Luo, X.; Wen, Q. A survey on the security of blockchain systems. Future Gener. Comput. Syst. 2020, 107, 841–853. https://doi.org/10.1016/j.future.2017.08.020

[14] Etheterum: Intorduction to dapps https://ethereum.org/en/developers/docs/dapps/