Skip to main content

An Empirical Analysis of Smart Contracts: Platforms, Applications, and Design Patterns

  • Conference paper
  • First Online:
Financial Cryptography and Data Security (FC 2017)

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 10323))

Included in the following conference series:

Abstract

Smart contracts are computer programs that can be consistently executed by a network of mutually distrusting nodes, without the arbitration of a trusted authority. Because of their resilience to tampering, smart contracts are appealing in many scenarios, especially in those which require transfers of money to respect certain agreed rules (like in financial services and in games). Over the last few years many platforms for smart contracts have been proposed, and some of them have been actually implemented and used. We study how the notion of smart contract is interpreted in some of these platforms. Focussing on the two most widespread ones, Bitcoin and Ethereum, we quantify the usage of smart contracts in relation to their application domain. We also analyse the most common programming patterns in Ethereum, where the source code of smart contracts is available.

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

Notes

  1. 1.

    http://www.coindesk.com/category/technology/smart-contracts-news.

  2. 2.

    As far as we know, currently only the Eligius mining pool accepts more general transactions (called non-standard in the Bitcoin community). However, this pool only mines \(\sim 1\%\) of the total mined blocks [20].

  3. 3.

    The consensus mechanism of Ethereum is a variant of the GHOST protocol in [46].

  4. 4.

    Solidity: http://solidity.readthedocs.io/en/develop/index.html.

  5. 5.

    See FAQ: How do Smart Contracts “form a consensus” on Counterparty? http://counterparty.io/docs/faq-smartcontracts/#how-do-smart-contracts-form-a-consensus-on-counterparty.

  6. 6.

    https://www.stellar.org/developers/guides/concepts/operations.html.

  7. 7.

    https://tendermint.com/.

  8. 8.

    https://lisk.io/documentation?i=lisk-handbooks/DelegateHandbook.

  9. 9.

    https://redd.it/5om2lw.

  10. 10.

    Sources: https://blockchain.info/charts/n-transactions-total (for Bitcoin), https://blockscan.com (Counterparty), and https://etherscan.io (Ethereum).

  11. 11.

    Market capitalization estimated by http://coinmarketcap.com.

  12. 12.

    https://github.com/BitcoinOpReturn/OpReturnTool.

  13. 13.

    Bitcoin financial contracts: Colu, CoinSpark, OpenAssets, Omni, SmartBit, BitPos.

  14. 14.

    Bitcoin notary contracts: Factom, Stampery, Proof of Existence, Blocksign, Crypto-Copyright, Stampd, BitProof, ProveBit, Remembr, OriginalMy, LaPreuve, Nicosia, Chainpoint, Diploma, Monegraph, Blockai, Ascribe, Eternity Wall, Blockstore.

  15. 15.

    Although the Ethereum virtual machine is designed to be Turing-complete, in practice the limitations on the amount of gas which can be used to invoke contracts also limit the set of computable functions (e.g., verifying checkmate exceeds the current gas limits of a transaction [35]).

  16. 16.

    http://www.oraclize.it/.

References

  1. Bitcoin contract. https://en.bitcoin.it/wiki/Contract. Accessed 14 Jan 2017

  2. Bitcoin OP_RETURN wiki page. https://en.bitcoin.it/wiki/OP_RETURN. Accessed 14 Jan 2017

  3. Dgx website. https://www.dgx.io/. Accessed 14 Jan 2017

  4. Ethereum hard fork 20 July 2016. https://blog.ethereum.org/2016/07/20/hard-fork-completed/. Accessed 14 Jan 2017

  5. Ethereum request for comment 20. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs. Accessed 14 Jan 2017

  6. Lisk. https://lisk.io/. Accessed 14 Jan 2017

  7. Making sense of blockchain smart contracts. http://www.coindesk.com/making-sense-smart-contracts/. Accessed 14 Jan 2017

  8. Monax. https://monax.io/. Accessed 14 Jan 2017

  9. Smart contracts: The good, the bad and the lazy. http://www.multichain.com/blog/2015/11/smart-contracts-good-bad-lazy/. Accessed 14 Jan 2017

  10. Stellar. https://www.stellar.org/. Accessed 14 Jan 2017

  11. The Stellar consensus protocol. https://www.stellar.org/papers/stellar-consensus-protocol.pdf. Accessed 14 Jan 2017

  12. Thinking about smart contract security. https://blog.ethereum.org/2016/06/19/thinking-smart-contract-security/. Accessed 14 Jan 2017

  13. Understanding the DAO attack. http://www.coindesk.com/understanding-dao-hack-journalists/. Accessed 14 Jan 2017

  14. Another bug in the ens, you can win with an unlimited high bid without paying for it (2017). https://www.reddit.com/r/ethereum/comments/5zctus/another_bug_in_the_ens_you_can_win_with_an/. Accessed 17 Mar 2017

  15. Anderson, L., Holz, R., Ponomarev, A., Rimba, P., Weber, I.: New kids on the block: an analysis of modern blockchains. CoRR abs/1606.06530 (2016)

    Google Scholar 

  16. Andrychowicz, M., Dziembowski, S., Malinowski, D., Mazurek, L.: Secure multiparty computations on Bitcoin. In: IEEE S & P, pp. 443–458 (2014)

    Google Scholar 

  17. Andrychowicz, M., Dziembowski, S., Malinowski, D., Mazurek, L.: Secure ultiparty computations on Bitcoin. Commun. ACM 59(4), 76–84 (2016). http://doi.acm.org/10.1145/2896386

    Article  Google Scholar 

  18. Atzei, N., Bartoletti, M., Cimoli, T.: A survey of attacks on ethereum smart contracts (SoK). In: Maffei, M., Ryan, M. (eds.) POST 2017. LNCS, vol. 10204, pp. 164–186. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54455-6_8

    Chapter  Google Scholar 

  19. Back, A., Bentov, I.: Note on fair coin toss via Bitcoin (2013). http://www.cs.technion.ac.il/~idddo/cointossBitcoin.pdf

  20. Banasik, W., Dziembowski, S., Malinowski, D.: Efficient zero-knowledge contingent payments in cryptocurrencies without scripts. In: Askoxylakis, I., Ioannidis, S., Katsikas, S., Meadows, C. (eds.) ESORICS 2016. LNCS, vol. 9879, pp. 261–280. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-45741-3_14

    Chapter  Google Scholar 

  21. Baqer, K., Huang, D.Y., McCoy, D., Weaver, N.: Stressing out: Bitcoin “stress testing”. In: Clark, J., Meiklejohn, S., Ryan, P.Y.A., Wallach, D., Brenner, M., Rohloff, K. (eds.) FC 2016. LNCS, vol. 9604, pp. 3–18. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53357-4_1

    Chapter  Google Scholar 

  22. Bartoletti, M., Carta, S., Cimoli, T., Saia, R.: Dissecting Ponzi schemes on Ethereum: identification, analysis, and impact. CoRR abs/1703.03779 (2017). https://arxiv.org/abs/1703.03779

  23. Bartoletti, M., Pompianu, L.: An analysis of Bitcoin OP_RETURN metadata. CoRR abs/1702.01024 (2016). To appear in Bitcoin Workshop 2017. https://arxiv.org/abs/1702.01024

  24. Bentov, I., Kumaresan, R.: How to use Bitcoin to design fair protocols. In: Garay, J.A., Gennaro, R. (eds.) CRYPTO 2014. LNCS, vol. 8617, pp. 421–439. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44381-1_24

    Chapter  Google Scholar 

  25. Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Gollamudi, A., Gonthier, G., Kobeissi, N., Rastogi, A., Sibut-Pinote, T., Swamy, N., Zanella-Beguelin, S.: Formal verification of smart contracts. In: PLAS (2016)

    Google Scholar 

  26. Bonneau, J., Miller, A., Clark, J., Narayanan, A., Kroll, J.A., Felten, E.W.: SoK: research perspectives and challenges for Bitcoin and cryptocurrencies. In: IEEE S & P, pp. 104–121 (2015)

    Google Scholar 

  27. Brown, R.G., Carlyle, J., Grigg, I., Hearn, M.: Corda: an introduction (2016). http://r3cev.com/s/corda-introductory-whitepaper-final.pdf

  28. Buterin, V.: Ethereum: a next generation smart contract and decentralized application platform (2013). https://github.com/ethereum/wiki/wiki/White-Paper

  29. Churyumov, A.: Byteball: a decentralized system for transfer of value (2016). https://byteball.org/Byteball.pdf

  30. Clack, C.D., Bakshi, V.A., Braine, L.: Smart contract templates: foundations, design landscape and research directions. CoRR abs/1608.00771 (2016)

    Google Scholar 

  31. Delmolino, K., Arnett, M., Kosba, A., Miller, A., Shi, E.: Step by step towards creating a safe smart contract: lessons and insights from a cryptocurrency lab. In: Clark, J., Meiklejohn, S., Ryan, P.Y.A., Wallach, D., Brenner, M., Rohloff, K. (eds.) FC 2016. LNCS, vol. 9604, pp. 79–94. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53357-4_6

    Chapter  Google Scholar 

  32. Dermody, R., Krellenstein, A., Slama, O., Wagner, E.: Counterparty: Protocol specification (2014). http://counterparty.io/docs/protocol_specification/. Accessed 14 Jan 2017

  33. Frantz, C.K., Nowostawski, M.: From institutions to code: towards automated generation of smart contracts. In: Workshop on Engineering Collective Adaptive Systems (eCAS) (2016)

    Google Scholar 

  34. Glaser, F., Zimmermann, K., Haferkorn, M., Weber, M.C.: Bitcoin - asset or currency? revealing users’ hidden intentions. In: European Conference on Information Systems (ECIS) (2014)

    Google Scholar 

  35. Grau, P.: Lessons learned from making a chess game for Ethereum (2016). https://medium.com/@graycoding/lessons-learned-from-making-a-chess-game-for-ethereum-6917c01178b6#.fwtdwly6e. Accessed 14 Jan 2017

  36. Kumaresan, R., Moran, T., Bentov, I.: How to use Bitcoin to play decentralized poker. In: ACM CCS, pp. 195–206 (2015)

    Google Scholar 

  37. Luu, L., Chu, D.H., Olickel, H., Saxena, P., Hobor, A.: Making smart contracts smarter. In: ACM CCS (2016). http://eprint.iacr.org/2016/633

  38. Marino, B., Juels, A.: Setting standards for altering and undoing smart contracts. In: Alferes, J.J.J., Bertossi, L., Governatori, G., Fodor, P., Roman, D. (eds.) RuleML 2016. LNCS, vol. 9718, pp. 151–166. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-42019-6_10

    Chapter  Google Scholar 

  39. Möser, M., Böhme, R.: Trends, tips, tolls: a longitudinal study of Bitcoin transaction fees. In: Brenner, M., Christin, N., Johnson, B., Rohloff, K. (eds.) FC 2015. LNCS, vol. 8976, pp. 19–33. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-48051-9_2

    Chapter  Google Scholar 

  40. Nakamoto, S.: Bitcoin: a peer-to-peer electronic cash system (2008). https://bitcoin.org/bitcoin.pdf

  41. Nomura Research Institute: Survey on blockchain technologies and related services. http://www.meti.go.jp/english/press/2016/pdf/0531_01f.pdf

  42. Popejoy, S.: The Pact smart contract language (2016). http://kadena.io/pact

  43. Reid, F., Harrigan, M.: An analysis of anonymity in the Bitcoin system. In: Altshuler, Y., Elovici, Y., Cremers, A., Aharony, N., Pentland, A. (eds.) Security and Privacy in Social Networks, pp. 197–223. Springer, Heidelberg (2013). https://doi.org/10.1007/978-1-4614-4139-7_10

    Chapter  Google Scholar 

  44. Ron, D., Shamir, A.: Quantitative analysis of the full Bitcoin transaction graph. In: Sadeghi, A.-R. (ed.) FC 2013. LNCS, vol. 7859, pp. 6–24. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39884-1_2

    Chapter  Google Scholar 

  45. Seijas, P.L., Thompson, S., McAdams, D.: Scripting smart contracts for distributed ledger technology. Cryptology ePrint Archive, Report 2016/1156 (2016). http://eprint.iacr.org/2016/1156

  46. Sompolinsky, Y., Zohar, A.: Secure high-rate transaction processing in Bitcoin. In: Böhme, R., Okamoto, T. (eds.) FC 2015. LNCS, vol. 8975, pp. 507–527. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-47854-7_32

    Chapter  Google Scholar 

  47. Szabo, N.: Formalizing and securing relationships on public networks. First Monday 2(9) (1997). http://firstmonday.org/htbin/cgiwrap/bin/ojs/index.php/fm/article/view/548

  48. UK Government Chief Scientific Adviser: Distributed ledger technology: beyond block chain. https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/492972/gs-16-1-distributed-ledger-technology.pdf

  49. Wood, G.: Ethereum: a secure decentralised generalised transaction ledger (2014). http://gavwood.com/paper.pdf

Download references

Acknowledgments

This work is partially supported by Aut. Reg. of Sardinia project P.I.A. 2013 “NOMAD”.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Massimo Bartoletti .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 International Financial Cryptography Association

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bartoletti, M., Pompianu, L. (2017). An Empirical Analysis of Smart Contracts: Platforms, Applications, and Design Patterns. In: Brenner, M., et al. Financial Cryptography and Data Security. FC 2017. Lecture Notes in Computer Science(), vol 10323. Springer, Cham. https://doi.org/10.1007/978-3-319-70278-0_31

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-70278-0_31

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-70277-3

  • Online ISBN: 978-3-319-70278-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics