A Novel Electricity Transaction Mode of Microgrids Based on Blockchain and Continuous Double Auction
Abstract
:1. Introduction
2. Principle of Blockchain and Unspent Transaction out (UTXO) Model
2.1. Basic Principle of Blockchain
- (i)
- Decentralization: The blockchain network is a P2P network. Direct transactions without any centralized third party can be made among nodes. All nodes in the blockchain network possess equal positions and can verify data in blocks.
- (ii)
- Transaction non-tampering: In the blockchain system, single or multiple node database modification does not affect the database of other nodes, unless the entire network of more than 51% of node changes can be controlled at the same time, which is practically impossible.
- (iii)
- Traceability: As mentioned above, each transaction in the blockchain is connected by a cryptographic method with two adjacent blocks; thus, any transaction is traceable.
- (iv)
- Transparency: The entire blockchain operation rules of the system is open and transparent; thus, the blockchain records information on multiple node redundancy backup and updates information with multiple node mutual authentication. A node cannot deceive other nodes.
2.2. UTXO Model
- (1)
- Store data commands <sig> and <pubKey> in stack while the duplicate command OP_DUP copies the public key in the top stack and places it in the top stack.
- (2)
- The command OP_HASH160 collects the data at the top stack. Perform hash calculations twice. After this command is executed, the public key in the top stack becomes the hash of the public key. The calculation formula is:
- (3)
- Execute the <pubKeyHash> command and place it on the top stack.
- (4)
- Execute the command OP_EQUALVERIFY. If the public key hash in the output script of the sender is equal to that in the input script of the receiver, remove two data on the top stack and execute the next command. Otherwise, return to the failure signal and stop the execution.
- (5)
- Verify the rest of the public and private keys in the stack by using OP_CHECKSIG. This command proves that this public key is matched with the private key of the receiver, and the receiver gains the ownership of the asset.
3. CDA Mechanism
4. Microgrid Electricity Transaction Mode Based on Blockchain and CDA Mechanism
4.1. Overall Structure
4.2. AA Strategy in Microgrid Electricity Market
4.2.1. CEP Estimation
4.2.2. Aggressiveness Model
4.2.3. Adaptive Learning Process
4.2.4. Pricing Strategy
4.2.5. Balance Mechanism
4.3. Settlement for Microgrid Electricity Transactions
- (1)
- Issue token money: After the transaction matching, the DG issues one token money, which is proportional to the transaction volume in the blockchain network, as the input source of transaction script.
- (2)
- Transfer bitcoin: The consumer who transacts with this DG creates a common transaction of transferring bitcoins. Input: UTXO of previous transaction; Output: Bitcoins are transferred to the address of the public key of this DG attached with a digital signature.
- (3)
- Transfer token money: DG creates a trade after receiving bitcoins from the consumer. Input: Token money issued in Step 1; Output: Transfer token money to the public key of the consumer attached with a digital signature. At this moment, the consumer and DG accomplish the transaction.
- (1)
- Issue token money: This step is similar with the aforementioned settlement.
- (2)
- Transfer bitcoin: The DG sends the consumer one redeemScript involving the public keys of the DG, the consumer, and the third party. The consumer creates one transaction of transferring common bitcoins. Input: UTXO of previous transaction; Output: Transfer the transaction to the redeemScript attached with a digital signature.
- (3)
- Transfer token money: This step is similar with the aforementioned settlement.
4.4. Digital Certificate of Electricity Assets
- (1)
- Extract 7–12 bits in Sequence_N:
- (2)
- Calculate the padding variable as:
5. Analysis of Application Context
5.1. Parameter Setting
5.2. Analysis of Microgrid Transaction Results
5.3. Comparative Analysis of Different Trading Strategies
5.4. Analysis of Settlement Process for Microgrid Electricity Transactions
5.4.1. DG 2 Creates the Transaction of Issuing Energy Coins
5.4.2. Consumer 5 Creates the Transaction of Multi-Signature Transferring Bitcoins
5.4.3. DG 2 Creates the Transaction of Transferring Energy Coins
5.5. Comparison of Different Electricity Transactions Modes
6. Conclusions
- (1)
- The proposed CDA mechanism can be used in microgrid electricity transactions. In this system, two trading parties can adjust quotes dynamically according to market information. Thus, this system can quickly reach the market equilibrium and is suitable for short-time microgrid transactions.
- (2)
- The AA strategy can make adaptive tracing of market information and search the optimal quotes according to transaction prices and price fluctuations. Compared with ZI and ZIP strategies, the AA strategy can aid market participants to obtain considerable profits, and the average market efficiency under this strategy can reach over 0.98.
- (3)
- Considering that the grid power purchase prices of the user are generally higher than the market price and the sale of DG on the grid electricity price is lower than the market price, the forecasting error of load or power generation of renewable energy will inevitably result in economic losses. This condition also indirectly shows that decentralized transactions can increase the revenue of DG and reduce the electricity cost of the consumer in the microgrid.
- (4)
- DGs and consumers realize direct settlement of transactions based on the blockchain. The multi-signature system can protect the benefits of the buyer from breach of contract of the seller, and the unique data structure of the blockchain ensures the security of transaction data.
Acknowledgments
Author Contributions
Conflicts of Interest
References
- Shen, B.; Han, Y.; Price, L.; Lu, H.; Liu, M. Techno-economic evaluation of strategies for addressing energy and environmental challenges of industrial boilers in China. Energy 2017, 118, 526–533. [Google Scholar] [CrossRef]
- Lv, T.; Ai, Q. Interactive energy management of networked microgrids-based active distribution system considering large-scale integration of renewable energy resources. Appl. Energy 2016, 163, 408–422. [Google Scholar] [CrossRef]
- WEC. World Energy Issues Monitor 2017—Exposing the New Energy Realities. Available online: https://www.worldenergy.org/wp-content/uploads/2017/04/1.-World-Energy-Issues-Monitor-2017-Full-Report.pdf (accessed on 8 October 2017).
- Lee, W.; Xiang, L.; Schober, R.; Wong, V.W.S. Direct Electricity Trading in Smart Grid: A Coalitional Game Analysis. IEEE J. Sel. Areas Commun. 2014, 32, 1398–1411. [Google Scholar] [CrossRef]
- Vasirani, M.; Ossowski, S. Smart consumer load balancing: State of the art and an empirical evaluation in the Spanish electricity market. Artif. Intell. Rev. 2013, 39, 81–95. [Google Scholar] [CrossRef]
- Kim, B.G.; Ren, S.; Schaar, M.V.D.; Lee, J.W. Bidirectional Energy Trading and Residential Load Scheduling with Electric Vehicles in the Smart Grid. IEEE J. Sel. Areas Commun. 2013, 31, 1219–1234. [Google Scholar] [CrossRef]
- Cui, T.; Wang, Y.; Nazarian, S.; Pedram, M. An electricity trade model for microgrid communities in smart grid. In Proceedings of the Innovative Smart Grid Technologies Conference, Washington, DC, USA, 19–22 February 2014; pp. 1–5. [Google Scholar]
- Mengelkamp, E.; Gärttner, J.; Rock, K.; Kessler, S.; Orsini, L.; Weinhardt, C. Designing microgrid energy markets: A case study: The Brooklyn Microgrid. Appl. Energy 2017. [Google Scholar] [CrossRef]
- Hesmondhalgh, S. Is NETA the blueprint for wholesale electricity trading arrangements of the future? IEEE Trans. Power Syst. 2003, 18, 548–554. [Google Scholar] [CrossRef]
- Roggenkamp, M.M.; Hendriks, R.L.; Ummels, B.C.; Kling, W.L. Market and regulatory aspects of trans-national offshore electricity networks for wind power interconnection. Wind Energy 2010, 13, 483–491. [Google Scholar] [CrossRef]
- Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Available online: https://s3.amazonaws.com/academia.edu.documents/32413652/BitCoin_P2P_electronic_cash_system.pdf?AWSAccessKeyId=AKIAIWOWYYGZ2Y53UL3A&Expires=1510887420&Signature=HbogS3BtyAHMacgiw4Q%2BLn4TC8E%3D&response-content-disposition=inline%3B%20filename%3DBitcoin_A_Peer-to-Peer_Electronic_Cash_S.pdf (accessed on 8 October 2017).
- Underwood, S. Blockchain Beyond Bitcoin. Commun. ACM 2016, 59, 15–17. [Google Scholar] [CrossRef]
- Blockchain: Putting Theory into Practice. Available online: http://www.businessinsider.com/goldman-blockchain-beyond-the-hype-practical-uses-2016-5/#sharing-economy-building-trust-on-platforms-like-airbnb-1 (accessed on 8 October 2017).
- Sikorski, J.J.; Haughton, J.; Kraft, M. Blockchain technology in the chemical industry: Machine-to-machine electricity market. Appl. Energy 2017, 195, 234–246. [Google Scholar] [CrossRef]
- Nurzhan, Z.A.; Davor, S. Security and Privacy in Decentralized Energy Trading through Multi-Signatures, Blockchain and Anonymous Messaging Streams. IEEE Trans. Dependable Secur. Comput. 2016. [Google Scholar] [CrossRef]
- Iosifidis, G.; Koutsopoulos, I. Double auction mechanisms for resource allocation in autonomous networks. IEEE J. Sel. Areas Commun. 2009, 28, 95–102. [Google Scholar] [CrossRef]
- Wurman, P.R.; Walsh, W.E.; Wellman, M.P. Flexible Double Auctions for Electronic Commerce: Theory and Implementation. Decis. Support Syst. 1998, 24, 17–27. [Google Scholar] [CrossRef]
- Chaggar, S.; Noble, J.; Cliff, D. The effects of periodic and continuous market environments on the performance of trading agents. In Artificial Life XI: Proceedings of the Eleventh International Conference on the Simulation and Synthesis of Living Systems, Winchester, UK, 5–8 August 2008; MIT Press: Cambridge, MA, USA, 2008; pp. 110–117. [Google Scholar]
- Izakian, H.; Abraham, A.; Ladani, B.T. An auction method for resource allocation in computational grids. Future Gener. Comput. Syst. 2010, 26, 228–235. [Google Scholar] [CrossRef]
- Charlish, A.; Woodbridge, K.; Griffiths, H. Phased array radar resource management using continuous double auction. IEEE Trans. Aerosp. Electron. Syst. 2015, 51, 2212–2224. [Google Scholar] [CrossRef]
- Li, Y.; Zhang, W.; Zhang, Y.; Zhang, X.; Xiong, X. Calibration of the agent-based continuous double auction stock market by scaling analysis. Inf. Sci. 2014, 256, 46–56. [Google Scholar] [CrossRef]
- Aloud, M.; Fasli, M. Exploring Trading Strategies and their Effects in the Foreign Exchange Market. Comput. Intell. 2016, 33, 280–307. [Google Scholar] [CrossRef]
- Cliff, D. ZIP60: Further explorations in the evolutionary design of trader agents and online auction-market mechanisms. IEEE Trans. Evol. Comput. 2009, 13, 3–18. [Google Scholar] [CrossRef]
- Vytelingum, P. The Structure and Behaviour of the Continuous Double Auction. Ph.D. Thesis, University of Southampton, Southampton, UK, December 2006. [Google Scholar]
- Kondratieva, V.; Seo, S.W. Optimized Hash Tree for Authentication in Sensor Networks. IEEE Commun. Lett. 2006, 11, 149–151. [Google Scholar] [CrossRef]
- Roussel-Huchettea, S.; Hemswortha, P.H.; Boissyb, A.; Duvaux-Ponterc, C. Customer Perspectives on E-business Value: Case Study on Internet Banking. J. Internet Bank. Commer. 2010, 15, 1–13. [Google Scholar]
- Bitcoin Developer Guide. Available online: https://bitcoin.org/en/developer-guide#block-chain-overview (accessed on 8 October 2017).
- Vytelingum, P.; Ramchurn, S.D.; Voice, T.D.; Rogers, A.; Jennings, N.R. Trading agents for the smart electricity grid. In Proceedings of the International Conference on Autonomous Agents & Multiagent Systems, Toronto, ON, Canada, 10–14 May 2010; pp. 897–904. [Google Scholar]
- Houy, N. It Will Cost You Nothing to ‘Kill’ a Proof-of-Stake Crypto-Currency; Social Science Electronic Publishing: Rochester, NY, USA, 2014; p. 34. [Google Scholar]
- Krovvidi, S.S. Competitive Microgrid Electricity Market Design. Ph.D. Thesis, Virginia Polytechnic Institute and State University, Arlington, VA, USA, 5 May 2010. [Google Scholar]
- Ji, Z.; Jing, P.; Su, Y.; Pang, Y. Rank canonical correlation analysis and its application in visual search reranking. Signal Process. 2013, 93, 2352–2360. [Google Scholar] [CrossRef]
- Colored Coins. Available online: https://en.bitcoin.it/wiki/Colored_Coins (accessed on 8 October 2017).
- EPOBC_simple. Available online: https://github.com/chromaway/ngcccbase/wiki/EPOBC_simple (accessed on 8 October 2017).
- Nicolaisen, J.; Petrov, V.; Tesfatsion, L. Market power and efficiency in a computational electricity market with discriminatory double-auction pricing. IEEE Trans. Evol. Comput. 2001, 5, 504–523. [Google Scholar] [CrossRef]
Type | Transaction Volume/Unit | MIN/Satoshi Unit−1 | v/Satoshi Unit−1 |
Consumer 1 | 4 | 5000 | 15,000 |
Consumer 2 | 2 | 5000 | 14,000 |
Consumer 3 | 3 | 5000 | 13,000 |
Consumer 4 | 5 | 5000 | 13,000 |
Consumer 5 | 3 | 5000 | 16,000 |
Consumer 6 | 3 | 5000 | 15,000 |
Consumer 7 | 6 | 5000 | 14,000 |
Consumer 8 | 2 | 5000 | 15,000 |
Type | Transaction Volume/Unit | c/Satoshi Unit−1 | MAX/Satoshi Unit−1 |
DG 1 | 5 | 6000 | 16,000 |
DG 2 | 5 | 4500 | 16,000 |
DG 3 | 4 | 4000 | 16,000 |
DG 4 | 7 | 5000 | 16,000 |
DG 5 | 4 | 6500 | 16,000 |
DG 6 | 5 | 8000 | 16,000 |
Type | ΔW/Unit | /Satoshi Unit−1 | Fexpected/Satoshi | Factual/Satoshi | Economic Loss/Satoshi |
Consumer | −1 | 10,200 | 30,600 | 40,800 | 10,200 |
1 | 10,200 | 51,000 | 58,800 | 7800 | |
Type | ΔQ/Unit | /Satoshi Unit−1 | Gexpected/Satoshi | Gactual/Satoshi | Economic loss/Satoshi |
DG | −1 | 10,055 | 40,220 | 32,275 | 7945 |
1 | 10,055 | 60,330 | 56,275 | 4055 |
Input | Prev_Tx hash1//hash of previous transaction Vout: 0//UTXO scriptSig: <A sig>, <pubKeyA>//input script Sequence_N: 0x225//serial number |
Output | Value: 556//output bitcoin value scriptPubKey: OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG//output script |
Process | (1) Acquire hash of previous unspent transaction “Prev_Tx hash1” and output of the current transaction “Vout”; (2) Execute script by stack language in Figure 2 to verify UTXO; (3) If the script execution fails, then terminate the transaction. Otherwise, proceed to Step 4); (4) Determine the transaction type: Tag_Tx = Sequence_N&0x3F =0x25 is the transaction of issuing energy coins; (5) Calculate: Padding_N = Sequence_N&0x0FC0 = 0x08 = 8; (6) Calculate Padding = 28 = 256; (7) Transfer 556 Satoshi to <pubKeyAHash>; (8) Determine quantity of energy coins: Ve = Value−Padding = 300 Satoshi; (9) Conclude the transaction. |
Input | Prev_Tx hash2//hash of previous transaction Vout: 0//output of the previous transaction scriptSig: <B sig>, <pubKeyB>//input script Sequence_N: 0xFFFFFFFF//serial number |
Output | Value: 31,500//output bitcoins scriptPubKey: OP_HASH160 <Hash160(redeemScript)> OP_EQUAL//output script |
Process | (1) Acquire hash of previous unspent transaction “Prev_Tx hash2” and output of the current transaction “Vout”; (2) Execute script by stack language in Figure 2 to verify whether the previous transaction output has been spent; (3) If the script execution fails, then terminate the transaction. Otherwise, proceed to Step 4); (4) Determine the transaction type: Sequence_N = 0xFFFFFFFF is the transcription of transferring bitcoins; (5) Transfer 31,500 Satoshi to <Hash160(redeemScript)>; (6) Conclude the transaction. |
Input | Pre_Tx hash3//hash of previous transaction Vout: 0//output of the previous transaction scriptSig: OP_0 <A sig or B sig> <C sig> <redeemScript>//multi-signature input script Sequence_N: 0xFFFFFFFF//serial number |
Output | {Value1: 9450//bitcoins transferred to DG 2 scriptPubKey: OP_DUP OP_HASH160 <pubKeyAHash> OP_EQUALVERIFY OP_CHECKSIG//output script} {Value2: 22050//bitcoins transferred to Consumer 5 scriptPubKey: OP_DUP OP_HASH160 <pubKeyBHash> OP_EQUALVERIFY OP_CHECKSIG////output script} |
Process | (1) Acquire hash that B transferred to “Hash160(redeemScript) Prev_Tx hash3” and output of the current transaction “Vout”; (2) Execute P2SH script by stack language and verify whether the transaction output has been spent by multi-signature script; (3) If the script execution fails, then terminate the transaction. Otherwise, proceed to Step 4); (4) Determine the transaction type: Sequence_N = 0xFFFFFFFF is the transaction of transferring bitcoins; (5) Transfer 9450 Satoshi to <pubKeyAHash>; (6) Transfer 22,050 Satoshi to <pubKeyBHash>; (7) Conclude the transaction. |
Type | Traditional Transactions Mode | Decentralized Transactions Mode of Proposed Method |
---|---|---|
Transaction form | To complete the transaction by the third party | P2P |
Energy loss | High | Low |
Transaction cost | High | Low |
Data storage | Centralized database | Decentralized database |
Data security | Opaque data, Risk of tampering, Untraceable | Transparent, Non-tampering, Traceable |
© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, J.; Wang, Q.; Zhou, N.; Chi, Y. A Novel Electricity Transaction Mode of Microgrids Based on Blockchain and Continuous Double Auction. Energies 2017, 10, 1971. https://doi.org/10.3390/en10121971
Wang J, Wang Q, Zhou N, Chi Y. A Novel Electricity Transaction Mode of Microgrids Based on Blockchain and Continuous Double Auction. Energies. 2017; 10(12):1971. https://doi.org/10.3390/en10121971
Chicago/Turabian StyleWang, Jian, Qianggang Wang, Niancheng Zhou, and Yuan Chi. 2017. "A Novel Electricity Transaction Mode of Microgrids Based on Blockchain and Continuous Double Auction" Energies 10, no. 12: 1971. https://doi.org/10.3390/en10121971
APA StyleWang, J., Wang, Q., Zhou, N., & Chi, Y. (2017). A Novel Electricity Transaction Mode of Microgrids Based on Blockchain and Continuous Double Auction. Energies, 10(12), 1971. https://doi.org/10.3390/en10121971