skip to main content
10.1145/3087801.3087835acmconferencesArticle/Chapter ViewAbstractPublication PagespodcConference Proceedingsconference-collections
research-article
Public Access

Adding Concurrency to Smart Contracts

Published:25 July 2017Publication History

ABSTRACT

Modern cryptocurrency systems, such as Ethereum, permit complex financial transactions through scripts called smart contracts. These smart contracts are executed many, many times, always without real concurrency. First, all smart contracts are serially executed by miners before appending them to the blockchain. Later, those contracts are serially re-executed by validators to verify that the smart contracts were executed correctly by miners. Serial execution limits system throughput and fails to exploit today's concurrent multicore and cluster architectures. Nevertheless, serial execution appears to be required: contracts share state, and contract programming languages have a serial semantics.

This paper presents a novel way to permit miners and validators to execute smart contracts in parallel, based on techniques adapted from software transactional memory. Miners execute smart contracts speculatively in parallel, allowing non-conflicting contracts to proceed concurrently, and "discovering" a serializable concurrent schedule for a block's transactions, This schedule is captured and encoded as a deterministic fork-join program used by validators to re-execute the miner's parallel schedule deterministically but concurrently.

Smart contract benchmarks run on a JVM with ScalaSTM show that a speedup of 1.33x can be obtained for miners and 1.69x for validators with just three concurrent threads.

References

  1. R. D. Blumofe, C. F. Joerg, B. C. Kuszmaul, C. E. Leiserson, K. H. Randall, and Y. Zhou. Cilk: An efficient multithreaded runtime system. In Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP '95, pages 207--216, New York, NY, USA, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. L. Bocchino, Jr., V. S. Adve, S. V. Adve, and M. Snir. Parallel programming must be deterministic by default. In Proceedings of the First USENIX Conference on Hot Topics in Parallelism, HotPar'09, pages 4--4, Berkeley, CA, USA, 2009. USENIX Association.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. G. Bronson, J. Casper, H. Chafi, and K. Olukotun. Transactional predication: High-performance concurrent sets and maps for stm. In Proceedings of the 29th ACM SIGACT-SIGOPS Symposium on Principles of Distributed Computing, PODC '10, pages 6--15, New York, NY, USA, 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Cachin, S. Schubert, and M. Vukolic. Non-Determinism in Byzantine Fault-Tolerant Replication. In P. Fatourou, E. Jiménez, and F. Pedone, editors, 20th International Conference on Principles of Distributed Systems (OPODIS 2016), volume 70 of Leibniz International Proceedings in Informatics (LIPIcs), pages 24:1--24:16, Dagstuhl, Germany, 2017. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.Google ScholarGoogle Scholar
  5. M. Castro and B. Liskov. Practical byzantine fault tolerance. In Proceedings of the Third Symposium on Operating Systems Design and Implementation, OSDI '99, pages 173--186, Berkeley, CA, USA, 1999. USENIX Association.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. DAO. Thedao smart contract. Retrieved 8 February 2017.Google ScholarGoogle Scholar
  7. K. Delmolino, M. Arnett, A. Kosba, A. Miller, and E. Shi. Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab, pages 79--94. Springer Berlin Heidelberg, Berlin, Heidelberg, 2016.Google ScholarGoogle ScholarCross RefCross Ref
  8. Ethereum. https://github.com/ethereum/.Google ScholarGoogle Scholar
  9. Ethereum design Rationale. http://github.com/ethereum/wiki/wiki/Design-Rationale#gas-and-fees.Google ScholarGoogle Scholar
  10. R. Guerraoui and M. Kapalka. On the correctness of transactional memory. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming (PPoPP'08), pages 175--184, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Herlihy and E. Koskinen. Transactional boosting: A methodology for highly-concurrent transactional objects. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP '08, pages 207--216, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Herlihy, V. Luchangco, M. Moir, and W. N. Scherer, III. Software transactional memory for dynamic-sized data structures. In Proceedings of the twenty-second annual symposium on Principles of distributed computing, PODC '03, pages 92--101, New York, NY, USA, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. N. Herman, J. P. Inala, Y. Huang, L. Tsai, E. Kohler, B. Liskov, and L. Shrira. Type-aware transactions for faster concurrent code. In Proceedings of the Eleventh European Conference on Computer Systems, EuroSys '16, pages 31:1--31:16, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Hyperledger white paper. http://www.the-blockchain.com/docs/Hyperledger%20Whitepaper.pdf .Google ScholarGoogle Scholar
  15. A. E. Kosba, A. Miller, E. Shi, Z. Wen, and C. Papamanthou. Hawk: The blockchain model of cryptography and privacy-preserving smart contracts. In IEEE Symposium on Security and Privacy, 2015.Google ScholarGoogle Scholar
  16. E. Koskinen and M. J. Parkinson. The push/pull model of transactions. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'15), Portland, OR, USA. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. E. Koskinen, M. J. Parkinson, and M. Herlihy. Coarse-grained transactions. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'10), pages 19--30. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Luu, D. Chu, H. Olickel, P. Saxena, and A. Hobor. Making smart contracts smarter. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, October 24-28, 2016, pages 254--269, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. Luu, J. Teutsch, R. Kulkarni, and P. Saxena. Demystifying incentives in the consensus computer. In Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS '15, pages 706--719, New York, NY, USA, 2015. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Nakamoto. Bitcoin: A peer-to-peer electronic cash system. May 2009.Google ScholarGoogle Scholar
  21. Scala STM Expert Group. Scalastm. web. Retrieved from http://nbronson.github.com/scala-stm/, 20 November 2011.Google ScholarGoogle Scholar
  22. Solidity documentation. http://solidity.readthedocs.io/en/latest/index.html.Google ScholarGoogle Scholar
  23. Solidity documentation: Solidity by example. http://solidity.readthedocs.io/en/develop/solidity-by-example.html.Google ScholarGoogle Scholar
  24. N. Szabo. Formalizing and securing relationships on public networks. First Monday, 2(9), 1997. Google ScholarGoogle ScholarCross RefCross Ref
  25. G. Wood. Ethereum: A secure decentralised generalised transaction ledger.Google ScholarGoogle Scholar

Index Terms

  1. Adding Concurrency to Smart Contracts

      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 Conferences
        PODC '17: Proceedings of the ACM Symposium on Principles of Distributed Computing
        July 2017
        480 pages
        ISBN:9781450349925
        DOI:10.1145/3087801

        Copyright © 2017 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 the author(s) 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: 25 July 2017

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        PODC '17 Paper Acceptance Rate38of154submissions,25%Overall Acceptance Rate740of2,477submissions,30%

        Upcoming Conference

        PODC '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader