Collection of packages from Energy Web to create Green Proof applications.
The Worker Contract enables anyone to build and run a digital tracking system for clean energy by leveraging decentralization easily and quickly. Primary components in this repo include
- Example of a decentralized logic execution for verifying data input and logic for creating digital proofs of clean energy
- Smart contracts on Energy Web Chain (EWC) for creating verifiable digital proofs representing clean energy
An ideal user of Green Proofs is a platform operator with the following problem: “I am an organization trying to generate a digital representation of proof of greenness but I cannot generate a green proof that is trusted by the community because there is no system that efficiently identifies and authorizes actors AND enables trusted data to enter the system.”
List of packages:
- @energyweb/algorithms-24-7
- @energyweb/ddhub-client
- @energyweb/contracts
- @energyweb/merkle-tree
- @energyweb/overseer
- @energyweb/worker
Examples of decentralized worker implementation:
Smart Contract successfully passed a smart contract audit by Hacken in February 2023.
sequenceDiagram
actor A as Data Provider
participant B as Broadcaster
participant C as Off-chain Worker 1
note over C: Worker Pool
participant D as Off-Chain Worker ...n
note over D: Worker Pool
Participant E as Voting Facet
note over E: Worker Contract
Participant F as Energy Web Chain
Participant H as Event Listener Node (overseer)
A->>B: Sends Data
B->>C: Multicast Data
B->>D: Multicast Data
C->>C: Executes Decentralized Logic
C->>C: Derives Merkle Tree Root Hash
D->>D: Executes Decentralized Logic
D->>D: Derives Merkle Tree Root Hash
C->>E: Cast Vote
D->>E: Cast Vote
E->>E: Reaches Consensus
E->>F: Notarize "Consensus Reached" Event
F->>H: Listens for Events
H->>H: Process Result of Voting
sequenceDiagram
actor Issuer
note over Issuer Facet: Worker Contract
participant Issuer Facet
participant Voting Facet
note over Voting Facet: Worker Contract
actor Token Holder
Issuer->>Issuer Facet: Request Token Issuance
activate Issuer Facet
Issuer Facet->>Voting Facet: Verification Request
Voting Facet->>Voting Facet: Verify if data is part of consensus
Voting Facet->>Issuer Facet: Verification Response
alt verification successful
Issuer Facet->>Issuer Facet: Volume verification
alt verification successful
Issuer Facet->>Token Holder: Issue Certificate
end
else invalid data
Issuer Facet->>Issuer: Reject Request
end
deactivate Issuer Facet
yarn purge && yarn && yarn build
We maintain two distribution channels: latest and next. next can be treated as alpha. To release particular channel use branch:
Channel | Branch |
---|---|
next | next |
master | master |
- Create personal access token on GitHub: https://github.com/settings/tokens
- Set this token as
GH_TOKEN
env variable (or just prefix command below withGH_TOKEN=xxxxx [...]
) - Run
yarn release
- Go to Github Actions
- Select "Release" from the workflow list
- Run it manually using "Run workflow" button, and select branch for given channel (see above)