Skip to main content

A Java Framework for Smart Contracts

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

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

Included in the following conference series:

Abstract

This article defines a framework for programming, in Java, smart contracts over blockchain. The framework consists of a restricted runtime and of an instrumentation procedure for classes that need to be persisted to blockchain, for payable contract methods and for gas metering. This instrumentation abstracts away any difference between storage and memory data location, which is at the origin of tricky semantical issues and bugs in Solidity. Moreover, this framework allows one to leverage, in a transparent way, existing expertise and tools from the Java world, in order to build smart contracts in a simple and comfortable way. The resulting contracts are strongly-typed and work over a shared storage, that allows simple intercontract communication. This makes it easy to install libraries or microservices in blockchain.

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.

    Takamaka is a valley in French Réunion island, where a network of waterfalls converge into a river. This is similar to Takamaka’s smart contracts, that is, distinct objects that collaborate over a shared global heap in blockchain.

  2. 2.

    The actual implementation of Takamaka allows storage objects to have fields that hold instances of type java.lang.String and java.math.BigInteger as well, but this is not explained in this article, for simplicity.

References

  1. Aion Foundation. https://aion.network

  2. EthereumJ. https://github.com/ethereum/ethereumj

  3. Hello World ... from the Aion Virtual Machine! https://blog.aion.network/hello-world-from-the-aion-virtual-machine-25038ac62f17

  4. Java Examples for NEO. https://github.com/neo-project/examples-java

  5. NEO - An Open Network for Smart Economy. https://neo.org

  6. Package java.lang.instrument. https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html

  7. Web3j. https://github.com/web3j/web3j

  8. Solidity Crowdfunding Example (2016–2019). https://solidity.readthedocs.io/en/v0.5.4/types.html

  9. Solidity Documentation (2016–2019). https://solidity.readthedocs.io

  10. BCEL, December 2017. https://commons.apache.org/proper/commons-bcel

  11. ASM, October 2018. https://asm.ow2.io

  12. Antonopoulos, A.M.: Mastering Bitcoin: Programming the Open Blockchain, 2nd edn. O’Reilly & Associates Inc., Sebastopol (2017)

    Google Scholar 

  13. Antonopoulos, A.M., Wood, G.: Mastering Ethereum: Building Smart Contracts and Dapps, 1st edn. O’Reilly & Associates Inc., Sebastopol (2018)

    Google Scholar 

  14. Lindholm, T., Yellin, F., Bracha, G., Buckley, A.: The Java Virtual Machine Specification, Java SE 8 edn. Addison-Wesley Professional, Boston (2014)

    Google Scholar 

  15. Manning, A.: Uninitialised Storage Pointers, October 2018. https://github.com/sigp/solidity-security-blog#storage

  16. Nakamoto, S.: Bitcoin: A Peer-to-Peer Electronic Cash System, October 2008. https://bitcoin.org/bitcoin.pdf

  17. Siegel, D.: Understanding the DAO Attack, June 2016. https://www.coindesk.com/understanding-dao-hack-journalists

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Fausto Spoto .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 International Financial Cryptography Association

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Spoto, F. (2020). A Java Framework for Smart Contracts. In: Bracciali, A., Clark, J., Pintore, F., Rønne, P., Sala, M. (eds) Financial Cryptography and Data Security. FC 2019. Lecture Notes in Computer Science(), vol 11599. Springer, Cham. https://doi.org/10.1007/978-3-030-43725-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-43725-1_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-43724-4

  • Online ISBN: 978-3-030-43725-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics