Skip to main content
Log in

Ethereum smart contract-based automated power trading algorithm in a microgrid environment

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

A recently emerged microgrid system presents the concept of a prosumer that consumers can also become suppliers, instead of a one-way configuration with separate providers and consumers. The microgrid system allows users to produce electricity, sell it on demand, and purchase them from other users. Unlike conventional centralized power trading, this emerging system aims on providing decentralized, transparent, and secure power trading. In this paper, we introduce a transparent and safe power trading algorithm between users using blockchain. The proposed algorithm has been implemented with an executable distributed code (i.e., smart contract) in an Ethereum blockchain platform. It explores for the power trading with automated operations in a decentralized environment without user intervention. The proposed power trading algorithm is written in the Solidity language and tested on the Ethereum blockchain platform. We also provide the actual code of the power trading algorithm written in the Solidity language.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  1. Gungor V Cagri et al (2013) A survey on smart grid potential applications and communication requirements. IEEE Trans Ind Inf 9(1):28–42

    Article  Google Scholar 

  2. Yan Ye et al (2013) A survey on smart grid communication infrastructures: motivations, requirements and challenges. IEEE Commun Surv Tutor 15(1):5–20

    Article  Google Scholar 

  3. Serna-Suarez ID, Ordonez-Plata G, Carrillo-Caicedo G (2015) Microgrid’s energy management systems: a survey. In: 2015 12th International Conference on the European Energy Market (EEM). IEEE, Washington

  4. Zhang Chenghua et al (2017) Review of existing peer-to-peer energy trading projects. Energy Procedia 105:2563–2568

    Article  Google Scholar 

  5. Zhang Chenghua et al (2016) A bidding system for peer-to-peer energy trading in a grid-connected microgrid. Energy Procedia 103:147–152

    Article  Google Scholar 

  6. Nakamoto S (2008) Bitcoin: a peer-to-peer electronic cash system. https://bitcoin.org/bitcoin.pdf. Accessed 2 Mar 2018

  7. Buterin V (2018) A next-generation smart contract and decentralized application platform. https://github.com/ethereum/wiki/wiki/White-Paper. Accessed 2 Mar 2018

  8. Klemperer Paul (1999) Auction theory: a guide to the literature. J Econ Surv 13(3):227–286

    Article  Google Scholar 

  9. Solidity (2018). https://solidity.readthedocs.io/en/develop/. Accessed 2 Mar 2018

  10. Ethereum JavaScript API (2018). https://github.com/ethereum/wiki/wiki/JavaScript-API. Accessed 2 Mar 2018

  11. Mavridou A, Laszka A (2017) Designing secure Ethereum smart contracts: a finite state machine based approach. arXiv preprint arXiv:1711.09327

Download references

Acknowledgements

This research was supported by a Research Grant from Sangmyung University.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jong-Hyouk Lee.

Appendix

Appendix

We provide the smart contract code written in the Solidity language v0.4.25. The major variables have been defined at the beginning part of the code. The functions of the smart contract are then followed.

The magic global variables supported by the Solidity language are used such as now and msg. The magic global variable now is the timestamp that indicates the current time of the smart contract, whereas the magic global variable msg indicates the transaction. For instance, msg.sender refers to the address of the transaction sender and msg.value refers to the amount of the bidding sent in the transaction.

figure a
figure b

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Myung, S., Lee, JH. Ethereum smart contract-based automated power trading algorithm in a microgrid environment. J Supercomput 76, 4904–4914 (2020). https://doi.org/10.1007/s11227-018-2697-7

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-018-2697-7

Keywords

Navigation