Skip to main content

Compiling Quantitative Type Theory to Michelson for Compile-Time Verification and Run-time Efficiency in Juvix

  • Conference paper
  • First Online:
Leveraging Applications of Formal Methods, Verification and Validation: Applications (ISoLA 2020)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12478))

Included in the following conference series:

  • 856 Accesses

Abstract

Michelson, the stack-based virtual machine of the Tezos blockchain, integrates type-checking for program execution completion but not program correctness. Manual stack tracking is efficient but less ergonomic to write in than a higher-level lambda calculus with variables. Compiling McBride’s Quantitative Type Theory to Michelson allows for compile-time verification of semantic predicates and automatic stack optimisation by virtue of the type-theoretic usage accounting system.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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. S. Developers, Solidity: An object-oriented, high-level language for implementing smart contracts. https://solidity.readthedocs.io/en/v0.6.8/

  2. Wood, G.: Ethereum: A secure decentralised generalised transaction ledger. https://gavwood.com/paper.pdf

  3. Parity Technologies: A postmortem on the parity multi-sig library self-destruct. https://www.parity.io/a-postmortem-on-the-parity-multi-sig-library-self-destruct/

  4. 0x Core Team, “Post-mortem: 0x v2.0 exchange vulnerability.” https://blog.0xproject.com/post-mortem-0x-v2-0-exchange-vulnerability-763015399578

  5. Goodman, L.M.: Tezos - a self-amending crypto-ledger, September 2014. https://tezos.com/static/white_paper-2dc8c02267a8fb86bd67a108199441bf.pdf

  6. Bernardo, B., Cauderlier, R., Pesin, B., Tesson, J.: Albert, an intermediate smart-contract language for the tezos blockchain (2020). https://arxiv.org/abs/2001.02630

  7. Bernardo, B., Cauderlier, R., Hu, Z., Pesin, B., Tesson, J.: Mi-cho-coq, a framework for certifying tezos smart contracts. https://arxiv.org/abs/1909.08671 (2019)

  8. Pettersson, J.: Safer smart contracts through type-driven development. https://publications.lib.chalmers.se/records/fulltext/234939/234939.pdf

  9. Brady, E.: IDRIS - systems programming meets full dependent types. In: PLPV 2011 - Proceedings of the 5th ACM Workshop on Programming Languages Meets Program Verification, pp. 43–54 (2011)

    Google Scholar 

  10. Edgington, B.: Ethereum lisp like language. https://lll-docs.readthedocs.io/en/latest/lll_introduction.html

  11. Atkey, R.: Syntax and semantics of quantitative type theory. In: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, pp. 56–65 (2018)

    Google Scholar 

  12. N. Labs: Michelson: The language of smart contracts in tezos. https://tezos.gitlab.io/whitedoc/michelson.html

  13. McBride, C.: I got plenty o’ Nuttin’. In: Lindley, S., McBride, C., Trinder, P., Sannella, D. (eds.) A List of Successes That Can Change the World. LNCS, vol. 9600, pp. 207–233. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-30936-1_12

    Chapter  Google Scholar 

  14. Ornelas, J.: Compiling Juvix to Michelson, May 2020. https://research.metastate.dev/juvix-compiling-juvix-to-michelson/

  15. Goes, C., Morris, A.: Usage polymorphism and dependent usages in Juvix, September 2019. https://github.com/cryptiumlabs/juvix/issues/87

  16. Goes, C.: The why of Juvix: on the design of smart contract languages, January 2020. https://research.metastate.dev/the-why-of-juvix-part-1-on-the-design-of-smart-contract-languages/

  17. Goes, C.: The why of Juvix: Ingredients & architecture, January 2020. https://research.metastate.dev/the-why-of-juvix-ingredients-architecture/

Download references

Acknowledgements

This paper describes part of the ongoing research work being undertaken to develop the Juvix smart contract language [16, 17] by the Juvix team at Metastate, including Marty Stumpf, Jeremy Ornelas, Andy Morris, and April Goncalves. Thanks to an anonymous reviewer for comments and suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christopher Goes .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Goes, C. (2020). Compiling Quantitative Type Theory to Michelson for Compile-Time Verification and Run-time Efficiency in Juvix. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation: Applications. ISoLA 2020. Lecture Notes in Computer Science(), vol 12478. Springer, Cham. https://doi.org/10.1007/978-3-030-61467-6_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-61467-6_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-61466-9

  • Online ISBN: 978-3-030-61467-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics