PowerX

PowerX

Peer-2-Peer Energy trading DApp

The problem PowerX solves

In 2023, 80% of the electricity is generated through non-renewable sources of energy. Even though we know what harm we are doing when it comes to adapting renewable sources, we all step back due to the investment it demands. So this can be done away with if we find a way to build a new marketplace in this renewable energy domain. Here we are, team PowerX, with the solution.

  1. After the initial investment in Solar Panels, Wind Mills, and transmission infrastructure, the users can connect themselves with neighbors (Nodes) in the network and start trading excess stored energy.

  2. PowerX comes into play as an intermediary portal for executing transactions, which decentralizes the system and does not require any middleman.

  3. Through our application, the user creates a free account, connects Metamask wallet & activates Push Protocol for notifications.

  4. Once the bid is created, all users of the App will receive a Push notification, about the entry details. This energy sale is now available to be bought. A transaction takes place between the entry creator and some other user who buys energy from an entry.

  5. The buyer and seller must have some connection between them. This is necessary for both physical connections between homes and within the smart contract.

Thus PowerX allows peer-2-peer energy sharing between nodes (houses), in turn removing dependency on a central authority.

Challenges we ran into

Building a DApp of such a scale has really been hectic, but fun. In the app, there are multiple chained asynchronous function calls and a lot of await statements that call APIs and functions built on smart contracts. The live capability of auctions had to be implemented with interval-based API calls and implemented in React, such that the App re-renders every time values change.

We have implemented a node structure, linking each wallet address and its user. One important issue was, even though transactions happen between nodes, all the intermediate nodes must receive gas fees. For this, we had to implement Dijkstra’s algorithm (in Javascript), which was something we had trouble with.

We also implemented Push Notifications, using Push Protocol. Initially, we were facing problems setting up the Staging App and creating a channel. Automatic Opt-in for the channel was difficult to set up in the front end and required some tinkering.

Currently, due to free web hosting, only one user can stay logged in at a time. Hence, buying and selling energy cannot take place simultaneously. The user who created the sell entry must log out, and then the buyer should log into the app to execute the transaction.

Tracks Applied (2)

Polygon: Open Track

The smart contract is deployed on Polygon Mumbai Testnet.

Polygon Technology

Push Protocol

Every transaction invokes Push Notification for all DApp registered users. Whenever a new user signs in, he/she directly...Read More

Push Protocol

Discussion