skip to main content
10.1145/3384544.3384577acmotherconferencesArticle/Chapter ViewAbstractPublication PagesicscaConference Proceedingsconference-collections
research-article

An Improved Gas Efficient Library for Securing IoT Smart Contracts Against Arithmetic Vulnerabilities

Authors Info & Claims
Published:17 April 2020Publication History

ABSTRACT

Public blockchains targeting Internet of Things (IoT) are gaining more traction every day with majority of them being built on top of the Ethereum infrastructure. However, a growing number of these blockchains introduces security issues. There are 525 entries already in the Common Vulnerabilities and Exposure database related to Ethereum smart contracts. 479 of them are related to arithmetic errors, which include integer overflow or underflow. This paper, thus, concentrates on analyzing arithmetic vulnerabilities found in existing public blockchains targeted at IoT applications. Furthermore, the performance in terms of security and gas cost of smart contracts is analyzed with and without SafeMath library. In addition, an improved SafeMath library is proposed that has better arithmetic coverage and requires lower gas consumption. Four security tools are used to analyze the arithmetic protection of the improved SafeMath library. The results show that the improved SafeMath library is able to cover 4 more arithmetic operations compared to the original one by using only two common conditions checks and is capable of saving 26 units of gas, which is a significant amount in the long run.

References

  1. Vogelsteller, F., Buterin, V.. 2015. ERC-20 token standard. Ethereum.Google ScholarGoogle Scholar
  2. Tikhomirov, S., Voskresenskaya, E., Ivanitskiy, I., Takhaviev, R., Marchenko, E., Alexandrov, Y. 2018. SmartCheck: Static analysis of Ethereum smart contracts. In: 2018 IEEE/ACM 1st International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), 27 May-3 June 2018, pp. 9--16Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Buterin, V.2017. Vyper. DOI=https://vyper.readthedocs.io/en/latest/.Google ScholarGoogle Scholar
  4. Edgington, B. 2017. LLL Introduction. DOI= https://lll-docs.readthedocs.io/en/latest/lll_introduction.html.Google ScholarGoogle Scholar
  5. Delmolino, K., Arnett, M., Kosba, A., Miller, A., Shi, E.2015. A programmer's guide to Ethereum and serpent. DOI=https://www.cs.umd.edu/~elaine/smartcontract/guide.pdf.Google ScholarGoogle Scholar
  6. Ethereum: Solidity: 2016. Introduction to smart contracts. DOI= https://solidity.readthedocs.io/en/v0.4.24/introduction-to-smart-contracts.html.Google ScholarGoogle Scholar
  7. Buterin, V. 2017. PSA: I now consider Serpent outdated tech. DOI = https://twitter.com/vitalikbuterin/status/886400133667201024?lang=en.Google ScholarGoogle Scholar
  8. Castor, A. 2017. One of Ethereum's earliest smart contract languages is headed for retirement. DOI=https://www.coindesk.com/one-of-ethereums-earliest-smart-contract-languages-is-headed-for-retirement (2017)Google ScholarGoogle Scholar
  9. Wohrer, M., Zdun, U.: Smart contracts. 2018. Security patterns in the ethereum ecosystem and solidity. In: 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE), 20--20 March 2018, pp. 2--8.Google ScholarGoogle ScholarCross RefCross Ref
  10. Diligence, C. 2018. Ethereum smart contract best practices. DOI=https://consensys.github.io/smart-contract-best-practices/known_attacks/Google ScholarGoogle Scholar
  11. NCC. 2018. Decentralized application security project - top 10. DOI=https://dasp.co/.Google ScholarGoogle Scholar
  12. Wood, G. 2019. Ethereum: A secure decentralised generalised transaction ledger Ethereum.Google ScholarGoogle Scholar
  13. Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Bunzli, F., Vechev, M. 2018. Securify: Practical security analysis of smart contracts. Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, Canada.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Diligence, C. 2018. Mythirl platform: Platform and ecosystem for Ethereum security tools. DOI=https://mythril.ai/files/whitepaper.pdfGoogle ScholarGoogle Scholar
  15. Luu, L., Chu, D.-H., Olickel, H., Saxena, P., Hobor, A. 2016. Making smart contracts smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Sen, K., Marinov, D., Agha, G. 2005. CUTE: a concolic unit testing engine for C. SIGSOFT Softw. Eng. Notes 30(5), 263--272. DOI=10.1145/1095430.1081750Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Remix. 2018. Ethereum- IDE. DOI=https://remix.readthedocs.io/en/latest/Google ScholarGoogle Scholar
  18. Brent, L., Jurisevic, A., Kong, M., Liu, E., Gauthier, F., Gramoli, V., Holz, R., Scholz, B. 2018. Vandal: A scalable security analysis framework for smart contracts. CoRRGoogle ScholarGoogle Scholar

Index Terms

  1. An Improved Gas Efficient Library for Securing IoT Smart Contracts Against Arithmetic Vulnerabilities

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Other conferences
      ICSCA '20: Proceedings of the 2020 9th International Conference on Software and Computer Applications
      February 2020
      382 pages
      ISBN:9781450376655
      DOI:10.1145/3384544

      Copyright © 2020 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 April 2020

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader