Skip to main content

Programming Legal Contracts

– A Beginners Guide to  Stipula –

  • Chapter
  • First Online:
The Logic of Software. A Tasting Menu of Formal Methods

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13360))

Abstract

We discuss the design principles of Stipula, a domain specific language that can assists lawyers in programming legal contracts through specific software patterns. The language is based on a small set of primitives, that precisely correspond to the distinctive elements of legal contracts, and that are amenable to be prototyped on both centralized or distributed systems. We also outline two formal techniques to reason about Stipula contracts: a type inference system that allows to derive types for fields, assets and contract’s functions, and an analyzer of liquidity that pinpoints those contracts that do not freeze any asset forever.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    For simplicity, this code requires Better1 to place its bet before Better2. It is easy to extend the code to let the two bets be placed in any order.

References

  1. Cardano Documentation (2020). https://docs.cardano.org/

  2. Bartoletti, M., Zunino, R.: Verifying liquidity of bitcoin contracts. In: Nielson, F., Sands, D. (eds.) POST 2019. LNCS, vol. 11426, pp. 222–247. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17138-4_10

    Chapter  Google Scholar 

  3. Basu, S., Mohan, A., Grimmelmann, J., Foster, N.: Legal calculi. Technical report, ProLaLa 2022 ProLaLa Programming Languages and the Law (2022). https://popl22.sigplan.org/details/prolala-2022-papers/6/Legal-Calculi

  4. Biryukov, A., Khovratovich, D., Tikhomirov, S.: Findel: secure derivative contracts for ethereum. In: Brenner, M., et al. (eds.) FC 2017. LNCS, vol. 10323, pp. 453–467. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-70278-0_28

    Chapter  Google Scholar 

  5. Coblenz, M.J., Aldrich, J., Myers, B.A., Sunshine, J.: Can advanced type systems be usable? an empirical study of ownership, assets, and typestate in obsidian. In: Proceedings of ACM Programming Language, vol. 4, no. OOPSLA, pp. 132:1–132:28 (2020)

    Google Scholar 

  6. Coblenz, M.J., et al.: Obsidian: typestate and assets for safer blockchain programming. ACM Trans. Program. Lang. Syst. 42(3), 14:1–14:82 (2020)

    Google Scholar 

  7. Crafa, S., Laneve, C., Sartor, G.: Pacta sunt servanda: legal contracts in Stipula. Technical report, arXiv:2110.11069, October 2021

  8. Lexon Foundation. Lexon Home Page (2019). http://www.lexon.tech

  9. Peyton Jones, S.L., Eber, J.-M., Seward, J.: Composing contracts: an adventure in financial engineering, functional pearl. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), Montreal, Canada, 18–21 September 2000, pp. 280–292. ACM (2000)

    Google Scholar 

  10. Pierce, B.C.: Types and Programming Languages. The MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  11. Open Source Contributors. The Accord Project (2018). https://accordproject.org

  12. Research Group on EC Private Law (Acquis Group) Study Group on a European Civil Code. Principles, Definitions and Model Rules of European Private Law: Draft Common Frame of Reference (DCFR), Outline Edition. Sellier (2009)

    Google Scholar 

  13. Wright, A., Roon, D., ConsenSys, A.G.: OpenLaw web site (2019). https://www.openlaw.io

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Cosimo Laneve .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Crafa, S., Laneve, C. (2022). Programming Legal Contracts. In: Ahrendt, W., Beckert, B., Bubel, R., Johnsen, E.B. (eds) The Logic of Software. A Tasting Menu of Formal Methods. Lecture Notes in Computer Science, vol 13360. Springer, Cham. https://doi.org/10.1007/978-3-031-08166-8_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-08166-8_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-08165-1

  • Online ISBN: 978-3-031-08166-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics