Building A Blockchain From Scratch: Key Considerations And Steps

After being originally proposed as a public, decentralized and trust-less ledger for digital currencies, blockchain technology has gained widespread adoption in many fields [1-3]. Recently, utilities and network operators in the energy domain have begun focusing on using the novel possibilities provided by blockchain technology for realizing such decentralized, trust-less applications that do not rely on a single trusted third party. This includes protocols for tariff matching [4, 5] and energy trading [6, 7]. Utility providers and network operators aim at exploring the properties and benefits, as well as the shortcomings of this technology for their respective use casesFootnote 1.

In this paper, a novel and previously unsolved real-world use case of two major Austrian utility companies is investigated: National legislature, which also applies to other European countries, requires that for a shared ownership of small photovoltaic power plants, such as those commonly found in multi-party rental apartments, customers can exchange portions of their energy production with neighbors. This allows customers to save money by shifting portions to other consumers when they need less energy themselves, e.g., when they are traveling.

For this use case, we evaluate the need for blockchain technology and the applicability of different types of consensus algorithms and permissions/visibilities. A number of existing implementations, such as MultiChain [8], OpenChainFootnote 2, Ethereum [9], and a Bitcoin fork [1], were initially taken into consideration. However, due to scalability issues on the desired hardware and for achieving a lightweight and simple solution, a blockchain has been implemented from scratch. Furthermore, this use case does not only involve blockchain technology, but also requires user interaction and customer acceptance, as well as the processing of privacy-sensitive data, all of which adds an additional layer of complexity.

This paper describes the real-world use case, the design, and the final implementation as well as the outcomes in detail. It aims at serving as a guide for others by showing potential opportunities and pitfalls when implementing a blockchain for a particular field of application other than financial transactions.

The rest of the paper is structured as follows: In Section 2, we give an introduction to blockchain technology. In Section 3, we describe the underlying use case and its legal requirements in detail, including related work on the subject. We further motivate the use of blockchain technology for the proposed application. In Section 4, we discuss existing blockchain implementations and their drawbacks in our use case and continue to motivate and describe our custom implementation in detail in Section 5. Finally, in Section 6, we discuss the lessons learned from our implementation before concluding the paper.