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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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.
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
Aion Foundation. https://aion.network
EthereumJ. https://github.com/ethereum/ethereumj
Hello World ... from the Aion Virtual Machine! https://blog.aion.network/hello-world-from-the-aion-virtual-machine-25038ac62f17
Java Examples for NEO. https://github.com/neo-project/examples-java
NEO - An Open Network for Smart Economy. https://neo.org
Package java.lang.instrument. https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html
Solidity Crowdfunding Example (2016–2019). https://solidity.readthedocs.io/en/v0.5.4/types.html
Solidity Documentation (2016–2019). https://solidity.readthedocs.io
BCEL, December 2017. https://commons.apache.org/proper/commons-bcel
ASM, October 2018. https://asm.ow2.io
Antonopoulos, A.M.: Mastering Bitcoin: Programming the Open Blockchain, 2nd edn. O’Reilly & Associates Inc., Sebastopol (2017)
Antonopoulos, A.M., Wood, G.: Mastering Ethereum: Building Smart Contracts and Dapps, 1st edn. O’Reilly & Associates Inc., Sebastopol (2018)
Lindholm, T., Yellin, F., Bracha, G., Buckley, A.: The Java Virtual Machine Specification, Java SE 8 edn. Addison-Wesley Professional, Boston (2014)
Manning, A.: Uninitialised Storage Pointers, October 2018. https://github.com/sigp/solidity-security-blog#storage
Nakamoto, S.: Bitcoin: A Peer-to-Peer Electronic Cash System, October 2008. https://bitcoin.org/bitcoin.pdf
Siegel, D.: Understanding the DAO Attack, June 2016. https://www.coindesk.com/understanding-dao-hack-journalists
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 International Financial Cryptography Association
About this paper
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)