Incorporating blockchain and internet of thing: The context of renewable energy certificate on smart grid

. Blockchain and the Internet of Things (IoT) complements each other within the space of decentralization, real time monitoring, and data sharing and security. In this paper we explored the integration of blockchain and IoT within the context of smart grid. Current REC system lacks visibility and transparency which are very critical to the success of smart grids. Conventional smart grid system makes it difficult to proof whether a buyer has truly received an energy certificate or not. Therefore, we proposed a blockchain and IoT based system for autonomous monitoring of energy sources and tracking of RECs on smart grid. Our system provides the visibility and transparency on smart grid networks that is imperative to safeguarding RECs market. Results based on extensive experiments illustrate the efficiency and scalability of our system.


Introduction
Blockchain and Internet of Things (IoT) have gained enormous attention in recent years, particularly, the field of finance, health and energy [1][2] [3] . It is not surprising that there is a growing interest to incorporate blockchain and IoT technology in Renewable Energy Certificate (REC) market space. REC is strategic way of tracking and trading renewable energy production in current time. To produce a single renewable energy certificate, a 1.0MWh of renewable energy must be produced [4] [5] . Conventionally, REC is tradable on the energy market and customers who buy RECs adopt the renewable attributes of its and even the type and source of renewable energy generation. AS earlier mentioned, RECs are energy commodities that are non-tangible and tradeable.
Renewable Portfolio Standard led to the creation of REC's. In order to proof that companies are producing energy in an eco-friendlier manner, these RECs are to provide proof of compliance culture, particularly, companies and homes that participate in the generation and distribution of energy on smart girds. Highly, the proof of ownership of certificate on the energy market is very difficult and complex. Hence, we proposed a blockchain and IoT based system that facilitate smooth tracking of energy certificates on the smart grid network. RECs are mostly purchased by companies and enterprise to meet their energy needs. This means companies and smart homes with more RECs holds more energy in stock which can be traded. Policy instruments by Government encourages service providers to include a minimum renewable energy supply for their electricity supply, which will create the market for RECs.
Considering the Renewable Energy Certificate market on the smart grid systems-the conditions, the quantity, type and geographical source of certificate are key information that should be available to all entities on the smart grid, particularly, to the end users. IoT devices could be used at various energy production sources to help monitor conditions and type of renewable energy produced. The blockchain provides a decentralized architecture that embodies IoT devices as light nodes. The integration of IoT and blockchain technology gives a comprehensive monitoring and tracking of RECs on smart grids [7] .

Smart energy and smart grids
The dependency on fossil fuels for electricity generation raises concerns on sustainable environment and low carbon cities. In recent years, the use of renewable energy sources is increasing to promote sustainability of energy. Smart energy systems seek to maximize energy production and use. The main component of smart energy includes consumer, network and supplier [8] [9] .At some point the consumer is referred as a prosumer (produce energy, use and sell). The network encompasses the distribution and telecommunication networks that seek to optimize the distribution of information in real time basis. Supply hinges on the generation of power in relation to demand.
Smart grids give the opportunity of a bidirectional communication between entities on the grid [10] . The smart grid approach minimizes energy loss and it relies on intelligent resources such as the Internet of Things to achieve effective real time communication. Smart grid offers the chance of effective energy transmission, faster power recovery, reduction of operation cost and greater integration of large energy production systems. The production of energy on smart grids requires to be monitored and tracked, thereby, the introduction of Renewable Energy Certificate of crucial to the energy market.

Renewable energy certificate (RECS)
In practice, the generation of electricity from renewable sources varies in relation to weather and climatic conditions. It is of importance to track the ownership of prosumers who generate energy using renewable sources. Renewable Energy Certificate is a tradable commodity that could be used as a tracking strategy. This REC is issued when 1 MWh of electricity is generated and transmitted to the grid from a renewable energy resource [11] .Our blockchain system is used to track renewable energy certificate from one point on the smart grid network to the other. The ownership certificates could be track on the system. Difficulties in the tracking of RECs on conventional smart grid network, will be handled by our blockchain system which provides a decentralized ledger for the trading of RECs.

System architecture
We leveraged the distributed ledger properties of blockchain, with smart contract, IoT devices and smart grid in establishing our blockchain and IoT based REC tracking on our blockchain enabled smart grids system. Entities on our system include, service provider, companies. To avoid the diffusion of REC's owner on the system, customer id is added as part of trading transaction and stored in a blockchain ledger. Prosumers that produces energy from a renewable source obtains renewable certificate from service providers which can be traded for payment.

Block structure of our smart grid system
For our decentralized RECs market on smart grids system, we ensure the creation and validation of blocks by consensus mechanisms. All participating nodes agreed upon transaction on our system by following a consensus protocol.
Each block is linked to the hash of the previous block, Also the timestamp of event, nonce, Merkle tree root hash, version number, and transactions is recorded in the block as seen in figure 2. Users can query information from the blocks to settle disputes and doubts. This will prevent fraudulent certificates on the smart grid network since all stakeholders can query information on drugs for verification.

The need for a blockchain and IoT in smart grid
Blockchain is a distributed ledger that run on a network of computers called nodes. Every node on the network stores a copy of the blockchain ledger which makes the data on the blockchain available to multiple parties and verified by more than one person (decentralized system). Any changes that occur at point in the ledger is replicated across all nodes for verification and storage [12]. Most importantly, blockchain eliminates the need of third parties in centralized systems. Also, when one node fails, it does not affect the overall system unlike a centralized architecture. One of the key concerns of using blockchain in drug supply chain is security concerns. Since the inception of blockchain technology, there is no known fraud or breach of its security, which makes it the best option for cyber security. Again, it eliminates the biases in the current supply chain systems and gives a trustless system where goods and services can be traded/shared or verified without the need of trusting a single party.
Moreover, blockchain gives an option for tracking Renewable energy certificates on the blockchain [13] . It takes record of all events across the smart grid. These records include, change of ownership of goods, energy records from smart meters. These records are pushed as transaction on the blockchain to be stored. These records become the history of a particular REC on the smart grid. This option prevents the loss of REC within the smart grid network.
Beyond the aforementioned characteristics of blockchains and its relevance, smart contract is a key feature of blockchain 2.0. Smart contracts extend the functionality of blockchains and give it more flexibility to be applied in real world scenarios. They are pieces of code that contain the application logic within the blockchain space and runs autonomously on all or some blockchain nodes dependent on the functionality of the node.

How blockchain complement IoT in smart grids
The growing interest of IoT in current times is not surprising since they possess significant sensing and monitoring of data from a one-point source to another over a network domain [14] . Also, devices-to-device communication is key in the world of smart cities. More specifically, smart devices transmit sensitive data, which is not limited to personal information of device users. These personal information of users are vulnerable to cyber-attack over the internet during data transmission [15] . Mostly, adversaries can analyses data packets to identify the true owner of smart meters for their own selfish interest. These breach of privacy presents security concerns of users on the smart grid network. However, to facilitate smooth running of smart grid system, customers must be a communicate and exchange energy in P2P fashion beyond centralized architectures. This brings us to the blockchain and IoT approach, where users can share their REC certificate as seen in figure 3. Blockchain gives the opportunity to secure IoT devices in decentralized and distributed manner. Computation-wise, smart devices have less resources to run full blockchain nodes thus we suggested smart devices to run as light nodes and limited to the transmission of information from point smart homes and energy production centres to the blockchain and receiving of alerts. On the smart grid network, smart devices forwards energy production information together with certificate of production and ownership to the blockchain so that users can prove the correctness of certificates.

System implementation
In bringing our ideas into light, we tested our system on an Ethereum blockchain platform that gives the flexibility to write smart contracts for testing. We wrote our smart contract in solidity programing language and tested our system function using Remix IDE with Metamask API. This gives the platform to deploy smart contract to an Ethereum public blockchain and test the cost of executing smart contracts and key contract functions.

Conclusion
With the growing interest of Internet of Things and blockchain applications, we have proposed a blockchain based IoT system for the RECs market on smart grid. The blockchain provides a decentralized and secured communication of IoT devices on the smart grid and also serve as immutable records of all events.
We run about 100 transactions with an average gas cost of 0.2481. It is evident that the cost of running our smart contract functions are moderate. Moreover, if our system is extended to the global front, the cost of running the blockchain will be spread among multiple parties which will make it cost effective than centralized RECs market. However, it is imperative to harness permissioned blockchain system such as Hyperledger Fabric to improve on scalability issues within public platforms.