Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Proof of Concept for Peer to Peer Energy Trading using Ethereum Blockchain Client.

License

Notifications You must be signed in to change notification settings

saurabh1002/energy-trading-blockchain

Repository files navigation

Peer to Peer Energy Trading using Blockchain

1. Use case Description

  • Consider an isolated micro-grid, containing entities that generate and store energy; and other entities that are energy deficient.
  • Such a network requires distribution of energy to bring about equilibrium.
  • Presently, there is no such system which can facilitate communication between entities having an energy surplus and entities having an energy deficit.
  • This Proof of Concept demonstrates the trading of energy between two such entities using a blockchain platform as an immutable ledger of transactions
  • We have also used a Smart Contract for real-time accounting and settlement of transactions.

2. Advantages of our Architecture

  • A Peer-to-Peer Network
  • Creates a better balanced Grid Network by facilitating energy exchange between producers and consumers
  • Consensus without Centralization
  • Measurement, Verification and Settlement of traded energy in real time

3. Why Ethereum

  • It is the most stable Blockchain Platform
  • Its Proof of Work Algorithm for mining blocks does not require an ASIC
  • Enables the usage of Escrow accounts through Smart Contracts
  • Application Programming Interface (API) for Decentralized Applications (DApp) Development
  • Supports roughly 15 Transactions per second
  • Block Time: 10-19 seconds

4. Our Prototype Architecture

  • 1 Producer - PV Emulator
  • 1 Consumer - Programmable Load
  • DC Energy Meters to monitor energy supplied by producer and energy used by consumer
  • Energy Storage Units - Lead Acid Batteries

5. Demonstration Procedure

  1. Complete the steps in INSTALL.md and SMART_CONTRACT.md on 2 machines, one of the producer and one of the consumer.
  2. Start an ethereum private chain on both the machines using ./Geth/geth --rpc .... command.
  3. Run the main server using node server.js command on only the producer's machine.
  4. Enter the producers's IP address in place of the main server IP address field on line 25 of consumer.js on the consumer's machine.
  5. Also enter the same IP on line 31 of wallet.html on both machines.
  6. Run producer server using node producer.js command on the producer's machine.
  7. Run consumer server using node consumer.js command on the producer's machine.
  8. Once the above setup is ready, both users need to open the browser and type localhost:3000 to enter the login page.
  9. The login page enables the user to to unlock his/her wallet by entering the respective account passphrase.
  10. Once the user credentials are entered, you will be guided to your corresponding wallet which has the following details:
    • Dock :
      • Energy Marketplace : Redirects you to the Energy Trading Portal.
      • Logout : It will take you back to the Login page.
    • Wallet :
      • Energy Tokens : Every 1 KWH supplied by producer to the batteries fetches 1 token from the smart contract.
      • Current Generation : This shows the amount of energy generated by the user in KWH
      • Account Balance: This shows the Ether balance in the user’s account.
    • Pending Transactions :
      • For every token fetched by the smart contract and assigned to the user, a transaction must be deployed on the Blockchain and validated by the mining process.
      • Until validated, it is a pending transaction.
      • Each pending transaction is represented by a hash.
    • Ethereum Mining Options :
      • Every user is provided with options of start or stop mining to contribute to the network’s computational power.
    • Ethereum Wallet Transactions :
      • This option enables a user to transact only in crypto-currency (Ether) with any other participant in the network.
  11. The Energy Marketplace has the following features:
    • Sell :
      • This option enables any user having surplus energy to broadcast his tokens, account address (public key) and the start bid to be broadcasted on the network.
    • Buy :
      • This option enables any user who needs to purchase energy to enter his account address (public key) and make a bid.
      • Multiple users can bid on this portal and only the highest bid is taken into account after a predefined timeout.
    • Close Connection :
      • This option enables the buyer to stop drawing power from the batteries once the buyer’s requirement is fulfilled.
    • Logout : It will take you back to the Login page.
    • The cards on this page show all the information about the sellers and the buyers in the network.
  12. After a timeout, the latest bid value along with buyer’s and seller’s address are fed into the Blockchain using the Smart Contract.
  13. Corresponding crypto-currency (Ether) are sent from the buyer’s account to the seller’s account for every KWH power consumed by the buyer.
  14. All these actions in the software are coupled with the demo hardware, for example, depending on the state of transcation between two entities, the serial ports of the machines command microcontrollers present inside the Energy Meters to toggle the relays.

6. Hardware Demonstration Video

Demo Video

7. Awards and Recognition

  1. This Project won the Ernst Young Blockchain Hackathon in 2017.

    EY Hackathon Winners

  2. This Project also won at the Global Blockchain Congress in 2018.

    Global Blockchain Congress Winners

  3. Visit by Dr Shekhar Dutt, former Defence Secretary, Govt. of India.

    Visit by Dr. SM Dutt

  4. Visit by a Swiss Delegation operative in the fields of energy storage, energy efficiency, and Solar energy.

    Visit by Swiss Delegation

8. Team Details

About

Proof of Concept for Peer to Peer Energy Trading using Ethereum Blockchain Client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published