Skip to main content

Introduction to Smart Contracts and DeFi

  • Chapter
  • First Online:
Understanding Cybersecurity Management in Decentralized Finance

Abstract

Smart contracts are a modern version of the traditional paper-based legal agreements. It is an evolving concept which is reshaping the way legal contracts used to bind the involved parties to do business. Smart contracts are computer programmed by a software developer who codifies the terms and conditions of the paper-based legal agreement. Thus, smart contracts are used to automate the execution of legal agreements so that all parties immediately come to know the outcome. There is no involvement of an intermediate party in execution of the contract.

Smart contracts are a critical component of several applications and platforms built using blockchain or distributed ledger technology. However, there are some challenges with the wide adoption of smart contracts. For example, smart contracts are not easy to modify owing to the use of blockchain technology to store them. This brings them on back foot as there is no privilege to change or add any term into the already coded smart contract.

This chapter outlines the fundamentals of smart contracts and decentralized finance. It brings forward the technical operational process of smart contracts and how they are programmed to replace the traditional paper-based legal agreements. The chapter also includes pictorial representation to demonstrate the pragmatic approach of creating the first smart contract. Decentralized finance is the key concept highlighted toward the end of the chapter. It introduces decentralized finance and presents some popular applications which utilize decentralized finance. Any technology has its pros and cons and so does decentralized finance. The famous oracle problem finds its place before the chapter finishes.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 89.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Victor Youdom Kemmoe, William Stone, Jeehyeong Kim, Daeyoung Kim, and Junggab Son, Recent Advances in Smart Contracts: A Technical Overview and State of the Art, IEEE Access, Vol. 8, pp. 117782-117801, 2020.

    Google Scholar 

  2. Stuart Haber and W. Scott Stornetta, How to time-stamp a digital document, Journal of Cryptology, Vol. 3, No. 2, pp. 99111, 1991, https://www.anf.es/pdf/Haber_Stornetta.pdf

  3. Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, pp. 1-9, 2008, https://bitcoin.org/bitcoin.pdf

  4. Stuart D. Levi and Alex B. Lipton, An Introduction to Smart Contracts and Their Potential and Inherent Limitations, Skadden, Arps, Slate, Meagher & Flom LLP, Harvard Law School Forum on Corporate Governance, 2018.

    Google Scholar 

  5. Mateja Durovic and André Janssen, The Formation of Smart Contracts and Beyond: Shaking the Fundamentals of Contract Law?, In Smart Contracts and Blockchain Technology: Role of Contract Law, 2019.

    Google Scholar 

  6. Andreas M. Antonopoulos and Gavin Wood, Smart Contracts and Solidity, Mastering Ethereum - Building Smart Contracts and DApps, O’Reilly, First Edition, 2018.

    Google Scholar 

  7. Daniel Davis Wood, Ethereum: A Secure Decentralised Generalised Transaction Ledger, Berlin version, 2014.

    Google Scholar 

  8. Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Anitha Gollamudi, Georges Gonthier, Nadim Kobeissi, Natalia Kulatova, Aseem Rastogi, Thomas Sibut-Pinote, Nikhil Swamy, and Santiago Zanella-Béguelin, Formal Verification of Smart Contracts: Short Paper, ACM Workshop on Programming Languages and Analysis for Security, Vienna, Austria, 2016.

    Google Scholar 

  9. Jiachi Chen, Xin Xia, David Lo, John Grundy, Xiapu Luo, and Ting Chen, DEFECTCHECKER: Automated Smart Contract Defect Detection by Analyzing EVM Bytecode, IEEE Transactions on Software Engineering, pp. 1-19, doi: https://doi.org/10.1109/TSE.2021.3054928, 2021.

  10. James Clavin, Sisi Duan, Haibin Zhang, Vandana P. Janeja, Karuna P. Joshi, and Yelena Yesha, Blockchains for Government: Use Cases and Challenges, Digital Government: Research and Practice, Vol. 1, Issue 3, Article No. 22, pp. 1–21, 2020.

  11. Top 12 Smart Contract Use Cases, https://101blockchains.com/smart-contract-use-cases/, 2021.

  12. Bhabendu Kumar Mohanta, Soumyashree S Panda, and Debasish Jena, An Overview of Smart Contract and Use cases in Blockchain Technology, 9th International Conference on Computing, Communication and Networking Technologies (ICCCNT), 2018.

    Google Scholar 

  13. Tejasvi Alladi, Vinay Chamola, Joel J. P. C. Rodrigues, and Sergei A. Kozlov, Blockchain in Smart Grids: A Review on Different Use Cases, Sensors, Vol. 19 (22), 2019.

    Google Scholar 

  14. Massimo Bartoletti and Livio Pompianu, An empirical analysis of smart contracts: platforms, applications, and design patterns, Financial Cryptography and Data Security. FC 2017. Lecture Notes in Computer Science(), Vol. 10323. Springer, Cham. https://doi.org/10.1007/978-3-319-70278-0_31, 2017.

  15. Zaheer Allam, On Smart Contracts and Organisational Performance: A Review of Smart Contracts Through the Blockchain Technology, Review of Economic & Business Studies, Vol. 11, Issue 2, pp. 137-156, 2018.

    Google Scholar 

  16. Valentina Gatteschi , Fabrizio Lamberti, Claudio Demartini, Chiara Pranteda, and Víctor Santamaría, Blockchain and Smart Contracts for Insurance: Is the Technology Mature Enough?, Future Internet, Vol. 10, No. 2, Article No. 20, 2018.

    Google Scholar 

  17. Pierluigi Cuccuru, Beyond bitcoin: an early overview on smart contracts, International Journal of Law and Information Technology, Vol. 25, pp. 179-195, 2017.

    Google Scholar 

  18. Julija Strebko and Andrejs Romanovs, The advantages and disadvantages of the blockchain technology, IEEE 6th Workshop on Advances in Information, Electronic and Electrical Engineering (AIEEE), pp. 1-6, doi: https://doi.org/10.1109/AIEEE.2018.8592253, 2018.

  19. Vanshika Kaushik, Introductory Guide to Decentralized Finance (DeFi), Analytics Steps, 2021.

    Google Scholar 

  20. Patrick Schueffel, DeFi: Decentralized Finance - An Introduction and Overview, Journal of Innovation Management, Vol. 9, No. 3, pp. I-X, 2021.

    Google Scholar 

  21. DeFi Pulse - The Decentralized Finance Leaderboard, https://www. defipulse.com/

  22. Dirk A. Zetzsche, Douglas W. Arner, and Ross P. Buckley, Decentralized Finance, Journal of Financial Regulation, Vol. 6, pp. 172-203, 2020.

    Google Scholar 

  23. Yan Chen and Cristiano Bellavitis, Blockchain disruption and decentralized finance: The rise of decentralized business models, Journal of Business Venturing Insights, Vol. 13, 2020.

    Google Scholar 

  24. Yan Chen and Cristiano Bellavitis, Decentralized Finance: Blockchain Technology and the Quest for an Open Financial System, Stevens Institute of Technology School of Business Research Paper, pp. 1-27, 2019.

    Google Scholar 

  25. Kaihua Qin, Liyi Zhou, Yaroslav Afonin, Ludovico Lazzaretti, and Arthur Gervais, CeFi vs. DeFi - Comparing Centralized to Decentralized Finance, https://arxiv.org/abs/2106.08157, 2021.

  26. Fabian Schär, Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets, Economic Research, Vol. 103, No. 2, Second Quarter 2021.

    Google Scholar 

  27. Semyon Malamud and Marzena Rostek, Decentralized Exchange, American Economic Review, Vol. 107, No. 11, pp. 3320-3362, 2017.

    Google Scholar 

  28. Yuen C Lo and Francesca Medda, Uniswap and the emergence of the decentralized exchange, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3715398, 2020.

  29. Guillermo Angeris, Hsien-Tang Kao, Rei Chiang, Charlie Noyes, and Tarun Chitra, An analysis of Uniswap markets, Stanford University, https://web.stanford.edu/~guillean/papers/uniswap_analysis.pdf, 2019.

  30. Massimo Bartoletti, James Hsin-yu Chiang, and Alberto Lluch-Lafuente, SoK: Lending Pools in Decentralized Finance, In: Matthew Bernhard, et al. Financial Cryptography and Data Security. FC 2021 International Workshops. FC 2021. Lecture Notes in Computer Science(), vol 12676. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-63958-0_40.

  31. Jiahua Xu and Nikhil Vadgama, From banks to DeFi: the evolution of the lending market, https://arxiv.org/abs/2104.00970, 2021.

  32. How does Defi Lending Work? | DeFi Lending and Borrowing, How does Defi Lending Work? | DeFi Lending and Borrowing (leewayhertz.com)

  33. How do derivatives work in DeFi?, How do derivatives work in DeFi? (futurelearn.com)

  34. Top-notch DeFi Derivatives You Should Know About - Blaize, blaize.tech

    Google Scholar 

  35. Abid Hassan, Md. Iftekhar Ali, Rifat Ahammed, Mohammad Monirujjaman Khan, Nawal Alsufyani, and Abdulmajeed Alsufyani, Secured Insurance Framework Using Blockchain and Smart Contract, Hindawi, Scientific Programming, Article ID 6787406, pp. 1-11, 2021.

    Google Scholar 

  36. DeFi Cryptocurrency Insurance Projects Compared, defirate.com

  37. DeFi Insurance: Simply Explained, blockdata.tech

    Google Scholar 

  38. Mohsen Attaran and Angappa Gunasekaran, Blockchain for Gaming, Book Chapter, Applications of Blockchain Technology in Business, Springer International Publishing, 2019.

    Google Scholar 

  39. Dennis Lange, NFTs and Gaming: Are GameFi and P2E the future?, paytechlaw.com

  40. Entrance to GameFi World, Super Player World White Paper, 2021.

    Google Scholar 

  41. Usman W. Chohan, Non-Fungible Tokens: Blockchains, Scarcity, and Value, Critical Blockchain Research Initiative, pp. 1-14, 2021.

    Google Scholar 

  42. Michael Dowling, Is non-fungible token pricing driven by cryptocurrencies?, Finance Research Letters, Vol. 44, 2022.

    Google Scholar 

  43. Qin Wang, Rujia Li, Qi Wang, and Shiping Chen, Non-Fungible Token (NFT): Overview, Evaluation, Opportunities and Challenges, Technical Report, 2021.

    Google Scholar 

  44. Lennart Ante, The non-fungible token (NFT) market and its relationship with Bitcoin and Ethereum, Blockchain Research Lab (BRL) Working Paper Series No. 20, 2021.

    Google Scholar 

  45. Abdeljalil Beniiche, A Study of Blockchain Oracles, https://arxiv.org/abs/2004.07140, 2020.

  46. Lorenz Breidenbach, Christian Cachin, Benedict Chan, Alex Coventry, Steve Ellis, Ari Juels, Farinaz Koushanfar, Andrew Miller, Brendan Magauran, Daniel Moroz, Sergey Nazarov, Alexandru Topliceanu, Florian Tram`er, and Fan Zhang, Chainlink 2.0: Next Steps in the Evolution of Decentralized Oracle Networks, https://chain.link/whitepaper, 2021.

  47. Giulio Caldarelli, Understanding the Blockchain Oracle Problem: A Call for Action, Information, Vol. 11, No. 11, 2020.

    Google Scholar 

  48. Giulio Caldarelli and Joshua Ellul, The Blockchain Oracle Problem in Decentralized Finance—A Multivocal Approach, Applied Sciences, Vol. 11, No. 16, 2021.

    Google Scholar 

  49. Bowen Liu, Pawel Szalachowski, and Jianying Zhou, A First Look into DeFi Oracles, https://arxiv.org/abs/2005.04377, 2021.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Kaur, G., Habibi Lashkari, A., Sharafaldin, I., Habibi Lashkari, Z. (2023). Introduction to Smart Contracts and DeFi. In: Understanding Cybersecurity Management in Decentralized Finance. Financial Innovation and Technology. Springer, Cham. https://doi.org/10.1007/978-3-031-23340-1_2

Download citation

Publish with us

Policies and ethics