Skip to content

quaintrelle7/P2P-Electricity-Transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

P2P-Electricity-Transfer

Deployed on the Polygon Chain: Test on the Mumbai Testnet

contractAddress = "0x0f2CB1000B9685D3f51878eA64825db2386FDb1A"

  1. The producer node will generate a token corresponding to the value of electricity produced.
  2. When a producer wants to sell the electricity generated by them, it orders the network to sell those tokens. The system will check and block the posting before posting the sales order.
  3. Customers that require electricity can buy tokens with that value. Before submitting the purchase order, the system checks and blocks the buyer's balance. A smart contract transaction is generated when a sell order meets a buy order.
  4. When a consumer consumes electricity, tokens of that value are burned.

The verification of transactions will take place as follows:

  1. In block candidates new transactions are included.
  2. Track the ownership of consumers' tokens whether or not the consumer is the proper owner of the token. Because the history of transactions are recorded by blockchain, the token's ownership chain can be traced.
  3. Make sure the producer has enough power to sell on the market. A block candidate is added to the blockchain and transmitted to all nodes in the network when a transaction is confirmed. The smart contract is then put into action. When the requirements are completed by the parties who have agreed in advance, the smart contract functions as a digital protocol that automatically conducts predetermined activities. The smart contract is utilized in this scenario to supply electricity to the customer once the customer pays the producer a predetermined fee. Because smart contracts are written in code and linked to the blockchain, they inherit the network's immutability, ensuring that the agreed-upon contract cannot be changed.

The contract logic takes place as follows:

  • Conditions such as price, amount, source, destination, etc should be read.
  • Payment should be checked
  • If the requirements have been verified then
  • Grant access to an electric source,
  • Record the electricity consumption.
  • If consumption is reached the threshold, revoke access.

To consume and/or sell power, nodes must join and contribute to the grid, according to our approach. For their excellent contributions to the network, nodes can be rewarded. Transaction fees may be added to the network to cover infrastructure costs or if nodes employ extra services like public storage.