Advertisement

Towards Adding Variety to Simplicity

  • Nachiappan Valliappan
  • Solène Mirliaz
  • Elisabet Lobo Vesga
  • Alejandro RussoEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11247)

Abstract

Simplicity is a Turing-incomplete typed combinator language for smart contracts with a formal semantics. The design of Simplicity makes it possible to statically estimate the resources (e.g., memory) required to execute contracts. Such a feature is highly relevant in blockchain applications to efficiently determine fees to run smart contracts. Despite being Turing incomplete, the language is capable of expressing non-trivial contracts. Often, Simplicity programs contain lots of code repetition that could otherwise be avoided if it had common programming languages features, such as local definitions, functions, and bounded loops. In this work, we provide the foundations to make Simplicity a richer language. To achieve that, we connect Simplicity’s primitives with a categorical model. By doing so, we lift the language to a more abstract representation that will allow us to extend it by leveraging category theory models for computations. This methodology facilitates the addition of local definitions, functions, and bounded loops. We provide an implementation of Simplicity and its virtual machine in the functional programming language Haskell.

Keywords

Simplicity Category theory Haskell Functional programming Blockchain Smart contracts 

Notes

Acknowledgments

This work was funded by the Swedish Foundation for Strategic Research (SSF) under the project Octopi (Ref. RIT17-0023) and the Swedish research agency Vetenskapsrådet.

References

  1. 1.
    Barendregt, H., Dekkers, W., Statman, R.: Lambda Calculus with Types. Cambridge University Press, Cambridge (2013)CrossRefGoogle Scholar
  2. 2.
    Cousineau, G., Curien, P., Mauny, M.: The categorical abstract machine. Sci. Comput. Program. 8(2), 173–202 (1987)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Elliott, C.: Compiling to categories. In: Proceedings of the ACM on Programming Languages (ICFP) (2017). http://conal.net/papers/compiling-to-categoriesGoogle Scholar
  4. 4.
    Marlow, S.: Haskell 2010 language report (2010). http://www.haskell.org/
  5. 5.
    Nakamoto, S.: Bitcoin: a peer-to-peer electronic cash system (2008)Google Scholar
  6. 6.
    O’Connor, R.: Simplicity: a new language for blockchains. In: Proceedings of the Workshop on Programming Languages and Analysis for Security, PLAS 2017. ACM (2017)Google Scholar
  7. 7.
    O’Connor, R.: Simplicity: a new language for blockchains. CoRR abs/1711.03028 (2017). http://arxiv.org/abs/1711.03028
  8. 8.
    Peyton Jones, S., Vytiniotis, D., Weirich, S., Washburn, G.: Simple unification-based type inference for gadts. In: ACM SIGPLAN Notices, vol. 41, pp. 50–61. ACM (2006)Google Scholar
  9. 9.
    Schwartz, D., Youngs, N., Britto, A., et al.: The ripple protocol consensus algorithm. Ripple Labs Inc White Paper 5 (2014)Google Scholar
  10. 10.
    Swan, M.: Blockchain: Blueprint for a New Economy. O’Reilly Media Inc., Newton (2015)Google Scholar
  11. 11.
    Wadler, P.: Monads for functional programming. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 24–52. Springer, Heidelberg (1995).  https://doi.org/10.1007/3-540-59451-5_2CrossRefGoogle Scholar
  12. 12.
    Wood, G.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Pap. 151, 1–32 (2014)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  • Nachiappan Valliappan
    • 1
  • Solène Mirliaz
    • 2
  • Elisabet Lobo Vesga
    • 1
  • Alejandro Russo
    • 1
    Email author
  1. 1.Chalmers University of TechnologyGothenburgSweden
  2. 2.ENS RennesRennesFrance

Personalised recommendations