Only this pageAll pages
Powered by GitBook
1 of 97

Legacy documentation

Loading...

Loading...

Solutions 2023

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

EW-DOS Technology Components 2023

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Foundational Concepts

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Data Exchange

Introduction to Energy Web Data Exchange

Enterprise Data Exchange is a customizable solution for authorizing, delegating, and delivering messages between a multiplicity of companies, systems, and assets operating in a common market environment without relying on a central administrator or broker. It is an extension of electricity market flexibility and e-mobility solutions developed in the Energy Web community over the last five years.

  • Data Exchange Overview

  • Data Exchange Architecture

  • Channels and Topics

  • Use Cases and Reference Implementations

    • Digital Spine for Electricity markets

    • E-Mobility Management

Welcome to Energy Web

Open-source software and digital infrastructure for a decarbonized energy system

Energy Web is an independent nonprofit accelerating the global energy transition by developing open-source Web3 software solutions that help companies unlock business value from clean and distributed energy resources. This site provides an overview of the foundational concepts, technical components, and use cases of the Energy Web Decentralized Operating System (EW-DOS).

EW-DOS gives companies simple tools to deploy custom applications and business networks that combine established protocols and platforms with pioneering technologies and novel architectures.

💡 Get Started

Learn More about EW Solutions

Energy Web's tech stack is designed to address two primary challenges in the current energy and renewables market:

Learn More about EW-DOS Components

Click on any of the boxes below to learn more about the EW-DOS technical components.

Learn about EW-DOS foundational concepts

Develop with the Energy Web Chain

For a deep-dive into the motivation and methodology behind our technical solutions, we encourage you to read our White Papers:

  • (2023)

  • Energy Web on Vision and Purpose (2020)

  • Energy Web on Technology Detail (2020)

A Note on this Site's Documentation

EW-DOS builds on the foundations of other open-source technologies and uses many well-known libraries and technologies in the stack, so this documentation provides references and links to other articles and sources of documentation throughout.

We encourage you to become familiar with the core concepts of blockchain technology and if you are new to this space. The Foundational Concepts section provides brief explainers for what we think is essential to understand our technology. They point you toward more in-depth resources and documentation.

We are an open-source foundation and we want our solutions to be accessible and our community to be wide. Please provide feedback or questions on the documentation by reaching out on , , or .

E-Mobility Dashboard v0.1

The E-Mobility Dashboard is in a beta release, and is not recommended for production applications. The purpose of making the dashboard client publicly available is to provide an example of how the OCN can be used to develop new applications.

The EV Dashboard is an application which aggregates OCPI data (via the OCN) and Blockchain data for both EVs and charge points. It also facilitate the request and issuance process for credentials relating to a flexibility market.

The dashboard client is available on Github at

Helping electricity market participants share information and coordinate operations to maximize the value of clean and distributed energy resources
Create open, scalable marketplaces for transparent and efficient renewable energy purchasing
Drawing
Self-Sovereign Identity
Open-Source Software
Ethereum Blockchain Technology
Getting started with EW-DOS
Connect to the Energy Web Chain using MetaMask
Run a local node of the Volta Test Network or production network
Get Energy Web Tokens
Get Volta Testnet Tokens
Deploy a smart contract on Volta Test Network
Energy Web X Light Paper
White Paper
White Paper
self-sovereign identity
Telegram
Twitter
Discord
https://github.com/energywebfoundation/ev-dashboard-client

Data Exchange Overview

Energy Web Data Exchange simplifies communication and business logic execution in complex markets by replacing heterogeneous point-to-point integrations among participants with a hub-and-spoke model in which all participants maintain a single integration to communicate with all other parties. Unlike conventional hub architectures that rely on a central broker to administer access and host the infrastructure, EW Data Exchange combines multiple open-source technologies to establish a shared platform that is owned, operated, and governed by multiple participants.

EW Data Exchange is tailored to execute high-volume, business-critical communications in electricity markets and e-mobility applications, but can be customized to support any business process involving data exchange between multiple organizations. Enterprise Data Exchange is protocol agnostic, and supports established standards including IEEE 2030.5, XML, OADR, and OCCP.

In its simplest form, Data Exchange is a secure, open-access messaging infrastructure that:

  • Allows multiple parties to send, receive, and authenticate messages based on the roles that have been issued to and associated with their self-managed identity;

  • Allows parties to exchange diverse datasets, ranging from real-time telemetry to bulk file uploads, in support of multiple DER and e-mobility use cases;

  • Provides end-to-end encryption for all messages and data transfers, using cryptographic signatures from self-managed identities;

  • Requires only a single integration mechanism with a central infrastructure in order to communicate via one:one (bilateral), one:many (broadcast), and many:many (multicast) channels.

Data Exchange can support a wide variety of use cases, including:

  • Coordinating DER installation data among installers grid operators

  • Streamlining DER registration in wholesale and/or local markets

  • Enabling seamless roaming and advanced tariffs for electric vehicles

  • Coordinating real-time grid operations between transmission and distribution system operators (operating envelopes, local constraints)

  • Facilitating customer switching between retailers in deregulated markets

  • Consolidating disparate market operations communications channels and processes (e.g. registration, nomination, bids/offers, dispatch, settlement)

  • Establishing dynamic registries for DERs and EVs

A use case is defined by a particular configuration of a messaging channel (i.e. who is allowed to read/write, how messages are routed) and data schema (the format, frequency, and logic governing messages). Thus Data Exchange is a practically infinitely customizable solution; much like the way a road supports many types of transportation (from cars, to bicycles, scooters, trucks, etc.) Data Exchange provides a foundation for many types of business processes in electricity markets.

Who is it for?

EW Data Exchange can be applied in any energy market context where many-to-many data exchanges are critical. Companies or consortia can design how user roles are defined and acquired; what data structures and protocols are supported; and what types of integration options are made available to participants.

  • Wholesale market & transmission system operators who need a solution to facilitate data exchange among market participants and distribution system operators in order.

  • Distribution utilities who need to coordinate local services and non-wires alternatives with multiple vendors or aggregators.

  • E-mobility service providers and charge point operators who want to reduce the cost and complexity of managing e-roaming and advanced charging programs.

  • Industry consortia

EW Data Exchange allows companies seeking to offer / build / operate market-wide data exchange hubs to define the following aspects:

  • Onboarding and issuing roles to organizations, systems, assets and users with DIDs, via the SSI-Hub

  • Configuring role-based permissions, conditions, and restrictions for users

  • Defining data structures and protocols

  • Defining hosting and integration patterns (e.g. self-hosting clients, exposing APIs)

  • Establishing communication channels between participants

  • Scheduling jobs for batch processing and caching of data

  • Use the channels for passing data between participants

Glossary

24/7 Clean Energy

An initiative for purchasing clean, carbon-free energy every hour on a regional grid where consumption occurs. An entity's clean energy demands are correlated with its energy generation on an hourly basis.

Aggregator

A new role in energy service provision that groups local participants in a power system (energy consumers, energy producers, energy prosumers) to determine and moderate how much energy they will need to consume from the grid, and, in some cases help them sell their excess electricity from distributed energy resources (DERs) back to the regional or wholesale electricity market.

The aggregator is an intermediary between prosumers, Transmission System Operators (TSOs), and Distribution System Operators (DSOs) that want to serve this group or use their DER services on the grid.

Application Registries

Application registries are the logic to manage permissions, enrollments, and relationships between market participants in an automated way.

Charge Point Operator (CPO)

The Charge Point Operator (CPO) is responsible for technical operation and maintenance of (public and semi-public) charging stations. Its revenue comes mainly from providing electrical energy to EVs.

Crypto Climate Accord (CCA)

The Crypto Climate Accord (CCA) is a global private sector-led initiative co-launched by Energy Web to build, test, and implement digital solutions that will decarbonize the crypto and blockchain industry by 2040. Learn more here.

dApp

A decentralized application (dApp) is an application built on a decentralized network that combines a smart contract and a frontend user interface.

Decentralized Identifier (DID)

DIDs **** are persistent identifiers that identify DID subjects such as assets, customers, organizations, and other market participants. DIDs allow the controller of a DID to prove control over it without requiring permission from any other party. DIDs associate a DID subject with a DID document to allow trustable interactions with that subject.

Decentralized Service Bus (DSB)

The DSB is the messaging service of the Energy Web Decentralized Operating System’s (EW-DOS) utility layer. Unlike any other centralised and managed pub/sub messaging systems, EW-DSB is designed and implemented to be fully decentralised and scalable. Messages shared on EW-DSB can be traced back to its original sender using cryptographic signatures; it adds extra security to data exchanges. One of the key benefits of the EW-DSB is to be schema agnostic, meaning any type of schema can be shared as a message between users/systems.

Distributed Energy Resources (DER)

Physical and virtual assets that are deployed across the distribution grid can be used individually or in aggregate to provide value to the grid, individual customers, or both.

DERs can for example include solar, batteries, flexible loads and are also often referred to as “devices” or “assets”.

Distribution System Operator (DSO)

The operating managers (and sometimes owners) of energy distribution networks that operate at a regional or local level. DSOs manage high-voltage incoming electricity from larger transmission grids (via TSOs), convert it to a lower voltage, and distribute it throughout the local network. They are, in essence, the middle-man between the raw, high-voltage electricity from transmission grids and the local consumers of electricity.

E-Mobility Service Provider (eSMP)

The eMobility Service Provider (eMSP) provides e-mobility services such as access to charging services, payment and more to EV drivers. It requires certain data exchange for those services, e.g. charging locations for routing.

Electric Power Distribution

The movement of high-voltage electricity from sub-stations to customers through distribution lines.

Electric Power Transmission

The movement of high-voltage electricity from initial generation sites to substations.

Energy Attribute Certificates (EACs)

Energy Attribute Certificates (EACs) describe global instruments which certify that a specific unit (historically 1 MWh, but sometimes 1 KWh) of electricity was produced from a renewable source.

Globally there are various EAC systems to claim the use of renewable or low-carbon energy. Some well-known standards include Guarantees of Origin (EU), I-RECs (global), and RECs (US/Canada).

  • Redeemed EAC = an EAC that has been bought by someone can't be resold to anyone else

  • Claimed or Cancelled EAC = other ways of calling Redeemed EACs

  • Bundled Certificates = contracts that sell consumable energy + EACs together

  • Unbundled Certificates = contracts that sell EACs separately from the energy that produced them

Energy Web Chain (EWC)

The EWC is a public, enterprise-grade blockchain platform designed for the energy sector’s regulatory, operational, and market needs. Launched in mid-2019, it serves as a foundational digital infrastructure on which companies can build and run blockchain-based decentralized applications (dApps). Learn more here.

Energy Web Decentralized Operating System (EW-DOS)

EW-DOS is the acronym for Energy Web Decentralized Operating System. EW-DOS is an open-source stack of decentralized software and standards. **** Learn more here.

Energy Web Token (EWT)

The EWT is the Energy Web Chain native first-layer utility token.

Grid Flexibility

The ability of the grid to balance how much power it generates with how much demand there is for it. Flexibility services include any service that meets a requirement to provide more or less demand on the system. ****

At a basic level, Transmission System Officers (TSOs) and Distribution Service Operators (DSOs) procure flexibility services. Aggregators and prosumers offer flexibility services using distributed energy resources.

Message Broker

A distributed messaging node which can send OCPI messages between OCN Parties.

Open Charging Network (OCN)

A decentralized network for enabling use-cases in the EV charging domain. Consists of many OCN Nodes and a single OCN Registry. Can also be considered as an implementation of the OCPI 2.2 Hub concept.

Open Charge Network (OCN) Identity

A self-sovereign identity of a party on the Open Charging Network based on an Energy Web Chain public/private key-pair.

Open Charge Network (OCN) Node

**Open Charge Network (**OCN )Node

A single node of the Open Charging Network which forwards OCPI/OCN messages between parties based on a routing system. Consists of a message broker, a connection to an Energy Web Chain Node, a blockchain wallet and more. A network of nodes constructs the Open Charging Network.

Open Charge Point Interface (OCPI)

A protocol that allows for a scalable, automated roaming setup between Charge Point Operators and eMobility Service Providers. See OCPI documentation here.

Open Charge Network (OCN) Registry

Smart contracts on the Energy Web Chain that contain important information about registered OCN Nodes, OCN Parties and OCN Services. These contracts act as the addressing, identity, and permissions system of the OCN. A command line interface and libraries are provided for interaction.

Original Equipment Manufacturer (OEM)

A company that manufactures and sells products or parts of a product that their buyer, another company, sells to its own customers while putting the products under its own branding.

Prosumer

Anyone who both consumes and produces energy. Prosumers produce energy through Distributed Energy Resources (DER), such as rooftop solar panels.

Self Sovereign Identity (SSI)

SSI is a digital paradigm that promotes an individual’s control over their identity and their data. This is in contrast to the current paradigm where most of our official identifiers (driver’s license, birth certificate, usernames, etc.) are given to us and maintained by a central authority, and where our data can be shared without our knowledge or consent.

DIDs and VCs are the two most critical components of SSI. Together they allow users to have control over both their identity and any data associated with them.

Software Development Toolkit (SDK)

An SDK is a collection of software development tools in one installable package. They facilitate the creation of applications. In the context of Energy Web, they are open-source “blueprints” for building apps on EW-DOS.

Staking

Energy Web launched staking on the Volta Test Network in August 2021. This is a first step towards a Decentralized Software as a Service (dSaaS) infrastructure, allowing for decentralized, community-driven service provision for Energy Web utility services and applications.

The Energy Web staking model extends blockchain tokens staking to SaaS provisioning. Ultimately, anyone will be able to stake tokens with service providers of their choosing, and both parties will be rewarded for providing fast, stable and secure services based on EW's decentralized, open-source software. Staking in the way Energy Web is implementing it, applies the benefits of decentralization and network resiliency of blockchain technology to software and IT services more broadly.

Supervisory Control And Data Acquisition (SCADA)

Supervisory control and data acquisition (SCADA) is a system of software and hardware elements that allows industrial organizations to i) control industrial processes locally or at remote locations; ii) monitor, gather, and process real-time data; iii) directly interact with devices such as sensors, valves, pumps, motors, and more through human-machine interface (HMI) software; and iv) record events into a log file.

Switchboard

Switchboard is an identity and access management dApp (decentralized app). Switchboard allows for the definition of organization and application structures to be used for role-based permissioning within applications that relate to decarbonization.

It enables a user-centric, decentralized approach where users are in control of their identity (identifier, keys, credentials). Switchboard enables the digitization of assets by giving them unique identities and allowing them to interact with the decentralized operating system and decarbonization use cases.

Transmission System Operator (TSO)

Responsible for transmitting electrical power from power generation plants to distribution local or regional operators (Distribution Service Operators) via the electrical grid. This involves determining how much electricity needs to be on the grid at any given time, and managing reserve capacity and ancillary energy providers to keep the grid balanced.

Utility Layer (UL)

The UL is composed of decentralized cloud services like messaging, key manager, and storage that form the “middle” layer of the EW-DOS tech stack.

Validators

"Validators" refer to both a node and an organization; the companies operating the EWC. Validators on the Energy Web Chain have three main responsibilities: i) Create Blocks, ii) Provide Network Security, and iii) Participate in the EWC Governance.

Verifiable Credentials (VC)

VCs are a set of statements made about a subject (such as a DID) by an authority. They can be used to convince others (who trust the authority) of the truth of the statements and can be linked from a DID document.


DDHub Patterns

Implement an SSI Hub instance

EWC Overview

Customize Worker Logic

{coming soon}

IAM Patterns

Worker Node Guides

IAM Guides

Worker Node Architecture

2. Select an OCN Node and register in OCN Registry

In order to connect a service to the OCN, you must choose which OCN node you want to connect to, and know the node's public wallet address. You will then request a registration token (Token_A) from your selected node.

Access the full OCN technical documentation .

1. Select a node

In order to connect a service to the Open Charging Network, you must decide which OCN Node you want to connect to.

Test Network

To view public nodes available on the public test network and their wallet address, see "".

Production Network

To view public nodes available on the public test network and their wallet address, see "".

2. Request a Token

Once you select a node operator that you want to connect to, you must:

  1. Know the OCN Identity (wallet address) of that OCN Node Operator ().

  2. Request a registration token (TOKEN_A in OCPI terms). Note that this token is only temporary and will become invalid once the registration is complete.

3. Enter Node details in OCN Registry

After you have the public address of your public node and your registration token, you are now ready to create / update your OCN Identity on the OCN Registry. Follow the steps provided here:

3. Manage your Whitelist and Blacklist

The Open Charging Network allows you to exchange OCPI messages with anybody on the network with just one single OCPI connection, regardless of the OCN Node that you or your counterpart are connected to.

There are some cases in which you want to restrict the list of parties that can communicate with you. For this, the OCN Node provides you with a white- and blacklisting module, called OCN Rules.

Note: This service is an optional feature that needs to be enabled in your own OCN Node or by your OCN Node Operator.

Example: add party to blacklist

  • You can find a documentation of how you can use this service on the under OcnRules module.

  • See the source code for the OCN node Rules service .

Access the full OCN technical documentation .

Use the OCN Service Interface

Overview

The OCN Service Interface enables third-party services (such as billing, settlement, location data enrichment) to offer their products to the OCPI community by accessing communication between two OCPI parties on the Open Charging Network without the need for endless API development work.

This is done using OCN Permissions, and requires no additional integration work to be done by the OCPI parties.

It reduces the cost for integration work beyond the EV roaming use-case, helping everyone involved climbing the API mountain of Electric Vehicle charging.

We consider this as crucial to a seamless mass-consumer experience and an efficient EV charging value-chain.

A detailed description of the benefits and functionality of the OCN Service Interface can be found on our (based on a billing example)

Access the full OCN technical documentation .

Get Started

As an OCN Service Provider

Learn how to connect your OCN Service to the OCN and to define what OCPI-based information your service needs from OCN Parties / Service Users (OCN Permissions).

As an OCN Party / Service User

Learn how to sign up for an OCN Service by agreeing to OCN Permissions.

Demo

To get started with the OCN Service Interface and to see how the above given example works in action, see our OCN Demo. It mocks a full set-up of an Open Charging Network with two OCN Nodes, two CPOs, one eMSP and one billing service and allows developers to run through the scenario outlined in this article. Get started .

Offer an OCN Service

An OCN Service Provider develops and provides OCN services that can be used by CPOs, eMSPs and other parties to improve their charging services - such as contracting, billing, payment systems etc.

The OCN Service is - similar to any other OCPI role - an OCN Party. We make this distinction from other "Services" that might only require customers to send OCPI messages (including custom OCPI modules) directly.

Offer your OCN Service

To offer your OCN Service via the OCN Service Interface, make sure the following prerequisites are met:

Now you are ready to publish your OCN Service on the OCN Registry.

Set Service Permissions

An OCN Service is an OCPI party that requires additional permissions from their customers. Such permissions could include the forwarding of session or charge detail record data, for example in a payment service.

Once a customer/user has agreed to the Service's permissions, the OCN Node tied to the customer will automate any such required permissions, lessening the cost of integration with a service.

To be granted the aforementioned permissions, you must then list your OCN Service and the permissions required in a separate smart contract, entitled "Permissions". Thereafter, a user can make their agreement explicit in the same smart contract. Learn more on how to list your OCN Service on our .

You can find a full list of currently implemented OCN Permissions .

Access the full OCN technical documentation .

Sign up for an OCN Service

If an OCN user wants to make use a particular OCN Service, it has to agree on to the Service's permissions. The OCN Node tied to the customer will automate any such required permissions, lessening the cost of integration with a service

To make use of an OCN OCN Service via the OCN Service Interface, make sure the following pre-requisites are met

  1. Your preferred OCN Service is connected to the OCN

You are now ready to give the OCN Service its required permissions.

Learn more about how to do that on our .

Access the full OCN technical documentation .

Use Cases and Refrence Implementations

Leading examples of Data Exchange Implementations include:

  • E-Mobility Management [coming soon]

Energy Web X

Energy Web X is an open-source, public, substrate-based blockchain purpose-built to support .

To learn more about the role of Energy Web X within EW-DOS, read the .

Hardware cryptocurrency wallets

Hardware wallets are a physical device. They provide an added layer of protection as the wallet’s private key is not stored in your browser or even on your machine - it is stored on the hardware device itself. is a widely-used hardware wallet, and it supports most major cryptocurrencies, including all and. We provide direction on how to connect your Trezor Hardware Wallet to MetaMask here (link), and to a local node of the blockchain here(link)

DDHub Message Broker

Overview

DDHub Message Broker is a component that primarily provides message routing, persisting, and delivery for a seamless data exchange between participants within an energy market or supply chain.

The message broker promotes sovereignty of participants by:

  • The broker does not have authority or logic which assumes the power of the participants

  • No one except the participant themselves can govern data exchange channels and verify messages

  • Encryption/decryption, signature validation, authorization, etc must be done under the participants domain ()

DDHub Message Broker Component Diagram

Below are the Message Broker components which need to be hosted to deploy a Decentralized Data Hub:

  • Message Broker App

  • NATS Jetstream and Jetstream Store to store small data messages (small messages up to 2 MB) and channel configurations

  • Azure Blob (or other large file) Store for large data messages and delimited files converted into blobs, as well as file metadata

  • RDBMS for message topic and schema management

Software cryptocurrency wallets

A cryptocurrency wallet is a digital wallet to manage your cryptocurrency. Just like you need an email address to manage your online communication, you need a cryptocurrency wallet to manage your crypto.

A cryptocurrency wallet has two keys, . Your public key is also called a receive address and you send it to people to receive cryptocurrency. Just like you send your email address to people to receive an email message. A private key gives you full rights and full access to your wallet. It is extremely important that only you have access to your private key and that you don’t share this with anyone. This is the key to your wallet, similar to a password to your email account.

here
Develop on the Test Network
Develop on the Production Network
from Step One above
Create and manage an OCN Identity
POST to URL: https://node.ocn.org/ocpi/receiver/2.2/ocnrules/blacklist

    {
        "country_code": "DE",
        "party_id": "ABC",
        "modules": ["cdrs", "locations"]
    }
HTTP API Documentation
here
here
Medium blog
here
Get started here.
Get started here.
here
The OCN Service has a OCN Identity
The OCN Service is connected to the OCN
OCN Registry Repository
here
here
You have an OCN Identity
Your backend is connected to the OCN
OCN Registry repository
here
Digital Spine for Electricity Markets
Worker Node Networks
EWX Lightpaper
Trezor
ERC20 tokens
Energy Web Token
a public and a private key
Here you can read more about private keys.

E-Mobility Management

This page describes how the EW Data Exchange solution can be applied to e-mobility use cases in general. As of Q2 2023, several features specific to e-mobility are under development for the DDHub Client Gateway.

Background

Adoption of electric vehicles (EVs) is growing exponentially around the world, and EVs are on pace to represent a significant share of the global transportation sector this decade. Collectively, EVs represent an opportunity to both accelerate decarbonization in the energy sector and introduce innovative new business models. Emerging opportunities for EVs include:

  1. Grid balancing and demand response: EVs can provide multiple grid services (e.g. peak shaving, voltage support, etc.) by adjusting their charging patterns based on grid conditions. Smart charging systems can optimize charging schedules to avoid overloading the grid during peak demand periods, or consume excess variable renewable energy duriong periods of low demand. By acting as demand response resources EVs can help flatten demand peaks and reduce strain on the grid, thus enhancing its efficiency and reliability.

  2. Grid flexibility and storage: EVs can act as distributed energy storage units. With smart charging infrastructure and vehicle-to-grid (V2G) technology, EV batteries can be used to store excess electricity during times of high renewable energy production. This stored energy can then be fed back into the grid during periods of high demand or when renewable generation is low. V2G technology allows bidirectional power flow between the grid and EVs, enhancing the grid's flexibility and stability.

  3. Accelerating deployment and increasing utilization of renewables: As a major consumer of electricity, EVs can drive demand for carbon-free electricity through clean energy tariffs, purchases of environmental attribute certificates, or even carbon-optimized charging. EV charging infrastructure can be colocated and powered directly by renewable energy installations, and EV charging strategies can be optimized to charge EVs during hours with plentiful supply of renewables.

While these opportunities are promising, fully realizing their potential is challenging due to complex relationships between multiple stakeholders, the highly distributed and diverse nature of EV and EV charging infrastructure, and the sheer volume of EVs.

EW Data Exchange builds on the capabilities first introduced in the Open Charging Network to deliver EV drivers, grid operators, charge point operators, vehicle manufacturers, retailers, and other EV service providers with a comprehensive and cohesive solution for sharing and validating data.

Reference Implementations

  • Open Charging Network 2.0: A next-generation implementation of the OCN is currently under development. OCN2.0 will share many architectural features with the Digital Spine toolkit, but include several e-mobility specific features including built-in standards (e.g. OCPI) within the DDHub Client Gateway, as well as the ability to run the gateway within EV and EVSE equipment, to simplify integration between EV equipment and channels hosted in the DDHub Message Broker. OCN2.0 will also feature dedicated Worker Node networks to verify and validate message routing between participants, as well as execute custom business logic involving multiple companies (e.g. smart charging, V2G, etc.).

  • Real-time Locational Green Charging: Combining the Data Exchange solution with the 24x7 Green Proofs toolkit enables advanced green charging tariffs and programs that match locally-available carbon-free generation with specific EV charging events in near real-time.

DDHub Guides

EWC Guides and Tutorials

Open-Source Software

Software License

Our mission is to develop and deploy an open and decentralized digital operating system for the energy sector in support of a low-carbon, customer-centric energy future. Therefore, the Energy Web Foundation publishes the source code of its software projects under the GNU General Public License Version 3+. Some libraries intended to be distributed with hardware devices are released under the LGPLv3+.

Frequently Asked Questions about the GNU Licenses

https://www.gnu.org/licenses/gpl-faq.html

Advantages of Free Software

A program is free software if the program's users have the four essential freedoms: [1]

* The freedom to run the program as you wish, for any purpose (freedom 0).

* The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.

* The freedom to redistribute copies so you can help others (freedom 2).

* The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

https://www.gnu.org/philosophy/free-sw.html

Client Gateway

Data Exchange Architecture

Data Exchange Context Diagram

Component
Description

Participant Environment

Hosting environment (e.g. public cloud instance, or on-premise server) where participants deploy and operate the DDHub Client Gateway Application.

Participant System:

Participant applications (e.g. DER management system, market operation systems) that send and receive messages on relevant channels (within the shared message broker) via the Client Gateway.

The interface presenting UI, and API for interacting with the Message Broker to send and receive messages. Client gateway repo is available at or on .

The component that routes messages between Client gateways (using API to control ). Authentication and authorization for interacting with the message broker is done via the . Message broker repositor is available at

Libraries and components that implement identity and access management functionalities. Learn more in the .

IPFS

Distributed file storage system used to store and manage identity and role definitions. Learn more at

Connect an OCPI/OCN Party to a Node

Connect to an existing OCN node

Overview

The most common use case of the Open Charging Network describes an eMobility Service Provider (eMSP) or Charge Point Operator (CPO) connecting their backend service to an OCN Node. An OCN node provides an entry point into the system, so a party must connect to an OCN node in order to participate in the network.

Follow these steps in order to successfully connect your own backend service.

  1. Make your backend service OCN-ready (implement the OCPI 2.2 API and OCN Signature)

  2. Select an OCN Node and enter details in OCN Registry

  3. Manage your White- and Blacklist

  4. Connect your service to an OCN Node

*Note that not only MSPs and CPOs can use the Open Charging Network, but these are the most common roles.

Access the full OCN technical documentation here

Deploy Worker Nodes

The worker node is containerized and can be run on a virtual machine.

Requirement

  • CPU: 2 vCPUs

  • Memory: 4 GB

  • Disk Space: 100 GB

  • Operating System: Ubuntu 20.04 LTS

Create a Virtual machine

To create a virtual machine in your cloud provider. Ensure the virtual machine matches the minimum requirements listed in the above section.

Deployment Guide

Clone the following repository - GitHub - energywebfoundation/greenproofs-worker-guide

It contains the guide and files required to run the worker image.

Deploying Worker Image to Virtual Machine

Once connected to the VM. Follow the steps to run the container image.

Install docker

sudo snap install docker

Confirm docker and docker-compose are installed

docker -v docker-compose -v

Application setup

Once done, ensure to the .env file contains all environment variables required in the same directory as the docker-compose.yml file.

Finally, run the command

docker-compose up -d

This would bring up all services. You can reach out to the team for further help or check out the Docker Compose cheat sheet for more debugging tips here.

DDHub Client Gateway

The DDHub Client Gateway is an integration gateway SDK that is intended to run on-premises or on the cloud environment of participants. It provides an interface for participant systems to interact with other systems in the shared interacting with a data exchange solution - namely, the DDHub Message Broker.

The Client Gateway is available in Github at https://github.com/energywebfoundation/ddhub-client-gateway or in the Azure Marketplace.

The gateway application is authenticated, authorized, and encrypted (messages) using self-sovereign identities (DIDs) and verifiable credentials rather than a centrally trusted and managed approaches seen in legacy solutions.

The client container is an integral part of the DDHub in achieving its decentralized characteristics as it assumes the power of the identity that it currently holds/represents.

  • DDHub Client GW UI: the main interface for admins to manage their DDHub Client GWs

  • DDHub Client GW API: exposes RESTful and Web Socket APIs for integration

  • DDHub Client GW Scheduler: contains scheduler jobs for caching data including but not limited to channels, topics, and decryption keys

  • DDHUB Client Gateway Storage: a postgres DB used to store configuration data.

  • Key Vault - store private keys and other secrets

  • DDhub Message Broker: The component that routes messages between Client gateways (using API to control NATS messaging).

  • SSI Toolkit: Libraries and components that implement identity and access management functionalities.

EW-DOS Overview

The Energy Web Decentralized Operating System gives companies simple tools to deploy custom applications and business networks that combine established protocols and platforms with pioneering technologies and novel architectures.

Decentralized Data Hub (DDHub)

The Decentralized Data Hub (DDHub) is one of the primary technologies underpinning EW Data Exchange solutions. The DDHub Environment is composed of multiple DDHub Messaging Client Nodes interacting with each other through the DDHub Message Broker.

  • Each node (or group of nodes) in the Message Broker cluster is identified with a unique DID and must be issued with a DDHub Messaging Client role

  • Each node contains an IAM Client that ensures legitimacy of users interacting within the messaging cluster by checking their identities, and issued role or set of roles\

  • The IAM Client and DIDs provide a layer of protection against unauthorized access to DDHub functionalities

  • Data exchanged within the cluster is secured in transit with mTLS

Worker Node Process Diagrams

Reaching Consensus

Voting Manager

Caching Results

Worker Nodes

Worker Nodes are a new technology developed by Energy Web that enable enterprises to construct distributed computing networks that securely execute sensitive business operations impacting multiple companies.

What are Worker Node Networks?

Worker Nodes were originally developed to solve a paradox that hinders advanced renewable energy tracking solutions like 24x7 matching and green electric vehicle charging: credibility relies on accurate, publicly verifiable results (e.g., proof that digital representations of renewables are not double-counted). But inputs from separate organizations, such as granular renewable energy production and electricity demand data, are commercially sensitive and need to remain private. Complex commercial, legal, and technical requirements often make it challenging for a single actor to unilaterally access and process all requisite data. The ability to establish a shared source of truth from segregated, individual information sources has been an ongoing challenge in multilateral settings; the challenge is even greater for energy market participants seeking to exchange and process granular data in order to procure services from distributed energy resources.

The Energy Web Worker Node toolkit solves these challenges by enabling enterprises to configure, launch, and maintain distributed computing networks that ingest data from external sources, execute custom workflows based on business logic, and vote on results in order to establish consensus without revealing or modifying the underlying data. Worker Nodes apply concepts and components from blockchain technology in a novel, enterprise-friendly architecture to provide all stakeholders with cryptographic proof that mutually-agreed rules and and processes are followed correctly, ensure computational outputs from business processes are correct, and preserve the privacy and integrity of underlying data for auditing purposes.

Why are Worker Nodes beneficial for the energy sector?

Decarbonizing the global energy sector is the most important solution to mitigate climate change. Worker Nodes can help accelerate decarbonization in two specific areas that require coordination and information sharing among multiple independent actors. The first is (e.g., rooftop solar systems, batteries, electric vehicles, electric vehicle charging stations, heat pumps) to the grid. The second is bringing —including but not limited to , , and .

The solutions we apply to these areas, dubbed and , are powered by a brand-new web 3 technology that has significant business value for energy enterprises: . Each worker node network is a decentralized group of computers that jointly execute sensitive business processes that involve or impact multiple companies. Though worker nodes establish consensus about the results of a business process, they are not blockchains. Whereas the “work” performed by traditional blockchain miners or validators—validating and sealing blocks—has limited value for energy enterprises, worker node networks are fine-tuned to execute custom logic that is specific to an actual business problem. Worker node networks are only useful in cases where multiple businesses need the capability to transmit complex datasets amongst three or more parties in a way that does not reveal all data to all parties, and/or the capability to provide public verification of outputs while maintaining privacy and integrity of inputs.

How do Worker Nodes actually work?

Today worker nodes are implemented as independent off-chain computing nodes that communicate with a smart contract deployed on the Energy Web Chain. Worker nodes can be implemented in any development framework, including node.js, python, and rust.

Each worker node is programmed to execute a specific conditional logic workflow based on a predefined dataset (i.e. source and schema) and event trigger (e.g. a regular time interval, or a specific external event). Workers are given read-only access to one or more external data sources via API or message broker. When the workflow “event” is triggered, the workers initiate a round of calculation and voting (worker nodes can be configured to either poll an external data source at regular intervals, or “listen” to an external source for a specific trigger).

In the calculation step, each worker node independently executes the conditional logic based on the data it received during the trigger. Then, each worker submits its results (i.e. output of the logic workflow) to the smart contract, which collates the worker nodes’ votes into a unique voting round and keeps track of each round to maintain continuity. The smart contract defines a voting threshold (typically a simple majority, such as 2 of 3, or 4 of 7, etc.) that must be reached in order to establish consensus on the results of each voting round. Each voting round is defined by a voting ID, the number of unique votes (from worker nodes), and a consensus result. If the threshold is reached (i.e. a majority of nodes independently reach the same conclusion and submit identical results to the vote), then the voting round is closed and the result is hashed on the Energy Web Chain; this creates a connected tree of results that can be queried and validated for auditing purposes. If consensus is not reached in the voting round, the entire process from event trigger through voting is repeated; if a second round fails, a custom workflow is executed (this can include alerts, failover to other nodes, or acceptance of results from a plurality of workers).

In addition to collating the voting results, the smart contract is configured to issue rewards for workers in the pool based on performance criteria. A base reward can be issued simply for workers being available in the pool, and additional rewards can be issued based on metrics such as consistency (i.e. availability for all voting rounds), accuracy (i.e. being part of the winning consensus), and speed (i.e. being fastest to submit voting results following the event trigger).

Volta Test Network: Validator Node Installation

This page describes the steps to install a validator node on the Volta test network.

  1. Choose a hosting provider (on-premise or qualified cloud provider) and favored operating system.

  2. Install operating system and prepare host according to the OS Installation Guide (see previous lesson)

  3. Find the Client installation script matching the installed OS on the energyweb github: and copy it from the volta-affiliate/openethereum or volta-affiliate/nethermind directory to the host

  4. Make sure the latest system updates are installed by running apt-get update

    (debian/ubuntu) or

    (centos)

  5. Make the script executable with

  6. Run the script (please do not use the

    parameter which can be used to take default for node-name and generate a random key)

    • First review any to see if there is a known issue.

    • If the issue is not already known, email to troubleshoot.

  7. If the installation was successful, it should generate a .txt file (named install-summary.txt) that lists the node address, IP address, , influxDB username/password. You will need to provide these details via a form in the next step to successfully add your validator node to the .

    • If you encounter issues with the installation or the install-summary.txt file is not generated:

        1. First review any to see if there is a known issue.

        2. If the issue is not already known, submit a question in the #validators or #technical_questions channels in the to troubleshoot.

  8. Submit the Volta node installation details .

    1. After submitting the installation details, you will receive another email with instructions for proceeding to the main EW Chain.

System Architecture

Components that implement blockchain and consensus protocol

The Energy Web Chain is comprised of different components that provide the functionalities determined by the blockchain’s protocol.

Broadly speaking, protocols are defined rules and standards. Internet protocols, like HTTP protocol for example, define standard procedures for the transfer of data over the internet.

A blockchain network is no different. In a decentralized and self-executing system like a public blockchain, protocols are of significant importance in establishing how the system works, and then ensuring that the system continues to self-execute as designed.

Protocols exist to determine specific aspects of blockchain behavior, such as:

  • How transactions are validated

  • Who gets to validate transactions and when

  • How validators are compensated

  • How peer nodes interact with each other

The system components below ensure that the Energy Web blockchain adheres to Ethereum's protocols, and the protocols established by OpenEthereum's . (OpenEthereum is the Ethereum client that is used by the Energy Web Chain. You can read more about the purpose of Ethereum clients )

System Components

System Contracts are that implement the protocols. Read more about Energy Web's system contracts

The validator node architecture monitors validator behavior to ensure consistent and secure blockchain operation. Read more about the validator node architecture

Related Content

Getting started with Energy Web Chain

1. Install MetaMask

You will need to (or another Ethereum wallet) to connect to EW-DOS applications on the Volta test network or the main network, and to sign transactions on the blockchain.

Read more about using MetaMask .

2. Get Tokens

If you are using applications or smart contracts on the , you will need .

  • Learn how to get Volta Tokens .

  • Once you have Volta tokens, you will need to .

If you are using or developing applications or smart contracts deployed on the , you will need to have .

  • Learn how to get EWT .

  • Once you have EWT, you will need to .

3. Using EW-DOS

Learn about Volta Testnet and Energy Web Mainnet

See an Overview of the EW-DOS Tech Stack

Self-Sovereign Use Case Interaction

1. Alice creates a digital identity

She can manage her data and consents using a unique, secure digital signature

2. The data is encrypted and inaccessible to anyone without Alice’s consent

3. Alice can share her data with others

  • She must explicitly consent to this

  • She can revoke her consent at any time

  • The recipient does not store the data

  • She can prove or reveal attributes without revealing the entire underlying data

4. Alice can add verified data from others, if she chooses

5. Alice can then consent to share that verified data with a third party

6. The third party can see both the data and its verified source

7. If/when conditions (e.g., contractual relationships) change, Alice modifies her consent to change permissions for ADRs

Alice keeps her digital identity in perpetuity; there is no need to re-register / duplicate digital identities across different systems

This architecture can be applied in any market context and with other types of data

Metamask

is a browser extension and a mobile app that handles blockchain account management and helps users securely interact with web dApps. It’s supported in Chrome, Brave, and Safari browsers, as well as it is available for Android and iOS devices. By default, you can connect to the Ethereum Mainnet or any of the Ethereum test network.

  • You can find the latest version of MetaMask at their .

  • For help using MetaMask, visit the Metamask .

  • For up-to-the-minute news, follow their or pages.

To interact from your browser with Energy Web or the testnet Volta, you need to add settings to Metamask and point it to the right network.

Using MetaMask with Other Blockchains

MetaMask is compatible with any blockchain that uses an Ethereum-compatible . This is why we can connect to the Energy Web mainnet and the Volta testnet with MetaMask via a custom Remote Procedure Call (RPC). We provide directions on how to do this . By default, MetaMask connects to the blockchain using and nodes. This allows you to connect with the blockchain without having to run a node yourself.

MetaMask was designed as both an Ethereum-compatible wallet and a method for decentralized application (dApp) verification.

  1. Store and transfer Ethereum compatible (ERC20) tokens

  2. Connect to other Ethereum-based blockchains using a remote procedure call (RPC)

  3. Store and transfer utility tokens for other Ethereum-based blockchains, like the Energy Web Chain. (You must be connected to that blockchain network to do this.)

  4. Authenticate into Dapps and sign transactions. The key-pair for each account generated by MetaMask serves as your cryptographic signature

  5. Connect to a hardware wallet and initiate transactions using an account on the hardware wallet

It's important to understand that MetaMask provides user sovereignty in Ethereum-based decentralized applications. Instead of having a separate username and password for each decentralized application that you interact with, you can authenticate into all of them using your account(s) in MetaMask. MetaMask accounts are initialized by you and are under your authority.

Hierarchical Deterministic (HD) Wallets

Hierarchical Deterministic (HD) Wallets

Many cryptocurrency wallets (including and Trezor) are Hierarchical Deterministic Wallets (HD Wallets).

Using a protocol called , HD Wallets allow you to derive multiple accounts that support different types of coins from one master private key. For each HD Wallet, there is one 12-24 word mnemonic seed phrase. The algorithm associated with BIP44 forms a tree using the seed phrase. Account information (public addresses and private keys) for different tokens or currencies exist at different branches of the tree. This ensures that you get a different address information for each token. You can recreate this tree in a new wallet by importing your mnemonic seed phrase.

Derivation Paths

A path called a 'Derivation Path' provides a logical hierarchy for the wallet to use to search the tree for a user's address information at a specific branch (for a specific coin type).

Derivation Path Components

  • The path typically starts with "m'" for "master"

  • The second figure is the purpose. This is a constant, always set to '44' for . It indicates that this branch of the tree is compliant with BIP-44 specifications.

  • The third figure denotes the coin type for a specific blockchain. Ethereum, for example, is always "'60". Energy Web Chain is "'246". (You can see all of the registered coin types for BIP-44 .)

  • The fourth figure is the account. Accounts are numbered from index 0 upward. A user can have many accounts associated with one currency. You can liken this to having multiple accounts at a single bank.

  • The fifth figure is the change. It can be a value of 0 or 1. 0 denotes that the address is visible to others outside of the wallet and can receive payments. 1 indicates that the address is not visible to others outside of the wallet and cannot receive payments.

Certain wallets only accept derivation paths for specific tokens or currencies. MetaMask for example, only supports the BIP-44 derivation path with coin type 60, which is Ether - m’/44’/60’/0’/0.

You can find documentation for the BIP-44 .

Derivation Paths and Energy Web Chain

If you are using a hardware wallet and are not using it through a connection with MetaMask, you may need to change the derivation path to Energy Web Chain's derivation path to see your EWT in your account.

Energy Web Chain's derivation path is m/44'/246'/0'/0

helping electric utilities digitize and integrate distributed energy resources
deep levels of transparency and verifiability to emerging green product supply chains
24/7 matched renewable electricity
sustainable aviation fuel
sustainably produced bitcoin
Data Exchange
Green Proofs
worker node networks
 && apt-get dist-upgrade
yum update
chmod +x ./install-*.sh
--auto
https://github.com/energywebfoundation/ewc-validator-node-install-scripts/tree/master/volta-affiliate
open issues on Github
[email protected]
validator system contract
open issues on Github
EWF Member Slack space
here
Drawing
Decentralized Data Hub (DDHub) Client Gateway
https://github.com/energywebfoundation/ddhub-client-gateway
Azure cloud marketplace
DDHub Message Broker
NATS messaging
DID Authorization Proxy
https://github.com/energywebfoundation/ddhub-message-broker
SSI Toolkit
IAM page
https://docs.ipfs.tech/
Proof-of-Authority consensus engine
here.
1. System Contracts
smart contracts
Authority Roundtable Proof-of-Authority consensus engine
here.
2. Validator Node Architecture
here.
Proof-of-Authority Consensus Mechanism
Validator Node Architecture
install MetaMask
here
Volta Test Network (testnet)
Volta tokens
here
connect MetaMask to the Volta blockchain
Energy Web Main Network (mainnet)
Energy Web Tokens
here
connect MetaMask to the Energy Web Chain
Developing on the Volta Test Network and Main Network (Energy Web Chain)
MetaMask
official website
User Support Site
Twitter
Medium
JSON API
here
web3.js
Infura
Set up MetaMask to interact with Energy Web Chain
MetaMask
BIP44
BIP-44 derivation paths
here
here
Alice creates a digital identity

SSI Hub

SSI Hub

NodeJS server application using NestJS framework. The server caches specific smart contract data such as ENS namespaces and DID documents in order to improve read-query performance for applications and packages that rely on on-chain data.

The SSI Hub also facilitates the credentials exchange between credential requesters and issuers, which enables other applications such as Switchboard or Decentralized Service Bus to use credentials for role permissioning.

SSI Hub persists the following information that is created, read and updated by the IAM library:

  • Organization namespaces

  • Application namespaces

  • Role namespaces

  • User credentials

Documentation Resources

  • GitHub repository

  • ReadTheDocs

See an overview of all Identity and Access Management (IAM) components in EW-DOS here

Dependencies and Dependents

EW-DOS Dependencies
EW-DOS Dependents

EV-Dashboard

Cryptocurrency Wallets

What are cryptocurrency wallets used for?

Cryptocurrency wallets are used to:

  1. 'Store' and exchange cryptocurrency - tokens or cryptocurrencies are actually stored as records on the blockchain itself, but they are associated with a user's private key, which is stored in a cryptocurrency wallet.

  2. Authorize transactions on a blockchain

There are many different wallets available, many of which are built to be compatible with a specific blockchain like Ethereum or Bitcoin. You can choose to use a hardware wallet (discussed below), use only software or web-based wallets, or use a combination of both.

Cryptocurrency wallets are used in decentralized, peer-to-peer environments that have no central oversight or source of authority. Because of this, trust mechanisms are built into wallet functionality. Methods and implementations vary, but most cryptocurrency wallets use cryptographically seeded public-private key-pairs that serve as a way for users to identify themselves and safely validate and authorize transactions on the blockchain. The public key serves as their address in a network, and their private key (which should never be shared) serves as as a method for authorizing transactions. It serves as your digital signature. In EW-DOS, the user's public key is used as the identifier in their DID that is anchored on the blockchain. You can read more about this here.

You should never lose track of or share your private key(s) with anyone. Anyone with access to the private key can access the funds of that key's account.

Regardless of your choice of hardware wallet, we highly recommend that you use MetaMask when developing with or using EW-DOS. MetaMask is a browser-based cryptocurrency wallet. It is both an Ethereum-compatible wallet and a gateway for using decentralized applications built on Ethereum-based blockchains like the Energy Web Chain. We discuss MetaMask's functionalities below.

Multisignature Wallets

A multi-signature wallet is a smart contract that allows multiple parties to agree on transactions before execution. It is analogous to a joint bank account.

One pain point of "traditional" crypto wallets is that anyone who has access to the wallet's private key has total authority over the wallet’s funds: they can move funds or perform transactions with no limitations or accountability.

If an account is managed by multiple people, each person knows the private key and can therefore make transactions at their discretion without group consensus. Risk remains even if an account is managed only by one person. In this case, if the private key is stolen, someone else now has total control over the wallet and the funds in it.

A multi-signature addresses these pain points. You can set multiple owners for a wallet and the number of minimum confirmations needed to perform transactions. It gives robust security for private users and businesses. Some benefits include:

  • No single-point-of-failure: If your wallet has 3 owners and 2 confirmations are needed to execute a transaction (2-­of-­3 scheme), and one of the private keys gets stolen or lost, the funds can still be accessed, or the compromised owner's address can be removed or changed. A wallet with 2-­of-­3 scheme can tolerate 1 failure, a wallet with 3-­of-­5 scheme can tolerate 2, etc.

  • Accountability: No more insider theft. The transaction history, details, and the approvers of a transaction can be viewed.

  • Daily withdrawal limit: an amount can be determined that can be withdrawn daily without confirmations

  • Ease of use: less operational burden than a hardware wallet

There are a number of multi-signature wallets for the Ethereum network. One of the most widely used is the Gnosis Safe Multisig. You can view the smart contracts for Gnosis Safe here.

Related Content

Mycrypto wallet

Accessing Your Energy Web Tokens in MyCrypto wallet

https://support.mycrypto.com/how-to/nodes-networks/how-to-access-energy-web-chain-tokens/

By using a Ledger Device (Hardware wallet)

To interact with EWT using your Ledger device, you have to use the EnergyWebChain app on your Ledger device, not the Ethereum app. If you do not have this app installed, you can use Ledger Live to install it.

After accessing your Ledger device with MyCrypto, you will notice that a list of different addresses will show up instead of the addresses that you would see if you were connected to the Ethereum network. You are free to use these for your Energy Web Tokens.

If you have accidentally sent EWT to your Ethereum addresses previously, you can still access these by clicking the drop-down field next to "Addresses" and selecting the "Ledger (ETH)" option.

You will see your Ethereum addresses displayed alongside their EWT funds.

By using a Trezor Device (Hardware wallet)

Access your Trezor device like usual. You will notice that a list of different addresses will show up, instead of the addresses that you would see if you were connected to the Ethereum network. You are free to use these for your Energy Web Tokens.

If you have accidentally sent EWT to your Ethereum addresses previously, you can still access these by clicking the drop-down field next to "Addresses" and selecting the "TREZOR (ETH)" option.

You will see your Ethereum addresses displayed alongside their EWT funds.

Accessing Your EWTB (Bridged) Tokens

Energy Web has developed the EWT Bridged (EWTB) token, which is an ERC-20 token on the Ethereum blockchain. You can mint EWTB tokens through its interface which you can find at bridge.energyweb.org. This method allows you to transfer EWT from the Energy Web Chain to the Ethereum blockchain.

If your Ethereum address contains EWTB tokens, you might not see them in your interface right away. In this case, you have to manually add this token as a custom token.

The contract address of EWTB is 0x178c820f862b14f316509ec36b13123da19a6054, you can also find this address on Etherscan.

The Energy Web Chain

The Energy Web Blockchain

The Energy Web Chain (EWC) is the foundational “trust layer” of the stack. The Energy Web Chain (EW Chain) is an open-source, public blockchain blockchain technology. It is the foundational trust and persistence layer of EW-DOS.

The blockchain performs three key functions in EW-DOS:

  1. Provides the smart contract mechanism to store (DIDS)

  2. Facilitates on-chain verification and transactions between parties

  3. Executes smart contracts that are used by EW-DOS's decentralized applications, SDKs and utility packages.‌

You can read more about the Proof-of-Authority consensus mechanism .

The blockchain provides trust in several ways that allow for a decentralized system that is self-executing and without central authority or oversight of on-chain transactions:

  1. The data in each block is immutable and unchangeable. Each is linked to the previous block by a cryptographically created hash. If one block is tampered with, the hash of every subsequent block in the chain would be need to be updated. Because Validators' consensus is required to create new blocks, a block with an alternative transaction history would be rejected by Validators.

  2. Smart contracts provide automated logic for on-chain actions. Transactions on the chain are governed by code called that contain explicit logic and requirements for actions to occur. When specific conditions are met, the code will self-execute. Once a smart contract is deployed on the blockchain, it cannot be changed or reversed, removing the risk that anyone can update the logic of the contract for personal gain.

  3. Cryptographic verification is required for . In order for an individual to verify any on-chain transaction, they must sign the transaction using their private key. This makes it impossible to perform a transaction unless you have the private key.

Persistence on the Energy Web Chain

The Energy Web Chain stores the following information:

  • Smart contracts for that are created through EW-DOS's .

  • Smart contracts that govern validator consensus behavior and remuneration. These are known as .

  • Smart contracts that implement other Ethereum network protocols, such as permissioning and protocols.

  • Smart contracts that contain logic and functionality specific to deployed on the Energy Web Chain and the that connect them and their users to the Energy Web Chain.

If you're not familiar with Smart Contracts, you can read Ethereum's introduction to smart contracts .

You can see a list of repositories containing EW-DOS smart contracts .

Related Content

Run an OCN Node

Overview

The Open Charging Network is a decentralized implementation of the hub concept. Unlike traditional, centralized hub architecture, the OCN does not rely on a centralized server - the network is made up of a distributed network of server nodes. Anybody can run an OCN node.

Why Run a Node?

In the context of OCN, running a node means running and hosting an instance of the

There are several benefits to running your own node of the network.

  • From an individual perspective, running a node makes you less dependent on external service providers

  • From a network perspective, the Open Charging Network becomes more reliable the more nodes that are running

The following steps below help you to successfully set up and run your own OCN Node:

Access the full OCN technical documentation .

1. Setup and Configuration

Before running a node and connecting it to a local, test or production environment, it is recommended to become acquainted with how the network operates first.

For this, a demonstration of a network simulation with two OCN Nodes and mock parties ( and has been provided. Please visit this page to learn more and to find the necessary repositories for running the demo:

If you are familiar with the concept behind the Open Charging Network you can start the setup and configuration of your OCN Node. We recommend first running the node on the before moving to .

Visit the OCN Node README page in the GitHub repository for a step-by-step guide and all necessary resources:

2. Administration of Node and Connected Parties

After you have set up and configured your OCN Node, you can now set up administration and access restrictions, and allow others to access your node using the OCN Node APIs.

The for the OCN Node describes the available endpoints which can be used by administrators and parties.

Outside of the full OCPI v2.2 API, OCN Nodes provide additional features, such as the custom OCPI module, OcnRules, as well as ways for admins to restrict use and users to query the OCN Registry.

3. Keep your OCN Node up to date

Every OCN Node is a crucial part of the overall Open Charging Network. As soon as you run your own node, you are responsible for keeping it up to date. This helps to keep the Open Charging Network efficient and secure.

The Energy Web Foundation is steering the development of all Open Charging Network Open Source components, and will release regular updates.

The release date of an update will be announced on our at least two weeks before it will come into effect (be pushed from its DEVELOP BRANCH to the MASTER BRANCH). It is planned to keep the components downwards compatible at least one version, but this may not always be possible. Please make sure that you update your OCN Node within 24 hours after the publication of a new release.

Using Oracles

Incorporate external data sources into your smart contracts

Blockchain Oracles

By themselves, smart contracts cannot access data outside of the blockchain or send its data to services outside of the blockchain. To do this, smart contracts use middleware called an oracles, which are third-party services that fetch and send data to and from smart contracts. Oracles are similar to traditional web-based API services.

Smart contracts can contain logic that triggers certain changes or actions based on external data from an Oracle. Without oracles, blockchains and their applications that cater to specific industries that rely on real-time changes such as finance, commodity trading, or IoT, would not have access to the data necessary to react to real-time external factors.

It's important to keep in mind that oracles are agnostic of the data they transmit - they are only responsible for fetching, verifying and relaying the data to and from the blockchain.

Inbound vs. Outbound Oracles

Inbound oracles send data to the blockchain. This is the most common type of oracle. Like traditional API services, the inbound data that the oracle provides can be anything that your smart contract needs for internal logic that it cannot access from the blockchain or the smart contract itself.

For example, you want to send 10 EWT to a friend's address when the price of a specific stock goes above $10 per share. An oracle will provide you with the data about stock price, and the blockchain logic will trigger the send when the oracle delivers data indicating that the price of a stock goes above $10.

Outbound oracles send data about events that happen on the blockchain to third party applications. For example, an account could receive a payment and trigger an outbound oracle to a mechanism that activates a pv solar panel.

Oracle Data Sources

Oracles can gather data from software and hardware. A software oracle interacts with and fetches data available from any web source that exposes its data. Some common examples are weather APIs, real-time stock information and exchange rates.

Hardware oracles interact with 'physical' data sources like sensors from IoT devices, QR codes or bar codes. Some examples could be reading the temperature from a smart thermostat or fetching data from a flood sensor..

Centralized Vs. Decentralized Oracles

Centralized oracles are developed, maintained and controlled by a single entity. One oracle is responsible for fetching data from one or many data sources, and then transmitting that data to the smart contract on the blockchain. You could liken this to using a centralized database for your smart contract's external data sources.

Decentralized oracles aggregate data from multiple sources using multiple oracle nodes, so that there is no single point of failure for data retrieval, and no single point of failure for the oracle itself. Decentralized oracles are more aligned with the wider community of public blockchain.

Fundamental Oracle Functionality

Regardless of the data source, or if it is centralized or decentralized, all oracles provide three main functionalities:

  1. Listen to the blockchain network for incoming requests for off-chain data

  2. Fetch data from the requested off-chain source

  3. Transfer the data to the blockchain via a signed transaction

  4. Insert the data into a smart contract’s local storage. Once the data is in the smart contract's storage, it can be used to trigger logic within that smart contract, or it can be available for other smart contract's to use

Oracle Design Patterns: Communicating Data To Smart Contracts

Depending on the nature of the data itself and how the smart contract uses the data, oracles can be designed to communicate with smart contracts using three main patterns:

  1. Publish-subscribe: An oracle broadcasts data, and certain smart contracts are polling or "listening to" that oracle for changes in data. An example: "Poll the temperature of region X every 10 minutes. If the temperature is above 70 degrees celsius, turn the smart thermostat to 'on'."

  2. Immediate-read: Oracles hold data in their storage and provide this data on request. Users or devices query the oracle for this data at the same time that it is needed. An example: "Is device X in a list of authorized devices to provide solar power to region Y."

  3. Request-response: External accounts (via decentralized applications) interact with a smart contract and necessitate data from the oracle. The smart contract sends the data parameters to the oracle and performs the third-party data query. When the data is fetched, it sends the result back to the smart contract for the decentralized application to use. Because the decentralized application cannot always wait for the data, this occurs asynchronously. An example: A user selects from a dropdown on a decentralized application a date range to determine the average temperature of each day during the range. The start and end date are sent to the data oracle to fetch the temperatures for the days in the given date range. The data is sent back to the smart contract to perform necessary logic based on the data.

Tutorial: Using Chainlink with the Volta Test Network

provides decentralized oracle networks. covers:

  • Setting up a Chainlink node and using it from a smart contract on the Volta test network

  • Aggregating data from multiple Oracles, and how to use the public Price Pair Oracle infrastructure on Volta

  • Design principles of Chainlink oracles

  • Scenarios where it makes sense to use Chainlink

Ethereum

Foundational blockchain technology

Ethereum

The Energy Web blockchain is derived from technology. Ethereum provides a strong foundation for the Energy Web Chain because it is open-source, widely used, and many well-developed tools for development on Ethereum exist today.

Ethereum-based technology is used as EW-DOS's trust layer because anyone can use Ethereum to build and deploy decentralized applications that run on blockchain technology. This aligns with the purpose of EW-DOS, which is to build decentralized, open-sourced applications that accelerate decarbonization of the energy grid.

What Sets Ethereum Apart from Other Blockchains?

Prior to Ethereum, most blockchains were protocols created to exist as a public, decentralized ledger for financial transactions (think Bitcoin).

Ethereum developed the (EVM) to allow users to store and execute programs on the Ethereum blockchain. This lets programmers write programs that contain logic and state management, both which are critical to. These programs are called . Once it is deployed on the blockchain, a smart contract has an address on the blockchain and anyone can use to interact with the contract or call its public functions. You can read more about how to interact with smart contracts .

This means that blockchain technology can not only be used to buy and trade cryptocurrency, but also to create robust applications for decentralized finance, asset trading, gaming and, in our case, a decentralized energy market.

Read an overview of Ethereum and the Ethereum Virtual Machine on the Ethereum documentation's "What is Ethereum" section .

Ethereum Fundamentals

The Energy Web Chain is derived from Ethereum, but it is a separate blockchain using a different consensus protocol and unique governance mechanisms. However, most of the fundamentals of the Ethereum network are the same for the Energy Web Chain. These fundamentals are helpful in understanding the role that blockchain technology plays in EW-DOS. This is especially true if you want to develop and deploy smart contracts on the Energy Web Chain.

If you are unfamiliar with Blockchain technology, or the Ethereum Virtual Network, there are some additional resources below to get you started.

  • (this is an overview of transactions in Ethereum, but we explain more about transactions on the Energy Web Chain )

Additional Resources

  • on

Connect a Trezor Hardware Wallet
Set up MetaMask to interact with Energy Web Chain
DID Library
Decentralized Service Bus
Energy Web Chain
Switchboard
IAM Smart Contracts
Chainlink
This tutorial
EWT/EUR

Develop on the Test Network

The Public Test Network is the pre-production test network of the Open Charging Network.

It should be used to test services and features in a robust quality assurance environment. To develop on the test network, you can connect to an OCN test node and the OCN Registry that is deployed on the Volta Test Network. See more details on this below:

  • OCN Registry on Volta Test Network

  • Connect your service to an OCN test node

  • Run a node in a test environment

  • Testing tools

Please note, that it is not advised to run a service in production on the Public Test Network. Energy Web Foundation reserves the right to make changes to the testing components on this environment, that could affect your service.

Access the full OCN technical documentation here.

OCN Registry on Volta Test Network

The Volta Test Network is the pre-production test network (testnet) of the Energy Web Chain. It is the blockchain equivalent of a test server or test environment in traditional software development.

The OCN Registry for the test network can be found on Volta under the following public key: 0xd57595D5FA1F94725C426739C449b15D92758D55.

You can view transactions and the log history for this contract on the Volta Block Explorer here. If you're unfamiliar with the Block Explorer, you can read more here.

Connect your Service to an OCN Test Node

The Public Test Network of the Open Charging Network provides you with some public test OCN Nodes that you can use for testing the features of the Open Charging Network.

The following test OCN test nodes are currently known to Energy Web Foundation:

  • eMobilify GmbH with OCN Identity 0x4174161e7B8f137De780C024D0e988f4039F8C70 - You can obtain a registration token (Token_A) for this node here: https://qa-faucet.shareandcharge.com/ Temporarily unavailable - By using the Public Test node provided by eMobilify GmbH, you accept the Terms&Conditions and Data Protection Guidelines by eMobilify GmbH. Please visit the company website to learn more, or reach out to [email protected]

  • Elaad NL with PublicURL ocn.elaad.io (Reach out to [email protected] to obtain the OCN Identity and the registration token)

Follow the steps outlined in the "Connect your Service to an OCN Node" in order to connect your service to one of the nodes listed above.

Run a Node in a Test Environment

The Public Test Network should give you the option to test your OCN Node operation in a QA environment.

The OCN-Registry for the Public Test Environment can be found on the Volta Test Blockchain by Energy Web under the following public key: 0xd57595D5FA1F94725C426739C449b15D92758D55

Follow the steps outlined in the Run and OCN Node for guidance on how to run a node.

Testing Tools

The Open Charging Network provides mock OCPI parties for exchanging simple OCPI requests over the Public Test Network.

One Mock CPO and one Mock eMSP are available on the Public Test Network (i.e. registered in the Registry contract that is deployed on the Volta Testnet)

Mock

Country Code

Party ID

Charge Point Operator

CH

CPO

eMobility Service Provider

CH

MSP

Please note that the functionality of both mock parties is limited, and does not implement or cover all OCPI modules and use-cases. Details can be found on the Bitbucket repository: tutorial-servers.

Identity and Access Management (IAM)

Identity and Access Management (IAM)

Identity and access management (IAM) refers to the frameworks and procedures that provide the users of a technology with appropriate access to the technology’s resources (i.e. what a user is allowed to do and access within a system). It includes the processes for validating user identities and establishing the hierarchies they exist in.

IAM plays a critical role in Energy Web tech stack. The IAM components are responsible for creating user identities and defining and enforcing governance structures that identities participate in. These governance structures define criteria that users must have in order to take on roles within an application or organization, and provide the mechanisms to request, verify and issue these roles.

Energy Web's Approach to IAM (Self-Sovereign Identity)

The Energy Web IAM architecture is informed by and implements the principles of self-sovereign identity (SSI). SSI is a paradigm that promotes an individual’s control over their digital identity and how it is used. This is in contrast to traditional, centralized IAM approaches, where a third party is responsible for storing a user's identity and/or their data in a proprietary database.

Self-sovereign identity exists to address the shortcomings and vulnerabilities of centralized identity approaches. Some of these include:

  1. Users lack custody over their digital identity and its associated data (what data is shared and with whom).

  2. Applications and systems do not provide interoperability or portability of user data. User identifiers and data are typically sequestered within an application and are not accessible to the user outside of that context.

  3. Centralized systems are vulnerable to attack, resulting in exposure and dissemination of sensitive user data.

The two fundamental components of SSI (Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs) serve as the fundamental components of Energy Web's IAM framework.

  • Similar to a traditional 'username', A DID is a user's primary identifier in the Energy Web ecosystem. A DID is derived from the user's public key, and is anchored on the Energy Web Chain in the DID Registry. See further documentation on DIDs in self-sovereign identity and the IAM stack here.

  • Verifiable credentials are digital credentials that can be verified cryptographically using public-key infrastructure. In the Energy Web ecosystem, verifiable credentials are used to authorize a user's or asset's enrolment into an application or organization. See further documentation on verifiable credentials in self-sovereign identity and the IAM stack here

DIDs and Verifiable Credentials are used together within a framework of role-based hierarchies to create permissioning systems. You can read more about the role of DIDs and verifiable credentials in our governance framework here.

EW SSI Toolkit Architecture Diagram

Further Documentation

For further documentation on our IAM stacks:

  • Guides (how to use IAM stack apps)

  • Patterns (cross-cutting concepts across the IAM stack):

    • Credentials: the role and lifecycle of verifiable credentials in the IAM stack

    • Assets as Ownable Smart Contracts: defining and managing digital identities for assets (digital representation of a physical or virtual device)

    • SSI Credential Governance using ENS Domains: Energy Web's role-based governance frameworks

Credential Metadata

Possible credential metadata

In a verifiable credential ecosystem, there are various metadata that are useful for effectively using the data in the credentials. This page aims to describe possible metadata specifications and technologies that may be used with credential data.

Note: Not all of the following metadata is available for all credentials within the Energy Web credentials ecosystem.

Data Semantics

Data semantics refers to the meaning of the data. This includes semantic disambugation (know precisely what a term is refering to) as well as data descriptions and relationships.

Linked Data provides semantic disbiguation by requiring that terms be IRIs.

Linked Data Contexts

Linked Data context maps terms to IRIs. This allows JSON-LD documents to be written in more concise, readable manner, without sacrificing accuracy.

The VC Implementation Guide also has instructions on how to create new contexts for verifiable credentials.

Linked Data Vocabulary/Ontologies

Linked Data can also be used to provide further information about the semantics of a term. This is provided in a data vocabulary or ontology.

For example, the RDF Schema comment property can be used to provide further description of a resource.

Note that vocabularies can be used to infer data validation but this is non-standard and violates the open-world assumption of W3C ontology languages.

This point is made in SHACL and OWL Compared

Although data validation is an important practical use case for the RDF stack, until SHACL came around, there was no W3C standard mechanism for defining data constraints. Over time, people became creative in working around this limitation. Many tools simply decided that for all practical purposes, the open-world and non-unique-name assumptions should simply be ignored. OWL-aware tools including TopBraid and Protégé, for example, provide data entry forms that restrict users from entering more than one value if there is a corresponding owl:maxCardinality 1 restriction, or require the selection of a specific instance of ex:Person if that class is the rdfs:range of the property. The GAIA-X FAQ makes a similar point SHACL shapes are not an ontological models. They serve a different purpose. Ontologies describe concepts and help in inferring additional knowledge. Firstly, the W3C ontology languages follow the Open World Assumption, secondly SHACL follows the Closed World Assumption. If a self-description is missing an attribute, it is an error in the shape validation (and that’s how it should be!). From the ontology’s point of view, the attribute could be defined somewhere else in the WWW, if not in the JSON-LD file at hand (but this extremely decentralised view is not compatible with Gaia-X’s trust-building approach).

Data Structure Validation

Data structure validation is used to validate that data, for example, contains specific properties or that properties have specific values.

There does not seem to be a single way of describing data structures in the Verifiable Credentials ecosystem as different methods have different tradeoffs.

For verifiable credentials, the schema of a credential can optionally be linked using the credentialSchema property.

JSON Schema

JSON Schema can be used to describe the precise shape required by the a credential.

The JsonSchemaValidator2018 credentialSchema type is defined in the Verifiable Credentials Vocabulary

Open API Schema

SHACL

SHACL is the W3C standard for validating RDF graphs.

SHACL is being used by GAIA-X for their self-descriptions.

To check whether the claims in a Self-Description follow all constraints, such as including all mandatory attributes, the claims are validated against a shape. Technically, these shapes follow the W3C Shapes Constraint Language (SHACL). The claims themselves are represented as an RDF graph, serialised in the W3C JSON-LD format, where JSON is a data interchange format widely supported by programming languages, and JSON-LD (LD = “linked data”) makes it compatible with RDF.

JSON-LD Schema

JSON-LD Schema is a pre-alpha project that attempts to reconcile the trade-offs of JSON Schema and SHACL.

It notes:

JSON-LD documents can be seen from two points of view: as regular JSON documents following certain conventions or as RDF graphs encoded using JSON syntax. Validation mechanisms indeed exist for both ways of looking at the information in a JSON-LD document, but each of them has important drawbacks when working with JSON-LD:

  • JSON-Schema can be used to validate JSON-LD as plain JSON documents. However, the information in a JSON-LD document can be encoded through multiple, syntactically different, documents, so it is hard to write a generic JSON-Schema validation without going through a normalisation step, and even if the validation is written for a normalised JSON-LD document, the description of the validation becomes verbose and complex to write, relying, for example, on the usage fo fully expanded URIs. There is also the issue of the implications for the validity of the RDF information encoded in the document when we are just validating the JSON syntax.

  • SHACL can be used to validate the RDF graph encoded in the JSON-LD document. SHACL is powerful and expressive but difficult to write and learn, especially for users that do not want to work with JSON-LD as an RDF format. Additionally, the performance of SHACL validators is far from the performance of syntactical JSON-Schema validators

Data Display

The Wallet Rendering specification describes how a credential can be displayed.

Channels and Topics

In EW Data Exchange, the DDHub Message Broker is analogous to a computer - it is foundational infrastructure upon which participants gain the ability to establish their own “profiles”, exchange messages, and run their own applications. The DDHub Message Broker routes and translates messages between participants. Messages are structured and organised in distinct channels corresponding to specific use cases or business processes, and formatted in topics which define data formats and schemas.

In order to access certain channels and gain permissions to send and/or receive specific message types, participants must acquire roles that reflect their role within the market (or use case), using credentials attached to their self-determined identity. Credentials are granted by a platform governing body and determine the ability to send messages to other participants using channels (what messages are sent and received) and topics (data schemas that define the payload of a message).

Channels

Channels are defined at the client gateway, and are what messages are sent and received on. Participants define a channel as:

  • Type: Publish/Subscribe

  • Topics: Any that the DID has visibility of

  • Restrictions: Who will receive a message on a publish channel, or who I will receive a message from on a sub channel. Channels can be restricted by DID or role

An example of a channel definition object is provided below. In this example, the channel will receive RealTimePricing or DayAheadPricing from any DID with the role: user.roles.internal.apps.operator.iam.ewc and does not specify that payload encryption is required.

// Market Pricing Channel Example
 {
        "fqcn": "pricingtopics.sub",
        "type": "sub",
        "conditions": {
            "topics": [
                {
                    "topicName": "RealTimePricing",
                    "owner": "internal.apps.operator.iam.ewc",
                    "topicId": "62f9b4123bef104db2264f2b",
                    "schemaType": "JSD7"
                },
                {
                    "topicName": "DayAheadPricing",
                    "owner": "internal.apps.operator.iam.ewc",
                    "topicId": "62f9b4644bfe104db22642c0",
                    "schemaType": "JSD7"
                }
            ],
            "dids": [],
            "roles": [
                "user.roles.internal.apps.operator.iam.ewc"
            ],
            "qualifiedDids": [
                "did:ethr:volta:0x135ebb63ab839bef3e292e55dcF4A98Bfe38Ba47A9",
                "did:ethr:volta:0x87795f53b443ece663986f46e6747fb10dbc6745fC"
            ]
        },
        "payloadEncryption": false,
        "createdDate": "2022-08-16T00:03:46.164Z",
        "updatedDate": "2022-09-04T22:33:43.313Z"
    }

Topics

Topics are data schemas that define the payload of a message within a channel. They are grouped under owners that are used as an authorization unit for visibility. Two examples of Topics for publishing and acknowledging a distribution network line constraint are provided below:

// Constraint Publication Example
{
    "participantId": "string",
    "submissionTimestamp": "string",
    "networkConstraints": [
        {
            "meterID": "string:",
            "intervals": [
                {
                    "activePowerExportLimit": 0.0,
                    "activePowerImportLimit": 0.0,
                    "diEndtime": "string",
                    "diStarttime": "string"
                }
            ]
        }
    ]
}
// Constraint Acknowledgement Example
{
    "data": {
        "initiatingMessageId": "string",
        "initiatingTransactionId": "string",
        "systemProcessedDttm": "datetime"
    },
    "acknowledgements": [
        {
            "code": "string",
            "title": "string",
            "detail": "string",
            "source": "string"
        }
    ],
    "errors": [
        {
            "code": "string",
            "title": "string",
            "detail": "string",
            "source": "string"
        }
    ],
    "warnings": [
        {
            "code": "string",
            "title": "string",
            "detail": "string",
            "source": "string"
        }
    ]
}

\

Develop on the Production Network

The Production Network is the live network of the Open Charging Network. Services and features should only be used in a production network after performing robust quality assurance environment.

Access the full OCN technical documentation here.

OCN Registry on Energy Web Main Network

The Energy Web Main Network (mainnet) is the production network of the Energy Web Chain.

The OCN Registry for the main network can be found under the following public key: 0x184aeD70F2aaB0Cd1FC62261C1170560cBfd0776

You can view transactions and the log history for this contract on the Block Explorer here. If you're unfamiliar with the Block Explorer, you can read more here.

Connect your Service to an OCN Production Node

Follow the steps outlined in the "Connect your Service to an OCN Node" in order to connect your service to one of the nodes listed below.

The following test OCN production network nodes are currently known to Energy Web Foundation:

  • eMobilify GmbH with OCN-Identity 0x34F160573b96D3Db5928Ae804D7d99DdD0aF222c Reach out to eMobilify GmbH via [email protected] to get connected.

  • eMobility Easy with OCN-Identity 0x79d2D88A1F668296c96150139366ff507eFeD618 Reach out to eMobility East via [email protected] to get connected.

Follow the steps outlined in the "Connect your Service to an OCN Node" in order to connect your service to one of the nodes listed above.

Run a Node in a Production Environment

For the running of a production node, we advise that a few extra steps are taken. These include configuring HTTPS, enabling message signing, and running against a relational database.

You can see all OCN node configuration settings here.

1. Configure HTTPS

Running the OCN Node in production mode (by default or with the configuration setting ocn.node.dev=false) will require HTTPS. On startup in this mode, the OCN Node will look to see if HTTPS is enabled and properly working. If not, the node will shutdown.

We recommend using an Nginx reverse proxy and Let’s Encrypt certificate, but other solutions are not discouraged.

2. Enable Message Signing

This feature allows recipients to verify the integrity of the data they are receiving. When the configuration setting ocn.node.signatures=true, request senders should include an OCN-Signature header that all entities that the request passes through (i.e. OCN Nodes and the recipient) sign to verify that the data has not been modified without consent. Likewise, for responses, an ”ocn_signature” property should be placed in the JSON response body by the recipient.

Read more about OCN signatures here.

In some cases an OCN Node will need to modify data (typically to make URLs work for recipients). The signature can be modified by an OCN Node, but they must state the properties that they changed, and sign any new data. More information about message signing and verification can be found here.

By default message signing is turned on, but it can also be set with ocn.node.signatures=true if it is not.

3. Configure a Database

The default dev properties configuration file only connects to an in-memory database, for ease of quickly testing the OCN Node. When running a Node on the test or production environment, a database should be set up to persist data across restarts. The example application.prod.properties file provided with the OCN Node provides the configuration necessary to use PostgreSQL.

4. Configure Load Balancing

If necessary, the OCN Node can be load balanced. To do so, the nodes operating under the load balancer should have the same configuration:

ocn.node.url = https://balancer.server.net
ocn.node.privatekey = 0x...45d1
ocn.node.apikey = supersecretkey

The operator should also list the load balancer as the domain name using the same private key in the registry listing:

ocn-registry set-node https://balancer.server.net --signer 0x...45d1

Legal Setup of eRoaming via the OCN

The OCN allows you to have simple, cost-efficient and secure technical connections to other EV charging players like Charge Point Operators and eMobility Service Providers. To run your EV charging service in production, you may need to enter into different legal relationships.

You might want to consider establishing the following agreements when setting up your charging service:

Service Level Agreement (SLA) with Your OCN Node Operator

The OCN Node is responsible for your technical connection to other parties on the OCN. If you are not running your own OCN Node, but using the OCN Node of a third party (OCN Node Operator), you might want to sign a Service Level Agreement (SLA) with the OCN Node Operator. The agreement should make sure the OCN Node is hosted properly and has a high uptime.

eRoaming Agreement with Other Players on the OCN

Engaging with other parties on the Open Charging Network (like charge points or electric vehicles) requires in many cases a formal legal relationship between you and your counter party. An eRoaming Agreement stipulates the terms and conditions for the eRoaming connections between you and your counter party.

Proof-of-Authority
derived from Ethereum
decentralized identities
here
block in a blockchain
smart contracts
on-chain transactions
Decentralized Identities (DIDs)
identity and access management library
system contracts
the OpenEthereum client
applications
utility packages
here
here
REVIEWER FEEDBACK
Energy Web Block Explorer
System Architecture
Interacting with Smart Contracts in EW-DOS
OCPI 2.2
OCN node software.
Setup and Configuration
Administration of Node and Connected Parties
Keep Your OCN Node Up to Date
here
CPO
eMSP)
Examples
Test Environment
Production
OCN Node Repository
HTTP API Documentation
Gitter community
Run an OCN Node
Ethereum blockchain
Ethereum Virtual Machine
decentralized applications (dapps)
smart contracts
here
here
Introduction to Ethereum
Transactions
here
Blocks
Accounts
Ethereum Virtual Machine
Gas
Smart Contracts
Ethereum Documentation:
Ethereum development documentation | ethereum.org
“Best Resources for Learning About Blockchain and Ethereum” on Medium
Dapp University YouTube Series on building Dapps with Ethereum:
Dapp University
“The Ethereum Virtual Machine: How Does It Work?”
Medium
Chapter 1: What Is Ethereum? · GitBook
Chapter 2: Ethereum Basics · GitBook

Maturity Model, Feature Roadmap and Releases

The development of the Open Charging Network is steered by community needs with the non-profit Energy Web Foundation curating the development.

For this purpose, transparency about the current feature set is required, which the following OCN maturity model (inspired by Gitlab) shall provide. The maturity model and the roadmap of the Open Charging Network development is discussed quarterly during the Share&Charge Foundation and Tech Call.

The maturity model is based on different categories (columns):

  • Messaging: How messages between OCN Parties are transmitted and secured

  • Service interfaces: Interfaces that can be used by OCN Parties to connect their services to the OCN

  • Connection & Community: Tools for the community to test and use the OCN

Maturity is indicated with different-sized black boxes or a heart:

Planned: Requirements are getting defined

Minimal: First implementations are tested

Viable: Can be used in production

Lovable: Functionality set is complete and used by community

A reference to the open source repositories is provided in parenthesis after the feature description.

Messaging

Service interfaces

Community & Network tools

Release 1.0.0 (03.03.2020)

OCPI 2.2 messaging (OCN-Node)

Address book for message routing (OCN-Registry)

Signed OCPI messages (OCN-Notary)

White-/Blacklisting of OCPI parties (OCN-Node)

OCPI 2.2 CPO & eMSP interface (OCN-Node)

CPO & eMSP testing tools (OCN-Tools & OCN-Demo)

Release 1.1.0 (16.10.2020)

OCN Service Permissions (OCN-Registry)

OCPI 2.2 HubClientInfo Module (OCN-Node)

Custom OCN / OCPI message (OCN-Node)

OCN Service Interface (OCN-Node)

OCN Service Interface testing tools (OCN-Demo)

On Roadmap

Non-OCPI API connections (OCN-Bridge)

Ideas / Requirements / Addons

Decentralized Identifiers for OCN Registry

OCN Service Interface with Interception / Changing functionality

ERC20 Token interface (Settlement & Token Bridge)

OCPI 2.1.1 bridge

OCN / OCPI 2.2 testkit

Energy Web Token (EWT)

The Energy Web Chain's native token

What is the Energy Web Token?

The Energy Web Token (EWT) is the native utility token of the Energy Web Decentralized Operating System (EW-DOS). Tokens are used in EW-DOS to pay for gas fees on the Energy Web Chain, and for staking to secure the Energy Web X blockchain as well as Worker Node Networks. You will need EWT in your digital wallet (we recommend using MetaMask) if you want to make transactions or use applications or smart contracts that are deployed on the Energy Web Chain main network.

EWT on the Energy Web Chain

Like other public blockchains, the Energy Web Chain uses EWT as a utility token to access services and orchestrate stakeholders within its blockchain system. In the context of the Energy Web Chain, EWT compensate validators for processing transactions, and are used to pay for transactions - for example, registering a new asset or organization in Switchboard.

Utility tokens like EWT are different from other digital assets in the blockchain sphere such as coins, non-fungible tokens, and stablecoins. To learn more about the distinctions between these assets, see this article, The ultimate cryptocurrency explainer: Bitcoin, utility tokens, and stablecoins .

EWT on Energy Web X

Energy Web X will leverage and complement the existing Energy Web Chain by introducing new technical capabilities that streamline the deployment and operation of Worker Node networks.

To maximize the security of every Energy Web solution using worker nodes, EWT will be required to interact with worker nodes and Energy Web X. Most notably, Energy Web Tokens will be required to:

  • Reward worker node networks: worker nodes are software packages that need to be run by individuals and/or businesses. In order to attract entities to run worker nodes, enterprises will need to include rewards, paid in EWT, that compensate worker node operators for their work.

  • Operate worker nodes: in order to become a trusted party to run worker nodes, individuals and/or businesses will be required to stake EWT. Staking requirements and reward schedules are mass customizable—enterprises launching worker node networks can configure different thresholds and award schedules at their discretion.

  • Validate Energy Web X: Energy Web X validators will need to stake a significant number of Energy Web Tokens in order to become validators on Energy Web X.

For clarity, instead of launching a new token with the Energy Web X blockchain, Energy Web X will be powered by the existing or EWT. Users have the ability to “lift” Energy Web Tokens from the existing Energy Web Chain onto Energy Web X. Lifted Energy Web Tokens can then be used for the functions described above. With this mechanism in place, EWT holders will be able to “lower” Energy Web Tokens back to the main Energy Web Chain at their discretion. Over time, token holders will be able to lower EWT to other layer one blockchains (for example, main net Ethereum) making Energy Web solutions interoperable with any blockchain ecosystem.

Get EWT

You can buy EWT on any of the exchanges listed here. You can also bridge EWTB ERC20 tokens acquired on Ethereum mainnet back to EW Chain by following this guide.

Related Content

  • Transactions and Transaction Costs

  • Energy Web Token

  • Volta Testnet Token

  • Token Bridge

  • Cryptocurrency Wallets

Additional Resources:

  • What is Energy Web Token? | EWT Coin | Kraken

  • ****The utility of the utility token for utilities - how companies can use the Energy Web Token to build and operate enterprise-grade decentralized applications on a public digital infrastructure

  • Energy Web Token - Energy Web

Block Reward Contract

Overview

The Block Reward contract manages block reward payouts to validators. Block rewards are issued as native Energy Web tokens that are minted by the engine.

Two entities are rewarded by each created block:

  1. The block author (validator)

  2. The community fund

Interaction graph for the block reward contract

Documentation and Source Code

  • Energy Web Block Reward Contract

  • OpenEthereum documentation on Block Reward Contract

Block Reward Payouts

Block Authors

Block authors are rewarded each time they seal a block. The amount issued to block authors decreases over time, as depicted by the Discreet S Curve.

Calculator: https://github.com/energywebfoundation/discrete-scurve-calculator

Fig. 2.: Discrete inverse S curve use for block rewards. Calculated for a 5 second step size, 10 million ethers total payout over 10 years

Energy Web Community Fund

A portion of block rewards goes to the Community Fund. Unlike the amount awarded to block authors, the amount that goes to the Community Fund remains constant over time.

The amount is chosen to add up to roughly 37.9 million tokens over a 10 year period. The community fund can change its own address and set a payout address too.

With 5 second step size: Payout-per-block = 600900558100000000 wei

Visual representation of the community reward distribution is depicted below in Fig. 3.

Fig. 3.: Community reward distribution.

Interaction with Block Reward Contract

Contract Address and ABI

Name

Address

JSON ABI

RewardContract

0x1204700000000000000000000000000000000002

Function Name

Description

mintedTotally()

Returns the token amount that was minted totally in wei

mintedForCommunity()

Return the token amount that was totally minted for the community fund in wei

mintedForCommunityForAccount(address)

Returns the total token amount that was minted for a certain address for the community so far in wei

mintedForAccount(address)

Return how much was minted for an account so far in wei

mintedInBlock(uint256)

Returns how much was minted in certain block in wei

mintedForAccountInBlock(address, uint256)

Returns how much was minted for a certain account in a certain block in wei

communityFundAmount()

Returns the constant payout for the community per block in wei

communityFund()

Returns community fund address

payoutAddresses(address)

Returns an address' payout address

setPayoutAddress(address)

Sets payout address for sender

resetPayoutAddress()

Resets payout address for sender

getBlockReward(uint256)

Returns blockreward amount for a certain block number

checkRewardPeriodEnded()

Returns true if blockreward period has ended (based on blocknumber), false otherwise. The blockreward period right now ends after 10 years. After that no blockrewards or community fund payouts are minted.

Callable functions

Developing on the Volta Test Network and Main Network (Energy Web Chain)

Blockchain networks to support test and production environments

Energy Web supports two distinct blockchain networks:

  1. The Volta Test Network (Testnet)

  2. The Energy Web Production Network (Mainnet)

These networks are independent of each other. They each have their own chain specifications that the OpenEthereum client uses to configure the blockchain. You can view them on github here.

You cannot transfer tokens between these two blockchains. They each use their own unique utility token that pays for transaction fees on the blockchain (read more about this here).

The Energy Web Chain's main network utility token is the Energy Web Token, which has real fiat value. The Volta Test Network's token is the Volta Token, and it has no real value. They are not interchangeable - if you have Volta tokens, this does not mean you have Energy Web Tokens, and vice versa.

Developing on Volta Test Network

Volta is the pre-production test network (testnet) of the Energy Web Chain. It’s the blockchain equivalent of a test server or test environment in traditional software development. Most blockchains have at least one test network. Ethereum, for example, has several test networks for pre-deployment testing.

Volta is used as a staging network to:

  • Test smart contracts before they are deployed on the production chain. If you write your own smart contract, you will want to deploy it and test it on Volta first to make sure it works as expected. Because tokens on the testnet (Volta tokens) have no real value, you can test thoroughly and incur no cost.

  • Test protocol updates before they are deployed on the production chain. Each time there is an upgrade to Ethereum's protocol, we test it on the Volta Network first.

The utility token for the Volta Test Network is the Volta token. Volta tokens have no real value, but you will need them to "pay" for transaction costs associated with interacting with smart contracts on the Volta network. Read more about the Volta Token and how to get some here.

Get Started Using Volta

  • Get Volta Tokens

  • Connect to Volta Test Network using MetaMask - you will need to connect to the Volta network in order to access applications and smart contracts deployed on Volta

  • Run a local node - you have the option to run your own local node of the Volta network. You can read about the purpose and benefits of running a local node here.

Developing on Energy Web Main Network

The Energy Web main network (mainnet) is the production network of the Energy Web Chain. The gas fees to pay for transactions require Energy Web Tokens (EWT), which have real value. You can read more about EWT and how to acquire it here.

You can read more about transaction costs on the Energy Web Chain here.

Get Started Using the Energy Web Chain

  • Get EWT

  • Connect to Energy Web Main Network using MetaMask - you will need to connect to the Energy Web Chain in order to access applications and smart contracts deployed on the Energy Web main network

  • Run a local node - you have the option to run your own local node of the Energy Web Chain. You can read about the purpose and benefits of running a local node here.

Related Content

Holding Contract

Overview

The Holding Contract holds tokens for initial investors. These tokens are "pre-mined", and do not enter the pool through block validation. Tokens are held for affiliates until a specific point of time that is specified in the contract, at which point they can be released to the specified address. The constructor of the holding contract and its initial balance is part of the chainspec file. This allows the investors' tokens to be locked at the first block.

The mapping between the account address and the token amount is hard coded into the contract and cannot be changed after deployment. After a block that has a later timestamp than the holding timestamp of an address is created, the tokens for that address can be transferred to the address by calling the realeaseFunds method. This method can be called by anyone, not only by the address that holds that balance.

Interaction with Holding Contract

Documentation and Source Code

  • Energy Web Holding Contract

Check a Balance and Withdraw Funds

If you're an investor and want to see your balance, you can use the Balance Viewer interface: http://balance.energyweb.org/.

You will need MetaMask pointed to a local or a remote node

  • To learn how to connect via remote RPC, go here

  • To learn how to run a local node go here

  1. Enter your address in the lookup field to see your holding balance

  2. If the release period has ended, press the "Withdraw" button to release the funds to the address it belongs to. Make sure you trigger the withdraw function with an account that has some ethers to cover transaction costs

Holding Contract User Interface

Mapping Between Address and Tokens

The mapping between addresses and tokens/release timestamp is kept in the storage of this contract. This mapping data structure was filled at the deploy time of the contract and cannot be changed.

mapping (address => Holder) public holders;

// -- snip --

struct Holder {
    uint256 availableAmount;
    uint256 lockedUntilBlocktimestamp;
}

// -- snip --

// in the constructor
addHolding(0x120470000000000000000000000000000000000a, 10000000000000000000000000, 1564509540);

Interacting with the Holding Contract

Contract Address and ABI

Contract

Address

JSON ABI

Holding

0x1204700000000000000000000000000000000004

Callable Functions

Function Name

Description

releaseFunds(address)

Releases funds for a holding address if it is present in the contract and the holding period is over

holders(address)

Returns the holding data for an address, the available amount and the holding-period-end blocktimestamp

TARGET_AMOUNT()

Returns the total amount initially held by the contract

1. Make your backend service OCN-ready

In order for your backend service to be OCN-ready, it must:

  1. , the shared communication protocol for the OCN

  2. in order to sign and verify OCN messages

Access the full OCN technical documentation .

1. Implement the

The OCPI protocol is the common communication protocol for the OCN. Each OCN node implements the OCPI 2.2 API (see, for example, the Kotlin implementation of the OCPI 2.2 API for the OCN node ), and every backend-service that communicates with an OCN node must also implement the OCPI 2.2 API.

Using the OCN Bridge

Using the is an alternative to implementing the full OCPI 2.2 API in your backend service. The OCN Bridge provides an OCPI interface using pluggable backend APIs. You can instantiate an instance of the Bridge, which will proxy your requests and responses with other OCN parties.

In addition to the OCPI 2.2 implementation, the OCN Bridge also provides services to interact with an OCN node (i.e. register with a node, get connection status to a node) and the OCN Registry.

Examples:

You can view documentation on how to to implement the OCN Bridge .

The OCN Bridge simplifies the implementation of the OCPI interface, but it is not required to use in your backend service. Note that the OCN Bridge can only be implemented in JavaScript environments.

2. Implement the

The OCN Notary is a package that enables the verification of OCN signature, which are used to sign and verify OCN requests using public/private key-pairs.

OCN Signatures

Taking a cue from the blockchain community, we have developed a message signing and verifying system for the Open Charging Network.

Under the hood it uses the Elliptic Curve Digital Signature Algorithm (ECDSA) as implemented by Ethereum. The signature itself holds a JSON Object containing all the necessary data for the recipient to verify the data it is receiving.

Not only do requests need to be signed, but responses too.

Signing Requests

For requests, the signature is appended to the outgoing OCPI 2.2 headers:

Authorization: Token 0ea32164-515f-418b-8bef-39f3817ea090

X-Request-ID: 71d62c5b-5017-493e-be00-3f5ad4e34fff

X-Correlation-ID: 9881b6f7-63aa-40d2-b9c2-d6daa69c11fb

OCPI-From-Country-Code: CH OCPI-From-Party-Id:

MSP OCPI-To-Country-Code: CH OCPI-To-Party-Id:

CPO OCN-Signature: eyJmaWVsZHMiOlsiJFsnaGVhZGVycyddWyd4L (truncated)...

Signing Responses

For responses, the signature is appended to the outgoing OCPI 2.2 JSON response body:

{

"status_code": 1000,

"data": { "result": "ACCEPTED" },

"timestamp": "2020-03-02T12:48:33.005Z",

"ocn_signature": "eyJmaWVsZHMiOlsiJFsnaGVhZGVycyddWyd4L (truncated)..."

}

The idea is that the recipient can use this signature to verify that the message has been signed correctly and has not been modified by an unauthorized party.

What do we mean by unauthorized?

For the OCN to function properly, there are cases where an intermediary (i.e. an OCN node) needs to modify the request/response. Such an example would be the response_url in the JSON body of requests made to the receiver interface of the OCPI commands module. As the recipient does not have access to the response_url defined by the sender, the OCN Node must modify the value. In an OCN signature, this is known as “stashing”. The signature object contains the history of rewrites, with the previous signature being stashed by the party modifying the data. When a recipient then verifies a signature, the rewrites are also verified.

Let’s take a closer look at what the signature actually is:

interface Signature {

val fields: Array val hash: String

val rsv: String

val signatory: String

val rewrites: Array

}

interface Rewrite {

val rewrittenFields: Map<String, Any?>

val hash: String

val rsv: String

val signatory: String

}

The signature itself contains everything needed to verify the most-recent version of the sent data, i.e. by the sender or OCN node depending on whether any values needed to be modified. Provided is a list of jsonpath fields which can be used to recreate the message as signed by the sender, with the original order of values preserved. The values are hashed using keccak-256, as implemented by Ethereum. The resultant hash is actually the message which is signed. The RSV is the signature, produced by ECDSA using an Ethereum wallet’s private key. The signatory refers to the address of the wallet that was used to sign the message.

The list of rewrites contains an object containing the previous hash, rsv and signatory. It also allows the original message to be recreated by storing the fields which have been rewritten. For example, a commands receiver request might have the following rewrite by the OCN node:

1Rewrite( 2 rewrittenFields = mapOf("$['body']['response_url']" to "https://emsp.net/ocpi/2.2/sender/commands/START_SESSION/acfbb8d2-bd49-4837-97e2-d2c38f6bae55"), 3 hash = "0x1ce93f156bc5b3a5c26c5f2499db7bfa2b38c37fd32616fc6487175b86f41eb2", 4 rsv = "0x16e8b9c4e44f4646235fca85a594b5a31057930676d338d111ae985a4f0d9d4214705a0a2ae18c4dfd014581e96eb4625137a937853d4b2d17a0f3a22750f6ac1c", 5 signatory = "0x25e4fca0a0e5107d06d71ed78f687827208d5ff9" 6)

The Signatory

Of course, the signatory of both the OCN Signature and its rewrites should be independently validated. The verification of the signature only tells us that the message was signed by the signatory provided. The signatory itself could be any Ethereum wallet address. The address of both the original sender and their OCN node can be found in the OCN Registry[link to repo].

Now that we know how the signature functions, how do we actually use it? Enter the .

Implementing the OCN Notary

The OCN Notary implements the above Signature and Rewrite interfaces. It can deserialize an incoming OCN Signature and verify its contents. It can be used to sign an OCPI request, and likewise to stash/rewrite values in a request.

Currently the Notary library is available as an and as a Maven package for languages targeting the JVM. See the to find more information for each package.

OCN Network v1.0 Open API 3.0 Specs

You can find the API specification document in the OCN Node repository, here:

Using this specification, it is possible to generate client code and test implementations. For more information, see .

Note that this document was generated using unmodified source code in the master branch. As such, certain features of the specification format might be missing, such as examples for HTTP requests and responses.

Open Source Development

The Open Charging Network is a community project by and for the Electric Vehicle Charging community. Its mission is to provide the EV Charging industry players an open, secure and decentralized network for digital interoperability. This is why the core components are developed open source under the .

The development of the Open Charging Network is driven and steered by the non-profit Energy We Foundation. Many users and community members are contributing to it in the form of feedback, raised issues, pull requests and dedicated working groups. This article should provide you with some guidance on how you can contribute to this project.

Access the full OCN technical documentation .

Version Management

The production-ready version of every Open Charging Network component can be found in its MASTER BRANCH

Development of each component can be found in its DEVELOP BRANCH. Pull requests should therefore generally derive from the develop branch, which will be eventually merged into the master branch to coincide with the release of a new version.

Bare in mind that new features that are big enough may warrant their own feature branch so that multiple contributors can work on them before being merged into the development branch.

Maturity Model, Feature Roadmap and Releases

  • The current state of development is made transparent with a maturity model, which describes the current and planned feature set:

  • Monthly Developer Community Calls are being hosted to align the development of all software components. Anyone is invited to join. Learn more about it

Community support

If you need support in using or contributing to the Open Charging Network, use our .

Reporting bugs and contribute with coding

Issues are raised, described and prioritized in our .

You can contribute fixes to bugs or new features by sending via the GitHub repository. Using the GitHub UI, a pull request can be initiated from a branch in a fork of repository.

Before we can include your contributions to the Open Charging Network code, you need to give us permission. As the author of any creative work (including source code, or documentation), you control the copyright for that work. Energy Web Foundation Foundation can’t legally use your contribution unless you allow us to.

To manage this process, we use a mechanism called a popularized by The Linux Foundation. The DCO is a legally binding statement that asserts that you are the creator of your contribution, and that you license the work under the .

Please take the following steps so that we can include your work:

1. Each source file must include the following header:

2. Each commit must include your sign-off

Your sign-off certifies that you are either the author of the contribution or have the right to submit it under the Apache 2.0 license used by the Share&Charge project. The sign-off is done by adding the following line to your source code:

You must use your real name. Pseudonyms or anonymous contributions are not allowed.

If you set your user.name and user.email as part of your Git configuration, you can sign your commit automatically with git commit -s.

More tips on how to sign-off your work with Git can be found on this website:

The full text of the DCO is:

Sign-In with Ethereum

Sign-in with Ethereum (SIWE) is an open standard for decentralized authentication that allows users to sign in to websites and applications using their Ethereum accounts. Unlike traditional centralized authentication methods, this innovative approach allows users to access various online services and applications using their Ethereum wallet address and cryptographic keys. This groundbreaking login solution represents a significant step forward in the evolution of decentralized identity management, empowering users with enhanced privacy and ownership of their digital identities.

Why SIWE?

The Ethereum Foundation and Ethereum Name Service (ENS) had put forward a for Sign-in with Ethereum in 2021, based on EIP-4361 (). The reference implementation of Sign-In with Ethereum by SpruceID ( ) provides an easy integration with Application’s Identity services and assures smooth Sign-In user experience. It has numerous benefits over other PKI based signatures, such as :

  1. A standard human readable verifiable message to confirm signatures.

  2. An EIP-standard message schema to incorporate all the information needed for a secure authentication.

  3. Verification for domain and uri, this assures the authenticity of the requester / verifier. Users can validate the domain the transaction was initiated from and the URI to which the access would be provided to (redirection) upon signing for authentication / authorization.

  4. Preventing replay attacks with a nonce, which could be a challenge from a server or a random token .

SIWE message template

Message Field Descriptions

authority is the RFC 3986 authority that is requesting the signing. address is the Ethereum address performing the signing conformant to capitalization encoded checksum specified in EIP-55 where applicable. statement (optional) is a human-readable ASCII assertion that the user will sign, and it must not contain '\n' (the byte 0x0a). uri is an RFC 3986 URI referring to the resource that is the subject of the signing (as in the subject of a claim). version is the current version of the message, which MUST be 1 for this specification. chain-id is the EIP-155 Chain ID to which the session is bound, and the network where Contract Accounts must be resolved. nonce is a randomized token used to prevent replay attacks, at least 8 alphanumeric characters. issued-at is the ISO 8601 datetime string of the current time. expiration-time (optional) is the ISO 8601 datetime string that, if present, indicates when the signed authentication message is no longer valid. not-before (optional) is the ISO 8601 datetime string that, if present, indicates when the signed authentication message will become valid. request-id (optional) is an system-specific identifier that may be used to uniquely refer to the sign-in request. resources (optional) is a list of information or references to information the user wishes to have resolved as part of authentication by the relying party. They are expressed as RFC 3986 URIs separated by "\n- ".

Sample SIWE Message :

Given all these advantages, Sign in with Ethereum proved to be an ideal choice for Energy Web in implementing authentication for our decentralized applications (DApps). Authentication with SIWE is supported by our Passport strategy (available in passport-did-auth from v2.0.0 ).

How it works?

A signature request with Metamask SIWE will look something like :

Note: The text block in the above MetaMask pop-up for signing is the SIWE message.

Major security considerations for SIWE

Preventing replay attacks

  • During each session initiation, it is crucial to select a nonce with sufficient entropy to thwart replay attacks – a type of man-in-the-middle attack where an adversary intercepts the user's signature and uses it to initiate a new session on their behalf.

  • To ensure security, implementers have the option to utilize privacy-preserving but readily accessible nonce values. For instance, they may consider using a nonce derived from a recent Ethereum block hash or a recent Unix timestamp. These methods offer a balance between safeguarding privacy and ensuring widespread applicability.

Verification of domain binding

  • Wallets are required to verify that the domain aligns with the actual source of the signing request.

  • It is recommended to cross-check this value with a trusted data source, such as the browser window, or through another reliable protocol. By doing so, wallets can enhance security and mitigate potential risks associated with fraudulent or unauthorized signing requests.

SIWE with Federated Identity service

Many organizations aim to deploy a unified Identity Service that can be utilized across all federated services, employing OpenID Connect for efficient user session management. Thanks to SIWE-OIDC (), this objective has now become achievable.

Current scope for SIWE-OIDC

SpruceID has deployed an OpenID Connect Provider (OP) which has support for SIWE and hosted under SIWE Open ID Connect . This deployment is a DAO-governed OP supported by ENS DAO.

To use the hosted OIDC server it is required to register the application as an OIDC client using the OIDC client registration of SIWE Open ID Connect . Currently, no user interface for OIDC client registration is supported. For that reason, developers will need to use the REST API.

The following is an example response:

A client can then be updated or deleted using the registration_client_uri with the registration_access_token as a Bearer token. The authentication could be similar to

Note : This flow is just a possible flow, it could be different for a different use case.

Apart from the existing functionalities offered by SIWE, there is potential for future extensions, including support for Decentralized Identifiers and Verifiable Credentials, as well as integration with EIP-712 for Type structured data hashing and signing.

Deploy a Smart Contract on Volta with Remix

Below are steps to deploy a on the (the test network for the ) using . Remix is a web application used to compile, deploy and test smart contracts on Ethereum networks.

In order to deploy a smart contract to the Energy Web Chain Main Network, rather than the Volta Test Network, the steps are identical, except that you will connect your MetaMask to the Energy Web Chain rather than to Volta. We recommend that you always deploy and test your smart contracts to Volta first to make sure they behave as expected.

Once your smart contract is deployed, you can use the contract's ABI and address on the blockchain to interact with its public methods. For more information on how to interact with smart contracts, go .

1. Configure MetaMask to connect to the Volta Test Network

You can see steps for doing this are . If you do not have a MetaMask installed, you can do so .

2. Get Volta Tokens

You will need to to pay for the transaction fee for deploying the smart contract to the blockchain. For directions on how to get Volta Tokens, go . To learn more about what transaction fees are, you can go .

*Note that if you are deploying to the Energy Web Main Network, you will need to have .

3. Navigate to

4. Navigate to the "Deploy and Run Transactions" icon on the left panel (shown below).

In the "Environment" dropdown, selected "Injected Web3". Notice that when you select this, "Custom (73799) network shows up. 73799 is the Volta Test Network - this confirms that we are connected to the Volta network via MetaMask.

5. Confirm the connection on MetaMask

You will need to confirm the connection to MetaMask.

6. Create a simple smart contract

Go to the file explorer panel (select the first icon on the left panel). Add a new .sol file in the 'Contracts' folder. Below it is called VoltaContract.sol.

In the .sol file, add the following code:

7. Compile the smart contract

If there are no errors, click "Compile VoltaContract.sol" (make sure that the 'Language' selected is 'Solidity').

8. Copy the deployed contract's (Application Binary Interface)

If you want to interact with your contract in the future using an API client, you will need the contract's ABI. The ABI is in the bottom right hand corner of the Solidity Compiler page after it is compiled.

9. Deploy the smart contract

Click 'Deploy' to deploy the contract to Volta Test Network.

Confirm the transaction in MetaMask. Make sure that you have some gwei as a gas price by doing the following:

Select EDIT

Select "Edit suggested gas fee"

Make sure you have a Gas price of 6e-8 GWEI (this should be autofilled)

Confirm the transaction in MetaMask

10. See and test the deployed transaction

Once your contract is deployed, you can see it in the "Deployed Contracts" section of the same page ("Deploy and Run Transactions")

Click on "get" to test our contract's functionality. Remember from the code that is should just return a string "Volta".

11. See deployed contract on the Volta Block Explorer

Copy the address of the contract by clicking the copy icon.

Go to the . If you are deploying to the main network, the block explorer is .

Paste the contract address in the search bar at the top right:

You can see the smart contract address details, the block it was created in, and the byte code. The block explorer contract details from the example above is .

12. Use your smart contract in dapps

Now that you have your smart contract's address on the blockchain and its ABI, you can use an Ethereum API client to interact with your contract in your decentralized applications. For a tutorial on how to do this, go .

SSI Credential Governance using ENS Domains

Governance frameworks in the IAM stack

Governance

Governance provides the rules and procedures to establish behavior, expectations and trust within an environment. While governance is a critical component of any multi-party network, it is especially critical in decentralized environments, where there is no central authority to define and orchestrate governance mechanisms over every component of the ecosystem.

As an example, consider an application built on top of the . Each application must ensure that:

  • Components are in compliance with existing digital frameworks that their application depends on (e.g. , peer-to-peer protocols or )

  • The application has a governance framework that is robust enough to garner stakeholder trust and compliant participation within the application itself (i.e. defining and enforcing who is allowed to do what within the application)

Governance Frameworks

Governance in a network is established through a governance framework (also referred to as a trust framework). The framework provides concrete policies, rules and expectations for the stakeholders within the network.

Energy Web IAM Governance Framework

Energy Web’s IAM governance relies on two systems: and . Used together, these components provide a governance framework for users to interact with the digital infrastructure, and with other users in a secure and self-sovereign manner.

Role credentials are associated with a user’s , which is anchored on the Energy Web Chain in the . This means that a user’s roles and credentials are not siloed within any one application; because a user can use their DID to register with any application built on top of the Energy Web Chain, their roles and credentials are portable.

Role-based Hierarchies

In the Energy Web IAM ecoystem, role-based hierarchies are defined by organizations, applications, and designated roles within them. The tech stack leverages to define and namespace relational hierarchies within a system. We decided to deploy our own copy of ENS on the Energy Web Chain as it provides a standard set of widely-used, well-tested smart contracts. Read more about the ENS smart contracts deployed on the Energy Web Chain .

The namespace hierarchy is built on four levels:

  1. Organization: a top-level organizing body

  2. Sub-organization(s)

  3. Application: a distinct service or functionality provided by an organization or sub-organization

  4. Role: a distinct functionality within an application or within an organization

Role-definition properties

When roles are created within an organization or an application, the creator can define conditions or criteria that restrict who is qualified to take on the role. The role creator can also determine which users (by DID or role) are authorized to issue or revoke a role.

Below is a resolved role definition for a role of "install lead". Note that it contains an enrollment precondition that the subject already has the role (credential) of 'project installer'. The role definition also specifies an expiration date, and asserts that only users that have the role of 'install manager' can issue or revoke this role.

Verifiable Credentials

Verifiable Credentials enable users and their assets to take on (that is, within an organization, a sub-organization or an application within a hierarchy, as discussed ).

See more extensive documentation on credentials in the IAM stack .

IAM Stack Governance Components

provides the user interface for creating and defining these hierarchies. See the Switchboard guide on Governance and role creation .

The supporting provide the functionality for persisting and resolving namespaced domains Namespace domains that are registered and managed in the . Read more about the role of Ethereum Name Space in Energy Web Digital Infrastructure .

These libraries also support governance by providing credential verification mechanisms. This is discussed further in the .

Additional Resources

Energy Web Block Explorer

The block explorer interface provides the most important on-chain information about blocks, transactions, accounts and . Below is an overview of what information you can view on the Block Explorer.

Note that there is a separate site for the Volta Testnet Block Explorer.

  • Volta Testnet Block Explorer:

  • Main Network Block Explorer:

Block Explorer Overview

Blocks

  • - block details for all sealed blocks

    • Block Height

    • Num transactions

    • Hash

    • Parent Hash

    • Difficulty

    • Total Difficulty

    • Gas Used

    • Gas Limit

    • Block Rewards

    • Miner (validator)

    • Transactions

Transactions

  • - transaction details for all validated transactions

    • Transaction address

    • Status

    • Block Number

    • Nonce

    • Transaction fee

    • Transaction Speed

    • Raw input

    • Gas

    • Internal Transactions

  • - transaction details for all pending transactions

    • Transaction address

    • Nonce

    • Gas limit

    • Internal Transactions

Account details for all external and smart contract account addresses with balances and associated transactions

  • Address

  • Token balance

  • Num. transactions

  • Last balance update

  • Gas used

  • All transactions

  • Coin balance history

Tokens

APIs

  • GraphQL: GraphQL interface which you can use to query specific information that are on chain: . To find out more about the possible queries visit:

The Energy Web Chain
public async getNodeInfo(nodeURL: string): Promise<INodeInfo> {
    const res = await fetch(new URL("/ocn/registry/node-info", nodeURL).href)
    return res.json()
}
Implement the OCPI 2.2 API
Implement the OCN Notary
here
OCPI 2.2 API
here
OCN Bridge
here
OCN Notary
OCN Notary
NPM package
OCN Notary repository
Open API 3.0 specs
https://swagger.io/docs/specification/about/
Copyright 2020 Your Name or Organization>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Signed-off-by: John Doe <[email protected]>
Developer's Certificate of Origin 1.1
 
By making a contribution to this project, I certify that:
 
(a) The contribution was created in whole or in part by me and I
     have the right to submit it under the open source license
     indicated in the file; or
 
(b) The contribution is based upon previous work that, to the best
     of my knowledge, is covered under an appropriate open source
     license and I have the right under that license to submit that
     work with modifications, whether created in whole or in part
     by me, under the same open source license (unless I am
     permitted to submit under a different license), as indicated
     in the file; or
 
(c) The contribution was provided directly to me by some other
     person who certified (a), (b) or (c) and I have not modified
     it.
 
(d) I understand and agree that this project and the contribution
     are public and that a record of the contribution (including all
     personal information I submit with it, including my sign-off) is
     maintained indefinitely and may be redistributed consistent with
     this project or the open source license(s) involved.
Apache license Version 2.0
here
Maturity Model, Feature Roadmap and Releases.
here.
Stack Overflow tag
repositories on GitHub
pull requests
Developer Certificate of Origin (DCO)
Apache License Version 2.0
DITA Open Toolkit
${domain} wants you to sign in with your Ethereum account:
${address}

${statement}

URI: ${uri}
Version: ${version}
Chain ID: ${chain-id}
Nonce: ${nonce}
Issued At: ${issued-at}
Expiration Time: ${expiration-time}
Not Before: ${not-before}
Request ID: ${request-id}
Resources:
- ${resources[0]}
- ${resources[1]}
...
- ${resources[n]}
switchboard-dev.energyweb.org wants you to sign in with your Ethereum account:
0x09622D91d6aA98385f40D3D0713BaA66baF3281A


URI: https://identitycache-dev.energyweb.org/v1/login/siwe/verify
Version: 1
Chain ID: 73799
Nonce: wRiKroUIa9LuYWWeG
Issued At: 2023-03-07T09:07:46.050Z
curl -X POST https://oidc.signinwithethereum.org/register
   -H 'Content-Type: application/json'
   -d '{"redirect_uris": ["<https://<your.comaind>/cb"]}'>
{
"client_id": "9b49de48-d198-47e7-afff-7ee26cbcbc95",
"client_secret": "er...",
"registration_access_token": "2a...",
"registration_client_uri": "https://oidc.signinwithethereum.org/client/9b49de48-d198-47e7-afff-7ee26cbcbc95",
"redirect_uris": ["https://<your.domain>/cb"]
}
Request for Proposal
ERC-4361: Sign-In with Ethereum
SpruceID
OpenID Connect Identity Provider for Sign-In with Ethereum
SIWE Authentication
Switchboard with SIWE
{   
    roleName: "installlead",
    defaultValidityPeriod: 31536000000,
    enrolmentPreconditions: [{
        conditions: ['projectinstaller.roles.testdidproject.apps.suborgs.whitney.iam.ewc'],
        type: role 
    }],
    issuer: {
        issuerType: "ROLE",
        rolename: "installmanager.roles.suborgs.whitney.iam.ewc"
    },
    revoker: {
        issuerType: "ROLE",
        rolename: "installmanager.roles.suborgs.whitney.iam.ewc"
    },
    
    roleType: "org",
    version: 1,
    issuerFields: [],
    requestorFields: []
}
Energy Web Chain
cryptocurrency wallets
smart contracts
role-based hierarchies
verifiable credentials
Decentralized Identifier (DID)
DID registry
Energy Web’s Ethereum Name Service
here
roles within a system
above
here
Switchboard
here
IAM libraries
Energy Web Ethereum Namespace smart contracts
here
Credential documentation
"Unlocking the Potential of Self-Sovereign Identity for Enterprise with Energy Web Switchboard" on Medium
"How Switchboard Tackles the Challenge of Enterprise Identity Management" on
Medium
"Ethereum Name Service (ENS) is now available for the Energy Web" on Medium
Energy Web IAM Namespace Hierarchy

Proof-of-Authority Consensus Mechanism

Blockchain Consensus

In a centralized system, such as a bank or a broker, a designated authority or central operating system would be in charge of adding transactions or information to the system, making sure that each transaction is trustworthy, up to date with the whole system, and does not duplicate previous transactions.

In contrast, public blockchains are decentralized, peer-to-peer systems that have no central authority or oversight like this. Designated actors are responsible for processing transactions, creating new blocks and maintaining the integrity and history of previous blocks.

The system for determining these actors and how they are selected is called a consensus mechanism. These mechanisms determine the process of who can confirm transactions and create new blocks on the blockchain and the protocol for how they do so. Because there is no central oversight, consensus needs to be designed in a way that prevents or disincentivizes malicious or uninformed actors from corrupting the integrity of the chain.

There are many consensus algorithms. You may have heard of some widely used ones like Proof-of-Work or Proof-of-Stake. Each mechanism has its own way of determining who is eligible to process transactions and create new blocks, and how how actors are selected to do so.

The Energy Web Chain uses the Proof-of-Authority (PoA) consensus mechanism.

All consensus mechanisms have disadvantages and advantages and are chosen based on the purpose and use case of the blockchain it will be serving. You can read more about why Energy Web employs the Proof-of-Authority mechanisms below.

Proof-of-Authority Consensus

The Proof-of-Authority (PoA) consensus mechanism has a defined set of actors that validate transactions and propagate new blocks to the chain. Rather than competing or staking for a chance to add blocks, they take turns creating new blocks in a round-robin style. These actors are called validators.

Energy Web validators participate by running full nodes of the blockchain using OpenEthereum client software. Smart contracts called Validator-Set contracts have the functionality to add or remove validators. Anyone can run a full node of the blockchain, but only addresses that are included in the Validator-Set contracts can validate transactions and seal blocks. You can read about the Energy Web Chain's Validator Set Contracts here.

The Energy Web Chain uses a specific type of PoA called Authority Roundtable (AuRa). The AuRa Proof-of-Authority consensus mechanism can be used by blockchains that run the OpenEthereum client.

You can read more about the validator process below.

For more in-depth information on Proof-of-Authority, read the Authority Roundtable Proof-of-Authority white paper

Energy Web Chain Validators

In other consensus mechanisms, such as Proof-of-Work or Proof-of-Stake, miners can remain anonymous. So long as they meet the proof-of-work or staking requirements, they can process transactions on the blockchain and in many cases do so anonymously.

Validators are not anonymous. They have applied to become a validator and have undergone a a KYC (“Know Your Customer”) process as part of their application. Our validators are well-known members of the energy community, meet the eligibility requirements and the hardware/software installation specifications to become a validator, and they have a vested interest in the Energy Web Chain’s performance. You can see a full list of Energy Web Chain validators here.

Validator Functions

  1. Validators create blocks: The fundamental role of the Proof-of-Authority validator is to validate transactions, compile valid transactions into blocks and propagate new blocks to the network.

  2. Validators provide network security: By storing the current and historical state of the Energy Web Chain, each validator contributes to the overall integrity and security of the network. Since at least 51% of validators are required to sign each block before it is finalized on the chain, validators provide checks and balances against any erroneous or malicious attempts to publish falsified transactions or alter historical data. Physical decentralization of validator nodes provides redundancy in the event that one or more validators is unavailable due to technical reasons or otherwise compromised.

  3. Validators participate in the the Energy Web Chain's governance: Validators will be asked to offer opinions and contribute to technical and non-technical decisions relating to modifications of the Energy Web client, protocol and validator set.

Why Proof-of-Authority?

Energy Web uses Proof-of-Authority consensus for three primary reasons that benefit the Energy Web’s digital infrastructure, the energy sector that will use the technology, and the environment as a whole.

  1. To enable transaction capacity on the order of hundreds to thousands of transactions per second: we estimate that the Energy Web Chain has the ability to achieve 30x greater throughput capacity than the Ethereum Mainnet;

  2. To minimize resource (i.e. electricity and computation) consumption, and subsequently, transaction costs: Eliminating competitive Proof-of-Work results in 54,000x less energy consumption and 350x lower network costs (i.e. costs incurred by organizations hosting validator nodes) which translates into lower and more stable transaction costs;

  3. To improve compliance with relevant regulations and business requirements in the energy sector: substituting fully anonymous miners for vetted validators enhances the ability of decentralized applications to comply with various regulations, including data-protection regulations like GDPR, and increases the likelihood of widespread user and enterprise adoption.

To improve compliance with relevant regulations and business requirements in the energy sector: substituting fully anonymous miners for vetted validators enhances the ability of decentralized applications to comply with various regulations, including data-protection regulations like GDPR, and increases the likelihood of widespread user and enterprise adoption.

Proof-of-Authority Process

At a high level, the PoA mechanism works as follows:

  1. All validator nodes maintain a complete list of the validators, identified by public keys. This list changes as validators are added or removed. In addition to storing the current and historical state of the network, all validators maintain essential information about the network (such as synchronized timing information and current data processing limits).

  2. For a defined time window, one validator is assigned as the primary validator via the PoA algorithm. During this time, they are responsible for collecting the broadcasted transactions and proposing the new block. Only one validator is designated as primary at a time–based on a calculation derived from the timestamp on synchronized clocks among the validator nodes in the network and the number of validators–in order to prevent validators from arbitrarily creating blocks at irregular intervals.

  3. If a validator fails to create a block when it is selected (e.g., because of hardware problems on the side of the validator) or its block fails to be validated by the pool of nodes (e.g., because of network connectivity problems), the next validator proceeds to create a block with whatever transactions haven’t been processed.

  4. The remaining validator nodes verify that the transactions in each block are legitimate for that time window, sign the block with their private keys, and propagate the signed block to the network.

  5. Once a simple majority of validators have authored a block on top of a given signed block, finality is achieved for that given block, and the block is confirmed by the network and added to the chain.

Additional Resources

  • AuRa Proof-of-Authority white paper

  • “What is "proof of work" and "proof of stake"? On CoinBase

  • “Blockchain Consensus: A Simple Explanation Anyone Can Understand” on Blockgeeks

Tutorial on connecting a party at minute 12:29
Tutorial on running an OCN Node at minute 2:50
pragma solidity >=0.4.0 <0.7.0;

contract SimpleReturn {
    function get() public pure returns (string) {
        return "Volta";
    }
}
smart contract
Volta Test Network
Energy Web Chain
Remix
here
here
here
Volta tokens
here
here
EWT
remix.ethereum.org
ABI
Volta Block Explorer (volta-explorer.energyweb.org)
explorer.energyweb.org
here
here
Select Edit
Returns string "Volta"
Block explorer details for contract created
Interacting with Smart Contracts in EW-DOS
https://gist.github.com/ngyam/07d34631fa0e899e5896303b5ec92a3c
https://gist.github.com/ngyam/4393eb96ada896b62afc922b760c6802
Energy Web Token (EWT)
https://volta-explorer.energyweb.org/
https://explorer.energyweb.org/
Blocks
Validated
Pending
Accounts
All
Bridged from Ethereum
Bridged from Binance Smart Chain
https://explorer.energyweb.org/graphiql
https://github.com/ConsenSys/ethql#query-handbook

Set up MetaMask to interact with Energy Web Chain

In this section, we'll walk through how to connect to the Energy Web blockchain, and the Volta testnet using the MetaMask browser extension.

is a browser extension and a mobile app that handles blockchain account management and helps users securely interact with a . It’s supported in Chrome, Brave, and Safari browsers, as well as it is available for Android and iOS devices. By default, you can connect to the Ethereum Mainnet or any of the Ethereum test network.

If you don’t have MetaMask installed install the extension first. Learn about here.

Connect MetaMask to the Energy Web blockchain

Prerequisite: Metamask plugin is installed in the browser; this section explains how to add the Energy Web blockchain to it.

Option1: Automatic configurator

To configure Metamask to connect to the Energy Web blockchain or to Volta, the fastest way to do that is using the or

Option2: Manual configuration

Manually configuring MetaMask to connect to the Energy Web mainnet

1. Click on the "Networks" dropdown at the top of your MetaMask interface and select "Custom RPC"

2. Add the new network using the following settings

3. Save the settings and switch to the newly added network 'EWC'

Manually configuring MetaMask to connect to the Volta testnet

1. Click on the "Networks" dropdown at the top of your MetaMask interface and select "Custom RPC" 2. Add the new network using the following settings

3. Save the settings and switch to the newly added network 'Volta'

Manually configuring MetaMask to connect to the Consortia RPC

The Consortia RPC is an alternative to using the Energy Web Mainnet RPC.

1. Click on the "Networks" dropdown at the top of your MetaMask interface and select "Custom RPC"

2. Add the new network using the following settings

Field
Value

Depending on what network you connected to, and if you have Energy Web tokens or Volta Tokens in your account, you should see your balance.

Video Tutorial

Assets as Ownable Smart Contracts

Assets in EW-DOS

In the context of EW-DOS, an Asset is a digital representation of a physical or virtual device on the Energy Web Chain. An Asset could represent, for example, a solar photovoltaic panel, a battery, an electric vehicle, or an IOT device.

Assets must have a Decentralized Identifier - DID in the Energy Web Chain's DID Registry in order to participate in applications and marketplace activities. Once an Asset has a DID, it can take on roles within an organization or application. This is discussed further below.

Asset Smart Contracts

Assets and their chain of custody are managed by smart contracts that are deployed on the Energy Web Chain.

IdentityManager smart contract

When an Asset is first created, it is registered in the IdentityManager smart contract as an owned identity (the owner address being the Asset owner, discussed below).

The main purpose of the IdentityManager smart contract is to have a on-chain location which aggregates known assets. In other words, it provides a kind of "asset-registry" functionality. This can allow one for instance, to more easily answer questions such as "how many assets have been registered in total?".

While there are many OfferableIdentity smart contracts, there is intended to be fewer IdentityManager smart contracts as the IdentityManager's main purpose is the aggregation of OfferableIdentity information. For instance, an enterprise could have a single IdentityManager to all assets which are registered by their employees.

OfferableIdentity smart contract

The Asset owner can offer ownership to another DID. The OfferableIdentity smart contract provides methods to verify, offer and transfer ownership of Assets (these concepts are discussed in further detail below).

Other contracts in the Ethereum ecosystem exist which track ownership such as popular NFT contract or contracts which implement ERC-173 such as ERC-725. However, a key requirement of Energy Web's asset implementation was that ownership transfers cannot be performed unilaterally and so these aforementioned options were not used.

Asset Owners

Every Asset must have an owner. Asset owners initiate the registration, transference and enrolment activity of their Assets. This requires them to make transactions on behalf of their Asset, so the owner must have an address on the Energy Web Chain that is connected to an Ethereum-compatible crypto-currency wallet such as MetaMask. The owner of an Asset is recorded in the Asset's identity on-chain.

Asset Chain-of-Custody

The iam-client-library Asset service provides high-level methods to facilitate the chain of custody for an Asset.

Chain-of-custody events (registration, ofference and transference) for an Asset are emitted from the IdentityManager smart contract. SSI Hub listens for and persists the details of these events. All historical owners of an Asset and the dates of offer, transference and acceptance are accessible through SSI Hub's API.

Register Asset

Registering as Asset involves creating an OfferableIdentity smart contract for the Asset on the Energy Web Chain, and registering its identity in the IdentityManager smart contract. This is initiated by the Asset owner. Because each Energy Web Chain address is a valid DID under the did:ethr DID method, each asset inherently has a DID.

Transfer Asset Ownership

The owner of a registered Asset can transfer ownership to another address on the Energy Web Chain. (The new owner's address must have signing capabilities in order to sign transactions associated with asset management).

The OfferableIdentity smart contract provides methods to facilitate Asset transferance. This contract makes calls to the IdentityManager smart contract so that the state of the Asset is updated at each phase of the transfer.

1. Offer Asset

When a transfer is initialized, an 'offer' of transfer is made to the recipient DID.

The state of the Asset identity is marked as 'offered' in the IdentityManager smart contract.

2a. Accept Asset

The DID that the Asset was offered to must accept the Offer before it is transferred to them. iam-client-library provides a method to accept the transfer. The Asset's owner is updated in the IdentityManager smart contract to reflect the new ownership.

2b. Reject Asset

The DID that the Asset was offered to has the option to reject the transfer. The Asset's 'offered' status in the IdentityManager smart contract is set to 'false'.

Asset Enrolment

An Asset can take on (enrol to) roles within an organization or an application. If their enrolment request is approved by the role issuer, the Asset is issued a role-based verifiable credential.

Read more about role-based credentials in the documentation here

Read more about credentials in the IAM stack here.

  • If the Asset's owner is an authorized issuer of the desired role, the Asset owner can directly issue a role-based verifiable credential to their Asset.

  • If the Asset's owner is not an authorized issuer of the desired role, the owner can submit an enrolment request on behalf of their Asset to the issuer.

iam-client-library provides the high-level methods to request and issue enrolments. See the API documentation here.

Using and Managing Assets in EW-DOS

Switchboard provides an interface for users to register, transfer and enroll Assets. If you are logged into Switchboard, you can view the Asset management interface here.

iam-client-library contains the high-level functions for managing (registering, fetching, transferring, etc.) assets and their corresponding data. You can view the service API documentation for Assets in the library here.

Use Case: Stedin Decentralized Asset Management

Energy Web and the distribution system operator (DSO) Stedin jointly developed a decentralized energy asset management system leveraging the EW-DOS components and architecture discussed above.

The goal of this collaboration was to:

  • Facilitate secure, encrypted communication between distributed energy resources (DERs) (i.e. solar panels, batteries, etc) and the grid

  • Enable DERs to provide grid services (e.g. selling excess energy back to the grid)

Grid assets (e.g, smart meters, distribution automation devices), and distrubuted energy resources (DERs) were assigned DIDs. The DID is anchored on the asset's pre-existing SIM cards. Each asset exists as an identity in the IdentityManager smart contract on the Energy Web Chain. Cryptographically signed information (such as control signals and commands) from the DSO (Stedin) can then be sent to targeted assets. This allows for an awareness and exchange of grid services between the DSO and DERs.

You can read more about this use case in the official press release here.

Run RPC Node using Nethermind client

Nethermind Client

  1. Download Nethermind Client

  2. Full specification for Nethermind configuration options can be found here:

    1. https://docs.nethermind.io/

    2. https://docs.nethermind.io/get-started/system-requirements

  3. Run the following command in your terminal -

Run RPC node in Volta Network

chmod +x nethermind
# To run a Full node
./nethermind --config volta 

# To run an Archive node
./nethermind --config volta_archive

Run RPC node in EWC Network

# To run a Full node
./nethermind --config energyweb

# To run an Archive node
./nethermind --config energyweb_archive

Your local node should start:

2024-03-05 13-54-12.2501|Nethermind starting initialization.
2024-03-05 13-54-12.2939|Client version: Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
2024-03-05 13-54-12.2980|Loading embedded plugins
2024-03-05 13-54-12.2981|  Found plugin type Nethermind.Consensus.AuRa.AuRaPlugin
2024-03-05 13-54-12.2982|  Found plugin type Nethermind.Consensus.Clique.CliquePlugin
2024-03-05 13-54-12.2983|  Found plugin type Nethermind.Consensus.Ethash.EthashPlugin
2024-03-05 13-54-12.2983|  Found plugin type Nethermind.Consensus.Ethash.NethDevPlugin
2024-03-05 13-54-12.2983|  Found plugin type Nethermind.Hive.HivePlugin
2024-03-05 13-54-12.2983|  Found plugin type Nethermind.UPnP.Plugin.UPnPPlugin
Resolved executing directory as /home/ubuntu/neth/nethermind-1.25.4.
2024-03-05 13-54-12.3211|Loading 12 assemblies from /home/ubuntu/neth/nethermind-1.25.4/plugins
2024-03-05 13-54-12.3212|Loading assembly Nethermind.Init
2024-03-05 13-54-12.3230|Loading assembly Nethermind.Merge.AuRa
2024-03-05 13-54-12.3254|  Found plugin type Nethermind.Merge.AuRa
2024-03-05 13-54-12.3255|Loading assembly Nethermind.HealthChecks
2024-03-05 13-54-12.3270|  Found plugin type Nethermind.HealthChecks
2024-03-05 13-54-12.3271|Loading assembly Nethermind.EthStats
2024-03-05 13-54-12.3276|  Found plugin type Nethermind.EthStats
2024-03-05 13-54-12.3277|Loading assembly Nethermind.Consensus.AuRa
2024-03-05 13-54-12.3315|Loading assembly Nethermind.Optimism
2024-03-05 13-54-12.3330|  Found plugin type Nethermind.Optimism
2024-03-05 13-54-12.3331|Loading assembly Nethermind.JsonRpc.TraceStore
2024-03-05 13-54-12.3338|  Found plugin type Nethermind.JsonRpc.TraceStore
2024-03-05 13-54-12.3338|Loading assembly Nethermind.Mev
2024-03-05 13-54-12.3361|  Found plugin type Nethermind.Mev
2024-03-05 13-54-12.3361|Loading assembly Nethermind.Init.Snapshot
2024-03-05 13-54-12.3365|  Found plugin type Nethermind.Init.Snapshot
2024-03-05 13-54-12.3366|Loading assembly Nethermind.Merge.Plugin
2024-03-05 13-54-12.3393|  Found plugin type Nethermind.Merge.Plugin
2024-03-05 13-54-12.3394|Loading assembly Nethermind.AccountAbstraction
2024-03-05 13-54-12.3419|  Found plugin type Nethermind.AccountAbstraction
2024-03-05 13-54-12.3420|Loading assembly Nethermind.Api
2024-03-05 13-54-12.4062|Loading standard NLog.config file from /home/ubuntu/neth/nethermind-1.25.4/NLog.config.
2024-03-05 13-54-12.4908|NLog.config loaded in 83ms.
2024-03-05 13-54-12.4915|Reading config file from /home/ubuntu/neth/nethermind-1.25.4/configs/volta.cfg
2024-03-05 13-54-12.5428|Configuration initialized.
05 Mar 13:54:12 | RocksDb Version: 8.3.2 
05 Mar 13:54:12 | Loading chainspec from embedded resources: /home/ubuntu/neth/nethermind-1.25.4/chainspec/volta.json 
05 Mar 13:54:12 | CPU:  (CT) 
05 Mar 13:54:12 | Using http://ipv4.icanhazip.com to get external ip 
05 Mar 13:54:12 | Setting up memory allowances 
05 Mar 13:54:12 |   Memory hint:          768 MB 
05 Mar 13:54:12 |   General memory:        32 MB 
05 Mar 13:54:12 |   Peers memory:          25 MB 
05 Mar 13:54:12 |   Netty memory:         134 MB 
05 Mar 13:54:12 |   Mempool memory:       110 MB 
05 Mar 13:54:12 |   Fast blocks memory:    46 MB 
05 Mar 13:54:12 |   Trie memory:           83 MB 
05 Mar 13:54:12 |   DB memory:            335 MB 
05 Mar 13:54:12 | Generating private key for the node (no node key in configuration) - stored in plain + key store for JSON RPC unlocking 
05 Mar 13:54:14 | Store this password for unlocking the node key for JSON RPC - this is not secure - this log message will be in your log files. Use only in DEV contexts. 
05 Mar 13:54:16 | Block tree initialized, last processed is 0, best queued is 0, best known is 0, lowest inserted header , body , lowest sync inserted block number  
05 Mar 13:54:16 | Initializing 15 plugins 
05 Mar 13:54:16 |   Clique by Nethermind 
05 Mar 13:54:16 |   Clique by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   AuRa by Nethermind 
05 Mar 13:54:16 |   AuRa by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   Ethash by Nethermind 
05 Mar 13:54:16 |   Ethash by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   Optimism by Nethermind 
05 Mar 13:54:16 |   Optimism by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   NethDev by Nethermind 
05 Mar 13:54:16 |   NethDev by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   AuRaMerge by Nethermind 
05 Mar 13:54:16 |   AuRaMerge by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   Merge by Nethermind 
05 Mar 13:54:16 |   Merge by Nethermind initialized in 2ms 
05 Mar 13:54:16 |   MEV by Nethermind 
05 Mar 13:54:16 |   MEV by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   HealthChecks by Nethermind 
05 Mar 13:54:16 |   HealthChecks by Nethermind initialized in 1ms 
05 Mar 13:54:16 |   Hive by Nethermind 
05 Mar 13:54:16 |   Hive by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   Account Abstraction by Nethermind 
05 Mar 13:54:16 |   Account Abstraction Plugin: User Operation Mining Disabled 
05 Mar 13:54:16 |   Account Abstraction by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   EthStats by Nethermind 
05 Mar 13:54:16 |   EthStats by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   Snapshot by Nethermind 
05 Mar 13:54:16 |   Snapshot by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   TraceStore by Nethermind 
05 Mar 13:54:16 |   TraceStore by Nethermind initialized in 0ms 
05 Mar 13:54:16 |   UPnP by Nethermind 
05 Mar 13:54:16 |   UPnP by Nethermind initialized in 0ms 
05 Mar 13:54:16 | Loaded 0 static nodes from file: /home/ubuntu/neth/nethermind-1.25.4/Data/static-nodes.json 
05 Mar 13:54:16 | Skipping Account Abstraction network protocol 
05 Mar 13:54:16 | Now syncing nodes starting from root of block 0 
05 Mar 13:54:16 | No block tree levels to review for fixes. All fine. 
05 Mar 13:54:16 | Numbers resolved, level = Max(0, 0), header = Max(0, 0), body = Max(0, 0) 
05 Mar 13:54:16 | Beacon Numbers resolved, level = 0, header = 0, body = 0 
05 Mar 13:54:16 | Loading fork choice info 
05 Mar 13:54:16 | Grafana / Prometheus metrics are disabled in configuration 
05 Mar 13:54:16 | System.Diagnostics.Metrics disabled 
05 Mar 13:54:16 | Skipping Flashbots RPC plugin 
05 Mar 13:54:16 | Skipping Account Abstraction RPC plugin 
05 Mar 13:54:16 | Json RPC is disabled 
05 Mar 13:54:16 | 
======================== Nethermind initialization completed ========================
This node    : enode://15ec8f735368cf809735071cd607ee8e12fe86bbbc99c14161272c8a2253d4a7cf063d46b9cd201735011ae008687175b504bdcf45f8f20605a763d39b951044@15.188.207.110:30303
Node address : 0x1dc9ca5452806e178959506e100300d3566ec79f (do not use as an account)
Mem est tx   :    40 MB
Mem est DB   :     8 MB
Genesis hash : 0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5
External IP  : 15.188.207.110
Ethereum     : tcp://15.188.207.110:30303
Discovery    : udp://15.188.207.110:30303
Client id    : Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
Chainspec    : chainspec/volta.json
Chain head   : 0
Chain ID     : Volta
===================================================================================== 
05 Mar 13:54:17 | Changing state Disconnected to FastHeaders at processed: 0 | state: 0 | block: 0 | header: 0 | target block: 26907152 | peer block: 26907152 
05 Mar 13:54:17 | Sync mode changed from Disconnected to FastHeaders 
05 Mar 13:54:17 | Connected to 2 bootnodes, 7 trusted/persisted nodes 
05 Mar 13:54:20 | Changing state FastHeaders to FastSync, FastHeaders at processed: 0 | state: 0 | block: 0 | header: 26680000 | target block: 26907153 | peer block: 26907153 
05 Mar 13:54:20 | Sync mode changed from FastHeaders to FastSync, FastHeaders 
05 Mar 13:54:21 | Peers | with best block: 2 | all: 2 | eth66 (100 %) | Active: 2 Headers, 1 Bodies, 1 Receipts, 1 Blocks | Sleeping: None | OpenEthereum (100 %) 
05 Mar 13:54:21 | Old Headers       2,560 / 26,680,000 (  0.01 %) | queue     2,048 | current            0 Blk/s | total          640 Blk/s 
05 Mar 13:54:25 | Discovered new block 26907154 13:54:25 (0xbf2c2c...21b348), tx count: 0 miner 0xe6c064719623c5bc62ef51caa4639416f8634ab6, sent by [Peer|eth66|26907154|   3.121.165.10:30303| Out], with AuRa step 341929373 
05 Mar 13:54:26 | Old Headers       6,144 / 26,680,000 (  0.02 %) | queue         0 | current          717 Blk/s | total          683 Blk/s 
05 Mar 13:54:26 | Downloaded   26,680,637 / 26,907,154 ( 99.16 %) | current            0 Blk/s | total          128 Blk/s 
05 Mar 13:54:30 | Discovered new block 26907155 13:54:30 (0x702e54...a3e29f), tx count: 0 miner 0xc09e63b27775508b6599daf3b6dcbe09cf3f82ac, sent by [Peer|eth66|26907155|   3.121.165.10:30303| Out], with AuRa step 341929374 
05 Mar 13:54:31 | Old Headers       8,192 / 26,680,000 (  0.03 %) | queue         0 | current          410 Blk/s | total          585 Blk/s 
05 Mar 13:54:31 | Downloaded   26,681,653 / 26,907,155 ( 99.16 %) | current          203 Blk/s | total          167 Blk/s 
05 Mar 13:54:35 | Discovered new block 26907156 13:54:35 (0xa73994...be656b), tx count: 0 miner 0x20ea864187c1c1eaa613726ed4d211244209503c, sent by [Peer|eth66|26907156|   3.121.165.10:30303| Out], with AuRa step 341929375 
05 Mar 13:54:36 | Old Headers       9,728 / 26,680,000 (  0.04 %) | queue         0 | current          307 Blk/s | total          512 Blk/s 
05 Mar 13:54:36 | Downloaded   26,682,669 / 26,907,156 ( 99.17 %) | current          203 Blk/s | total          179 Blk/s 

Run a local node using Docker with Nethermind client

This section describes minimal setup to run an RPC node locally or on the server using Docker container run with docker-compose. This is solely for development purposes, it's not a production grade recommendation.

See Nethermind documentation for Docker: https://docs.nethermind.io/get-started/installing-nethermind#docker-container

Set up

  1. Verify that prerequisites are installed:

docker --version 
docker-compose --version 
  1. Create working directory

mkdir data_dir
  1. Create docker-compose.yaml file

cat > docker-compose.yaml << 'EOF'
version: '3.8'
services:
  nethermind:
    image: nethermind/nethermind:1.25.4
    restart: always
    command:
      --config volta -dd /nethermind/data_dir
      # For EnergyWebChain network
      # --config energyweb -dd /nethermind/data_dir
    volumes:
      - ./data_dir:/nethermind/data_dir     
    ports:
      - 8545:8545
      - 8546:8546
      - 30303:30303
      - 30303:30303/udp
EOF
  1. Start container:

docker-compose up -d
  1. Examine logs:

docker-compose logs --tail 20 nethermind

The log output should be similar to the following

nethermind_1  | Mem est tx   :    40 MB
nethermind_1  | Mem est DB   :     8 MB
nethermind_1  | Genesis hash : 0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5
nethermind_1  | External IP  : 15.188.207.110
nethermind_1  | Ethereum     : tcp://15.188.207.110:30303
nethermind_1  | Discovery    : udp://15.188.207.110:30303
nethermind_1  | Client id    : Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
nethermind_1  | Chainspec    : chainspec/volta.json
nethermind_1  | Chain head   : 0 (0xebd8b4...0e43e5)
nethermind_1  | Chain ID     : Volta
nethermind_1  | ===================================================================================== 
nethermind_1  | 05 Mar 13:57:50 | Changing state Disconnected to FastSync, FastHeaders at processed: 0 | state: 0 | block: 26696639 | header: 26696639 | target block: 26907183 | peer block: 26907183 
nethermind_1  | 05 Mar 13:57:50 | Sync mode changed from Disconnected to FastSync, FastHeaders 
nethermind_1  | 05 Mar 13:57:51 | Connected to 2 bootnodes, 4 trusted/persisted nodes 
nethermind_1  | 05 Mar 13:57:54 | Peers | with best block: 2 | all: 2 | eth66 (100 %) | Active: 2 Headers, 1 Bodies, 1 Receipts, 1 Blocks | Sleeping: None | OpenEthereum (100 %) 
nethermind_1  | 05 Mar 13:57:54 | Old Headers     122,368 / 26,680,000 (  0.46 %) | queue         0 | current            0 Blk/s | total       30,593 Blk/s 
nethermind_1  | 05 Mar 13:57:54 | Downloaded   26,697,149 / 26,907,183 ( 99.22 %) | current            0 Blk/s | total          131 Blk/s 
nethermind_1  | 05 Mar 13:57:59 | Old Headers     130,048 / 26,680,000 (  0.49 %) | queue         0 | current        1,537 Blk/s | total       14,454 Blk/s 
nethermind_1  | 05 Mar 13:57:59 | Downloaded   26,698,165 / 26,907,184 ( 99.22 %) | current          203 Blk/s | total          173 Blk/s 
nethermind_1  | 05 Mar 13:58:00 | Discovered new block 26907185 13:58:00 (0x03214c...f02603), tx count: 0 miner 0x20ea864187c1c1eaa613726ed4d211244209503c, sent by [Peer|eth66|26907185|   3.121.165.10:30303| Out], with AuRa step 341929416 

Nethermind Configuration

  • https://docs.nethermind.io/fundamentals/configuration

Switchboard Application

Field

Value

Network Name

EWC

New RPC URL

https://rpc.energyweb.org

Chain ID

246

Currency Symbol

EWT

Block Explorer URL

http://explorer.energyweb.org

Field

Value

Network Name

Volta

New RPC URL

https://volta-rpc.energyweb.org

Chain ID

73799

Currency Symbol

VT

Block Explorer URL

http://volta-explorer.energyweb.org

Network Name

EnergyWeb RPC

New RPC URL

http://consortia-rpc.energyweb.org

Chain ID

246

Currency Symbol

EWT

Block Explorer URL

https://explorer.energyweb.org

Energy Web MetaMask configuration toolbox
Chainlist
Software cryptocurrency wallets
dApp
Software cryptocurrency wallets
Software cryptocurrency wallets

Digital Spine for Electricity Markets

Background

Decarbonizing electric grids around the world is the single most impactful step we can take to mitigate climate change. Luckily, we are headed in the right direction: renewables and small scale clean energy assets called distributed energy resources or DERs—assets like electric vehicles, rooftop solar systems, batteries, and other flexible electric loads—are being deployed at an unprecedented rate. Unfortunately, it’s not fast enough: to achieve net-zero emissions by 2050, annual clean energy deployment needs to be three times higher than it is today through at least 2030. And if we want to get there, we have to overcome a serious obstacle: today’s electric utilities are not equipped with the tools needed to manage a renewable grid populated with millions upon millions of DERs.

The grid works by maintaining a precise balance between supply and demand. Today, utilities achieve this via a century-old model: generate power in large, centralized stations and feed it one-way to customers. This model assumes 1) utilities have direct visibility and control over generation (supply) and 2) customer demand for electricity is both passive and predictable. These axioms are no longer valid: renewable energy output is variable and largely a function of weather while demand for electricity from customers—who now own DERs capable of storing electricity, shifting when it’s used, or even injecting power back into the grid— is anything but predictable. A grid composed of vast amounts of renewables and DERs presents a complete paradigm shift for electric utilities.

Utilities have never faced a challenge like this before, nor are they equipped with the tools needed to manage this new paradigm. We aim to change this with a Digital Spine.

Digital Spine Overview

In its simplest form, a Digital Spine is a thin layer of interoperability that connects and communicates information between all of the hardware, software, and organizational systems comprising a grid in near real time. In contrast to the existing information technology landscape that utilities rely on today (which features limited information sharing between isolated and fragmented systems) a Digital Spine offers an open-access, cohesive infrastructure that is jointly governed and operated as a public good.

Today the concept of a Digital Spine - a common digital layer for transactions and interoperability for all actors and processes in an energy system - is being developed in multiple energy markets globally, most notably the UK.

Energy Web's Digital Spine toolkit includes four elements:

  • Identity and Access Management (IAM): this component implements a unified authentication and authorization framework using self-managed, sovereign digital identities. This gives utilities and other grid participants the ability to mutually authenticate each other’s identity and authorize selective disclosure or communication of information based on their respective roles and responsibilities. A key benefit of this approach, in contrast to existing piecemeal systems, is delivering a “single sign on” user experience that improves interoperability and streamlines trusted integrations between devices, systems, and organizations without relying on a central administrator.

  • Data and Message Exchange Module: this component is a secure, open-access messaging infrastructure that 1) allows market participants to send, receive, and authenticate messages based on the roles that have been issued to and associated with their self-managed identity; 2) allows market participants to exchange diverse datasets, ranging from real-time telemetry to bulk file uploads; and 3) requires only a single integration mechanism with a central infrastructure in order to communicate via one:one (unicast), one:many (broadcast), and many:many (multicast) channels.

  • Data Hub Client Gateway: this component is an independent application that Digital Spine participants deploy in order to access the shared message broker. The Client Gateway provides a standardized interface to read and write messages in specific channels within the message broker.

  • Joint Business Processing: for DERs to be fully utilized, in many instances information needs to be transmitted amongst three or more parties in a way that does not reveal all data to all parties. In these instances, Energy Web has developed an open source, decentralized technology called “Worker Nodes” that ingest data from external sources, execute custom workflows based on predefined business logic, and vote on results in order to establish consensus without revealing or modifying the underlying data. This technology borrows concepts from public distributed ledger solutions, namely distributed consensus protocols which use cryptographic techniques to establish provably correct and timely results.

Digital Spine Use Cases

Collectively, these four components provide a shared digital infrastructure that facilitates communication and coordination between utility hardware and software systems–from smart meters to network planning tools–and DERs and the companies who manage them. Ultimately, a Digital Spine exists to enable new applications provided by other software vendors and utilities themselves, including:

  • Demand Response / Transactive Energy / Virtual Power Plants: Though there are many different names for it, the concept of using market mechanisms and dynamic pricing to influence DER behavior is well established globally. The Digital Spine enables distribution utilities to construct sophisticated transactive energy programs that procure grid services from DERs at specific locations and/or at specific times of day. For this use case, the role of the Spine is to facilitate data exchange and validation between the utility’s operations center and multiple third-party DER operators.

  • Network Optimization via Operating Envelopes: Operating envelopes (also called Dynamic Line Ratings) are an emerging solution for dynamically modifying import (consumption) or export (generation) of DERs to the distribution network. The core function of an operating envelope is to define limits on how much power can be injected or drawn by DER based on physical constraints within the distribution system. For this use case, the role of a Digital Spine is to ingest and partition (i.e. route) operating envelopes to the appropriate DER operators so DER can safely sell services wholesale and to the distribution utility.

Moving forward, our full vision for a Digital Spine includes additional applications where consortium building and technology integrations with existing vendors is critical:

  • Distribution network modeling / analytics solutions: Utilities need partners that can ingest both traditional system data and DER data to construct digital twins of entire networks in different ways and provide advanced analytical capabilities to utilities to support both operations and planning.

  • Optimization solutions: Dynamic line ratings (also called operating envelopes) are one way of optimizing dispatch of DER at the distribution level. There are many other companies that offer solutions to help optimize dispatch and management of DER who can use a Digital Spine to efficiently communicate distribution network conditions and constraints to other market participants.

  • Forecasting solutions: Today many companies offer forecasting capabilities (e.g. system demand, power flows within specific network lines, renewable output, etc.). A Spine can enhance forecasting capabilities by making additional datasets that are currently too complex or costly to integrate available to forecasting providers.

  • Real time operations solutions: Today there are many companies offering DER management systems and advanced distribution network management systems, but they are not ubiquitous. A Spine could make it easier to bring these solutions to utilities who currently lack them.

Switchboard Transaction Cost Estimates

When using Switchboard, users can create and update data that is stored in smart contracts on the Energy Web Chain. These actions require users to pay a small transaction cost. Users pay transaction costs using their cryptocurrency wallet such as MetaMask. Transaction costs on the Energy Web Chain are in Energy Web Token. Transaction costs on the Volta Test Network on are in Volta Tokens.

Read more about transactions and transaction costs in the Energy Web Tech Stack here.

The transaction cost amount depends on what action the user is performing, and the current gas cost. Actions and their estimated associated total transaction cost are listed below. They are organized according to the three main domains of Switchboard: Enrolments, Governance and Assets.

Calculating Transaction Costs

The total costs calculated below is the sum of the cost to process the metadata and the current gas cost. The costs below are approximate values per operation. The total cost can change:

  • Based on the user input data (e.g. number of input fields)

  • Based on congestion (i.e. how many transaction requests are currently in the pool to be processed), which affects gas price

Enrolments

Switchboard is used to request, issue, publish and revoke role-based credentials. These credentials are persisted on the Energy Web Chain (read more about on-chain credentials here). As such, they require transaction costs to cover their on-chain lifecycle events.

My Enrolments

Action
Cost in EWT

Publish role to

0.00031849

Revocable Enrolments

Action
Cost in EWT

Revoke on-chain role

0.00016711

Governance

Switchboard is used to create and manage organizations, applications, and roles associated with them. These elements are persisted in Energy Web's Ethereum Name Service smart contract. ٍ Each time a user creates or updates one of these entities, they must pay a small transaction cost

Read our documentation on SSI Credential Governance using ENS Domains here.

Organizations

Action
Cost in EWT

Create Organization

0.00077047

Create Sub-Organization

0.00077047

Create an organization-level role

0.00085867

Transfer organization ownership

0.00013159

Edit organization details

0.0001474

Delete organization

Not Available

Applications

Action
Cost in EWT

Create application

0.00064152

Create an application-level role

0.00085867

Edit application-level role details

0.00032897

Edit application details

0.0001474

Delete application

0.00010978

Edit application role details

0.00032897

Assets

Switchboard is used to create (register), manage and transfer Assets. Each Asset is registered in a smart contract on the Energy Web Chain (read more about Assets as ownable smart contracts here.) Each time a user interacts with these contracts for Asset management, they must pay a small transaction cost:

Action
Cost in EWT

0.0002375

(offer) of Asset

0.0000956

to DID Document

0.00010972

Accept/decline Asset offering

0.00007288

Related Content

Validator-Set Contracts

Overview

Validator Set contracts provide information on current validators and private functionality to add and remove validators.

Validator set components

Documentation and Source Code

  • Energy Web Validator Set Contracts

  • OpenEthereum documentation on Validator Set contracts

Components

For upgradeability purposes, the contracts are divided into 2 parts. See below Fig. 1.

RelaySet Contract

This contract implements the required reporting ValidatorSet interface expected by the engine and it is the contract defined in the chainspec seen by the engine. It relays most of the function calls to the RelayedSet contract, which holds the actual logic. The logic contract can be replaced (upgraded), so it is possible to change the behavior of validator management without conducting a hard fork.

RelayedSet Contract

This contract implements the logic and manages the validator list. The owner of the validator set interacts with this contract for managing the validators. This contract maintains two validator sets:

  1. The current validator set (the validators who are actively sealing)

  2. The migration validator set, which is the new set we migrate to in case of a change (validator addition or removal).

Validator States

Validators and potential validators have four states in these contracts:

  1. Active validator: Validator is in the active validator set, sealing new blocks

  2. Not a validator: The address nothing has to do with validation.

  3. Pending To Be Added Validator: Validator is already added by the owner and their acceptance is pending, but not active yet until it is finalized. This implies that the validator cannot report, be reported, or produce blocks yet.

  4. Pending To Be Removed Validator: Validator is pending to be removed (removed by the owner), but it is not finalized, and so is still active as a validator. This implies that as long as the removal is not finalized, the validator is actively producing blocks, can report and can be reported on.

Reporting

The RelayedSet contract logs malicious or benign reports by emitting corresponding log events that can be seen by anyone. Reporting can only be on and about active sealing validators.

event ReportedMalicious(address indexed reporter, address indexed reported, uint indexed blocknum);
event ReportedBenign(address indexed reporter, address indexed reported, uint indexed blocknum);

The events contain the reporter- and reported address, and the block number which the validator was reported on.

Interaction with RelayedSet (logic) Contract

Name

Address

JSON ABI

ValidatorSetRelayed

0x1204700000000000000000000000000000000001

Callable functions

Function

Description

finalized()

Returns true if there are ongoing changes to the active set, false otherwise. If true, implies that current validators list equals migration validators list.

addressStatus(address)

Returns the state of an address, two integers: an integer representing the validator state, and an index value. The index is the position of the validator address in the currentValidators array. It is only relevant if the address is an active validator, should be ignored otherwise.

The validator state mappings are:

  • NonValidator: 0

  • Finalized: 1

  • PendingToBeAdded: 2

  • PendingToBeRemoved: 3

getValidators()

Returns currently active block producing validators

getMigrationValidators()

Returns the migration validator set. If there are no changes, it returns the same list as getValidators().

getUnion()

Returns the union of current and migration sets. Useful for tracking the statuses of all affected validators in case of an ongoing change

getValidatorsNum()

Returns the number of currently active validators

isPendingToBeAdded(address)

Returns true if address is pending to be added to the active list.

isPendingToBeRemoved(address)

Returns true if address is pending to be removed from the active list.

isPending(address)

Returns true if address is pending to be added or removed.

isActiveValidator(address)

Returns true if address is an active validator, meaning it partakes in producing new blocks. Note that a validator who is pending to be removed is still active.

isFinalizedValidator(address)

Returns true if address is a finalized validator, meaning it is active and NOT pending to be removed either.

Events you can listen to, in addition to report events:

event ChangeFinalized(address[] validatorSet);
event NewRelay(address indexed relay);

Interaction with Relay Contract

Callable functions

Function Name

Description

getSystemAddress()

Returns the system address

getValidators()

Same as RelayedSet getValidators()

relayedSet()

Returns the address of the Relayed contract

Events you can listen to:

event NewRelayed(address indexed old, address indexed current);

4. Connect your service to an OCN Node

If you have followed the previous steps in this tutorial you should now have the following things ready for making your connection to the Open Charging Network:

  • (TOKEN_A in OCPI Terms)

Follow the steps listed below to connect to your OCN Node

Access the full OCN technical documentation .

1. Get the Public URL of your selected OCN node from the OCN Registry

There are three methods of interacting with the OCN Registry:

Using the CLI

If you are using the on GitHub, you can check the Public URL of your selected OCN Node by doing this:

ocn-registry get-node 0xEada1b2521115e07578DBD9595B52359E9900104

Where 0xEada1b2521115e07578DBD9595B52359E9900104 is the operator's public address.

Using the Typescript Library

You can find documentation on how to install and use the library .

The Public URL could look something like this: https://test-node.emobilify.com

Please visit the for further details about this step.

Once connected to the registry, you can use the getNode method to return the operator's public URL:

Using the Java Library

Use the documentation provided to connect to the OCN Registry using the Java library.

2. Get OCN Node versions and endpoints

We will first send a GET request to the OCN Node’s versions endpoint, using the TOKEN_A we received from the faucet. Note that curl requests can be imported into e.g. Postman or Insomnia if desired.

You should see a JSON response with OCPI status code 1000. The response data will tell you that version 2.2 can be found at .

Do the same for this endpoint:

You should see a long list of OCPI version 2.2 endpoints implemented by the OCN Node. You will want to save these endpoints for future reference in your application’s database.

For now though, we just need one endpoint. Find the endpoint URL for the module identifier “credentials”. This will be the one we use to connect to the node:

3. Ensure OCN Node can access our versions and endpoints

During the credentials handshake, the OCN Node will attempt to request our own versions and endpoints, just as we did before in

The OCN Node needs to know where to contact us in case there is a message from another party that needs to be routed to us. It can also help to filter requests, in the case that we have not implemented a specific OCPI module that another party is requesting from us.

If you have not already done so, we can spin up a quick server and execite a node script that will display our versions and endpoints as follows (note: requires , and ):

This will create an authorization token that the OCN Node should use to access our own endpoints. It is logged on start. Be sure to make a note of the authorization token as we will need it later.

Note also the PUBLIC_IP. We want the OCN Node to be able to access these endpoints from the outside, so we should make sure that the server is reachable via the public IP we set.

4. Credentials handshake

Now we are ready to connect to the OCN Node.

The credentials request is detailed below. Make sure to replace the variables TOKEN_A, TOKEN_B and PUBLIC_IP, PARTY_ID and COUNTRY_CODE where described:

  • TOKEN_A should match the one generated for you by the faucet

  • TOKEN_B should match the authorization token that you have created

  • PUBLIC_IP should point to your publicly accessible web service

  • PARTY_ID and COUNTRY_CODE refer to the same OCPI credentials that you used

If the request is successful, you should see a response with OCPI status code 1000 and the OCN Node’s credentials returned in the body.

Now that we have connected to the Open Charging Network we can make use of OCPI to find point of interest data, issue remote commands at charge points and authorize RFID cards of any other OCPI party that is connected to the network.

Using the Ethereum Name Service

The Ethereum Name Service is available on Energy Web Chain and Volta Testnet

The Energy Web blockchain uses the (ENS) for name-spacing assets that are anchored on our blockchain. ENS is a critical part of providing user-friendly dApps. You can interact with the ENS contracts that are deployed on the Energy Web Chain in several ways.

Below we explain:

Benefits of Ethereum Name Service

The (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain.

Machine-readable blockchain identifiers such as Ethereum addresses, content hashes and metadata are difficult to interact with in a user interface. ENS was developed to provide human-readable, user-friendly mapping for these identifiers, and to give users the ability to reserve domain names for our applications. To date, it is the most widely used blockchain naming standard.

ENS solves a similar problem that Domain Name Systems (DNS) provide. DNS lets us navigate to a website using human language and an intuitive format (), rather than using an IP address that is impractical to remember and has no association with the content that it directs you to (104.26.13.227). Similar to DNS, ENS supports a structure of dot notation for hierarchy and nesting.

Using ENS, you can create identifiers for the following blockchain content types:

  • Address

  • Reverse address (e.g. an address resolves to alice.eth)

  • Content hash (e.g.: IPFS/Swarm hashes)

  • ABI definitions

  • DNS records

  • Public keys

  • Smart contract interfaces (see )

  • Text (email, physical address, geo location, metadata)

You can see a full list , as well as the specifications for resolving each type.

Examples:

As a simple example, if you want to send funds to your friend Alice, you can specify the recipient as “alice.eth” instead of “0x0052569B2d787bB89d711e4aFB56F9C1E420a2a6”.

If you want to refer to a content hash of a report listed at your custom domain, you can refer to it has “myReport.myDomain”, instead of by the hash identifier.

The two main components of ENS, explained below, are responsible for storing the human-readable address in smart contract registry, and resolving it to its original content.

Main Components of ENS

ENS has two primary components: the Registry and the Resolvers.

Registry

A smart contract that holds all of the domains/subdomains, the owner of the domain, and the domain resolver (the method used to map it back to its original address.) You can see the ENS Registry smart contract

Resolvers

Methods that translate the human-readable names to their original address. A resolver has multiple methods, each of which are responsible for resolving different types identifiers (for example, one method is responsible for resolving contract ABI definitions , one method is responsible for resolving content hashes.)

  • You can see the ENS smart contracts for all of the resolver types

  • You can read more about the Registry and Resolvers in the original documentation

What’s important to take away is that the two primary components for ENS are smart contracts that hold a mapping for all domains/subdomains, and provide resolver methods for translating different address types to a human readable form. These contracts are extendible, so you can add your own resolvers for different address types.

ENS on the Energy Web Chain

Energy Web has deployed the ENS smart contracts on the Energy Web mainnet and Volta testnet. You have several options for interacting with ENS, depending on your use case.

Interact directly with the smart contracts on the blockchain

Use the

You can use this interface to search for available names in the Energy Web domain and register them to your address. Note that you will need to have sufficient funds in your wallet to do so as there is a fee for name registration.

Our management app is forked from the .

Use a JavaScript library

There are a number of libraries that support ENS. These libraries have methods to configure your registry, and manage and resolve names. The and both connect to ENS using the ethers library. You can see the Ethers API support for ENS .

For a full list of libraries that support ENS, see the

Additional Resources

     /**
     * Get a registry node listing for a given operator.
     * @param operator Ethereum address of the operator.
     * @returns the domain name/url if listing exists.
     */
    public async getNode(operator: string): Promise<string | undefined> {
        this.verifyAddress(operator)
        const node = await this.registry.getNode(operator)
        return node || undefined
    }
curl https://test-node.emobilify.com/ocpi/versions -H 'Authorization: Token {{TOKEN_A}}'
curl https://test-node.emobilify.com/ocpi/2.2 -H 'Authorization: Token {{TOKEN_A}}'
{
  "identifier": "credentials",
  "role": "SENDER",
  "url": "https://test-node.emobilify.com/ocpi/2.2/credentials"
}
const express = require("express")
const uuid = require("uuid")

const app = express()

const PUBLIC_URL = "https://service.msp.com"
const TOKEN_B = uuid.v4()
console.log("Auth TOKEN_B = " + TOKEN_B)


const authorize = (req, res, next) => {
	if (req.headers.authorization !== `Token ${TOKEN_B}`) {
		return res.status(401).send({
			status_code: 2001,
			status_message: "Unauthorized",
			timestamp: new Date()
		})
	}
	next()
} 


app.get("/ocpi/versions", authorize, async (_, res) => {
	res.send({
		status_code: 1000,
		data: {
			versions: [{
				version: "2.2",
				url: `${PUBLIC_URL}/ocpi/2.2`
			}]
		},
		timestamp: new Date()
	})
})


app.get("/ocpi/2.2", authorize, async (_, res) => {
	res.send({
		status_code: 1000,
		data: {
			version: "2.2",
			endpoints: [
				/* {
					identifier: "locations",
					role: "RECEIVER",
					url: `${PUBLIC_URL}/ocpi/2.2/receiver/locations`
				} */
			]
		},
		timestamp: new Date()
	})
})


app.listen(3000, () => { console.log("Started on port 3000") })
curl https://test-node.emobilify.com/ocpi/2.2/credentials \
  -H 'Authorization: Token {{TOKEN_A}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "token": "{{TOKEN_B}}",
    "url": "{{PUBLIC_IP}}/ocpi/versions",
    "roles": [{
      "party_id": "{{PARTY_ID}",
      "country_code": "{{COUNTRY_CODE}}",
      "role": "EMSP",
      "business_details": {
        "name": "Tutorial MSP"
      }
    }]
  }'
A backend service that has an OCN-ready API and Signing service
An OCN Identity
The OCN Identity of your selected OCN Node, and a registration token
Get the Public URL of your selected OCN Node
Get OCN Node versions and endpoints
Ensure OCN Node can access our versions and endpoints
Credentials handshake
here
CLI
Typescript Library
Java Library
Command Line Interface provided in the OCN Registry Repository
here
OCN Registry Repository
source
here
https://test-node.emobilify.com/ocpi/2.2
Step 2.
NodeJS
Express
UUID
when generating the registration token and entering details to the OCN Registry

Learn more about Energy Web's IAM Stack

Learn more about Self-Sovereign Identity

Learn more about Energy Web Data Exchange

Access the Decentralized Data Hub Message Broker and on Github

Access the Client Gateway repository on Github

Access the Client Gateway on Azure Marketplace

Learn more about Energy Web Worker Nodes

Access the Worker Contract on Github

Transactions and Transaction Costs
Assets as Ownable Smart Contracts
SSI Credential Governance using ENS Domains
Using the Ethereum Name Service
DID Document
Register asset
Transfer ownership
Publish Asset role

System Contracts

System contracts are the Energy Web Chain's smart contracts that implement OpenEthereum's protocols for Aura Proof-of-Authority consensus mechanism.

Energy Web's smart contracts are open-sourced, and you can see them on github here.

  • Validator Set Contracts - manage validator permissioning and behavior

  • Reward Contract - manages validator block rewards

  • Holding Contract - manages the initial disbursement of pre-mined energy web tokens

Implementing Client Protocol

System contracts are the Energy Web Chain’s smart contracts that implement OpenEthereum’s permissioning protocols. These protocols determine what actions can be taken on the network.

In order to adhere to the expected protocol, the Energy Web Chain’s system contracts must implement the interfaces that are expected by the AuRa consensus engine, so that it can conform to the client’s protocols.

Let’s take OpenEthereum's Validator-Set contract as an example.

The OpenEthereum documentation specifies that “A simple validator contract has to have the following interface”

[
    {
        "constant": false,
        "inputs": [],
        "name": "finalizeChange",
        "outputs": [],
        "payable": false,
        "type": "function"
    },
    {
        "constant": true,
        "inputs": [],
        "name": "getValidators",
        "outputs": [
            {
                "name": "_validators",
                "type": "address[]"
            }
        ],
        "payable": false,
        "type": "function"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "name": "_parent_hash",
                "type": "bytes32"
            },
            {
                "indexed": false,
                "name": "_new_set",
                "type": "address[]"
            }
        ],
        "name": "InitiateChange",
        "type": "event"
    }
]

Now let’s look at Energy Web’s ValidatorSetRelay smart contract.

You can see that this smart contract implements all of the functions of the Validator-Set protocol interface that was specified above.

pragma solidity 0.5.8;

import "../misc/Ownable.sol";
import "../interfaces/IValidatorSetRelay.sol";
import "../interfaces/IValidatorSet.sol";
import "../interfaces/IValidatorSetRelayed.sol";


/// @title Validator Set Relay contract
/// @notice This owned contract is present in the chainspec file. The Relay contract
/// relays the function calls to a logic contract called Relayed for upgradeability
contract ValidatorSetRelay is IValidatorSet, IValidatorSetRelay, Ownable {

    /// System address, used by the block sealer
    /// Not constant cause it is changed for testing
    address public systemAddress = 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE;
    
    /// Address of the inner validator set contract
    IValidatorSetRelayed public relayedSet;

    /// Emitted in case a new Relayed contract is set
    event NewRelayed(address indexed old, address indexed current);

    modifier nonDefaultAddress(address _address) {
        require(_address != address(0), "Address cannot be 0x0");
        _;
    }

    modifier onlySystem() {
        require(msg.sender == systemAddress, "Sender is not system");
        _;
    }

    modifier onlyRelayed() {
        require(msg.sender == address(relayedSet), "Sender is not the Relayed contract");
        _;
    }

    constructor(address _owner, address _relayedSet)
        public
    {
        _transferOwnership(_owner);
        _setRelayed(_relayedSet);
    }

    /// @notice This function is used by the Relayed logic contract
    /// to iniate a change in the active validator set
    /// @dev emits `InitiateChange` which is listened by the Parity client
    /// @param _parentHash Blockhash of the parent block
    /// @param _newSet List of addresses of the desired active validator set
    /// @return True if event was emitted
    function callbackInitiateChange(bytes32 _parentHash, address[] calldata _newSet)
        external
        onlyRelayed
        returns (bool)
    {
        emit InitiateChange(_parentHash, _newSet);
        return true;
    }

    /// @notice Finalizes changes of the active validator set.
    /// Called by SYSTEM
    function finalizeChange()
        external
        onlySystem
    {
        relayedSet.finalizeChange();
    }

    /// @notice This function is used by validators to submit Benign reports
    /// on other validators. Can only be called by the validator who submits
    /// the report
    /// @dev emits `ReportedBenign` event in the Relayed logic contract
    /// @param _validator The validator to report
    /// @param _blockNumber The blocknumber to report on
    function reportBenign(address _validator, uint256 _blockNumber)
        external
    {
        relayedSet.reportBenign(
            msg.sender,
            _validator,
            _blockNumber
        );
    }

    /// @notice This function is used by validators to submit Malicious reports
    /// on other validators. Can only be called by the validator who submits
    /// the report
    /// @dev emits `ReportedMalicious` event in the Relayed logic contract
    /// @param _validator The validator to report
    /// @param _blockNumber The blocknumber to report on
    /// @param _proof Proof to submit. Right now it is not used for anything
    function reportMalicious(address _validator, uint256 _blockNumber, bytes calldata _proof)
        external
    {
        relayedSet.reportMalicious(
            msg.sender,
            _validator,
            _blockNumber,
            _proof
        );
    }

    /// @notice Sets the Relayed logic contract address. Only callable by the owner.
    /// The address is assumed to belong to a contract that implements the
    /// `IValidatorSetRelayed` interface
    /// @param _relayedSet The contract address
    function setRelayed(address _relayedSet)
        external
        onlyOwner
    {
        _setRelayed(_relayedSet);
    }

    /// @notice Returns the currently active validators
    /// @return The list of addresses of currently active validators
    function getValidators()
        external
        view
        returns (address[] memory)
    {
        return relayedSet.getValidators();
    }

    /// @dev The actual logic of setting the Relayed contract
    function _setRelayed(address _relayedSet)
        private
        nonDefaultAddress(_relayedSet)
    {
        require(
            _relayedSet != address(relayedSet),
            "New relayed contract address cannot be the same as the current one"
        );
        address oldRelayed = address(relayedSet);
        relayedSet = IValidatorSetRelayed(_relayedSet);
        emit NewRelayed(oldRelayed, _relayedSet);
    }
}

Energy Web System Contracts

  • Validator Set Contracts - manage validator behavior

  • Reward Contract - manages validator block rewards

  • Holding Contract - manages the initial disbursement of pre-mined energy web tokens to a group of initial supporting affiliates

Developer Community Calls

Monthly Developer Community Calls are being hosted to align the development of all Open Charging Network software components.

Anyone is invited to jointly discuss current status of development, upcoming releases, development contributions from the community, and other related topics.

Calls will take place every second Tuesday of the month via the video conferencing platform Zoom. The call will be recorded and published on this page.

Join the call via Zoom:

  • Join Zoom Meeting https://us02web.zoom.us/j/81939801778?pwd=N3RzSHF2dEVBNXhWVE10OVZIUzcwUT09

  • Meeting ID: 819 3980 1778

  • Passcode: 009142

Dial by your location

Recordings of previous calls:

13.04.2021 - Watch recording on Youtube

09.03.2021 - Watch recording on Youtube

09.02.2021 - Watch recording on Youtube

12.01.2021 - Watch recording on Youtube

08.12.2020 - Watch recording on Youtube

10.11.2020 - Watch recording on Youtube

13.10.2020 - Watch recording on Youtube

08.09.2020 - Watch recording on Youtube

11.08.2020 - Watch recording on Youtube

Contract

Source

Volta address

EWC address

Registry

ens/ENSRegistryWithFallback.sol at master · ensdomains/ens

0xd7CeF70Ba7efc2035256d828d5287e2D285CD1ac

0x0A6d64413c07E10E890220BBE1c49170080C6Ca0

ETH Registrar Controller

ethregistrar/ETHRegistrarController.sol at master · ensdomains/ethregistrar

0xb842CCA1682DC2Ee6A9da6A59bA4B5C736b229cD

0x9C99a28D3d702E6096361Ff31E724b772B5D709e

ETH Base Registrar

ethregistrar/BaseRegistrarImplementation.sol at master · ensdomains/ethregistrar

0x5630EBDbf41624fF77DcBfC4518c867D93E42E9f

0x3BDA3EE55a5b43493BA05468d0AE5A5fF916252f

Public Resolver

resolvers/PublicResolver.sol at master · ensdomains/resolvers

0x0a97e07c4Df22e2e31872F20C5BE191D5EFc4680

0xA517983Bd4Af4DF0Ed9b52DA4BC405d0A95eE7E2

Reverse Registrar

ens/ReverseRegistrar.sol at master · ensdomains/ens

0xff7Befa016689dC5D89165867a65CF26B73e6514

0xcB9BCAa8010F51D6484570B99B127e8a26B6B468

Reverse Resolver

resolvers/DefaultReverseResolver.sol at master · ensdomains/resolvers

0x775e2a91501cdadeA65BF8eBb94a82529Fc2C34B

0x0C12c9087342DafE42b28A93998CEd711DC9a614

Ethereum Name Service
The benefits of ENS
The main components of ENS (Registry and Resolvers)
Interacting with ENS on Energy Web Chain
Ethereum Name Service
www.energyweb.org
EIP 165
here in the ENS documentation
here.
here
here
Energy Web ENS Manager app
Ethereum Name Service Manager app
IAM client library
IAM Cache server
here
ENS documentation here.
Ethereum Name Service (ENS) is now available for the Energy Web
Organization namespace using ENS nested notation
https://gist.github.com/ngyam/62a6702dc32edbad9b4421179cfaad30

Transactions and Transaction Costs

A transaction is any action that updates the state of the blockchain. There are costs associated with each transaction that cover the computational cost of processing that transaction. These costs are variable and dependent on several factors, which are discussed below.

This page covers the basic functionality of transactions, how their associated costs are calculated, and where to see transaction data from the Energy Web Chain and Volta Testnet. If you want to read more about the fundamentals of transactions, see the Ethereum documentation on transactions, blocks, and gas,

  • Transactions

  • Transaction Cost Variables

  • Calculating Transaction Costs

  • Gas Price and Block Size

  • Keeping the Public Transaction Cost Low

  • Additional Resources

Transactions

A transaction is any ‘write’ operation that changes or updates the state of the blockchain. Transactions are always initiated by an externally owned account, and they must be signed by the account owner that initiated the transaction in order to be completed. Examples of write transactions include:

  • Transferring tokens between accounts

  • Deploying new smart contracts or accounts

  • Calling or Interacting with existing smart contracts

Once confirmed by the initiator, transactions can be in two states: pending and validated.

Pending Transactions

In a Proof-of-Authority consensus blockchain, validators take turn validating transactions and sealing blocks. Before a transaction is validated, it is in a "pending" state in the memory pool ("mempool"). The following image shows a transaction in a "pending" state. You can view all pending transactions on the Energy Web Block Explorer here.

Notice that the transaction fee of a pending transaction is not determined yet and the "Block Number" is pending.

Transaction in pending state - from Energy Web Block Explorer

Validated Transactions

After a transaction is validated by a validator, it is added to a block. The block is designated by a block number, shown in the image below. Each block in a blockchain is made up of strictly ordered, consecutive, validated transactions.

The following image is a transaction in a "validated" state. You can view all validated transactions on the Energy Web Block Explorer here.

Notice that the transaction fee of a validated transaction is no longer 0, it has a value in EWT.

Determining Transaction Cost

Every transaction that updates the chain has a transaction cost (transactions that are "read only" - meaning they do not update the state of the blockchain - do not have a cost.) It’s important to keep in mind that all transactions are not created equal: some are more computationally intensive than others, some are more urgent, some require greater degrees of privacy.

For example, an interaction with a smart contract that has complex functionality and many internal variables to store will be more computationally intensive than a simple transfer of tokens from one account to another.

As we’ll soon see, these differences from one transaction to the next can have an impact on ultimate transaction cost.

Transaction Cost Variables

There are three key variables that influence transaction cost:

1. Gas Cost

A transaction’s computational complexity is measured in gas, a unit that assigns a numeric value to each operational code, or instruction, that will be executed to complete the transaction. The gas cost of a transaction is determined by the amount and sophistication of code that needs to be executed as well as the amount and type of data that will be stored on the blockchain as a result. The more complex the transaction, the higher the gas cost.

2. Gas Price

To derive a concrete fee requires a gas price as well. Every user that initiates a transaction chooses a gas price they are willing to pay for that particular transaction, at that particular time. It is essentially a bid the user makes to have their transaction validated and added to the chain. Users that want to have their transaction expedited, for example, might bid a higher gas price to ensure that it’s included as soon as possible in the next available block.

Gas price is on the EW Chain is denominated in EWT (usually in minuscule units like gwei, which represent one billionth of an EWT). The price is expressed in tokens (gwei) per unit of gas.

You can specify a gas price in a transaction through MetaMask:

Gas price of .01 Gwei.

3. Token Value

Finally, token value—usually expressed in a fiat currency equivalent—translates virtual transaction cost into ‘real’ transaction cost. And when token value varies widely, perhaps due to token market volatility, resulting transaction costs can vary too.

Calculating Transaction Cost

Using the three variables above, you can calculate the total transaction cost:

TxCost(unit:fiat$) = GasCost(unit:gas) x gasprice(unit:token/gas) x tokenvalue($/token)

Here’s how a fee would be calculated for a hypothetical transaction on the Energy Web Chain:

50,000 gas x 1 gwei per gas = 50,000 gwei = 0.00005 EWT

If the market price of EWT was $1 at the time of the transaction, this would equate to $0.00005 fee. If the price of EWT was $10, this would equate to $0.0005.

Gas Price, Gas Limits and Block Size

To ensure that block time remains consistent and to prevent any given block from being overloaded with transactions, the EW Chain has a predefined limit to the amount of gas that can be consumed in each block. Each block on the Energy Web Chain has a size limit of 8 million units of gas.

Gas cost, as we've mentioned, represents the computational effort that validators undertake when validating transactions and sealing blocks. The gas price is denominated in EWT, which is paid to the validators for their work.

Each validator may set their own minimum gas price that they are willing to accept in order to include a transaction in their blocks. Currently on the EWC, the default is 0.1 gwei, but the overall range is between 0.01 gwei and 1 gwei. When initiating a transaction on the EW Chain, you should make sure that your gas price is at least 0.01 gwei, and if you want to ensure that your transaction is executed within the next 1-3 blocks (roughly 15 seconds), you should choose a higher gas price.

Because each transaction uses different amounts of gas, the number of transactions that fit on a block will vary.

Each block on the Energy Web Chain has a size limit of 8 million units of gas. Hypothetically, a single extremely computationally intensive transaction could consume 8M gas, but a simple transfer of EWT between two accounts (the most basic transaction type there is) consumes 21,000 gas. This is why a simple metric of “transactions per second” is misleading; not all transactions are created equal in terms of complexity (i.e. gas cost.) If many of the transactions that are waiting in the memory pool have low computational cost, you can fit more transactions in the block. If they are larger, the block will hold less transactions.

Take a look at the details of a block added to the Energy Web Chain:

Block Details of a Single Block on the Energy Web Chain

From this we can see that:

  • This block includes 43 transactions

  • The gas limit for the block is 8,000,000 (this limit remains constant for every block)

  • Only 1,553,623 units of gas were used to create the block (less than 20% of its limit)

  • If there were more transactions waiting in the memory pool to be added to the block, this block could have processed ~6,446,377 units worth of gas.

You can see all block and transaction details for the Energy Web production chain at https://explorer.energyweb.org/.

You can see all block and transaction details for the Volta Testnet at https://volta-explorer.energyweb.org/.

Keeping Public Blockchain Transaction Costs Low

The same three variables above that define transaction cost also present opportunities to manage those costs and keep them low.

1. Lean smart contracts can help keep gas costs down: App developers and other smart contract writers are incentivized to write lean, efficient code—writing smart contracts and initiating transactions that are as computationally efficient as possible.

2. Gas price bids should remain low on networks with high transaction capacity: Of the three variables that contribute to transaction costs, gas prices are arguably the most powerful lever, since the bidded prices are solely at the discretion of the user submitting a transaction to the network. For reasons we’ll explore below, in the absence of sustained block “congestion”, gas prices can remain low and stable.

3. “Just in time” gas price calculations mitigate some risks of token value volatility: For a variety of reasons, some token markets are more volatile than others. But just because a token’s value relative to a fiat currency changes, it doesn’t mean that transaction fees similarly change without warning. Users calibrate gas price bids at the time of the transaction, and thus will bid a denomination of tokens relative to the token’s value at the time. While it is possible that a past transaction fee could end up being significantly more or less expensive relative to current (or future) token value, transaction fees at the time they are incurred should remain relatively stable as a function of fiat currency.

If users desire a low-cost network, why do transaction costs rise in the first place?

So why would anyone bid a high price for any transaction? Shouldn’t transaction fees remain very low, as rational users consistently attempt to minimize their costs? In reality, transaction fees vary precisely because of competition among users to get transactions confirmed.

At any given moment there may be hundreds or thousands of transactions waiting to be confirmed and formally added to the blockchain. These pending transactions sit in a memory pool, or "mempool", where they are ultimately selected by validators (miners in the case of proof-of-work blockchains) to be included in a block. But each block has a finite gas limit, meaning not all transactions can be confirmed at once. As a result, validators will typically give preference to the most-lucrative (or expensive, depending on perspective) transactions in the mempool. Transactions with lower fees may end up having to wait for their transaction to get confirmed.

Ultimately, fees are about transaction prioritization. The higher the gas price you pay, the faster your transaction will be confirmed. If you don’t care about the amount of time it takes to confirm your transaction, you can offer a very low (or no) gas price. However, with this strategy you run the risk that your transaction never gets confirmed, and just sits in the mempool queue indefinitely.

Lessons from what we know about the Energy Web Chain

At the most basic level, transaction fees on the EWC are determined as a function of supply (e.g., computational capacity of the network, as defined by block gas limit and block speed / time) and demand (i.e., number of pending transactions). Volatility comes into the equation because supply, namely block time and block gas limit, is essentially fixed, whereas demand fluctuates as a function of the number of users and and the volume and complexity of transactions in the memory pool at any given time. Occasionally, transaction fee trends diverge from transaction volume, but generally the two are correlated.

Looking at historical data since the launch of the EWC in June 2019, it’s fair to say that transaction fees are usually extremely low - with average block utilization (in terms of gas consumption) around 15-20% the minimum gas price of 0.1 gwei is almost always sufficient to ensure a transaction is validated within 2 blocks. Based on the historical market price of EWT, transaction fees expressed in terms of fiat currency are typically in the range of $0.0001 (or less).

Additional Resources

  • Energy Web blog post "How to Manage Transaction Costs on Public Blockchains"

  • "Chapter 6: Transactions" from Mastering Ethereum

  • Ethereum documentation on

    • Transactions

    • Blocks

    • Gas

Validator Node Installation Specifications

This page provides specifications for host environments for Volta and EWC validator nodes.

Host Machine Requirements

Validator nodes for Volta and the Energy Web Chain must run on a dedicated server or Virtual Machine only for the purpose of running the client; do not use hosts that already perform other tasks.

You can choose to run your validator node either On-Premise on your own hardware or on a virtual machine / cloud computing instance of your choosing. If you have any questions please contact the EWF NetOps team:

The following specifications are strongly recommended, but validators are free to configure their host machine at their discretion in accordance with relevant internal policies or requirements. Please note that hosting a node on a machine with insufficient CPU, storage, RAM, and/or networking capacity may result in node failure (e.g. unable to connect to peers, unable to synchronize, unable to seal blocks) and require extra labor to reconfigure the host machine.

On-Premise Hardware

A on-premise node should have these specs or higher. For security reasons these resources must be reserved for the validator node and not shared with other workloads.

  1. Modern Multi-core x64 CPU (at least 4 threads, preferably Xeon-class)

  2. 8GB RAM (preferably ECC)

  3. Local SSD storage, 300 GB free capacity for blockchain, redundant in RAID-1

  4. 1 GBit NIC

Cloud Environments

The following specifications are strongly recommended based on the most common cloud environments used by existing EW Chain validators. You may select any cloud provider of your choosing

Amazon AWS

The following EC2 instance sizes are appropriate to run validators. These resources should be reserved for the validator node and not shared with other workloads.

  • m5.xlarge

  • m5.2xlarge

  • m5a.xlarge

  • m5a.2xlarge

  • c5.xlarge

  • c5.2xlarge

The default EBS storage assigned (normally 8GB) is not large enough to run the node. Make sure to run the node with following EBS storage settings:

  • General Purpose SSD (gp2)

  • at least 300GB size

Microsoft Azure

The following Azure VirtualMachine sizes are suitable to run a validator. These resources should be reserved for the validator node and not shared with other workloads.

  • D4s_v3

  • DS3_v2

  • B4ms

Use Premium SSD as attached storage with a size of at least 300GB.

Google Cloud

The following Google Cloud Virtual Machine sizes are suitable to run a validator node. These resources should be reserved for the validator node and not shared with other workloads.

  • n2-standard-4 and above: https://cloud.google.com/compute/docs/general-purpose-machines#n2_machines

Digital Ocean

The following Digital Ocean Virtual Machine sizes are suitable to run a validator. These resources should be reserved for the validator node and not shared with other workloads.

  • General Purpose Droplet: 16 GB memory, 4vCPU

  • CPU-Optimized Droplet: 8 GB memory, 4vCPU

Use Block Storage as attached SSD storage with a size of at least 300 GB.

Connectivity Requirements

The following requirements should be met to ensure proper operation:

  • Wired connection with 100 MBit/s symmetric link to the internet

  • Low latency connection to next internet hop (<5ms)

  • No data volume limitations

Even though we recommend a 100MBit/s connection, that connection will likely not be saturated by the node. You can expect 10-30MBit/s when the chain is under load. Traffic will mainly flow on port 30303 (udp/tcp).

Operating System Requirements

The following Linux-based Operating Systems are supported for running a validator node:

  • Ubuntu Server 18.04 LTS or later

  • Debian 9.8 or later

  • CentOS 7 or later

  • RedHat Enterprise Linux 7.4 or later

Validators can elect other operating systems at their discretion, but may need to customize the installation scripts. Contact for questions and support.

The following section provide a comprehensive guide for installation of one the supported operating systems. All further deployment procedures are based on the installation results.

Ubuntu Server 18.04 LTS

On-Premise

Procedure based on version 18.04.2.

  • Download the ISO from .

  • Boot the ISO

  • Select English as language

  • Choose a convenient keyboard layout

  • Choose Install Ubuntu

  • Let the network auto-configure -or- configure manually if needed. The system needs an internet connection.

  • Select no proxy and keep the mirror address.

  • Select Use an entire disk and confirm

  • Choose user name and host name in next screen. Choose a strong password.

  • Select Install OpenSSH Server but don’t import keys

  • Don’t select any snaps and continue

  • Finish installation and let it boot to the prompt

  • Login as the created user and run a full system update using 'sudo apt update && sudo apt dist- upgrade -y'

Amazon AWS

Ubuntu AMI's are listed at . Search for "ebs 18.04 amd64" to get the right version.

Microsoft Azure

The URN for the image is Canonical:UbuntuServer:18.04-LTS:latest

Debian 9.8

On-Premise

  • Download the NetInst ISO from

  • Boot the ISO

  • Select Install from the boot screen

  • Select English as language

  • Select Location based on actual location of the host

  • Chose a convenient keyboard layout

  • Let the network auto-configure -or- configure manually if needed. The system needs an internet connection.

  • Name your host. Change it from debian to something else

  • Choose a strong root password

  • Create the user account and choose a strong password

  • Select the proper timezone

  • For the partitions use Guided - use entire disk

  • Select All files in one partition

  • Finish partitioning and write changes to disk

  • Select No when ask to scan more disks

  • Choose a mirror close to the host

  • Opt-out of the package survey

  • on the Software Selection select only SSH Server and standard system utilities

  • Install the grub bootloader to MBR and use the primary disk for that

  • Finish installation and let it boot to the prompt

  • Login as root and run a full system update using 'apt update && apt dist-upgrade -y'

  • Reboot

Amazon AWS

The AMI Id's can be found at

Microsoft Azure

The URN for the image is credativ:Debian:9:latest

CentOS 7

On-Premise

  • Download the minimal ISO from

  • Boot the ISO

  • Confirm the automatic boot option Test this media & install CentOS 7

  • Choose English as language

  • On the installation summary choose Installation destination and confirm automatic partinioning

  • Back on the installation summary screen click on Network & Hostname

  • Change the hostname

  • Enable the network interface and make sure it is configured properly

  • Click Done to get back to the summary and click Begin Installation

  • During installation set a root password

  • Finish installation and let it boot to the prompt

  • Login as root and run a system update with 'yum update'

Amazon AWS

The AMI Id's can be found at

Microsoft Azure

The URN for the image is OpenLogic:CentOS:7.5:latest

Recommended Security Settings

Running a validator node requires raised awareness of host and node security as authorities are a main attack surface to disturb operation of the blockchain. The following security rules are strongly recommended:

  • No services are permitted to run on the same host that are not part of the validator node package

  • All incoming connections on all ports except SSH (22/tcp) and the P2P (30303/tcp+udp) port have to be firewalled on the host with DROP rules. To guarantee proper network etiquette, incoming ICMP has to be accepted.

  • SSH access is only allowed for non-root users

  • SSH access is only allowed through RSA keys

  • OpenEthereum or Nethermind client RPC endpoints (HTTP, WebSocket) have to be disabled

  • System updates have to applied regularly and in a timely manner

  • Regular (monthly) run of rootkit detectors

  • If you are using AWS please also check out the additional .

[email protected]
[email protected]
https://www.ubuntu.com/download/server
https://cloud-images.ubuntu.com/locator/ec2/
https://www.debian.org/distrib/netinst
https://wiki.debian.org/Cloud/AmazonEC2Image/Stretch
https://www.centos.org/download/
https://wiki.centos.org/Cloud/AWS#head-78d1e3a4e6ba5c5a3847750d88266916ffe69648
AWS Security guide

Open Charging Network

An open and decentralized communication network for digital eMobility services.

Overview

The Open Charging Network (OCN) is a decentralized eRoaming hub.

Using the Open Charge Point Interface 2.2, the OCN provides the network for communication between Charge Point Operators (CPOs), eMobility Service Providers (eMSPs), and other industry players involved in EV charging services.

The primary purpose of the OCN is to make technical connection between these EV charging industry players as simple and secure as possible, without creating technical and commercial lock-in effects.

The two primary actors are eMobility Service Provider (eMSP) and Charge Point Operator.

  • eMobility Service Providers (eMSPs) provide EV drivers with network access to electric vehicle charge points, typically through software applications and platforms. Their primary end-user is the EV driver.

  • Charge Point Operators (CPOs) install and manage the physical charge point operation infrastructure and the network operations that allow for EV-charging. Their primary end-users are e-MSPs, who in turn make these charge points available to EV drivers through their products and services.

You can see a full list of roles in the OCPI 2.2 documentation 2.3. EV Charging Market Roles.

The OCN is made up of a distributed network of server nodes running the OCN Node software. These nodes share a registry that stores network participant data, which exists as a smart contract that is deployed on the Energy Web Chain.

Below you will find an overview of OCN functionality and technical components, as well as how to get started using the OCN.

  • Use Cases

  • Implementing the Open Charge Point Interface Protocol

  • The OCN as a decentralized solution

  • Get started using the OCN

  • OCN technical components

Access the full OCN technical documentation here or download the PDF below:

1MB
OCN-Documentation-v1.1.pdf
pdf
OCN Technical Documentation

OCN Use Cases

The OCN supports all use-cases described in the OCPI 2.2 protocol, including:

  • Authorization

  • Reservation

  • Tariff Information

  • Billing Stating Charge Point Information

  • Real-time charge point status information

  • Real-time charge session information

  • Charge Detail Record (CDR) information

  • Remote start/stop

  • Smart charging

  • Calibration law (eichrect) support

  • Platform monitoring

Implementing the Open Charge Point Interface Protocol

The OCN implements the Open Charge Point Interface (OCPI) 2.2 protocol. This protocol provides a common communication infrastructure for e-mobility service providers, Charge Point Operators and other market participants involved in supplying and delivering electric vehicle charging services.

These actors implement the OCPI on their back-end IT infrastructure.

OCPI Hub Concept

The OCPI protocol can be used for peer-to-peer (bilateral) communication, but is more widely used as a communication hub that connects multiple CPOs with multiple eMSPs.

This allows end-users to, for example, locate and use EV chargers that are managed by one CPO, even if they are using an application created by a different CPO or eMSP. It provides a broader network of access to services and charge points that are critical for eRoaming.

The OCPI is broken down into modules that provide the protocol's core functionality, which includes:

  1. Bilateral (peer-to-peer) and multilateral communication

  2. Real-time information about charge point locations, availability and pricing

  3. Exchange of data related to charging services (i.e. Charging Data Records)

  4. Mobile access to Charge Points

Access the full OCPI technical documentation here or download the PDF below:

1MB
OCPI-2.2-d2.pdf
pdf
OCPI Technical Documentation

The OCN as a Decentralized Solution

The OCN performs the role of communication hub as described by the OCPI 2.2, meaning OCN nodes handle the communication and message routing between relevant parties (CPOs, eMSPs, service providers).

The primary difference between the OCN and traditional hub networks is that the OCN is an open and decentralized network:

  1. There is no centralized server that participants must connect to in order to use the network. The OCN is comprised of a distributed network of server nodes, and anyone is able to run or connect their service to a node. Nodes are responsible for brokering messages between parties.

  2. There is no centralized database for storing participant user information. This data is stored in a smart contract on the Energy Web Chain, which is a public, decentralized blockchain. Anyone is able to register with this contract, provided they have required information. The OCN provides a whitelisting/blacklisting permissioning system to manage messaging preferences.

OCN Nodes

In the context of the OCN, a 'node' is a server running an instance of the OCN node software. Each node of the OCN forwards OCPI and OCN messages between parties based on a routing system and a shared registry that is anchored on the Energy Web Chain in a smart contract. As mentioned above, these parties are typically Charge Point Operators or eMobility Service Providers.

TO DO: GET PERMISSION FOR THIS PHOTO

A node consists of a message broker, blockchain wallet, and connection to an Energy Web Chain node. The network of nodes together constructs the Open Charging Network.

Anyone can run a node if they choose, or connect to a node remotely.

Read more about how to run a node here. Read more about how to connect to a node here.

The OCN Registry

OCN parties (those who are using the network - eMSPs, CPOs, third party service providers) are identified in the registry smart contract that is deployed on the Energy Web Chain. Every node on the OCN has access to this smart contract.

A participant is identified in the Registry by their public key, which is mapped to the public url of the OCN node that they are registered with:

// address => domain name/url
mapping(address => string) private nodeOf;

source code

Users can interact with the Registry smart contract to fetch, set or update their registered node or their party information.

Parties are required to sign messages that they send through the OCN with their private key as a means for security and verification. Learn more about how to create a public/private key pair and register as an OCN party here.

Benefits of a Decentralized Network

Most implementations of OCPI are centralized applications, where a third-party platform provides the 'hub' network connection between multiple eMSPs and CPOs that enable actors to send and receive information.

This approach brings certain advantages and convenience, but also creates commercial and technical limitations:

  • Participant identities are siloed within a network, creating a lock-in effect to that specific network

  • Network service providers can choose to not provide particular services on a proprietary platform, creating commercial restraints for the network's users

  • Centralized networks are typically less resilient and scalable than decentralized networks

  • Participation can be restrictive due to cost or commercial agreements

A decentralized, open source architecture provides a solution for some of these challenges:

  • Network participant identities are accessible to anyone on the network through a public, shared registry, reducing network and user silos.

  • Anyone can register and use the network for free. (Read more about how to create an OCN identity here)

  • Anyone can run a node. This makes the network scalable, resilient, and reduces potential points of failure. Read more about how to run a node here

  • The OCN is open-source. Anyone can build applications and provide services on top of the network for all to use. Read more about the OCN Service interface here

Getting Started

Create an OCN Identity

To get started with the OCN, you first need to create your own OCN Identity. Follow the steps outlined here: Create and manage an OCN Identity.

Connect your service to a node

To connect your EV charging service to an OCN Node (as a Charge Point Operator or an eMobility Service Provider), follow the steps outlined here: Connecting an OCPI/OCN Party to a Node.

Run your own OCN node

To operate your own OCN Node, follow the steps outlined here: Run an OCN node.

Offer a third-party service via the OCN Service Interface

To provide a service like settlement, payment, smart charging, etc. (OCN Service) to OCN Parties (Charge Point Operators, eMobility Service Providers, etc.), follow the steps outlined here: Use the OCN Service Interface.

OCN Technical Components

OCN Node

Provides an entry point to the network, which enables communication with other eRoaming parties using the Open Charge Point Interface 2.2.

Repository: https://github.com/energywebfoundation/ocn-node

OCN Bridge

A pluggable OCPI API interface for eRoaming parties with no OCPI API.

The OCN bridge can be used by CPO/eMSP backends to implement the OCPI protocol, which is a required step in connecting a backend to an OCN node, however it is not required to use the OCN Bridge to do so. Manages the OCPI interfaces, connection to an OCN client and registration with the OCN registry. JavaScript implementation only.

Repository: https://github.com/energywebfoundation/ocn-bridge

OCN Registry

The shared address, identity and permissions system of the OCN.

The OCN Registry is a smart contract on the Energy Web Chain that contains important identifying information about registered OCN Nodes, Parties and Services. It acts as the shared address, identity and permissions system of the OCN.

Repository: https://github.com/energywebfoundation/ocn-registry

OCN Notary

Utilities to securely verify and sign OCN messages using public/private cryptographic key-pairs.

Currently targeting JavaScript and JVM only.

Note that the OCN Bridge already implements the OCN Notary. If you are connecting a party to an OCN node, and you are not implementing the OCN Bridge, you will need to implement the OCN Notary in your backend setup.

Repository: https://github.com/energywebfoundation/ocn-notary

OCN Tools

Common tools for aiding development of applications built on top of the OCN.

You can run a mock E-Mobility Service Provider (MSP) or Charge Point Operator (CPO) with these tools, which can be helpful for local development. Uses the OCN Bridge as a dependency.

Repository: https://github.com/energywebfoundation/ocn-tools

Name Registry

Energy Web has deployed OpenEthereum's Name Registry contract. This contract is identical to OpenEthereum's original contract, with the exception that it was made Ownable by Energy Web Foundation. Only Energy Web can reserve a name or drain funds from this contract.

There are two reasons for making this contract Ownable:

  1. OpenEthereum's name registry might be needed for other OpenEthereum related system contracts later: e.g. service transaction checker, or auto updater.

  2. We will have the official Ethereum Name Service system set up on the chain, so this contract is only needed for internal purposes and will not be used publicly.

The name registry is a placeholder for now. The contract can be found in our repo: https://github.com/energywebfoundation/ewc-system-contracts/tree/master/contracts/registry

Interacting with the Name Registry Contract

Contract Address and ABI

Contract

Address

JSON ABI

SimpleRegistry

0x1204700000000000000000000000000000000006

Callable Functions

Function

Description

entries(bytes32)

Returns an entry based on the sha3 hash of the name registered.

reverse(address)

Reverse resolution of an address.

fee()

Returns the fee for reserving a name (not really relevant to public).

getData(bytes32,string)

Returns a string data value from an entry, given its key.

getAddress(bytes32,string)

Returns an address data value from an entry, given its key.

getUint(bytes32,string)

Returns an unsigned integer data value from an entry, given its key.

getOwner(bytes32)

Returns the owner of an entry.

hasReverse(bytes32)

Returns true if entry has a reverse address registered.

getReverse(bytes32)

Returns reverse address of an entry.

canReverse(address)

Returns true if address can have a reverse.

reverse(address)

Returns the reverse value of an address.

reserved(bytes32)

Returns true if the name (its sha3 hash) is already reserved.

https://gist.github.com/ngyam/255a461e2241085a6530d455f7c15529
Tutrial how to connect Metamask to Energy Web Blockchain
:black_medium_small_square:
:black_large_square:
:black_small_square:
:black_small_square:

Validator Node Architecture

Components for running a validator node and monitoring validator behavior

The system architecture of a validator node on the Energy Web Chain is made up of two components:

  1. The OpenEthereum Client

  2. Telemetry monitoring system

Together these two components allow validators to run a local node of the chain, validate transactions, seal blocks, and monitor validator behavior and metrics.

OpenEthereum Client

A client is software that allows you to run a local node on your machine and interact directly with the blockchain. Every validator must run a full node in order to participate in validation.

Remember that the Energy Web Chain is derived from the Ethereum blockchain. Because of this we use an Ethereum client to connect with the chain called OpenEthereum. Anyone can create a client, as long as it implements the protocols laid out in Ethereum’s yellow paper, and there are a number of Ethereum clients to choose from.

Energy Web uses the OpenEthereum client because it supports the Authority Roundtable (AuRa), which is a consensus algorithm specifically for Proof-ofAuthority blockchains. OpenEthereum allows validators to connect to the chain, collect transactions and seal blocks according the AuRa consensus algorithm.

To read more about OpenEthereum, you can visit their wiki.

To read more about Ethereum clients, see the Ethereum documentation.

Telemetry Monitoring system

The monitoring system collects comprehensive, real-time data and metrics on validator performance and provides a user interface for viewing the data. It is important to gather as much data about the validator nodes as possible in order to ensure a secure and performant blockchain. To do so, we rely on well established industry solutions to transfer these metrics off the validator node to protect the sensitive nature of the data.

The use of the telemetry monitoring system is opt-in. Validators can disable it if they have their own monitoring system in place that allows for real time tracking of all relevant metrics.

Telemetry Architecture

There are four components involved in the data collection process:

  • OpenEthereum client - monitors validator node behavior

  • Telegraf: open-source server agent that collects data from the OpenEthereum client

  • InfluxDB - open source database that stores the data collected from Telegraf

  • Grafana - data visualization tool that queries the InfluxDB for data and provides graphical interface for data visualization

All components are run in separate docker containers managed by docker compose. For additional information on docker visit: https://docs.docker.com/ and https://docs.docker.com/compose/.

Data Collection Process Overview

  1. The OpenEthereum client collects data on the validator node. Collected data includes:

    • CPU usage

    • Memory usage

    • Disk usage

    • Number of connected peers

    • List of visible P2P peers

    • Current block

    • Network latency to 3 different and major locations (e.g. cloudflare, google, amazon)

    • Network throughput

    • Network error rate

    • Number of SSH keys

    • Service status for SSH, docker and the parity container

    • SHA256 hashes of key system components/binaries

    • Current chain specification file (or hash)

  2. Telegraf collects relevant metrics from the host machine and the custom-built OpenEthereum metrics collector. The metrics collector allows Telegraf to receive the metrics from the OpenEthereum client

  3. The collected metrics are stored in an InfluxDB database and can be visualized using Grafana

Green Proofs Contracts

The GreenProof project by the Energy Web Foundation aims to provide a robust and flexible platform for issuing, managing, and verifying digital proofs representing clean energy certificates. To achieve this, the project employs the Diamond pattern, an innovative smart contract architecture based on the . This document presents an overview of the Diamond pattern, its benefits for the GreenProof project, and .

A modular and upgradable smart contract architecture

The Diamond pattern allows one main contract (called the diamond) to have an unlimited number of functions by separating the contract's functions into several smaller contracts called "facets." The diamond acts as a proxy contract that routes function calls to the appropriate facets (i.e., the actual subcontracts implementing the desired logic). This architecture enables a higher degree of modularity and upgradability for smart contracts by allowing users to trigger any on-chain function of any component using a single, stable smart contract address.

By implementing the EIP-2535 standard, the GreenProof core module provides an upgradable proxied system, wherein organized groups of smart contracts (facets and libraries) encapsulate different sets of functionalities into modules that can be plugged into the main GreenProof Diamond. This architecture unlocks the ability to efficiently and granularly compose the smart contract system based on the use case, allowing for seamless integration and updating of various components, enhancing the overall flexibility and adaptability of the system.

Benefits of the Diamond Pattern for GreenProof This smart contract architecture aims to achieve the following strategic objectives :

  1. Scalability: The modular nature of the Diamond pattern allows GreenProof to easily scale as more components and features are added or updated.

  2. Flexibility: Facets can be added, replaced, or removed granularly, enabling GreenProof to adapt to changing requirements in the green energy certification landscape.

  3. Maintainability: The Diamond pattern promotes a clean separation of concerns, making it easier to maintain, troubleshoot, and update the GreenProof smart contracts system.

GreenProof Diamond Implementation

To implement the Diamond pattern, the modules are composed of the following components:

contract/facets :

  • Voting component : implements the voting logic, allowing the worker nodes to achieve consensus on data to be certified.

  • Issuer component : encapsulates the issuance logic, allowing the verification and creation of green certificates. Each certificate is represented by an ERC1155 token bound to the proof of green, resulting from the workers' decentralized consensus.

  • Certificate Manager component: handles certificate management features, such as claiming, revocation, inspection, and verification.

contracts/libraries :

contracts/interfaces :

Below is the detailed Github repository structure:

Additionally, the GreenProof core module uses the library, which offers utility contracts implementing the EIP-2535 standard specification. The following are particularly useful:

  • The DiamondCutFacet.sol contract is a facet handling all the upgrading logic. (A cut, in the diamond’s industrie, is an action resulting in new facets creation, removal. This facet will be used to add, replace or remove granularly logic to the greenProof Diamond)

  • A dedicated facet is provided with the OwnershipFacet contract, which handles the implementation of the standard for the Diamond ownership.

  • A DiamondLoupeFacet.sol contract provides all standard for showing what facets and functions the diamond has.

Estimating Green Proofs Contract Gas Costs

We want to estimate, for each action taking place on smart contract, the cost estimation. Smart contract transaction costs can be measured on two different metrics:

  • a predictable, static computation gas consumption, which measures the computational effort required on the Ethereum Virtual Machine to execute the transaction logic

  • a dynamic cost associated to the base fee + priority transaction fees, provided to the validator nodes. This dynamic metric is related to the offer/supply balance on the network; the more traffic occurs, the highest are the required fees to have the transaction processed in priority.

The current document provides the average gas consumption for greenProof smart contracts. It uses the on the hardhat development environment. This plugin is useful in estimating how much our contracts will cost to deploy to production, and how much each transaction will cost once deployed. It can be enabled during unit testing.

A separate set of unit tests has been implemented to target each function and report the gas consumption. Below are the result of this estimation.

Deployment costs

  • Contracts deployed once (those contracts will be deployed only once by EnergyWeb and will act as on-chain libraries/modules for each new green proof instance)

E.g. for SAF and 24/7 app, we would deploy the facets for each of them once. We deploy all facets once, and any new projects which require those logic/feature will just have to connect to those deployed smart-contracts. For that purpose we need to keep track of the addresses of those facets in our backend system I guess, since we will have to reuse them.

Note about cost percentage: (For each transaction, the user provides into the parameter the maximum amount of gas allowed to execute this transaction. So here the % is out of this gasLimit parameter.)

  • Contracts deployed each time we want to set a new greenProof instance

This greeproof contract will be deployed only once for each project (i.e Quintrace). This is the main contract which will never be upgraded, and which purpose is, among others, to forward / redirect each transaction to the right sub-smartcontract (i.e facet) implementing the required logic. This greenproof contract has an internal registry mapping each function to the address of the contract which should be reached to execute this function.

So anytime we want to make an upgrade, we will send a transaction to that greenproof contract in order to change the address of the logic-contract inside the mapping / registry

At the end of the day, the greenproof contract won’t be redeployed.

(Note that we may need to deploy a new logic-contract in order to get the new address to store into the greenproof main contract. But the main one is not redeployed)

Certificate Management

The below methods will be called to perform actions on certificates.

Voting component

The below methods will be called to perform vote related actions.

How to optimize gas ?

On the smart contract level we are seeking for patterns which:

  • minimize readings and writings operation from and to the EVM storage, especially in loops

  • when possible, tightly pack data in structures

  • when possible convert external function calls into internal functions since calling external functions raises costs.

On the compiler level, the optimizer option can be enabled on the configuration file (hardhat.config or truffle.config). This option requires to set a runs parameter. From the solidity documentation:

The number of runs specifies roughly how often each opcode of the deployed code will be executed across the life-time of the contract. This means it is a trade-off parameter between code size (deploy cost) and code execution cost (cost after deployment).

Since we are using a highly modularized smart contract system (Diamond Proxy Pattern), our contracts bytecode is very reduced, which allows a high runs setting on the optimizer. (More infos on ).

Verifiable Credential API

VC-API is specification of a data model and HTTP protocols to issue, verify, present, and manage data in a ecosystem.

Energy Web provides an implementation of to reduce difficulties for organizations to start issuing and verifying Verifiable Credentials. Using these APIs it becomes easy for anyone to do Proof of Concepts for SSI use cases.

VC-API can be easily integrated with existing systems and are configurable for complex exchanges. Implementers can choose to implement APIs that fits their use case. One can keep it simple with minimal set of APIs even for complex data exchanges (presentation).

Refer for more information.

Advantages of EW implementation of VC-API :

  1. Portable, can be easily deployed to any environment and can be kept generic.

  2. Easy integration and configuration.

  3. Selective implementation of APIs based on the use case. For an application that provides feature to issue a credential only need to consume APIs specific to .

  4. Supports both Mediated and Unmediated exchange.

Entities of VC-API

The Verifiable Credentials data model introduces three actors . VC-API defines components that these actors may use for credential issuance, verification and exchange.

Each actors can have their own set of components to participate in the credential exchange.

  1. : execute the business rules and policies set by the actors. Also acts as mediator between these actors.

  2. : enable general VC-API functionality.

  3. : facilitate publishing and checking of status of Verifiable Credentials.

  4. : responsible for configuring and managing all the other components.

  5. : provide mechanisms to store and manage Verifiable Credential of the associated actor.

Energy Web's implementation of VC-API only provides services which enable VC-API functionality. A developer can implement their own components that are mentioned above.

Use-case functionalities

Applications can perform authorisation, issuance, verification and presentation exchanges using VC-API.

Servers implementing VC-API can confirm clients to utilise authorisation mechanism when performing certain requests. The request APIs endpoint can specify whether authorisation is needed or not.

For issuance of Verifiable Credentials, a holder can request any authority (Issuer) to issue a credential or can self-sign a credential.

A Holder can present their Verifiable Credential to the Verifier for verification. The Verifier can request the required credential from the holder using presentation-exchange protocol.

The sharing / exchange of Verifiable Credentials happen through presentation. These exchanges are executed based on the exchange-definition that are configured at run time.

A general exchange flow would look like :

Exchange Definition

The VC-API implementation can be easily deployed to any environment and can be kept generic, in other words exchanges are configured rather than coded in the application. This configuration is done at runtime via the use of Exchange Definitions.

In order to configure the credential exchange, you can use the exchange definition data transfer object. For reference see the implemented by Energy Web.

Some different types of exchange definitions are :

Sample DIDAuth query VP Request

Sample PresentationDefinition query VP request

Exchange Definition Structure and Properties

exchangeId

exchangeId is definition identifier, used to fetch exchange-definition

Exchange Queries

The Exchange Definition has a query property that tells which data needs to be requested. The type of queries that are supported are defined by VerifiablePresentationQueryType, for reference see .

The DIDAuth query type is used for exchange needed for authorisation, while PresentationDefinition could be used to request certain data from the Holder.

Exchange Callbacks

When defining an exchange, callbacks can be configured to allow parties to receive notice of a VP submitted in response to an exchange. Notifications consist of POST requests to the configured URLs. A callback is configured by adding an entry to the callback array in the Exchange Definition.

Exchange Interact Services

The exchange interaction types used by this VC-API implementation are directly related to Verifiable Presentation Request Interaction Types. The interaction types indicate to the receiver of the presentation request how they can expect to interact further with the issuer/verifier.

  1. Mediated Exchange Interactions

Mediated exchange interactions signal to the receiver of the presentation request that the exchange is mediated by an additional component and may not be automatically processed. Mediated exchanges therefore allow for a review of presentation submission by a human or automated process as well as the issuance of credentials based on this review.

Due to the duration of the mediation process being unknown, the submitter of the verifiable presentation may have to query repeatedly in order to check if the result of the mediation is available.

  1. Unmediated Exchange Interactions

Mediated exchange interactions signal to the receiver of the presentation request that the exchange is not mediated by an additional component and can be automatically processed.

serviceEndpoint

serviceEndpoint is used to continue exchanges

Presentation Definitions.

These presentation exchange take place on the basis of . Verifiers articulate these definitions of what they require for proofs. The issuer then wraps their Verifiable Credentials on the basis of presentation-definition in a VP and provide a response to the Verifier.

The presentation_definition are constructed of inputs, that describe the format and details for proofs required. They may also contain selection or filter rules for the presented Verifiable Credentials.

A presentation_definition has input_descriptors property which has an array of objects with properties describing what type of input data (credential) or sub-fields are required for submission.

See to know more.

Let's understand different workflows with VC-API

Presentation exchange between Holder and Issuer

Presentation exchange between Holder and Verifier

Example for a VC issuance and presentation using VC-API can be seen in .

{
  "verifiablePresentationRequest": {
    "query": [{
        "type": "DIDAuthentication"
      }, {
        "type": "QueryByExample",
        "credentialQuery": {
          "reason": "We need to see your existing University Degree credential.",
          "example": {
            "@context": [
              "https://www.w3.org/2018/credentials/v1",
              "https://www.w3.org/2018/credentials/examples/v1"
            ],
            "type": "UniversityDegreeCredential"
          }
        }
      }],
      "challenge": "3182bdea-63d9-11ea-b6de-3b7c1404d57f",
      "domain": "example.edu",
      "interact": {
        "service": [{
          "type": "UnmediatedPresentationService2021",
          "serviceEndpoint": "https://example.edu/exchanges/refresh-degree/0bc42ece-89f7-11ec-9af0-136dfa9e4dbb"
        }]
    }
  }
}
{
"exchangeId":"<SOME UNIQUE ID>",
    "query":[
      {
         "type":"PresentationDefinition",
         "credentialQuery":[
            {
               "presentationDefinition":{
                  "id":"286bc1e0-f1bd-488a-a873-8d71be3c690e",
                  "submission_requirements":[
                     {
                        "name":"Consent and Resident-card Exchange",
                        "rule":"pick",
                        "min":2,
                        "from":"A"
                     }
                  ],
                  "input_descriptors":[
                     {
                        "id":"PermanentResidentCard",
                        "name":"PermanentResidentCard",
                        "purpose":"PermanentResidentCard",
                        "group":[
                           "A"
                        ],
                        "constraints":{
                           "fields":[
                              {
                                 "path":[
                                    "$.type"
                                 ],
                                 "filter":{
                                    "type":"array",
                                    "contains":{
                                       "type":"string",
                                       "const":"PermanentResidentCard"
                                    }
                                 }
                              }
                           ]
                        }
                     }
                  ]
               }
            }
         ]
      }
   ],
   "interactServices":[
      {
         "type":"UnmediatedHttpPresentationService2021"
      }
   ],
   "isOneTime":true,
   "callback":[
      {
         "url":"FILL YOUR CALLBACK URL, for example 'https://webhook.site/efb19fb8-2579-4e1b-8614-d5a03edaaa7a'"
      }
   ]
}
"interact": {
            "service": [
                {
                    "type": "MediatedHttpPresentationService2021",
                    "serviceEndpoint": "http://localhost:3000/exchanges/resident-card-issuance-82793/55fb5bc5-4f5f-40c8-aa8d-f3a1991637fc"
                }
            ]
        }
"interact": {
      "service": [
        {
          "type": "UnmediatedHttpPresentationService2021",
          "serviceEndpoint": "https://vc-api-dev.energyweb.org/v1/vc-api/exchanges/b6754fca-f123-43ce-8bd2-92074f05a29b/25390400-e995-4f34-8f59-5820a8ce7816"
        }
      ]
    }
{
  "presentation_definition": {
    "id": "Scalable trust example",
    "input_descriptors": [
      {
        "id": "any type of credit card from any bank",
        "name": "any type of credit card from any bank",
        "purpose": "Please provide your credit card details",
        "constraints": {
          "fields": [
            {
              "path": [
                "$.termsOfUse.type"
              ],
              "filter": {
                "type": "string",
                "pattern": "https://train.trust-scheme.de/info"
              }
            },
            {
              "path": [
                "$.termsOfUse.trustScheme"
              ],
              "filter": {
                "type": "string",
                "pattern": "worldbankfederation.com"
              }
            },
            {
              "path": [
                "$.type"
              ],
              "filter": {
                "type": "string",
                "pattern": "creditCard"
              }
            }
          ]
        }
      }
    ]
  }
}
Verifiable Credentials
VC-API
VC-API specification
issuance
Issuers, Holders and Verifier
Coordinators
Services
Status Service
Admin
Storage Services
Authorisation
Issuance
Verification
Presentation
Exchange Definition Data Transfer Object
VpRequestQueryType
presentation-definition
input_descriptors
Resident Card Tutorial
exchange-flow-diagram
issuance-exchange-flow-diagram
presentation-exchange-flow-diagram

Contract to deploy

Avg unit of gas consumption txfees = (amount of gas) * gasPrice)

AVG cost (in USD)

Cost percentage

VotingFacet

2080202

0.16

6.9 %

IssuerFacet

3259338

0.25

10.9 %

ProofManagerFacet

1537946

0.12

5.1 %

GreenproofInit

173707

0.01

0.6 %

Contract to deploy

Avg unit of gas consumption

AVG cost (in USD)

Cost percentage

Greenproof (main proxy)

3993308

0.31

13.3 %

Methods

Avg unit of gas consumption

AVG cost (in USD)

requestProofIssuance

518491

0.04

discloseData

107834

0.01

safeTransferFrom

182209

0.01

claimProof

68582

0.01

claimProofFor

81530

0.01

revokeProof

95339

0.01

Methods

Gas consumption

AVG cost (in USD)

addWorker

105305

0.01

removeWorker

65767

0.01

Vote

404279

0.03

EIP-2535 standard
its implementation within the core module
GreenProof smart contracts
VotingFacet.sol
IssuerFacet.sol
ProofManagerFacet.sol
solidState
contract libraries
IEP-173
loupe functions
Gas Reporter plugin
gasLimit
how the EIP 2535 pattern helps in code optimization

Energy Web Chain Governance

Summary

As a Proof-of-Authority network, the Energy Web Chain is governed by its community of known, vetted validators: https://validators.energyweb.org/

The fundamental tenet of the EW Chain governance mechanism is "one validator = one vote", so each validator is equal in terms of decision-making power. The primary function of the governance mechanism is to make decisions regarding:

  • Validator eligibility & operational standards / procedures

  • Technical changes & updates to the EW Chain (e.g. network upgrades, client updates, etc.)

  • Utilization of the Energy Web Community Fund

  • Evolution of the governance mechanism itself

All decisions are made via a formal voting process, with a simple majority of "yes" votes required to adopt a proposal.

Within the EW Chain validator set, there are three committees that provide leadership and recommendations in three areas as follows:

  • The Technical Committee focuses on technical upgrades and modifications of the core EW Chain system components as well as the security and performance of validator nodes.

  • The Community Fund Committee focuses the utilization of the EW Community Fund, including proposals and grants.

  • The Operations Committee focuses on day-to-day operations of the EW Chain and validator community, including facilitating governance meetings/voting events and managing the governance process itself.

EWC Validator Roles & Responsibilities

The Energy Web Chain (EWC) is a public, Proof-of-Authority EVM blockchain.

Unlike other consensus mechanisms that depend on solving arbitrary difficult mathematical puzzles (Proof-of-Work) or locking up funds (Proof-of-Stake), Proof-of-Authority (PoA) relies on a trusted set of "authorities" - nodes that are explicitly permissioned to create blocks and secure the network. The EWC uses a specific PoA algorithm called AuRa (for a technical specification of AuRa, see here).

In the EWC, these authorities are called validator nodes; the organizations who host these nodes are referred to as Validators. To maintain credibility and trust, EWC Validators must be known, reputable entities with valid market influence and/or activity in the global energy sector.

EWC Validators have three primary responsibilities:

  1. Securely host validator nodes: Each Validator organization is expected to host a validator node on the main EWC as well as the Volta test network (maintaining both is critical to have a test environment that mirrors the production EWC as closely as possible). Hosting a node includes installing, maintaining, and monitoring their node while following best practices for key management, regular maintenance / updates to the node host environment, and proactively alerting the EWC community if they identify any potential bugs, vulnerabilities, or risks that can impact validator nodes.

  2. Participate in the EWC Governance: Validators are expected to offer opinions and contribute to technical and non-technical decisions (i.e. voting) relating to modifications of the Energy Web client, protocol, and governance mechanism itself.

  3. Actively participate and contribute to the EWC community: All validators are expected to proactively contribute to the EWC community in one or more of the following ways on a regular basis: Developing Applications & projects on the EWC; Contributing to open-source EW-DOS code; Contributing to Community Fund Proposals; Contributing to Governance Proposals; Community Building.

To view the current list of EWC validators, visit https://validators.energyweb.org/

EWC Validator Eligibility

At the time of the launch of the EWC in June 2019, the initial cohort of 10 Validators (all of whom were founding EWF Affiliates) decided that organizations must meet the following criteria to be eligible to become EWC Validators:

  1. Be legally registered organizations (not individuals);

  2. Be an official Member of EWF (i.e. have an active Membership in good standing), and;

  3. Demonstrate technical and security competence

In February 2020, the Validators asked for greater transparency and a formal structure for the EW membership program. The primary objective is to ensure that all members have sufficient reputation (i.e. good standing) and operational capabilities to strengthen the EW Chain and EW-DOS utility layer. Based on this feedback, the eligibility criteria for EW Membership was updated as follows:

To be eligible for EW Membership, organizations must:

  1. Have legitimate operational activities that will contribute to the mission of EWF and the success of the EW Chain; this includes energy market participants (e.g. grid/market operators, utilities/retailers, aggregators), organizations who provide products and services to energy market participants (e.g. OEMs/technology providers, regulatory/research organizations, financial services), and organizations who actively contribute to the development of open-source technology that enhances the Energy Web Decentralized Operating System.

  2. Have sufficient reputation (or “authority”) to credibly strengthen the Proof-of-Authority consensus mechanism (i.e. must have a minimum of three customer/project references that demonstrate the nature of the operational activities described above).

If you are part of an organization interested in becoming an Energy Web Member and EWC validator, please visit https://www.energyweb.org/workwithus/

EWC Validator Node Operational Functions

EWC validator nodes can:

  • Establish consensus about the state of the network by verifying the work / behavior of other validator nodes;

  • Reject blocks / transactions that violate input/output protocols defined by AuRa and the EVM state transition function;

  • Implement permissioning functions as described here (note: permissoining functions can only be implemented via a majority governance decision).

EWC validator nodes CANNOT:

  • Inspect or approve the contents of individual transactions;

  • Unilaterally verify transactions (any given transaction is only finalized after n/2 blocks, with n=total validators);

  • Associate identities with on-chain accounts;

  • Unilaterally modify account permissions, network topology, or network state.

EWC Governance Processes

All governance decisions impacting the EW Chain begin with a formal proposal, which is reviewed and ultimately decided by a vote among all validators. The process for making and implementing decisions is as follows:

  1. Validators coordinate proposals via monthly meetings and a dedicated governance forum (this is only available to active validators; a public summary of governance meetings and decisions is published separately).

  2. Proposals are specific changes to the EW Chain protocol, governance mechanism, or operating procedures that require a collective decision by the EW Chain validators. All Proposals are evaluated on an individual, case-by-case basis. Any validator is free to make a Proposal by creating a new Proposal Page in the Governance Forum.

    1. When a Proposal is created, it is announced to the entire validator community via Slack, email, and meetings. It is then open for comment and review for a period of up to 10 days to provide the validators with an opportunity to offer feedback or revisions to the Proposal language. Once the feedback period expires, the language of the Proposal is finalized.

  3. One or more Proposals are batched into a Voting Event; there is maximum of one Voting Event in any given month. When one or more Proposals are finalized and ready for a vote, the Operations Committee administers the voting process itself:

    1. On average there are 1-2 voting events per quarter (note: the frequency of voting events varies depending on the volume and complexity of proposals, but the intent is to maintain a voting schedule at regular intervals so all validators know in advance when they should expect to evaluate and decide on Proposals).

    2. A voting event is defined as a ten-day period during which Proposal polls will be open for voting.

    3. Each voting event will feature all Proposals that have not been formally decided since the preceding voting event (i.e. all new or pending Proposals).

    4. Voting events are announced at least one week in advance via the regular monthly validator governance call, and via Slack, email, and the Discuss Forum. This announcement will also specify which Proposal(s) shall be decided in the current voting event.

  4. Voting is performed via a binary poll on each Proposal page in the Governance Forum. A “Yes” vote means adopting the proposal exactly as worded and a “No” vote means rejecting the proposal in its entirety.

  5. For a Proposal to be accepted (i.e. a change will be implemented as described in the Proposal) greater than 50% of active validators must vote “Yes”. Any Proposal that does not achieve greater than 50% approval will be rejected; this means the status quo is the default position.

    1. Each validator organization is entitled to one vote, therefore the total number of votes is equal to the total number of validator nodes. The Operations Committee acts as an administrator capable of reviewing vote submissions and will delete any duplicate votes from validator organizations.

    2. Non-participation (i.e. a validator does not cast a vote) is counted as a “No” vote by default. This means that in order to implement the change as described in the Proposal, a majority of validators must proactively vote “Yes”.

      1. For example, if there are 20 validator nodes then there are 20 total votes in the current voting event. In this case a Proposal will only be adopted if 11 or more validators vote “Yes”.

    3. Validators are required to participate in at least 90% of voting events each year. During each voting event, all validators receive multiple instructions / reminders via email and Slack to ensure that they have the requisite knowledge and capacity for casting a vote. Failure to participate in at least 90% voting events violates the Validator Code of Conduct, and may result in penalties.

  6. Each validator organization designates only one representative to cast its vote during the voting period. Each voting representative acknowledges that they are responsible for casting a vote on behalf of their company, and that their company’s vote will be shared with the other validators. Every validator organization is responsible for its own internal policies and procedures for voting event participation. Validators recognize that casting a vote for or against a given Proposal is binding for that Proposal only.

    1. If multiple users from a single validator organization accidentially cast congruent votes (i.e. all votes are aligned), the Operations Committee will automatically de-duplicate the results and the company’s vote will be recorded accordingly.

    2. If multiple users from a single validator organization cast conflicting votes (e.g. some “yes” and some “no”), the Operations Committee will attempt to contact the representative(s) of the validator to clarify which position is correct. If the validator’s position is not confirmed by the end of the voting period, then the conflicting votes shall be collectively be counted as a “No” vote by the validator for that Proposal.

  7. The voting poll automatically closes 10 days after opening, giving validators two full business weeks to cast their vote. Upon closing of the voting period, the anonymized results (i.e. distribution of votes between “Yes” and “No”) will be automatically viewable on the Proposal Topic page.

  • Following the close of the voting period, the Operations Committee reviews the votes to ensure that only one vote per validator organization is counted.

  • Though the vote itself is “secret” voting, meaning no voters have knowledge of how other voters have cast their ballot, the final results indicating how each validator votes are shared with the rest of the validator set (and no other parties) after the voting period closes via documentation in the Proposal Topic page in order to maintain accountability, establish a robust audit trail for posterity, and reduce the potential for vote buying or collusion.

  • For accepted proposals (defined as greater than 50% of total votes cast in favor / “Yes”):

    • The relevant validator Committee works with the validator(s) who initiated the proposal to formulate an implementation plan and timeline.

  • For rejected proposals (defined as less than or equal to 50% of total votes cast in favor / “Yes”):

    • The validator(s) who initiated the proposal or who voted in favor of the failed proposal may revise the language and/or parameters of the proposal and present the revised proposal to the community for consideration. Revised proposals that materially differ from the original rejected proposals may be put to a vote the following month.

    • Rejected proposals that are not materially revised may be re-considered for a vote after a period of 6 months following the rejection vote has elapsed.

Validator Code of Conduct

The defining feature of the Energy Web Chain is its Proof of Authority consensus mechanism, which relies on reputable entities with valid authority in the global energy sector (i.e. actual market influence) to credibly maintain trust in the network. The adoption and success of the EW Chain is dependent on maintaining an engaged, active community of validators.

Like any community, the EWC validators must be aligned on a common set of principles and follow mutually-agreed upon rules. This Code of Conduct defines the operational and governance expectations and responsibilities for EWC validator organizations. The Code was formally adopted by a supermajority vote in December 2020 and amended by majority vote in December 2021.

Community Expectations for EW Chain Validators

Organizations hosting validator nodes must:

  • Proactively contribute to the EW Chain community in one or more of the following ways:

    • Developing Applications & projects: Building or participating in projects, applications, or markets that utilize the open-source EW-DOS technology stack.

    • Contribution to EW-DOS open-source code: Submitting pull requests to any of the open-source EW-DOS repositories, including the EW Chain, Utility Layer, and Toolkits.

    • Contributing to Community Fund Proposals: Identifying opportunities to leverage the Community Fund to support the development or integration of other relevant technologies/projects into the EW Chain or broader EW-DOS stack.

    • Contributing to Governance Proposals: Creating, responding to, and participating in threads (topic discussions) and formal voting proposals in the governance forum on a regular basis.

    • Community Building: Identifying and recruiting other organizations (e.g. energy market participants, regulators, researchers, technology partners) to participate in projects and/or the EWF community.

  • Actively participate in the EWC Validator Community:

    • At least one representative from each validator organization should attend the monthly governance meetings on a regular basis.

    • At least one representative from each validator organization should regularly (at least monthly) engage in the EWC governance forum to create or respond to different topics and proposals.

    • Engaging in discussions and helping answer questions from peers in the dedicated validator communication and support channels.

  • Hold themselves and peer validators accountable to:

    • Act with honesty, integrity, and openness in working in the best interest of the EWC community.

    • Comply with all applicable laws, rules, and regulations, particularly anti-bribery, anti-corruption, and anti-money-laundering laws, rules, and regulations.

    • Avoid conflicts of interest between the validator organization (and its core business) and the EWC (and EWC community).

  • Refrain from the following unacceptable behavior:

    • Non-participation: Organizations cannot just “set it and forget it”; if an organization sets up a validator node and subsequently never joins calls, participates in discussions, or contributes the the EWC community in any way then they will face a penalty or be removed from the validator set.

    • Obvious rent-seeking: The EW Chain is operated by and designed for the energy industry; its purpose (i.e. utility) is to support novel digital solutions that help advance the global energy transition. Validators who are transparently motivated solely by EWT block rewards, abuse their position as validators to create deleterious effects on EWT markets, and/or do not contribute to the mission and success of the EWC ecosystem as described above, will face temporary suspension and/or expulsion from the validator set. Rent-seeking is defined as validators liquidating greater than 10% of their block reward balance within any given 30-day period.

    • Lack of communication: Organizations who do not respond to official validator communications in the event of an operational or governance task will face temporary suspension and/or possible expulsion.

EW Chain Validator Organizational Accountability

Organizations who host EW Chain validator nodes are responsible for the following:

  • Keeping their node healthy and private keys secure. This includes implementing best practices for key management, regular maintenance / updates to the node host environment, and proactively alerting the EWC community if they identify any potential bugs, vulnerabilities, or risks that can impact validator nodes. Validator organizations are expected to perform node updates in a timely manner to support EWC network upgrades.

  • Monitoring their node. Proactively monitoring their node for issues and identifying faults that result in the node failing to successfully seal blocks.

  • Maintaining internal technical expertise to be self-sufficient. Each organization must possess sufficient internal technical resources to perform routine maintenance on the node / host environment as well as independent troubleshooting and fault diagnosis using the Wiki, Github, and the validator Slack channels (i.e. other validators in the community) as primary support tools.

  • Responding to official EWC validator communications in a timely manner. Validator organizations are expected to maintain an accurate contact list and respond to communications related to the operation and governance of the EWC.

  • Dedicating time to participate in meetings and governance decisions. At least one representative from each validator organization should plan on dedicating sufficient time each month to participate in calls, review documentation, and engage in the governance forum.

Code of Conduct Requirements & Enforcement

The following requirements were adopted by a majority vote in December 2021 and are effective immediately. These requirements are in addition to all existing terms of the Code and will be automatically monitored on a forward basis using the Validator dashboard (2022 onwards).

Validator Node Health Requirements

  1. Each Validator node must achieve at least 95% uptime on a rolling 30-day basis (equivalent to no more than 36 hours of unplanned outages over the preceding 30-day period). A node is considered failed if it falls more than 120 blocks behind the latest block and/or fails to seal a block at its designated slot for 5 or more consecutive authority rounds. Node outages during regularly-scheduled network upgrades or planned maintenance windows are excluded from this requirement.

Governance & Community Participation Requirements

  1. Energy Web Validators must participate in at least 75% of governance meetings and 90% of voting events on a rolling 6-month basis. Participation is defined as having one or more representatives from the Validator organization attending meetings and having one representative from the organization casting a vote in open proposals within the governance forum, respectively.

  2. Each quarter, all Energy Web Validators must demonstrate at least one specific example of community participation as defined in the Code (i.e. Developing Projects & Applications, Contribution to open-source EW-DOS source code, Contributing to Governance Proposals, Contributing to Community Fund Proposals, Community Building).

Energy Web Token (EWT) Block Reward Requirements

As leaders and stewards of the EWC, Validators commit to responsibly managing liquidation of EWT reward balances so as to not create deleterious effects on EWT markets. Validators qualify to transfer block rewards from payout addresses to known exchanges if three requirements are met:

  1. Time requirement: Validators must successfully host a node and comply with the Validator Code of Conduct for a period of 6 consecutive months following initial Validator node activation.

  2. Balance requirement: Validators must maintain a minimum balance of block rewards equal to or greater than the trailing 6-month average reward earned per validator (for example, if the average validator earned 15,000 EWT total in block rewards in the preceding 6 months, all validators must maintain a balance of at least 15,000 EWT in their payout addresses to remain eligible).

  3. Rent-seeking requirement: Once the time and balance requirements above are met, Validators may only transfer a maximum of 10% of their current block reward balance within any given 30-day period to known exchange addresses.

Current block reward balance is defined as the sum of EWT held in the Validator’s payout address(es) and EWT used in the Energy Web ecosystem on a rolling 12 month basis for business activity including but not limited to paying Energy Web Membership dues, Energy Web Chain transaction fees, procuring Utility Layer services, and staking EWT.

These requirements are designed to incentivize Validators to use EWT earned from block rewards in the Energy Web ecosystem.

Validator adherence to the Code of Conduct will be automatically monitored using the Energy Web Validator dashboard, which will collect data from the Validator governance forum, node telemetry, and the EWC itself to assign a quantitative performance score for each of the above categories.

The performance of each Validator will be made public via the dashboard so Validators and the wider community can hold each Validator accountable for maintaining compliance.

The Code will be enforced objectively as follows:

  • Single violation, defined as an initial breach of any one of the above categories, will result in an immediate two-week suspension of the validator node.

  • Secondary violation, defined as a breach of two categories concurrently, a breach of the code as listed below, or a second violation of a single category within a rolling 12-month period, will result in an immediate four-week suspension of the validator node. Reinstatement of the node is contingent upon the Validator submitting a written plan to remedy past violations and maintain compliance with the Code of Conduct within the governance forum.

    • Failure to perform necessary node updates as part of a planned network upgrade;

  • Significant violation, defined as a breach of all three categories concurrently, a breach of the code as listed below, or two or more secondary violations within a rolling 12-month period, will result in permanent expulsion from the EW Chain validator community.

    • Experiencing a major security failure in which a validator node's host machine and/or private keys are compromised by unauthorized actors;

    • Engaging in illegal, unethical, or anticompetitive behavior;

:black_small_square:
:black_large_square:
:black_large_square:
:black_small_square:
:black_medium_small_square:
:black_large_square:
:black_medium_small_square:
:black_small_square:
:black_medium_small_square:
:black_medium_small_square:
:black_large_square:
:black_medium_small_square:

Scaling Access to Grid Flexibility

This page covers three topics:

  1. Current challenges in integrating distributed energy resources (DER) into power grids

  2. The potential benefits of integrating DERs into power grids

  3. Examples of how EW-DOS is being applied to solve DER integration and related lifecycle management challenges

Current Obstacles to Grid Flexibility and DER Integration

The current energy transition involves a shift from a power system defined by a relatively small number of large conventional power plants to one that also includes increasing numbers of Distributed Energy Resources (DERs). DERs are small-scale assets (devices) that either supply or consume electricity (in some cases, either one at different times) and include rooftop solar panels, home batteries, and electric vehicles. On top of this is an expanding market of “smart” appliances, smart meters, and digital energy management systems that track and regulate energy usage in a customer-centric manner.

As of now, there is no shared technical infrastructure or communication system between the electricity grid and this growing number of customer-centric energy resources. Their current technical infrastructure and capabilities are widely incongruent; most electricity grid operators are not fully digital and innovation at a large scale is a challenge. Grid management, energy asset qualification and pricing were not designed to account for a distributed energy market where production, capacity and location can be so variable.

Compare this with modern, digital DER companies, where digitization and flexibility are key components to the way they operate. Their energy assets (batteries, EVs, solar panels, etc.) are connected to software management platforms that digitize their performance and efficiency.

‌But, even if grid operators did have the technical infrastructure to connect to DER assets, it would require an enormous amount of configuration to connect with each individual resource and coordinate their assets. As a result, many distributed assets remain invisible to the grid, or they are chronically underutilized in the grid’s planning and operation functions. This means that they cannot contribute to grid flexibility services to their fullest potential. (Grid flexibility services are any services that meet requirements for more or less load on the electricity grid.)

Grid Flexibility from Distributed Energy Resources

DERs offering flexibility have the potential to provide a number of grid services, including frequency regulation, voltage support (volt/VAR), spinning or non-spinning reserves, capacity/resource adequacy, or any other form of load balancing. Whether DERs actually can participate in relevant markets or programs has been limited by the inability of grid operators to “see” and trust what the assets are, where they are, and that they actually perform when called upon. Solving this set of challenges can then allow grid operators, utilities, and regulators to incorporate DERs into whatever markets or programs they design.

More practically, a solution that supports DER integration provides several benefits for grid operators:‌

  1. Situational awareness of DER capacity and expected performance so that grid operators can better understand real-time and forecasted grid conditions. By estimating how much DERs will affect the net load on the system, grid operators can model how much conventional supply is needed..

  2. Secure communication with DERs to directly coordinate their activity. This could be selective charging or discharging of assets like batteries or electric vehicles to reduce or increase their load on the grid.

  3. Simplified prosumer and device onboarding and compensation for participation in markets or programs.

Solving this set of challenges is exactly the motivation behind EW-DOS: It provides decentralized identity and access management (IAM) and messaging protocols so that grid operators can identify and coordinate grid flexibility services provided by consumers and Distributed Energy Resources (DERs).

Below are three broad applications of EW-DOS in scaling access to grid flexibility and applied industry use cases.

Application 1: Prosumer Coordination

Industry Challenge

In the current grid architecture, service operators at various levels of energy transmission, distribution, and aggregation have no open method for collectively identifying and orchestrating distributed energy resources (DERs). This means that grid operators have little insight into how much, when, and where energy is produced by DERs, how this affects load on the grid, or the potential for DERs to sell their energy back to the grid and/or adjust their consumption patterns. ‌

Primary Enterprise Actors

  • Transmission Service Operators (TSOs) or their equivalent

  • Distribution Service Operators (DSOs) or their equivalent

  • Aggregators

Solution

Design open systems that allow grid service operators to identify and coordinate DERs via a system that is accessible to all relevant market participants. To do this, there needs to be a standard, shared method for:

  1. Identifying DER assets via a shared, decentralized protocol (Decentralized Identifiers)

  2. Recording and verifying DER asset capabilities through Verifiable Credentials

  3. Communication standards among grid operators, aggregators, or other stakeholders and DERs

Applied Use Case: Australian Energy Market Operator (AEMO)

Key Industry Participants

  • Australian Energy Market Operator (AEMO) - manages the two sets of markets at the transmission level in Australia, the National Electricity Market (NEM) and the Wholesale Electricity market (WEM)

  • Distributed Network Service Provider (DNSP) - comparable to the role of Distributed Service Operator, manages the operation of the electric grid at the distribution level for a given territory

  • Aggregators

Project Overview

Energy Web is partnering with AEMO, Microsoft and PXiSE to design a decentralized messaging messaging platform (the "Energy Demand and Generation Exchange" platform) for aggregators and DNSPs to facilitate DER participation in local and wholesale markets. Aggregators and DNSPs will use the platform to exchange data about DER capacity to maintain grid balance.

EW-DOS will provide the infrastructure for:

  • Identity and access management for all assets and market participants in the program

  • A decentralized messaging service

The marketplace will enable three key functions:

  1. Exchange DER data between all actors in an efficient and scalable manner

  2. Dispatch DER fleets to the wholesale market without violating distribution network limits

  3. Facilitate open, scalable and competitive trade of DER Services in a way that keeps the local grid balanced

EW-DOS Components Used

EW-DOS Component
Function

Client library to manage , and application enrollment

Decentralized messaging service for communication between aggregators, DNSPs and AEMO

Stores information relevant to channels and application permissions and roles for fast read-query performance

User interface to administer DNSP and aggregator enrollments and permissions

Additional Info

  • AEMO EDGE Project website

  • "AEMO announces open-source operating system for world-leading distributed energy marketplace design trial"

  • "Canary in the Sunshine: Australia is showing the rest of the world what a modern grid looks like" on Medium

Application 2: Emergency Demand Flexibility

Industry Challenge

Grid operators employ a variety of strategies to ensure that the grid operates reliably in times of extreme stress. One of these tools is demand flexibility: rather than treating electricity demand as fixed at any given time and adjusting supply to meet it, grid operators increasingly try to adjust demand as well.

Demand flexibility takes various forms, ranging from utility demand response programs, to calls for the public to voluntarily conserve in times of especially high demand.

Without a system of shared identity for customers and assets, it is difficult for grid operators to know what customers and what assets will be participating in grid flexibility programs and to what scale. This makes it difficult to forecast how effective demand-flexibility will be in balancing the grid supply.

Primary Enterprise Actors

  • Transmission Service Operators (TSOs)

  • Distribution Service Operators (DSOs)

  • Energy Prosumers

Solution

Assign self-sovereign, Decentralized Identities(DIDs) to customers and their assets anchored on the Energy Web Chain. DIDs are crucial to having shared visibility into grid participants and their potential to offer flexibility. A self-sovereign approach ensures that personally-identifiable information is managed in accordance with legal requirements (e.g., GDPR) and consumer expectations.

Applied Use Case: California Independent System Operator (CAISO)

Key Industry Participants

  • CAISO - equivalent to a TSO, manages the transmission system and related markets for most of California and parts of Nevada

  • Consumers

Project Overview

California's power grid uses demand flexibility programs to maintain grid balance in periods of extreme weather and demand surge. Energy Web partnered with CAISO to enhance their existing 'Flex Alert' program with decentralized, self-sovereign identity.

CAISO encourages demand flexibility by administering the Flex Alert program, which involves voluntary calls for Californians to conserve energy in peak-demand hours, thereby reducing demand on the grid. Flex Alerts are communicated through several channels, including mass emails to Flex Alert subscribers and social media posts. Consumer conservation in response to a Flex Alert is completely voluntary; CAISO has no ability to enforce requests or manipulate respondents' utility services.

The initial Flex Alert system of communication was one-way: CAISO would send a Flex Alert, but recipients only read that alert and decided to adjust their behavior or not. CAISO had no insight into who would attempt to conserve or where participating consumers resided, which limited CAISO’s ability to forecast the level of impact a Flex Alert would have on the grid and adjust accordingly.

‌In conjunction to redesigning their outreach methods to be more bi-directional, CAISO employed Energy Web's method of Self-Sovereign Identification with Decentralized Identifiers (DIDs). Flex Alert participants now can subscribe to receive SMS messages or emails for Flex Alerts. They can choose to respond to the Flex Alert by indicating that they intend to conserve power during the critical period, and have the choice of providing their zip code, giving CAISO more visibility into where flexibility is coming from. Once they enroll in the system, participants are given a unique identifier that, in alignment with self-sovereign digital identities, is not linked to their personal data. CAISO can now encourage utility companies in zip codes with low Flex Alert participation to encourage customers to engage with the program.

Additional Information

  • "California grid operator launches new demand flexibility platform enhancements to Flex Alert system, leveraging Energy Web technology" on Medium

Application 3: Application and IoT Management

Industry Challenge

Distributed grid assets such as residential batteries and PV inverters do not unique identifiers that comply with an open, shared protocol. This makes it challenging to have insight into these assets' life-cycle and performance. There is no existing and openly accessible way to collect and digitize rich, insightful data about renewable assets over their lifetime. Without this data, it's difficult to forecast their potential contributions to the grid.

Primary Enterprise Actors

  • Original Equipment Manufacturer (OEM)

  • Government regulatory bodies

Solution

Give assets a vendor-agnostic, digital identity at the time of manufacturing that is anchored to the Energy Web Chain and accessible to all energy market participants. Use this identity to amass verified data about the asset that can allow it to participate in markets and give greater insight into its activity and its performance lifecycle.

Applied Use Case: Battery Recycling in Belgium (EasyBat)

Key Industry Participants

  • BeBat - Environmental non-profit focused on managing electronic waste, including lithium-ion batteries

  • Fluvius - DSO in Belgium

  • Original Equipment Manufacturers - responsible for assigning digital identity and asset credentials to batteries at time of manufacturing

Energy Web partnered with BeBat and Fluvius to develop a decentralized application (EasyBat) for battery life-cycle management. This was in response to the European Union's Battery 2030+ policy to promote efficient and high-performing batteries that have the least environmental impact. Using EW-DOS technology, the application assigns each battery that enters the Belgian market a digital "passport" based on DIDs and Verifiable Credentials.

This digital passport enables the accumulation of performance data on the battery throughout its lifecycle and facilitates responsible disposal of the battery when it's retired. Reference to the battery's claim information is stored in the battery's DID Document, then stored on IPFS and viewable through the EasyBat's user interface. (You can read more about the role of IPFS in storing assets' Verifiable Credentials here.)

Claims at each phase of the battery's lifecycle are stored on the DID Document

You can read more details on this project on the EasyBat website.

EW-DOS Components Used

EW-DOS Component
Function

Store and for system participants and provide on-chain verification

Create and manage and for battery assets

Interact with on the Energy Web Chain

Additional Information

  • "Bebat Launches EasyBat, an Open-Source, Decentralized Solution for Battery Lifecycle Management"

Run a Local RPC Node

Run a full instance of the blockchain on your machine

You have the option of running a full node of the Energy Web Chain main network or Volta test network locally. Running a local node does requires a degree of technical capability. It helps to understand the benefits of doing so, and the alternatives to running a full local node.

There are a number of benefits to running your own node, which are .

What does it mean to run a node?

A 'client' is software that implements a blockchain's protocols and allows you to connect directly with the blockchain - that is to read data from the blockchain or initiate transactions on the blockchain, such as transferring tokens. Anyone can create client software, as long as it implements that blockchain's official protocols. Ethereum's protocols are specified in their , and there are a number of Ethereum clients to choose from.

A node is any machine that is actively running client software and is connected to the blockchain. Blockchain is often called a “peer-to-peer” network, because its network is made up of many peers running nodes simultaneously that are connected to each other.

Depending on if you are running a full node, a light node, or an archive node (see the differences between these nodes ), your client will sync with the current state of blockchain and then continue to execute every transaction that is added to the blockchain. Essentially it is having a live copy or version of the blockchain running locally on your machine.

Depending on the blockchain you are you connecting to, this can take up large amounts of space and take a long time to retrieve and sync the history of the chain on your machine. For example, synching with the Energy Web chain will require much less resources than syncing with the Ethereum mainnet, as it is a much larger and longer-running blockchain.

What do I need to run a node?

To run a node, you need to install the client software. The Energy Web mainnet and Volta testnet both use the client (formally known as Parity), because it supports the , which is a consensus algorithm specifically for Proof-of-Authority (PoA) blockchains. You can read more about the PoA consensus algorithm and why we implemented it for the Energy Web Chain .

Only can create or 'seal' new blocks on the Energy Web Chain. If you run a full local node, you will be able to validate transactions, but not create new blocks.

Benefits to Running a Local Node

  1. The more nodes there are, the more secure the system is as a whole. Blockchains are decentralized technology, so by design the system performs better if there are multiple instances of it rather than just one. The more nodes there are, the less points of failure or opportunities for malicious action.

  2. Your transactions are more direct and more secure. Software that provides intermediary connections to the blockchain like or are, like any other web-based software, susceptible to downtime or error. By connecting to the blockchain yourself, you are removing your dependency on external providers for secure and direct connection. You also do not expose your public keys to the browser.

  3. You can self-verify transactions. You have part or all of the blockchain running on your node, so you can query the chain for transactions directly (and as often as you want) rather than relying on a user interface like a . Your queries can be more specific and efficient, giving you only the information that you need, for example, ‘how many transactions did addresses X, Y and Z send during this time period on each day for the last 30 days?’

  4. You are not subject to rate limits. Infura (and therefore MetaMask, as it implements Infura to connect to the blockchain) . If your development requires a lot of requests to the blockchain, running a local node may be more efficient.

Alternatives to Running a Local Node

Running a local node is not necessary to use applications that run on the blockchain or transfer tokens.

To use applications deployed on the Energy Web Chain, or to transfer tokens, you can connect to the blockchain through using a remote RPC. You can see guidance for doing that on the Volta Test Network and the Energy Web Main Network .

Run a local node using the command line

Hardware Requirements

You need to meet OpenEthereum hardware requirements and have enough disk space to store database snapshots (which will grow in time).

  • Multi-core CPU

  • 4GB RAM

  • SSD drive and free space

    • EWC RPC node - 150 GB

    • Volta RPC node - 200 GB

  • A decent DSL connection is required

Download Chainspec file

Download and save the chain config to your local machine.

Note that there are different chainspec files for the and the :

  • The chainspec file for Volta Test Network is .

  • The chainspec file for Energy Web Main Network is .

1. Download the chainspec file.

Volta Testnet chainspec:

Energy Web Chain (production) chainspec:

Using OpenEthereum Client

  1. Download

  2. Full specification for OpenEthereum configuration options can be found here:

  3. Run the following command in your terminal. Provide the path to the chain config that you want to use. The following command references the Volta chain config.

Your local node should start:

Connect your local node to MetaMask

Connect your MetaMask to the Volta Test Network or Energy Web Chain via remote RPC. You can read how to do this

Get the URL of your MetaMask account. You can do this by clicking the settings dropdown and selecting "Expand View."

When the view is expanded, copy the URL in the browser

Run the following command in your terminal

Run a local node using Docker with OpenEthereum client

This section describes minimal setup to run an RPC node locally or on the server using Docker container run with docker-compose. This is solely for development purposes, it's not a production grade recommendation.

See OpenEthereum documentation for Docker:

Prerequisites

Set up

  1. Verify that prerequisites are installed:

2. Create working directory

3. Create docker-compose.yaml file

4. Download database snapshot - this takes some time and requires resources due to the size of the .tar file, but it will speed up synchronization process.

*Note that this step is optional. If you do not download the database snapshot, move to Step 6.

Volta (depending on your internet connection ~1 hour download time for us):

Energy Web Chain (production) (30 minutes download time for us):

5. Unpack database snapshot. This snapshot only works with OpenEthereum client.

*Note that this step is optional. If you did not complete Step 5, skip this step and move to Step 6.

Volta:

Energy Web Chain (production):

6. Set permissions:

8. Start container:

9. Examine logs:

The log output should be similar to the following (sometimes the logging output does not appear immediately, wait some time):

10. After some, you will sync with the network. Until a full sync, you will see be in a "syncing" state:

11. Check the database synchronization status in the command line using OpenEthereum's 'eth-syncing' module:

The output will show current synchronization status:

It will take some time to fully sync with the current state of the blockchain. When the synchronization is finished status will be:

Additional Resources

Create and Manage an OCN Identity

Being part of the Open Charging Network requires participants to set up and manage a self-sovereign identity (OCN Identity).

A 'self-sovereign identity’ is an identity where an individual maintains control over their own credentials, as opposed to having them stored in a centralized server by a third-party. A user's self-sovereign identity could, for example, be partially derived from their cryptocurrency wallet address, which the user maintains control of at all times.

You can read more about self-sovereign identity in our documentation .

Secure identities are critical for the automated routing of OCPI-messages, and for being able to use applications on top of the Open Charging Network.

Below are details on how to complete the steps necessary to create your OCN identity:

  1. (not required for node operators)

Access the full OCN technical documentation .

1. Select and register your country_code and party_id

* This step is NOT required for OCN Node Operators

Your unique identity on the Open Charging Network is based on an compliant name constructed from a country_code (e.g. “CH”) and party_id (e.g. “SNC”).

Today, in many countries, national registries exist to ensure uniqueness of IDs. Please refer to the OCPI documentation for further information both on the Provider and Operator abbreviation as well as for a list of existing authorities: .

Note that currently not all countries have a national registry. To see a list of countries that currently have a national registry,

2. Create a private/public key pair

The Open Charging Network uses a cryptographic wallet structure to provide security and unique identities. Wallets are used to construct your OCN identity, and to sign (authorize) actions on the OCN, such as sending and receiving messages. Your wallet (or private/public key-pair), along with your country_code and party_id ( form your identity on the Open Charging Network.

As such, you must have an Ethereum-compatible wallet to create your OCN identity. If you do not already have an Ethereum-compatible cryptocurrency wallet, we recommend using .

You can read more about what cryptocurrency wallets are, and how they are used in the context of the Energy Web Chain .

A public-private key pair is generated programmatically by a wallet through a cryptographic algorithm. The algorithm produces a private key and a corresponding public key. The public key can be exposed and shared with others (it is used to identify participants in the OCN Registry smart contract), but the private key should not be shared with anyone. The algorithm used to generate the key-pair makes it virtually impossible for any outsider to guess your private key.

3. Register and Manage your OCN Identity with the OCN Registry

After completing and , you are now ready to register your OCN Identity with the OCN Registry. This registry serves as the address book for all OCN Identities.

The OCN Registry is implemented as a deployed on the Energy Web Chain. Anyone is allowed to register with the OCN Registry.

As a neutral platform, the Energy Web Foundation holds the administration key to this smart contract. The initial implementation requires a centralized authority to have administration rights (e.g. for updates). As the governance of the OCN Registry is a crucial piece to ensure openness of the Open Charging Network, Energy Web Foundation will further develop this governance together with the community (e.g. enable decentralized administration).

There are several ways to manage your OCN Registry entry. We recommend using the , or provided in the

3.1 Gather Required Information

The required information varies according to your role within the network and whether you are running a node or not.

You will need to determine your party's role. The most common roles are "CPO" (Charge Point Operator) and "MSP" (Mobility Service Provider).

You can see a full list of supported roles within .

OCPI Party (CPO, eMSP)
Node Operator

3.2 Fund your Ethereum-Compatible Wallet

As a a final preparation step, you need to fund your Ethereum wallet that you created in The funds will be used to enter our data into the registry. The transaction cost associated with entering the data into the registry is very low - less than 1 .

Depending on whether you want to connect to the or the there are two ways of getting funds for your wallet:

Public Test Network (Volta)
Production Network (Mainnet)

3.3 Create, read, update and delete your OCN Identity

After funding your wallet, you are now ready to make OCN Registry entries. Please follow the technical instructions on thefor more detailed steps on how to do this using the , or .

4. Store your private key safely - and don’t lose it

Your OCN Identity is your key to participate in the Open Charging Network. Your private key from your cryptographic wallet () is required for managing your OCN Registry entry (your self-sovereign identity). Keep your private key safe! It is advised to follow best-practices for secure storage and usage (similar to API Token Management, management of cryptocurrencies, etc.)

If you have any issues with your OCN Identity, please reach out to us.

Interacting with Smart Contracts in EW-DOS

Using smart contracts on the Ethereum Virtual Machine

EW-DOS packages and interact with . To do this, they use API Client Libraries to connect to the blockchain and create instances of smart contracts to access their public functions.

If you're not familiar with what a smart contract is, you can read Ethereum's introduction to smart contracts .

Below we provide an overview of API Client libraries and a some code examples. Note that exact implementation varies in each package or SDK, but the fundamental concepts remain the same.

API Client Libraries

You can interact with smart contracts (i.e. call their public read and write functions) on the the Energy Web Chain and the Volta Test Network using any Ethereum API client library. Client libraries allow you to connect to and interact with the blockchain network. You can read about all the functionalities of Ethereum API client libraries in the Ethereum documentation .

The most popular JavaScript libraries for interacting with Ethereum networks are and . EW-DOS uses ethers.js, so below we will provide ethers.js examples, however concepts will be similar among different client libraries.

When interacting with a contract, you use a library to first create a Provider, which is a connection the blockchain. You then use the provider to create an instance of the smart contract that you want to interact with. Once this instance is created, you can call the public methods that are exposed in the smart contract.

1. Instantiate a Provider

A provider is a connection to the blockchain. It gives you an interface to interact with the network. To create a , you will need the JSON RPC Url. To create an , you will need the path local IPC filename (this is only available in node.js).

You can see the full ethers.js documentation on Providers .

See source code

2. Instantiate a Contract

To create a new instance of a contract that is already deployed on the blockchain, you need three pieces of information:

  1. The contract's ABI- the ABI (Application Binary Interface). The ABI is a JSON object that provides the interface to your smart contract. It defines the contract's constructor, events and the behavior of its public functions. The contract's ABI is generated with the smart contract is compiled.

  2. The contract's address - every smart contract has an address when it is deployed to the blockchain. You can deploy the same contract on multiple blockchains, but each contract will have a different address.

  3. The provider

You can see the ethers.js documentation **** for creating a new instance of a deployed Contract .

See source code

2. Implement Contract Methods

The Contract method returns a new instance of that contract at the address passed in. Now that we have an instance of this contract, we can interact with its public methods:

See source code

EW-DOS Smart Contracts

For a tutorial on how to deploy a smart contract on the Volta Test Network or Energy Web Main Network, go .

Required Information

  • Country_code

  • Party_id

  • Role (e.g. "CPO" or "MSP")

  • OCN Node Operator wallet address

  • Public URL of OCN Node

Optional Information

  • Implemented OCPI modules. To see the full list of OCPI modules, and which modules each party typically implements, see the OCPI 2.2. documentation 2.3.1. Typical OCPI implementations per Role

Take your generated public wallet address and visit the Volta faucet. Enter the address and request 1 Volta Ether. This will be more than enough to pay for the transaction to add our details to the registry.

You can purchase Energy Web Token (EWT) at the Liquid Exchange, the BitMart Exchange and the Kucoin Exchange. Create an account at the exchange, fund it with your preferred currency and purchase Energy Web Token. One token should be enough cover the transaction cost. Then, transfer the tokens to the wallet address of your OCN Identity.

here
Select your country_code and party_id* (and register at your country’s national registry**)
Create a private/public key pair
Create, read, update and delete your OCN Identity
Store your private key safely
here
eMI3
OCPI 2.2 Documentation
see the OCPI 2.2 documentation, section 2.5. Provider and Operator abbreviation.
Step 1)
MetaMask
here
Step 1
Step 2
smart contract
Command Line Interface
Java
TypeScript library
OCN Registry repository on GitHub.
OCPI 2.2 in the documentation at 6.4.2 Role
Step 2.
EWT
Energy Web Public Test Network (Volta)
Energy Web Production Network (Energy Web Mainnet)
OCN Registry repository on GitHub "Listing a Party"
CLI library
TypeScript library
Java library
Step 2
import { providers, Signer, utils, errors, Wallet } from "ethers";
const { JsonRpcProvider } = providers;

this._provider = new JsonRpcProvider({ url: rpcUrl });
//pass in the smart contract address, smart contract ABI, provider:
this._contract = new Contract(settings.address, this.settings.abi, this._provider);
    try {
      valid = await this._contract.validDelegate(identityAddress, bytesType, delegateAddress);
    } catch (error) {
      throw new Error(error);
    }

Smart Contracts

Link to Source Code

IAM Smart Contracts

https://github.com/energywebfoundation/iam-contracts

Origin Smart Contracts

https://github.com/energywebfoundation/origin/tree/master/packages/traceability/issuer/contracts

Volta System Contracts

https://github.com/energywebfoundation/volta-system-contracts

Energy Web System Contracts

https://github.com/energywebfoundation/ewc-system-contracts

Staking Contracts

https://github.com/energywebfoundation/staking-contracts

utility layer
SDKs
smart contracts that are deployed on the Energy Web Chain
here
here
ethers.js
web3.js
JSONRpcProvider
IPCProvider
here
here
here
here
here
here
Deploy a Smart Contract on Volta with Remix
:black_heart:
:black_medium_small_square:
:black_medium_square:
:black_large_square:
:black_medium_small_square:
curl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/Volta.json -o chainspec-volta.json
curl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/EnergyWebChain.json -o chainspec-ewc.json
chmod +x openethereum
./openethereum --chain /path/to/chainconfig/Volta.json
2024-03-05 10:49:35 UTC Starting OpenEthereum/v3.3.5-stable-6c2d392d8-20220405/x86_64-linux-gnu/rustc1.58.1
2024-03-05 10:49:35 UTC Keys path /home/ubuntu/.local/share/openethereum/keys/Volta
2024-03-05 10:49:35 UTC DB path /home/ubuntu/.local/share/openethereum/chains/Volta/db/d94a0a739a3e416a
2024-03-05 10:49:35 UTC State DB configuration: fast
2024-03-05 10:49:35 UTC Operating mode: active
2024-03-05 10:49:35 UTC Not preparing block; cannot sign.
2024-03-05 10:49:36 UTC Configured for Volta using AuthorityRound engine
2024-03-05 10:49:36 UTC Signal for switch to contract-based validator set.
2024-03-05 10:49:36 UTC Initial contract validators: [0x36f67dd84e7327c10c7ead6c429a47189798fbdc, 0x20df7a4e8408add37c6a5c4afc1b1509924619fe, 0x77901f14183b1669c80e8c6137ff6721c9a26b25]
2024-03-05 10:49:36 UTC Listening for new connections on 127.0.0.1:8546.
2024-03-05 10:49:40 UTC Not preparing block; cannot sign.
2024-03-05 10:49:41 UTC Public node URL: enode://bb4962584a90ebcb373f5dd22cbe005ddd1300e7889c124ba33bfb0c327799948d8248054b7b6301f3bee46844c16cdaaffd390472198ddfb96798c8d03868b7@172.31.16.183:30303
2024-03-05 10:49:46 UTC Syncing    #1143 0xa666…220c   114.43 blk/s    0.0 tx/s    0.0 Mgas/s      0+    0 Qed LI:#1143    2/25 peers   405 KiB chain 0 bytes queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:49:51 UTC Syncing    #3559 0xe8e6…6a6c   483.00 blk/s    0.0 tx/s    0.0 Mgas/s      0+  124 Qed LI:#3683    2/25 peers   978 KiB chain 187 KiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:49:56 UTC Syncing    #5930 0xc530…ce9d   474.11 blk/s    0.2 tx/s    0.0 Mgas/s      0+ 1182 Qed LI:#7112    3/25 peers   2 MiB chain 2 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:50:01 UTC Syncing    #8458 0x63ee…be65   505.40 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 3226 Qed LI:#11684    3/25 peers   3 MiB chain 5 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:50:06 UTC Syncing   #10352 0xf609…52e3   379.12 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 5142 Qed LI:#15494    3/25 peers   3 MiB chain 8 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
openethereum --chain path/to/chainconfig/Volta.json --jsonrpc-cors METAMASK URL  
docker --version 
docker-compose --version 
curl --version
mkdir openethereum 
cd openethereum 
mkdir -p chain-data/chains
cat > docker-compose.yaml << 'EOF'
version: '3.8'
services:
  openethereum:
    image: openethereum/openethereum:v3.3.5
    restart: always
    ports:
      - 8545:8545
      - 8546:8546
      - 30303:30303
      - 30303:30303/udp
    command:
      --jsonrpc-interface all --chain /config/chainspec.json
      # Uncomment this if connecting local node to MetaMask
      # --jsonrpc-cors chrome-extension://URL-OF-METAMASK
    volumes:
      - ./chain-data:/home/openethereum/.local/share/io.parity.ethereum/
      - ./chainspec-volta.json:/config/chainspec.json:ro
      # chainspec file should be changed if using EWC
      # - ./chainspec-ewc.json:/config/chainspec.json:ro
EOF
curl -L -C - https://chain-download.energyweb.org/volta -o ./chain-data/chains/volta.tar
curl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tar
sudo tar -xvf ./chain-data/chains/volta.tar -C ./chain-data/chains
curl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tar
sudo chmod -R 777 chain-data
docker-compose up -d
docker-compose logs --tail 20 openethereum
openethereum_1  | 2024-03-05 10:54:30 UTC Starting OpenEthereum/v3.3.5-stable/x86_64-linux-musl/rustc1.59.0
openethereum_1  | 2024-03-05 10:54:30 UTC Keys path /home/openethereum/.local/share/io.parity.ethereum/keys/Volta
openethereum_1  | 2024-03-05 10:54:30 UTC DB path /home/openethereum/.local/share/io.parity.ethereum/chains/Volta/db/d94a0a739a3e416a
openethereum_1  | 2024-03-05 10:54:30 UTC State DB configuration: fast
openethereum_1  | 2024-03-05 10:54:30 UTC Operating mode: active
openethereum_1  | 2024-03-05 10:54:30 UTC Not preparing block; cannot sign.
openethereum_1  | 2024-03-05 10:54:30 UTC Configured for Volta using AuthorityRound engine
openethereum_1  | 2024-03-05 10:54:30 UTC Signal for switch to contract-based validator set.
openethereum_1  | 2024-03-05 10:54:30 UTC Initial contract validators: [0x36f67dd84e7327c10c7ead6c429a47189798fbdc, 0x20df7a4e8408add37c6a5c4afc1b1509924619fe, 0x77901f14183b1669c80e8c6137ff6721c9a26b25]
openethereum_1  | 2024-03-05 10:54:30 UTC Listening for new connections on 127.0.0.1:8546.
openethereum_1  | 2024-03-05 10:54:35 UTC Not preparing block; cannot sign.
openethereum_1  | 2024-03-05 10:54:35 UTC Public node URL: enode://b111a66d9d0cc942abe1c728d74e8109673a1dc80a2d50be8546993c51cecd6151f2c7e3322bb6a992adcd906af5f686b8d14d8c4373aafdd02c108aeb71ab07@172.28.0.2:30303
openethereum_1  | 2024-03-05 10:54:40 UTC Syncing    #1450 0x4a2f…7898   144.03 blk/s    0.0 tx/s    0.0 Mgas/s      0+   73 Qed LI:#1524    2/25 peers    434 KiB chain  105 KiB queue  RPC:  0 conn,    0 req/s,    0 µs
openethereum_1  | 2024-03-05 10:54:45 UTC Syncing    #2097 0xdef1…082f   129.40 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 2601 Qed LI:#4699    2/25 peers    767 KiB chain    4 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
12021-11-03 15:33:42 UTC Syncing #14332274 0x2b0d...23c2 0.00 blk/s 0.0 tx/s 0.0 Mgas/s 0+ 0 Qed LI:#14332276 1/25 peers 72 KiB chain 0 bytes queue RPC: 0 conn, 0 req/s, 87 µs
curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{"jsonrpc":"2.0","result":{"currentBlock":"0xdab79f","highestBlock":"0xdac9d2","startingBlock":"0xdab172","warpChunksAmount":null,"warpChunksProcessed":null},"id":1}
{"jsonrpc":"2.0","result":false,"id":1}
described below
What does it mean to run a node?
What do I need to run a node?
Benefits to Running a Local Node
Alternatives to Running a Local Node
Run a local node
Connect your local node to MetaMask
yellow paper
here
OpenEthereum
Authority Roundtable (AuRa)
here
approved validators
Infura
MetaMask
block explorer
does have rate limits for JSON RPC requests
MetaMask
here
OpenEthereum - EthHub
Volta Testnet
Energy Web production chain
here
here
GitHub - energywebfoundation/ewf-chainspec: EWF official chainspec repository
OpenEthereum client v3.3.5
OpenEthereum Documentation - Configuring OpenEthereum
here.
OpenEthereum Documentation - Docker
docker
docker-compose
curl
OpenEthereum Documentation - The `eth` Module
Install EWC/Volta RPC node
"Chapter 3: Ethereum Clients" from Mastering Ethereum
Nodes And Clients Ethereum Documentation
IAM Library
DIDs
Verifiable Credentials
Decentralized Service Bus
IAM Cache Server
Switchboard
Energy Web Chain
DIDs
DID Documents
IAM Library
DIDs
verifiable credentials
ID Registry
smart contracts

IAM Libraries

Identity Access and Management (IAM) Client Library

A TypeScript library that provides high-level functions related to the identity and access management (IAM) for all users, assets, organizations and applications that are anchored on the Energy Web Chain. This includes:

  • Management of Switchboard namespaces

  • DID/DID Document management

  • Creation and governance of organizations, applications and their associated roles. Once created, these are persisted on the IAM Cache Server

  • Claim requests, verification and issuance for role permissioning. Once created, claims are persisted on the IAM Cache Server

  • Staking functionality

Documentation Resources

  • GitHub Repository

  • ReadTheDocs

  • API

Dependencies and Dependents

EW-DOS Dependencies
EW-DOS Dependents

DID Library

A class-based TypeScript library that provides an abstraction layer to manage and interact with DIDs and Verifiable Credentials on the Energy Web Chain.

The DID Library enables users to adopt and/or implement different DID methods, which promotes interoperability with other methods of decentralized identifiers. The DID library currently implements the ERC1056 standard for creating and updating identities on the blockchain.

The DID library interacts with the Energy Web Chain using the ethers.js library.

Documentation Resources

  • GitHub repository (includes documentation)

Dependencies and Dependents

EW-DOS Dependencies
EW-DOS Dependents

See an overview of all Identity and Access Management (IAM) components in EW-DOS here

Other Resources

  • "EW’s DID Library is open-source" on Medium

  • "ERC1056 ❤ ERC780 — an open identity and claims protocol for Ethereum" on Medium

  • Ethereum Improvement Proposals: EIP-1056: Ethereum Lightweight Identity

Passport-DID-Auth

A backend class-based TypeScript library that allows other JavaScript/TypeScript applications to easily add authentication and authorization based on Switchboard roles to their applications. This allows any application to use Switchboard's decentralized approach to identity and access management.

Documentation Resources

  • GitHub repository

Dependencies and Dependents

EW-DOS Dependencies
EW-DOS Dependents

Other Resources

  • You can refer to the Identity and Access Management (IAM) Client Examples application to see an example of Passport-DID-Auth integration into an application

EW Credentials Library

A multi-package library for CRUD operations specific to Energy Web Verifiable Credentials. The repository is a module-based library built with Lerna.

Package
Description

Code to verify role based verifiable credential.

Smart contract and client code specific to EnergyWeb IAM roles.

exposes code to support role/claim lifecycle.

DID Library
Decentralized Service Bus
SSI Hub
Switchboard
IAM Smart Contracts
Energy Web Chain
IAM client librar
y
DID Library
IAM client librar
y
SSI Hub
@energyweb/vc-verification
@energyweb/credential-governance
@energyweb/onchain-claims

Facilitating Clean Energy Purchases

This page covers three topics:

  1. A description of energy attribute certificates (EACs)

  2. Current challenges in EAC marketplaces

  3. Examples of how EW-DOS is being applied to solve challenges in EAC marketplaces

Current Challenges in Energy Attribute Certification (EAC) Marketplaces

Energy Attribute Certificates

When energy from a renewable energy source (e.g.,wind, hydro, solar) enters the electricity grid, it can no longer be distinguished by energy consumers from electricity that originated from fossil fuel combustion. Energy Attribute Certificates (EACs) are a way to account for the “greenness” of electricity from renewable sources. An EAC is a document that certifies that a specific unit of energy (typically a megawatt-hour) originated from a particular (typically solar or wind) source. “Tagging” clean energy in this way facilitates its tracking in accounting systems for carbon, renewable portfolio standards, corporate sustainability, and more. EACs also allow the low-carbon attributes of units of energy to be traded between parties in a relatively standardized manner.

EACs have different names in different markets, including guarantees of origin (GOs), renewable energy certificates (RECs), and solar renewable energy certificates (S-RECs). These are conceptually similar.

‌Currently, the energy industry relies heavily on EACs to prove that a given unit of electricity came from renewable sources. Energy market participants--including grid operators, electricity suppliers, individuals, organizations, and corporations--purchase EACs in various ways to 'decarbonize' their electricity consumption or to meet sustainability goals.

Renewable Energy Certificates allow end-users to prove their electricity comes from renewable sources

Marketplace Challenges‌

Today, EAC markets operate in centralized silos. Markets operate under specific regulatory constraints that vary across geographies and EAC types. Technological sophistication also varies from market to market. This makes for a fragmented global market for EACs, presenting several specific challenges to scaling EAC transactions and thus, global access to clean energy:

  1. Lack of coordination across multiple stakeholders and systems: The bespoke, regional nature of EAC markets today creates challenges for buyers looking for efficient, low-cost access to clean energy attributes. EAC markets operate in a regional, heterogeneous manner, with certificates often stored in proprietary databases. These databases lack open, shared digital infrastructure to communicate and interoperate with one another. In addition to hindering buyer access to EACs, this lack of coordination limits EAC lifecycle transparency, creating mistrust between participants that is typically mitigated by EAC brokers and other intermediaries.

  2. Limited market access: Current EAC markets have high administrative costs and often depend on brokers and intermediaries to create trust between parties. This creates a lack of transparency in market offerings and pricing and creates complexity for corporations, governments, and other buyers working to meet carbon/ renewables procurement targets. In practice, it also restricts participation to companies that can afford to participate, such as energy companies with regulation-mandated targets for renewable energy (RE) procurement or carbon reduction, and large corporations that can afford robust sustainability programs.

  3. Outdated user experience and limited automation: EAC markets today rely heavily on manual processes for verifying generation data, completing transactions, and conducting settlement. Manual processes within market operations limits the EAC products that generators can bring to market. For example, small-scale RE installations are often unable to participate. Market participants also face outdated user interfaces and multi-step processes that make it difficult to acquire EACs at the scale needed by corporations and other buyers with aggressive sustainability targets.

EW-DOS provides a suite of modules (EW Origin) that addresses these specific challenges in renewable energy markets. The EW Origin modules provide technology to make existing and emerging EAC markets interoperable, scalable, automated, transparent and efficient for market operators and both buyers and sellers of renewable energy.

Below are three applications of Origin and applied industry use cases.

Application 1: Decentralizing and Automating Energy Attribute Certificate Issuance

Industry Challenges Addressed

  • Lack of transparency and streamlined coordination between stakeholders in the EAC issuance process

  • Centralized and siloed storage of issued certificates

Primary Enterprise Actors

  • Green energy generators

  • EAC issuers/regulation bodies

  • Marketplace Operators

EW-DOS Solution

In today's EAC schemes, issuing a certificate is a time-consuming, manual process involving multiple data streams and person-to-person interactions. Energy Web Origin's Issuer module addresses this pain point by enabling an open and automated issuance process that is compatible with any certification standard.

Certificate issuance is automated through the Issuer module's APIs, which handle data fetching and sending generating devices and with certification bodies. The request and issuance process depends on several factors such as regulation standards, the size of the generating device, and how generation data can be accessed, however the general issuance flow is as follows:

  1. Generators register their devices with the issuing body using Origin's Device Registration Module

  2. The Issuer module acquires data on the device’s energy generation. This can happen in several ways:

    1. The generator manually inputs generation data;

    2. The Issuer module API integrates directly with the generating device or its data system to receive generation data; or,

    3. If the grid operator has data on the generating device and exposes it via a public API, the Issuer Module can ingest this data.

  3. The Issuer module sends generation data as evidence to the certificate registration body to request certification

  4. The Issuer module queries the registration databases for certificate approvals. If approval is found, it triggers a process for minting an EAC on the Energy Web Chain in the form of an ERC-1888 Transferable Certificate Claim (which is an extension of the ERC-1155 Multi token Standard)

  5. Once minted, the generator claims the certificate.

There are several key benefits to having certificates on the blockchain:

  1. The data on the blockchain is permanent, immutable and incorruptible

  2. The ERC-1155 standard supports fungible and non-fungible components. The device’s kilowatt hours generated are stored as fungible tokens that represent certified green energy. Each hour or combination of hours can be split and sold to different customers. The device information, total energy volume and timeframe of generation are stored as an NFT asset, which cannot be split.

  3. The owner of the certificate has full control over the certificate. Transference cannot happen without their cryptographic consent

  4. Certificates are interoperable with any decentralized application that uses the certificate standard. Users can trade certificates using any digital wallet that supports the ERC-1155 and its smart contracts. This means that certificates are no longer siloed within centralized and proprietary databases.

ERC-1188 Token Non-Fungible and Fungible components

You can read more about the certificate's data structure here.

The Issuer module also supports private issuance to accommodate scenarios in which the device owner does not want the generation data publicly available on a blockchain. In this case, the device information (the NFT component) is stored on-chain, while the generation data (the kilowatt hours produced) are stored privately off-chain in the operator’s database.

Additional Information

  • "Issuing certificates with the EW Origin SDK (Part I)" on Medium

  • "Issuing certificates with the EW Origin SDK (Part II)" on Medium

Application 2: Facilitating Transparent and Competitive Energy Attribute Certificate Trading

Industry Challenge

Currently, most EAC sales are facilitated by third-parties who purchase EAC certificates directly from generators and then sell them onwards to EAC buyers. This structure and a lack of a shared marketplace prevents price and market-need transparency: EAC buyers are limited in their ability to source and compare certificates with specific attributes that meet their procurement needs (such as device model, device location, hours of generation, etc.). Current markets also do not accommodate small-scale participants, both sellers and buyers, or high frequency and high granularity trading activities due to the limited technical capabilities.

Primary Enterprise Actors

  • Green energy generators

  • EAC buyers

  • Marketplace Operators

Solution

The Origin Exchange module was developed to support transparent and competitive platforms that let buyers interface directly with sellers to purchase EACs. The module sets up a real-time, open order book via a matching engine algorithm: sellers post their expected prices for volumes of generated energy, and buyers can then accept those prices or bid differently in an open interface. All orders are collected and ordered by price in an order book, and a match is made if the seller and buyer agree on a price. As a result, current market demand is seen by all.

This format is advantageous for large-scale and small-scale buyers and sellers alike:

  • Price transparency allows smaller generators to compete in the marketplace because they are better able to see demand and price trends, and then make attractive bids

  • Buyers can state their specific requirements proactively to stimulate bids by generators. For example, if a buyer wants to buy EACs from solar production exclusively--or even exclusively locally-produced solar EACs-- she can post that demand rather than waiting for a generator to post qualifying supply.

The Exchange module's matching engine can not only match orders by price, but also by specific, granular EAC criteria such as vintage and location, not unlike how additional filters can be used when searching for a flight, hotel, or rental car online.

On-chain vs. Off-chain logic

The Exchange module tracks all inputs and outputs of the exchange on the EAC itself, which is minted as an ERC-1188 certificate on the Energy Web Chain. (You can read more about Origin's implementation of EACs as ERC-1888 tokens here.) This provides easy-to-observe traceability that improves transparency and confidence among renewable energy buyers, sellers, regulators, and other stakeholders.

Logic for the order book and the bid/ask algorithm, which needs to be as fast as possible, is abstracted away from the blockchain for optimal performance.

Additional Information

  • "Inside a digitalized EAC exchange for renewable energy markets" on Medium

Applied Use Case: PJM-EIS Bulletin Board

Key Industry Participants

  • PJM - large scale regional transmission operator for the Mid-Atlantic, Great Lakes and Northeast region of the US. Coordinates movement of wholesale electricity for distribution

  • PJM Environmental Information Services, Inc - subsidiary of PJM; administers the Generation Attribute Tracking System (GATS) (US-based REC trading and tracing platform)

Project Overview

This pilot project was a collaboration with PJM Environmental Information Services (PJM-EIS). PJM-EIS administers the Generation Attribute Tracking System Bulletin Board, a platform used to track and trade Renewable Energy Certificates (RECs) in the United States. (REC is a specific standard of Energy Attribute Certificate in the United States.) The Bulletin Board is an interface on GATS where REC buyers and sellers can post their bids and asks for specific REC volumes. Actually selling or buying those RECs remains the responsibility of the counter-parties in bilateral agreements.

The Bulletin Board was designed to facilitate trading of voluntary RECs in GATs, but historically it has been underutilized. This pilot assessed how improving the technical functionality and user experience of the Bulletin Board could remove market barriers and grow the local REC market.

Energy Web Origin provided the back-end infrastructure for the marketplace functionality and the Energy Web Chain to digitize the RECs in GATS and anchor the proof of any REC transactions that occurred on the pilot Bulletin Board system. We designed a 'marketplace' exchange interface so that buyers and sellers could post their specific bids and asks. Settlements occured in the existing GATS interface, but blockchain-based proofs of each transaction were created on the Energy Web Chain.

EW-DOS Components Used

EW-DOS Component

Function

Basic basic logic and interfaces for exchange functionality

Implements exchange-core. Provides order book-based exchange functionality for certificates

Basic logic and interfaces for backend (managing users, certificate, requests and devices)

Implements backend-core. Provides runnable backed API using NestJS framework

Backend utility functions

Additional Information

  • "PJM-EIS UPDATE: Modernizing a legacy U.S. REC tracking system with blockchain-based technology"

Application 3: Provide end-to-end infrastructure for a renewable energy procurement system

Industry Challenge

Current EAC markets need integrated, end-to-end solutions for device registration and EAC issuing, tracking, trading, claiming, and reporting. This means that there is no existing system that generators and EAC buyers can use to access the state of an EAC at any phase of its lifecycle, making it difficult to gather and generate data on a marketplace to support efficient EAC transactions.

Primary Enterprise Actors

  • Green energy generators

  • EAC issuers/regulation bodies

  • EAC Consumers

  • Marketplace Operators

Solution

Integrate the Origin Registration module, Origin Exchange module and the Origin Issuer module into a comprehensive EAC issuing and trading platform that supports full transparency and streamlined transactions for renewable energy generators/sellers, buyers and marketplace operators. ‌

The default way to facilitate and synchronize an end-to-end marketplace is to integrate the Origin Device Registry, Origin Exchange module and the Origin Issuer module. By doing so, the state of an EAC throughout its entire lifecycle can be visible to all participants, leveraging the full traceability and interoperability features of the Origin SDK.

  1. Devices are registered in a given marketplace using the Origin Device Registry module

  2. Devices submit data via the Issuer Module for EAC issuance

  3. The issuing body approves the request

  4. If the Origin Issuer and Origin Exchange module are integrated, issued EAC tokens are deposited to the Origin Exchange to be traded. The deposit is recorded on-chain and the exchange operator is now in the custody of the EACs.

  5. After the EAC has been traded, the buyer withdraws the EAC from the exchange to claim it for environmental impact reporting purposes. This is equally recorded on-chain and the EAC is removed from the custody of the exchange operator to the ownership of the buyer. This way, the ownership change from the seller to the buyer is clearly tracked on-chain.

Depending on the requirements of the operator of the Origin Exchange, all trades that happen within the exchange can be private or be be recorded on-chain.

End-to-end lifecycle of EAC marketplace

Applied Use Case: PTT Thailand

Key Industry Participants

  • PTT Thailand (Petroleum Authority of Thailand)

  • Green Certificate Company (one of the 2 local issuers in Thailand)

  • EGAT (one of the 2 local issuers in Thailand)

Project Overview

PTT’s platform offers buyers and sellers of EACs a fully integrated solution that provides all the functionalities needed to track, trade, claim, and report EACs in a regulatory-compliant way.

  1. In PTT’s platform, both buyers and sellers can register as users. Device owners can also register their generation devices with the I-REC Standard through the PTT platform. This is verified by the I-REC registry to ensure that only certified actors can participate in the marketplace. Identities and device information are stored in the Origin User and Device Registry respectively and are tracked on the Energy Web Chain without exposing any sensitive data. Device owners are also free to provide any additional data deemed valuable for buyers but not required by the I-REC standard. This can include granular generation data or social impact indicators.

  2. Device owners that are registered and verified by the I-REC Standard can request certificates by submitting generation evidence through PTT’s platform. The integration between Origin and the I-REC registry allows certificates to be issued upon the approval by the I-REC Standard. The issuance of certificates is recorded on the Energy Web Chain without disclosing any volume information.

  3. Device owners or brokers can then trade certificates by posting supply (“asks”) to the marketplace based on which certificates have been issued. Correspondingly, buyers can post demand (“bids”) based on their energy consumption and various purchasing criteria such as region, device type, desired RE portfolio proportions, etc. The platform automatically matches supply and demand based on specified criteria.

  4. When a trade is confirmed, the change in certificate ownership is recorded on the Energy Web Chain without disclosing sensitive data. PTT’s platform auto-generates agreements for the buyer and seller to sign. Payments can be immediately executed via online payment system (payment gateway).

  5. After a trade is executed, the new owner of the certificate can claim it and use it for sustainability reporting. Alternatively, the owner can also decide to push it back on the market and trade the certificate with interested parties.

    The integration of PTT’s platform with the I-REC registry makes it fully compliant with the I-REC Standard.

EW-DOS Components Used

  • Origin Device Registration Module

  • Origin Organization Registration Module

  • Origin Exchange (Trade) Module

  • Origin Issuer (Traceability) Module

  • Origin Energy API

  • Origin utility functions

Additional Information

  • "PTT and Energy Web Foundation Launch Blockchain-based Renewables Platform for Thailand, ASEAN, Japan"

Application 4: Enabling 24/7 Clean Energy Procurement

Industry Challenge

As sustainability targets for corporations and other buyer types increase in ambition, demand is growing for more sophisticated tools to support EAC purchases based on highly granular time intervals. For example, rather than purchasing a large volume of EACs to offset a month or a year’s worth of energy consumption, a buyer might wish to acquire certificates to match energy consumed on an hourly or even half-hourly basis. Similarly, some buyers wish to purchase EACs on a locational basis, acquiring renewables generated in the same region where consumption occurred, or from specific types of renewables only (e.g. only solar and not wind).

Meeting these needs requires a digital solution that can support a high number of transactions and granular timeframes. Since it is a niche and nascent market, few tools and solutions exist today that are capable of meeting these requirements.

Primary Enterprise Actors

  • Green energy generators

  • EAC Issuers/regulation bodies

  • EAC buyers

  • Platform operators

Solution

The 24/7 toolkit was developed to build applications that serve as 24/7 marketplaces. Built with Origin Core SDK modules, the toolkit provides functionalities for:

  1. Digital onboarding of participants: Organizations, devices and users can be digitally onboarded with the help of decentralized digital identifiers (DIDs), which ensure participants are who they claim they are. More information about DIDs here:

  2. Data collection: The toolkit offers an API for collecting consumption and generation data in real-time. Data granularity (e.g., MMh vs kWh vs Wh) and time intervals (e.g., 15 vs 30 minutes) can be configurable. The API documentation is available here, and the GitHub repository is here.

  3. Digital certificate issuance: Based on generation data, digital EACs are created on the Energy Web Chain. These on-chain EACs ensure that every unit of energy is documented with an exact timestamp, and can only be attributed to one owner. On-chain EACs show an accurate view of the energy’s lifecycle: where it is coming from (e.g., ID of the generation facility, exact location, etc), who receives it and claims the environmental impact

  4. Matching consumption and generation: Once consumption and generation are captured for the same time interval, there is a simple matching algorithm facilitates a match.Each consumption facility has pre-defined generation device(s) that are “favorites”, which means their generation is prioritized for that consumer. These favorites can be chosen based on different characteristics. For example, a consumer might prefer smaller-scale assets in the nearest proximity

  5. Reporting: Data about granular generation, consumption, matches, surpluses and deficits can be displayed in user-friendly and verifiable reports

Related Content

REVIEWER FEEDBACK

@energyweb/exchange-core
@energyweb/exchange
@energyweb/origin-backend-core
@energyweb/origin-backend
@energyweb/origin-backend-utils

Credential Lifecycle

The credential lifecycle in the IAM stack

This page documents the role and lifecycle of credentials in the IAM stack.

Credentials are documents that allow individuals to show that they possess certain accreditations (this is discussed further in depth below - 'Credentials Overview'). Credentials are traditionally document or paper-based, such as a driver's license or a passport, and are typically registered in a centralized repository under the stewardship of the issuing body.

Verifiable credentials are purely digital components that can be verified cryptographically. Verifiable credentials are a secure and self-sovereign alternative to traditional paper-based credentials or documents, which typically must be physically or electronically transmitted for verification, and have the potential to be intercepted, altered or tampered with.

In general, verifiable credentials do not rely on Decentralized Identifiers (DIDs) but they are often used together. If DIDs are used, decentralized ledger technology (i.e. a blockchain) can provide the public key infrastructure for the cryptographic verification.

The specification that defines verifiable credentials was established and is maintained by the World Wide Web Consortium (W3C). This protocol continues to evolve. Verifiable credentials are one of the three core pillars of self-sovereign identity, along with decentralized identifiers (DID) and distributed ledger technology.

See the W3Cs use cases and requirements for verifiable credentials here

Verifiable credentials are a key component of Energy Web's Identity, authorization and access management. In current use cases, credentials are used to authorize users' or assets' enrolment into applications and organizations. Each credential is associated with the subject's DID that is anchored on the Energy Web Chain. Energy Web's Switchboard application provides a user interface for creating, requesting, issuing and revoking role-based credentials. Energy Web's IAM libraries and APIs facilitate the full lifecycle of verifiable credentials. The Energy Web blockchain serves as the trust or verification layer for digital proof. This documentation provides references to these libraries, and to supporting W3C documentation that is used to guide and inform the development of Energy Web's IAM solution.

Click below to see a current diagram of Energy Web IAM architecture:

Credentials Overview

A claim is an assertion that is made about a subject. A claim could assert, for example, that a battery meets specific manufacturing standards.

A credential is a claim(s) made by an issuer about a subject. When the credential issuer makes a claim about a subject, they issue a verifiable credential. For example_,_ an issuer can issue a credential for a battery that asserts that it was manufactured on a specific date in a specific location.

In order for a credential to be verifiable, it must contain a proof mechanism and supporting information to evaluate the proof. The proof must be able to be verified through cryptographic (i.e. algorithmic) means, typically through a digital signature. Energy Web's IAM libraries support digital signatures of Ethereum-compatible wallets, such as MetaMask.

Proofs provide two primary functions:

  1. To verify the authorship of a credential

  2. To detect tampering or alteration to the credential/presentation

In the example of the battery mentioned directly above, the proof will verify that

  1. The issuer is authorized to assert that the battery was manufactured on a specific date and in a specific location

  2. That the credential data and digital signature has not been changed or compromised

Note that proof mechanisms do not validate the facts that the claim asserts (in the example above, the providence of the battery). It only verifies the issuer of the claim and the integrity of the claim's data over time (i.e. has the data been altered or tampered with).

Proof Mechanisms

There are two main proof mechanisms for verifying credentials, both of which are used in the IAM stack. These will be discussed further below.

  1. External proofs, which are commonly expressed by JSON Web Tokens. An external proof is one that wraps an expression of the credential data model, such as a JSON Web Token. See the W3C JSON payload encoding standards for verifiable credentials here. Verifiable Credentials expressed as JSON Web Tokens in the IAM stack is discussed below.

  2. Embedded proofs, in which the proof is included directly in the credential's JSON data. To be compatible with W3C Verifiable Credentials standard, the credential JSON must have a property of 'proof'. Verifiable credentials expressed as JSON/JSON Linked Data in the IAM stack are discussed below.

Credentials in the Energy Web Stack

The Energy Web IAM stack provides API methods to request, issue, publish, verify and revoke credentials.

Our ecosystem offers persistence for credentials on the Energy Web blockchain, and off the blockchain using the decentralized file system IPFS.

  • Credentials that are persisted on the Energy Web Chain are referred to as 'on-chain' credentials

  • Credentials that are persisted off-chain are referred to as 'off-chain' credentials

The distinctions are discussed in the following section.

Note that whether a user chooses to persist credentials on-chain and/or off-chain, credential data is also persisted in the SSI Hub. SSI Hub facilitates credential exchange by persisting credential request and issuance messages

'On-Chain' Credentials

On-chain credentials are registered on the Energy Web blockchain in the Claim Manager smart contract. The contract source code can be found here. A credential is registered in the contract when the credential is published by the holder.

The Energy Web Chain is a public blockchain. This means that smart contracts and their data are public, and their public methods can be called by anyone. This is an important point of consideration when deciding whether to publish credentials to the blockchain.

On-Chain Credential Persistence

Credential Smart Contracts

There are currently two smart contracts deployed on the Energy Web Chain that are used for verifying and persisting verifiable credential data (for 'on-chain credentials' only). The source code for these contracts can be found in the @energyweb/onchain-claims package.

Contract
Purpose
Address - Energy Web Chain
Address - Volta

Claim Manager

Holds mapping of issued verifiable credentials; Provides methods for credential verification

Claims Revocation Registry

Holds mapping of

'Off-Chain' Credentials

Off-Chain credentials are not referenced on the blockchain. Off-chain credential data is persisted as a JSON web token on IPFS, a decentralized public filesystem. IPFS, like a blockchain, is a decentralized system and relies on a network of peer nodes to create a distributed system.

When a token is stored on IPFS, it has a content identifier (CID) that points to its location on the file system. This CID is linked to the credential's corresponding DID Document through a service endpoint. A service endpoint points to any service that supports or acts on behalf of a DID. The CID is used to fetch and resolve the full credential from IPFS when necessary.

DID Document data, including service endpoints, are publicly available on the Energy Web Chain. IPFS data is accessible to anyone who has the service endpoint that contains its location on IPFS. This is an important consideration when deciding to publish credentials to IPFS.

Off-Chain Credential Persistence

Off-Chain Credential Schema

For each off-chain credential request, iam-client-library issues two credentials of different format and proof type.

Both signature mechanisms can be performed by Ethereum-based wallets such as MetaMask.

1. JSON Web Token with EIP-191 signature

A JSON web token is a common standard for transferring encoded, verifiable data between parties. The JSON web token payload is generated from the claim data.

  • Proof Mechanism: EIP-191 signature standard

  • Data Model: The JWT payload partially conforms to the properties established by W3C for verifiable credentials as a JWT. You can view these properties here.

  • Persistence: The issued token is included in an object that contains other data about the issued credential request. (Read more about claim issuance below). The token is persisted in the SSI Hub's database when the credential is issued, and persisted in IPFS when a credential is published by the subject. The credential's location in IPFS is referenced in the user's DID Document's service endpoints.

2. JSON-LD Verifiable Credential with EIP-712 signature

  • Proof Mechanism: EIP-712 signature specification. This allows the credential data to be displayed in a human-readable format when digitally signing the message:

EIP-712 signature request

See the W3C documentation on the EIP-712 signature here.

  • Data Model/Interface: The Verifiable Presentation interface conforms to W3C credential schema, which includes JSON-LD (JSON Linked Data) data format. JSON linked data ensure that credentials and presentations are universally machine readable and compatible. Read more about JSON-LD formatting in verifiable presentations and credentials in the W3C documentation here.

  • Persistence: The verifiable presentation is included in an object that contains other data about the issued credential. This object is persisted in SSI Hub database.

On-Chain vs. Off-Chain Registration Rationale

In addition to the above, there are a few distinctions to consider when deciding to register credentials off-chain or on-chain.

  • On-chain credentials can be read by any smart contract deployed on the Energy Web Chain, and thus used in many decentralized applications. This allows for greater application interoperability.

  • Off-chain credentials in IPFS do not require any transaction costs that are associated with a blockchain, and can be resolved by an IPFS client in any application.

IAM Stack Credential Lifecycle

1. Request Credential

A credential request occurs when a user requests to enrol to an organization or application’s pre-defined role. The role may have specified criteria that the subject must meet in order to take on the role. The user who is requesting to take on the role is the claim ‘subject’.

iam-client-library contains high-level methods to initiate credential requests. These methods indicate whether a credential should be registered 'on-chain' or 'off-chain'.

Claim requests are persisted in the SSI Hub.

Example

A user makes a request to the credential issuer to enrol into Organization A as a 'Battery Installer'. This role is pre-defined by Organization A, and has a designated set of issuers (each with a DID) who are authorized to approve and issue a credential for the 'Battery Installer' role. At the time of request, the subject must specify if they want this credential to be persisted on-chain or off-chain.

2. Issue Credential

The credential's issuer approves and issues (or rejects) a subject’s credential request. By issuing the credential, they are verifying that the subjects meets the requirements needed to obtain the credential.

Using the example **** above, the issuer is issuing a credential of 'Battery Installer' to the subject. In doing so they are asserting that the subject meets the requirements to hold this credential. They are signing the credential (providing proof) with their digital signature using an Ethereum- compatible wallet such as MetaMask.

Issuing On-Chain Credentials

If a credential has an **'**on-chain' registration type, the verified credential is registered in the Claim Manager smart contract.

Issuing Off-Chain Credentials

As discussed above, off-chain credentials are issued in two formats:

  1. A verifiable presentation ****

  2. A signed JSON Web token****

The verifiable presentation and issued token are appended to the claim data, which is updated in the SSI Hub.

3. Publish Credential

Once an issuer has issued a credential, the subject has the option to publish (persist) the credential. The persistence location depend on if the credential is registered on-chain and/or off-chain. Persistence for on-chain credentials is discussed above here. Persistence for off-chain credentials is discussed above here.

4. Revoke Credential

The W3C Verifiable Credential protocol includes revocation as a standard operation in the credential lifecycle. Credentials can be revoked due to a breach in proof integrity (digital signature), or because the subject no longer meets the requirements to hold the credential.

The IAM stack provides methods for a revoker to revoke a credential after it has been issued.

Revocation for Energy Web credentials is executed based on the Role Governance. Only an authorised revoker (a DID or any DID with specific role credential) can revoke a credential.

Revoking On-Chain Credentials

When an on-chain credential is revoked, the revocation is registered in the ClaimsRevocationRegistry smart contract. This smart contract holds a reference to every revoked credential. The ClaimsRevocationRegistry contract references the ENSRegistry contracts to ensure that the revoker has the right authority to execute revocation and ClaimManager contract to validate if the subject has the role credential (to be revoked) and if revoker's authoritative credential has either expired or revoked (for the case where revoker's authority is based on a specific role credential).

For a revoker to be able to revoke an on-chain credential, their authoritative credential should also be published on-chain.

On-Chain Revocation Sequence:

Design Rationale

For a credential to be verifiable on-chain, a verifier should be able to check the revocation status of the issued credential along with the issuance.

It should be possible to get a single source of truth for a revocation status i.e. a verifier should be able to get a valid revocation from a registry without the need to verify it again.

For a revocation to be registered on-chain it is necessary that the credential first be registered on-chain with ClaimManager, where holder has provided their consent to make the credential publicly available.

The publishing of a holder's credential reduces the privacy and allows someone to determine if a holder has been issued a role credential or not.

In other words, revocation of a credential which has not been published yet would imply that the holder holds the role credential reducing the privacy of the holder's credential.

Therefore, the revocation registry requires that the holder consent to their credential being on-chain and publishing it to the ClaimManager registry.

Having the credential in the ClaimManager allows the ClaimsRevocationRegistry to provide verifiability of:

  1. Only verified and valid credential being revoked, ClaimManager verifies credential's integrity and its issuer's authority before registration.

  2. Credential's validity with regards to expiration.

  3. Revoker's authority who revoked Holder's credential.

Thus establishing a design which provides Verifier with a trusted mechanism for revocation status check which ensures that a valid credential can only be revoked by an authoritative revoker.

Revoking Off-Chain Credentials

When an off-chain credential is revoked, the credential JSON is updated with a "credentialStatus" property that is conformant to W3C's StatusList2021 data model. This data model provides a link for verifiers to use to see the status of a credential (i.e. if a credential has been revoked by the revoker). The verifier can verify this credentialStatus property and derive the revocation status of the credential. You can view the properties of the StatusList2021 data model here.

When a credential is revoked using iam-client-library, which utilises status-list module to append this credentialStatus property to credentials, the credentialStatus will have a statusPurpose that reflects it has been revoked:

credentialStatus: {
    id: 'https://credential-status/admin',
    type: StatusListEntryType.Entry2021,
    statusPurpose: CredentialStatusPurpose.REVOCATION,
    statusListCredential:
      'https://isc.energyweb.org/api/v1/status-list/700xxxxx-5xxx-4xxx-bxxx-43acfaxxxxxx',
    statusListIndex: '0',
  }

Status list credentials are persisted in SSI Hub. The credentialStatus object has an attribute statusListCredential that provides a URL thorugh to fetch the credential's status for verification purposes.

More detailed documentation around StatusList2021 can be found here

5. Verify Credential

A verifier is responsible for verifying the authenticity of a credential. The criteria for this evaluation is specified by the W3C Verification standards here. iam-client-library provides verification methods that evaluates these criteria, namely:

  1. The credential proof (typically the digital signature) is valid.

  2. The credential is not revoked.

  3. The credential is not expired.

Beyond the scope of basic verification, iam-client-library's verification methods also validate the issuer's authorization to issue the credential and does this for all the issuers in the hierarchy.

This verification is executed for off-chain credentials and relies on the subject's (holder or issuer) DID Document resolution.

Off-Chain Verification Sequence:

Related Content

Using Switchboard

This is a walk-through covering the main functionality of the system released to date. It assumes you already have a wallet in either a WalletConnect-compatible mobile application or MetaMask browser

-> The test version of the system leverages the Energy Web Volta test network. Therefore, all chain transaction fees use Volta tokens, which have no value and are freely obtainable from the Volta faucet. Here you can try and become familiar with what the system can do for you.

-> The production version of the system is on the Energy Web Chain and uses Energy Web Tokens for transactions. You can view the cost of transactions for each operation using this link.

We recommend using Switchboard on Chromium (Google Chrome, Brave, etc.) or FireFox browsers.

Please note that some privacy-related browser extensions could cause problems with the system. Therefore, if you find that you are unable to complete a step described below, please try disabling your privacy extensions and reloading the page.

Visiting the Welcome Page

Using a web browser on your computer, visit the system landing page. It should appear similar to the image below.

->Test Version

-> Production Version

Welcome Page

[Optional] Installing Switchboard as a Progressive Web Application

The system is a progressive web app, meaning that if you access the system website via a browser on your mobile device, you can add the system as an app on your device’s home screen (without using the iOS App Store or Google Play Store).

To do this, first, open your browser and navigate to the system landing page.

Using Chrome on an Android device, click the three-dot overflow menu in the upper-right corner to reveal a menu similar to that shown at the right. Click on “install app” to initiate the download. You should then see the system logo as an app on your home screen.

On an iOS device, the process is similar. Navigate to the welcome page in Safari, then tap the “share” button and scroll down to “add to the home screen.” the system will now appear on your home screen.

Connecting Wallet

As noted above, you may connect to the system using either a WalletConnect-compatible mobile wallet app (on your mobile device) or a MetaMask browser extension. Each of these methods is described below. You can complete either one and skip the other option.

WalletConnect Mobile Wallet

This step requires that you have two devices: a primary device (e.g., a computer) with a browser displaying the system landing page, and a mobile device (tablet or smartphone) on which you have installed a WalletConnect-compatible application.

First, on your primary device, click “use mobile wallet” to view a QR code similar to that in the image at the right. Next, on your mobile device, open the mobile application you use as a wallet, and use that mobile app to scan the QR code on your primary device’s screen.

The app on your mobile device will ask you to confirm that you wish to connect to the system. Your mobile app might then ask you to sign one or more messages. Finally, your mobile app might ask to confirm the connection. After signing and confirming as instructed in your mobile app, your primary device should automatically bring you to the Switchboard dashboard screen.

MetaMask Browser Extension

This step requires that you already have installed the MetaMask browser extension and created a wallet in MetaMask. See the page on using the MetaMask browser extension for more details.

When you click the “use MetaMask” button, the MetaMask browser extension should open automatically. After you sign in to MetaMask, click the “connect” button. You will be requested to sign a message; do this to complete the connection to the system. You should land on the Switchboard dashboard screen.

Switchboard Dashboard

The Switchboard dashboard contains functionality related to assets (creating managing an asset DID), governance (managing organizations, applications, and roles), and enrolments (issuing, viewing and revoking roles).

Switchboard Dashboard

Managing the User Profile

If you click "Manage Profile" button on the top right corner of the dashboard, you can access the user profile menu.

User Profile Menu

Update Identity

You can add a human-readible name label to your DID account using this menu item. The name is only stored locally and viewable by you.

Update Identity pop-up

DID Book

DIDs are not very human-readible and hard to memorize, therefore you can use the DID Book function to store the most used DIDs with labels to access them quickly.

DID Book pop-up

QR Code Scanner

You can use this function to scan DID encoded QR Codes.

DID Document (⚠ Experimental)

You can use this function to see the DID document in raw JSON format and copy it.

Logout

You can use this function to logout from the current DID account.

Assets

An asset is a virtual representer of the user’s solar panels, smart energy meters, batteries and other devices in the system. Each asset is assigned its own DID that gives them the ability to be a part of the Energy Web Network, so they can be transferred or enrolled in a role.

By clicking on the “Register Asset” button on my assets tab, you add one more asset to your list. It will get its own DID automatically.

Register Asset pop-up

You should see a general list of assets similar in appearance to the image below.

My Assets tab

As an owner, you can perform several options under the three vertical dots button (next to the last updated date in the list).

Symbol

Name

Description

View Ownership History

View the history of owners and transaction of chosen asset.

Verification Method

Existence of the asset can be verified by a third-party. For this you should know the third-party public DID and type of Network.

Transfer Ownership

Transfer ownership of your asset. For this you should know public DID of a new owner. As soon as a request submited your asset from My assets tab will be moved to Previously owned assets.

Edit

At any time, you can set a personal name and icon for each of your items. For security reasons, assets names are blurred in the general list.

Generate QR-Code

Generate a QR-code for a chosen asset.

Issue Claim to Asset

Inform about Verified Claim of a chosen asset.

Assets can be enroled to a role credential. By clicking on the Enrolments button (next to the asset name) you can see all roles that the chosen asset has. We recommend adding this issued claim to the asset's DID document so that you have the credentials you need in order to access the application with the appropriate role, you can use the Publish button to do this operation.

Asset Enrolments Page

Governance

One set of functionality in the system relates to governance: managing organizations and applications. To explore this, click on the “governance” button from the system main screen. You should see a governance dashboard similar in appearance to the image below.

Organization Management tab

The system leverages the Energy Web Name Service (an implementation of the Ethereum Name Service for Energy Web). With EWNS, you can organize your organization, any applications your organization owns/operates, and all roles within your organization or those applications.

The development version of the system is built on Energy Web’s Volta test chain. As you set up your organization, applications, and roles, these will be anchored to Volta. We hope that you test out all available functionality, but we also recommend that you do not enter any sensitive information into the fields at this time. For example, when you create an application in part B below, use a test name if you wish to keep secret the real name of your application for now.

Organization Management

The first tab within governance relates to organization management.

If you haven’t had an organization yet, you can add it by clicking on the “Create Organization” button. The system asks you to fill the form and submit the request.

Create Organization form

The “Create Organization” button allows creating only one organization per wallet. After using, the button is hidden from UI.

Assume that you already own an organization, on the Organization management tab you can perform several options related to your organization and its EWNS namespace, each using the options under the three vertical dots button (next to an organization namespace in the list).

Symbol

Name

Description

View Details

View the basic details of your organization, including the logo, namespace, organization name, website, description, and other data.

Create Sub-Organization

Create a new sub-organization owned by the organization. This allows you to define applications and roles for specific subsidiaries or business units within your organizational umbrella. For example, you might create “subsidiary1.exampleco.iam.ewc” and “subsidiary2.exampleco.iam.ewc” so that you can define applications and roles specific to those subsidiaries (as described in the following sections of this document).

View Applications

View the applications owned by this organization (i.e., go to application management tab).

View Roles

View the roles associated with this organization or with any application owned by this organization (i.e., go to role governance tab).

Note that that are two kinds of roles:

  1. Roles associated with an organization - these roles are independent of any particular application. For example, you might create the role “global dApp admin” to manage all of your organization’s applications.

  2. Roles associated with an application - these roles are specific to a particular application. For example, you might create the role “installer” or “renewable energy buyer” in an application that you own. These roles are not necessarily part of your organization.

Create Application

Create a new application owned by the organization.

Create Role

Create a new role associated with either this organization or a specific application owned by this organization.

Edit

Change the details of your organization. Please note that it is not possible to change the root namespace of an organization. For example, after you have defined “exampleco.iam.ewc" as your namespace, you could define subdomains (e.g., "roles.exampleco.iam.ewc" or "applications.exampleco.iam.ewc"), or you could define a new root namespace (e.g., "exampleorg.iam.ewc"), but you are not able to change the root namespace "exampleco.iam.ewc" into something different.

The “others (JSON)” field allows you to specify formatting-related details (e.g., color scheme) that should be applied, so that when you integrate the system into your decentralized applications the branding is consistent. For example, you could add into this field the text:

1{"bgcolor":"CDD3FF","txtcolor":"FF0000"}

The above text will set the background color for the system in your application to be the light blue color with hex code CDD3FF and the text color to be red with hex code FF0000. You can experiment with different formatting options.

Transfer Ownership

Transfer ownership of your organization and its root namespace to another address.

Delete

Delete your organization.

Application Management

After you have created an organization and set its root namespace, you may wish to set the namespace for decentralized applications your organization will own/operate.

The first step is to create the new application namespace, using the “create an application” option on the organization management tab. You will then see a pop-up with several fields to complete. Starting with step 5 of this process (registering the namespace for the app), you will be asked to confirm the transaction using your linked wallet.

Create Application pop-up

Note that any application namespace you define will automatically be created under an “apps” subdomain within your organization’s namespace. For example, if your organization’s namespace is “exampleco.iam.ewc" and you wish to create a new subdomain for an application you call "DERmanager," then your resulting namespace will be "dermanager.apps.exampleco.iam.ewc" (the "apps" subdomain is added automatically, to organize applications separately from other subdomains).

After you have completed all steps to create the new application, your application management tab should appear similar to the image below.

Application management tab

You have several possible actions, similar to your options under organization management. Note that you also have the option to filter your applications by the organization; this may be helpful if, for example, different subsidiaries within your corporate umbrella wish to manage applications separately, but you as a designated super admin need to be able to view all of them.

Role governance

The final governance task is perhaps the most powerful use of the system, and it builds on the organization and application management functionalities described above. It is governance related to roles—not only roles within your organization but also roles that different users might have in your applications.

As noted above, the system allows you to define two types of roles:

  1. Roles associated with an organization - these roles are independent of any particular application. For example, you might create the role “global dApp admin” to manage all of your organization’s applications. This role is created under your organization or chosen sub-organization on the Organization management tab.

  2. Roles associated with an application - these roles are specific to a particular application. For example, you might create the role “installer” or “renewable energy buyer” in an application that you own. These roles relate to your application but are not necessarily part of your organization. This role is created under your application on the Application management tab.

For creating a role, you should fill the role definition form. You can find detailed explanation of the each step below;

1. Set Role Name

At this step, you will choose an unique role name to host the role definition, full domain path will be shown including application and organization names. The system will prompt if the name is already in-use.

Set Role Name

2. Set Role Issuers

At this step, you will select who is allowed to issue this role. As a role definition creator, your DID will be listed as an issuer by default. You can easily override it by adding another DID or even a role name.

Set Role Issuers

3. Set Role Revokers

At this step, you will select who is allowed to revoke this role. As a role definition creator, your DID will be listed as a revoker by default. You can easily override it by adding another DID or even a role name.

Set Role Revokers

4. Set Restrictions

At this step, you can define a precondition for the user to request this role from the issuer. The user needs to obtain the precondition role and publish it to its DID document and afterwards can continue to requesting this role.

Set Restrictions

5. Set Default Validity Period

At this step, you can define a default validity period to guide the issuers. The issuers have authority to override it at the time of the issuence.

Set Default Validity Period

6. Set Requestor Fields

At this step, you can create custom input fields that will be used to collect data from the user at the time of the role request. This data is only for the issuer to get some more information about the user before the issuence. The data is not stored on the role credential.

Set Requestor Fields

7. Set Issuer Fields

At this step, you can create custom input fields that will be used to collect data from the issuer at the time of the issuence. The data will be stored on the role credential.

Set Issuer Fields

When you have at least one role, the role governance tab should look similar to the image below.

Role governance tab

Each role in the list has the same list of options: View Details, Edit and Copy Role Enrolment URL. The first two are the same as we described above. By choosing the latter one you will copy a link to a URL that others can use to enroll as that role type. You will try this in the next section of this document below.

Enrolments

Users of the system can use the enrolments functionality in two ways. Recall that, because the system uses a decentralized system of identity and access management, any person can own a DID and add claims verified by authorities, which are then used to take on roles in applications. This system of enrolment has three key users:

  1. An authority (issuer) who can verify claims about users, so that the users can add the verified claims to their DID documents (and use them to enroll in an application).

  2. Users who request claims from authorities, so that users can add the verified claims to their DID documents.

  3. The owner of an application, who specifies what claims (the content of the claim, and from whom) are required in order to enroll in that application.

Example: Imagine you wish to deploy an application related to electric vehicle smart charging. Your application might include the roles of vehicle owner, vehicle manufacturer, __ and vehicle dealer. In order for a DID to enroll in your application as a vehicle owner, you might require a verified claim from a vehicle dealer that this DID is in fact the person to whom it sold a particular vehicle (you might require many more claims, including claims from the manufacturer about the vehicle’s model, identification number, battery capacity, and other things, but let us keep the example simple for now). In this example, you can use the system to set up these roles and requirements: a DID can enroll in you application as a vehicle owner only if it has a verified claim from a dealer that the DID is the owner of the vehicle.

Returning to the work you have done so far, you have set up the required claims and issuers. Now let us see how a new user can enroll in an example application. First, ensure you have the enrolment URL. Next, open a new browser window, and paste that URL in the navigation bar. This will load the sign-in page, and you can sign in with your existing address (i.e., the same DID and thus the same user) or create and sign in with a new wallet address (simply create one in your mobile wallet or MetaMask browser extension) if you wish to test this from the perspective of a new user. Either way, you will see an enrolment screen similar to the example below.

If you wish to use more than one DID, then it is recommended to either (a) use a different browser for each user or (b) use a browser extension that manages multiple sign-ins to a single website, such as SessionBox.

Submit Enrolment Request

Enroll in a role form (example)

When you complete these fields and register, the system sends the enrolment request to the issuer(s) who had previously been specified to approve the role.

Accept Enrolment Request

Return now to your sign-in as the issuer who can approve the role. The issue will be informed about the new request by Task Manager in the top navigation. The notification’s bubble disappears as soon as the task has been completed.

Task Manager list

Your enrolments screen should display the request from the new user.

Enrolment Requests Tab

“View Request” pop-up under the three vertical dots button contains information about the requestor, chosen role, and the fields from the enrolment form. If you approve this request, you have issued a verified claim that the new user can add to that user’s DID document and thereby access your application in the appropriate role.

Role Issuance pop-up

Return one final time to the new user’s sign-in. You can view this pending role request on your “my enrolments” screen, which should appear similar to the image below.

My Enrolments Tab

Publish the Role Credential

You can add this newly received role credential to your DID document and publish it to on-chain ClaimManager smart contract, so that you have the credentials you need in order to access the application with the appropriate role. Use the “Publish” button, in order to publish the role credential.

Publish option

Revoke a Role Credential

You can also revoke a role credential if your DID is listed as one of the revokers. In order to revoke a role credential, you should navigate to "Revocable Enrolments" tab and click "Revoke Off-Chain Enrolment" or "Revoke On-Chain Enrolment" to revoke.

Revocable Enrolments tab

Search

Because the system leverages EWNS, it is instantly possible for any user to search for organizations and applications that have defined namespaces.

To see an example, return to the main landing page by clicking on the system logo in the top left of your browser window. Your screen should appear similar to the image below.

Search bar on the Dashboard

In the search bar below your name and address, enter any search term. Try “flex” for an example. The system will display all organizations and applications that have the word “flex” in their EWNS namespaces. You are likely to see many examples and test applications. When you click on any of these, you will see the relevant public information associated with this namespace. For example, clicking on the Energy Web Flex (example) “application” displays information about that app, including the roles defined in that app’s namespace. In this way, you can view what roles (user types) are part of a given application.

You can even request to enroll your DID in one of these roles directly from this screen, using the action buttons in the roles list at right. Your enrolment request will be submitted to the relevant issuer, as defined by that app owner via the process described in Part V of this document.

Self-Sovereign-Identity

This page introduces the concept of Self-Sovereign identity (SSI), the components of Decentralized Identifiers (DIDs) and verifiable credentials (VCs), and how they provide the mechanisms for identity access and management in EW-DOS.

To learn more about Energy Web's implementation of SSI technologies, visit the Identity and Access Management page.

  • Self-Sovereign Identity (SSI)

    • Decentralized Identifiers (DIDs)

    • Verifiable Credentials (VCs)

  • DIDs and VCs in EW-DOS

    • EW-DOS Identity and Access Management Stack

Self-Sovereign Identity (SSI)

Self-sovereign identity (SSI) is a term used to describe the digital movement that recognizes an individual should own and control their identity without the intervening administrative authorities. SSI allows people to interact in the digital world with the same freedom and capacity for trust as they do in the offline world.

- Sovrin.org

‘Self-Sovereign Identity’ is a growing paradigm that promotes an individual’s control over their identity and their data. This is in contrast to the current paradigm where most of our official identifiers (driver’s license, birth certificate, usernames, etc.) are given to us and maintained by a central authority, and where our data can be shared without our knowledge or consent.

The SSI movement catalyzes the shift away from stratified, centralized authorities as the distributors and overseers of identity, and toward a system where individuals can maintain their own identity and where verification and data-sharing can occur via secure, digital consent.

Components of SSI

Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs) are two of the most important components of SSI.

A DID is an identifier that can be generated and controlled by individuals or organizations without an external authority. It can be used to identify any subject, such as a non-tangible asset, a customer, or an organization.

A Verifiable Credential is a secure and machine-verifiable digital credential which respects a standard data model.

Together they allow users and organizations to have control over their identities. Instead of an external authority maintaining control over an identifier and its associated identity data, any individual or asset can create an identity, and then establish credentials over time through interactions with peers or authorities on a trusted, decentralized network.

Both DIDs and VCs are specifications of the W3C. The W3C is an organization which provides core technical specifications to establish guidelines and best practices for an open, inclusive and trustworthy web. Energy Web’s approach to DIDs and VCs is sufficiently abstract and flexible that it can be used with the Energy Web Chain, another blockchain, or no chain at all.

Additional Resources on Self-Sovereign Identity

  • “Digging Deeper into Self-sovereign Identity and Access Management” - Energy Web Medium article

  • "Introduction to Self-Sovereign Identity and Its 10 Guiding Principles" on Medium

  • "How blockchain makes self-sovereign identities possible"

  • "The Path to Self-Sovereign Identity" on CoinDesk****

  • "An introduction to Self-Sovereign Identity" from SSI Ambassadors on **** YouTube

Decentralized Identifiers (DIDs)

A DID is an identifier that is user-generated and not coupled to any centralized authority. It can be used to identify any subject, such as a non-tangible asset, a customer, or an organization.

Unlike traditional forms of identification, DIDs are not generated by a central authority, such as a government-issued driver’s license, or a bank-issued account number, and they are not stored in a centralized database. A user can create a DID for themselves or an asset using cryptographic or other means.

A DID for a given system resides in a decentralized DID registry. DID Registries, like VCs and DIDs themselves, are developed according to W3C standards. Most DID registries live on a decentralized ledger, or a blockchain. In the case of EW-DOS, the DID registry is on the Energy Web Chain.

How are DIDs Created?

Public-Private Key Pairs

A DID is derived from a public-private key pair that is generated programmatically through a cryptographic algorithm. The algorithm produces a private key and a corresponding public key. Crypto wallets such as MetaMask will generate these keys for you on creation of an account. The public key can be exposed and shared with others, but the private key should not be shared with anyone. The algorithm used to generate the key-pair makes it virtually impossible for any outsider to guess your private key.

Your public key serves as your address on the blockchain, and your private key serves as your private identifier, similar to a password, and is used to sign transactions on the blockchain. The signature is proof that you initiated that transaction.

DID Format

DIDs are made up of a scheme, a method and a unique method identifier. There are many DID methods that are supported by different blockchain networks. You can see a full list here. DID methods define operations to create, resolve, update and deactivate DIDs and their associated DID Documents, which are discussed below. DID Methods are often associated with a verifiable data registry, which are registries with store DIDs and their data. If the registry is implemented on a blockchain, smart contracts usually serve as the data registry. An example of this is the did:ethr registry.

Energy Web Chain uses the ETHR DID Method Specification. The string that identifies this DID method is "ethr", and the method identifier is always the user’s public key (also known as an address.)

DID generated by ID Registry using ETHR DID Method Specification

DID Documents

Every DID resolves to a corresponding DID document, which contains metadata about the subject's authentication mechanisms and attributes, like its public key.

Below is a sample JSON document that was created by the EW-DOS DID library. For a list of required and possible DID Document properties, see the W3C documentation on DID Document Properties.

{
   "id":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
   "authentication":[
      {
         "type":"owner",
         "validity":{
            "_hex":"0x1fffffffffffff"
         }
      }
   ],
   "created":null,
   "delegates":null,
   "proof":null,
   "publicKey":[
      {
         "id":"did:ethr:0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45#key-owner",
         "type":"Secp256k1veriKey",
         "controller":"0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45",
         "publicKeyHex":"0x02d0e12da3425d7b01fd2e49b283f939f3a13d71273d749dd8933d3b792bb20078"
      },
      {
         "id":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75#key-owner",
         "type":"Secp256k1veriKey",
         "controller":"0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "publicKeyHex":"0x020ee3388dd3db4e3e4da39f2fdc27113161d33579c4d0350b5672bcb654ceff98"
      }
   ],
   "updated":null,
   "@context":"https://www.w3.org/ns/did/v1"
}

Additional Resources on DIDs

  • W3C DID Documentation

  • Energy Web - DID Explainer

  • EW’s DID Library is open-source

  • Energy Web - “Digging Deeper into Self-sovereign Identity and Access Management” on Medium

  • W3C, "A Primer for Decentralized Identifiers"

  • “Everything you need to know about Self-Sovereign Identity and Decentralized Identifiers” (3 part series) on Medium

  • Chapter 4: Cryptography · GitBook

Medium Series on private keys and their relevance in the Ethereum Network:

  • Part One: Understanding Private Keys

  • Part Two: Turning Random Numbers into an Ethereum Address

  • Part Three: Creating and Signing Ethereum Transactions

MetaMask glossary on key terms:

  • Public Key

  • Private Key

Verifiable Credentials (VCs)

Above we discussed the role of identity. Once an identity is established, it exists in a DID registry, but nothing is known about the subject through a digital identity alone. That is where Verifiable Credentials come into play.

A credential is something that we can prove about a subject or individual. Common examples of credentials include a driver's license, that proves that one has passed a test and can drive a particular class of vehicle, or a passport, that proves one is approved to travel internationally until a specified date in the future. These traditional credentials are authorized and issued by a central authority, such as a government bureau or a bank. They are distinct and not interchangeable. For example, you cannot use your passport to show that you can drive a car, and you cannot show your driver's license to prove that you can travel.

What is a Verifiable Credential?

Verifiable Credentials are a Web3 standard for digital credentials in a decentralized ecosystem, meaning a system with no central issuer or authority.

Like traditional credentials, VCs are statements or claims made about an identity, which is referred to as the credential subject. If a battery was the credential subject, it could have a verifiable claim that it originated in a particular manufacturing plant, or that it has a specific discharge rate at the time of manufacturing.

Issuers, Holders, Verifiers

There are three primary actors in the facilitation of Verifiable Credentials.

  1. Issuer: makes a claim about a credential subject and correspondingly creates and issues credentials asserting the claim.

  2. Holder: receives, holds and shares credentials

  3. Verifier: receives and verifies proofs (proofs can be the entire credential or a piece of info from the credential)

Credential Verification

The main difference between traditional, non-digital credentials and verifiable credentials are the way they are verified.

Traditional credentials require manual verification, such as a signature or a stamp. Verifiable Credentials are verified completely through cryptographic means using a digital proof mechanism, such as a digital signature or a JSON Web Token, through a digital trust mechanism, such as a blockchain.

In the context of EW-DOS, a digital cryptocurrency wallet such as MetaMask, which holds a user’s public and private keys, is used to facilitate a digital signature. This eliminates the need for any interaction between the issuer and the verifier. The blockchain provides the platform and mechanisms of trust.

Once an authority verifies a claim, a VC can then be used as an official record to assure others of the truth of the statements. These credentials are linked back to the credential subject’s digital identity. In the case of EW-DOS, credentials are linked back to the user's DID document. A DID Document can amass a rich set of Verifiable Credentials that provide a full picture of its origin, attributes and capabilities.

To see a more exhaustive list of possible interactions and use cases for issuers, holders and verifiers, see w3’s list of Verifiable Credential use cases.

Additional Resources on Verifiable Credentials

  • W3C documentation

  • Understanding the Verifiable Credentials (VCs)

  • "Verifiable Credentials 101 for SSI with Tyler Ruff" with SSI Meetup on YouTube

    "Machine Identity - DIDs & Verifiable Credentials for trust & interoperability in IoT" with SSI Meetup on Youtube

DIDs and VCs in EW-DOS

One goal of our technology is to give every participant in the energy system an identifier to allow for broad participation in decentralized applications built on the Energy Web Chain. Participants include individuals, organizations, applications and energy assets.

EW-DOS can be considered a self-sovereign ecosystem because there is no central administration or server to manage identity or verify attributes. As long as a user has a public-private key-pair, they can create a DID, which is then stored in the DID registry on the Energy Web Chain.

Once identity is established, VCs are the primary mechanism for acquiring attributes and sharing these attributes with other participants through cryptographic consent. VCs then determine if an asset can participate in a particular role or application based on set criteria.

To see the relationship of DIDs and VCs in the EW-DOS use cases, we recommend that you explore the Energy Web Interactive DID Explorer Dashboard.

DIDs and VCs create a full identity for energy assets on the Energy Web Chain

An example of DIDs and VCs in an asset lifecycle

To understand how and why an asset can take on a DID and acquire and use VCs using EW-DOS, let’s use the lifecycle of a battery as an example.

  1. When the battery is manufactured, the manufacturer assigns a DID to the battery, and issues claims on the battery’s physical makeup (date of manufacture, the model, the serial number, the battery capacity.)

  2. The battery is sold. The installer of the battery adds new claims on the battery’s purchaser and its new location.

  3. As the battery performs, the new owner adds claims on the battery’s charge and discharge rate.

  4. The battery reaches the end of its lifecycle. The final owner of the battery adds the date that it is retired, and its final charge and discharge rate.

Because we now have verified information on the battery, the battery can use its DID to participate in various energy markets and provide services to the grid based on its confirmed attributes. This all happens without central oversight of the battery, and the battery is not restricted to participating in only one market. It can participate in any market or application that is using the Energy Web Chain.

Managing DIDs and VCs in EW-DOS

The Identity and Access Management stack

EW-DOS’s Identity and Access Management (IAM) technology stack is composed of a decentralized application called Switchboard and several underlying packages listed below that manage the creation, reading, updating and removal of DIDs and VCs on the Energy Web Chain. To read more about Switchboard and its dependencies, go here.

The IAM stack provides means for authentication (proving you are who you are via DID) and authorization (proving you have the attributes to participate in a certain role via Verifiable Credentials.) The combination of a user's DID and VCs provide authentication to access multiple systems using role-based permissioning. You can view the components of the IAM stack below.

Where are DIDs Persisted?

DIDs are anchored on the Energy Web Chain in the DID Library smart contract. The DID library currently implements the ERC1056 standard for creating and updating identities on the blockchain, but will support other DID methods and standards in the future.

Where are VCs Persisted?

****VCs are stored off-chain on IPFS, a decentralized, peer-to-peer file system that uses content hashing for file location. The credential's corresponding DID Document has a service node that holds an array of service endpoints. Each serviceEndpoint points to the location of a Verifiable Credential stored on IPFS. Once retrieved, the VC is decoded and its contents can be read.

You can see a serviceEndpoint present in a DID document's service array below:

{
   "id":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
   "service":[
      {
         "id":"d88cb569-8390-420b-a685-b0e7a62ebe7c",
         "did":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "iat":1620072464520,
         "iss":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "sub":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "hash":"ffb51dc355c5ffd11b8733b2ea9ab4646343873f5adb334b0b1030f9d59b723b",
         "signer":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "hashAlg":"SHA256",
         "profile":{
            "name":"First Last",
            "address":"Washington, DC",
            "birthdate":539931600000
         },
         "serviceEndpoint":"QmRmwLTjzC4NeinPTHn3zuLazgGeyHrVvoCUR6v2ErAiDT"
      }
   ],
   "authentication":[
      {
         "type":"owner",
         "validity":{
            "_hex":"0x1fffffffffffff"
         },
         "publicKey":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75#owner"
      }
   ],
   "created":null,
   "delegates":null,
   "proof":null,
   "publicKey":[
      {
         "id":"did:ethr:0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45#key-owner",
         "type":"Secp256k1veriKey",
         "controller":"0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45",
         "publicKeyHex":"0x02d0e12da3425d7b01fd2e49b283f939f3a13d71273d749dd8933d3b792bb20078"
      },
      {
         "id":"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75#key-owner",
         "type":"Secp256k1veriKey",
         "controller":"0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75",
         "publicKeyHex":"0x020ee3388dd3db4e3e4da39f2fdc27113161d33579c4d0350b5672bcb654ceff98"
      }
   ],
   "updated":null,
   "@context":"https://www.w3.org/ns/did/v1",
   "logs":"{\"owner\":\"0x0000000000000000000000000000000000000000\",\"topBlock\":{\"_hex\":\"0xb59258\"},\"authentication\":{},\"publicKey\":{\"did:ethr:0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45#key-owner\":{\"id\":\"did:ethr:0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45#key-owner\",\"type\":\"Secp256k1veriKey\",\"controller\":\"0x5B1B89A48C1fB9b6ef7Fb77C453F2aAF4b156d45\",\"validity\":{\"_hex\":\"0x2000006087e1f8\"},\"block\":11552030,\"publicKeyHex\":\"0x02d0e12da3425d7b01fd2e49b283f939f3a13d71273d749dd8933d3b792bb20078\"},\"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75#key-owner\":{\"id\":\"did:ethr:0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75#key-owner\",\"type\":\"Secp256k1veriKey\",\"controller\":\"0x17b65C8C9746F87c82cc6f7C4FC38fCA5f1AeB75\",\"validity\":{\"_hex\":\"0x60b4ed75\"},\"block\":11899480,\"publicKeyHex\":\"0x020ee3388dd3db4e3e4da39f2fdc27113161d33579c4d0350b5672bcb654ceff98\"}},\"service\":{\"d88cb569-8390-420b-a685-b0e7a62ebe7c\":{\"id\":\"d88cb569-8390-420b-a685-b0e7a62ebe7c\",\"serviceEndpoint\":\"QmRmwLTjzC4NeinPTHn3zuLazgGeyHrVvoCUR6v2ErAiDT\",\"hash\":\"ffb51dc355c5ffd11b8733b2ea9ab4646343873f5adb334b0b1030f9d59b723b\",\"hashAlg\":\"SHA256\",\"validity\":{\"_hex\":\"0x2000006090581a\"},\"block\":11631883}},\"attributes\":{}}"
}

EW-DOS Identity and Access Management Stack

EW-DOS Components that implement functionality for DIDs and VCs in EW-DOS.

Component

Role

A decentralized application for defining a role credential governance framework and issuing role credentials. These functions are performed by interfacing with user's Web3 wallet.

Provides high-level functions for all identity and access management

Provides an abstraction layer to manage and interact with DIDs and Verifiable Claims on Energy Web Chain

Facilitates the credentials exchange between credential requesters and issuers. It also caches smart contract data such DID documents in order to improve read-query performance.

Decentralized DID registry

Off-chain, decentralized, peer-to-peer storage for Verifiable Credentials

Additional Resources on DIDs and VCs in EW-DOS

  • Digging Deeper into Self-sovereign Identity and Access Management

  • EW’s DID Library is open-source

  • How Switchboard Tackles the Challenge of Enterprise Identity Management

https://github.com/energywebfoundation/ewf-gitbook/blob/develop/identity-at-ew/technology/trust-layer-energy-web-chain/README.md
https://github.com/energywebfoundation/ewf-gitbook/blob/develop/identity-at-ew/how-tos-and-tutorials/interacting-with-a-smart-contract.md
https://github.com/energywebfoundation/ewf-gitbook/blob/develop/identity-at-ew/patterns/self-sovereign-identity/README.md
Source Code
'0x23b026631A6f265d17CFee8aa6ced1B244f3920C'
'0x5339adE9332A604A1c957B9bC1C6eee0Bcf7a031'
Source Code
revoked credentials
'0xd72B4c8D5B1a1A4C7085259548bDF1A175CFc48D'
'0x9876d992D124f8E05e3eB35132226a819aaC840A'
Switchboard
IAM Library
DID Library
SSI Hub
Energy Web Chain
IPFS
System design for your whole team; in sync with realityIcePanel
Click to navigate to IAM architecture

Digital Spine Integration Client Deployment Guide - from Azure marketplace

This guide demonstrates how to launch a Digital Spine Integration Client (DSI Client) instance from App ‘Digital Spine Integration Client by EnergyWeb’ on the Azure marketplace.

The public Digital Spine Integration Client and associated message broker service is currently offered free of charge for Energy Web Member organizations and on a free trial basis for non-members. Please note that the message broker is rate-limited in the free version, and thus may not be suitable for high volume / high frequency data exchange use cases. For assistance in configuring a custom DSI Client and Message Broker solution for your organization, please fill out this form.

Things to know before you start:

  • Each section of this guide is demonstrated in a short video clip and accompanied with step by step instructions.

  • Integration and identity access management (IAM) for the DSI Client is performed with Energy Web's self-sovereign identity technology stack (i.e DIDs and verifiable credentials). To manage your DID you will need a Digital Wallet and Metamask, with a minimum balance of 0.1 EWT, to execute IAM transactions in the Switchboard application including requesting roles and publishing credentials to your DID document. You can read more about Switchboard and IAM processes here.

    • NOTE: Sending and receiving messages via the DSI Client Gateway does not directly use or interact with the Energy Web Chain; you do NOT need EWT to send and receive messages. EWT is required only for the IAM and enrollment processes.

  • You need an active Azure subscription to access the DSI Client via the Azure marketplace. Additional cloud providers and self-hosted options will be available later in 2023.

  • You will need access to one of the following Secret Engines, with full Read & Write privileges required:

- Azure KeyVault (Vault URI, Service principle’s appId, password, tenantid)

- Hashicorp Vault (Vault URI, access token)

Contents

  1. Prerequisite Check

    1. Configure MetaMask settings

    2. Secret Engine credentials

  2. Resource Provisioning

    1. Launching Digital Spine Integration Client instance

    2. Config DSI Client

  3. Client UI walk through

  4. Creating Channels

    1. Creating a Publish Channel

    2. Creating a Subscribe Channel

  5. Demo Integration - test Sending / Receiving data

    1. Example Post data to a Channel

  6. Conclusion

1. Prerequisite Check

1.1. Configure MetaMask settings

To integrate the DSI Client with the Energy Web-hosted message broker, you will need to acquire and manage roles on Switchboard (https://switchboard.energyweb.org/). Metamask is used to log into the Switchboard dApp and sign transactions.

We recommend using Chrome (or Chromium-based, e.g. Brave) or Firefox desktop browsers to interact with the Switchboard dApp. To download MetaMask plugin to your browser, you can use the links below;

  • Firefox: https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/

  • Chrome (or Chromium-based): https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn

Go to Settings > Networks and click Add Network button to add Energy Web Chain. Enter the details below to add Energy Web Chain as a new network.

Network Name

Energy Web Chain

New RPC URL

Chain ID

246

Currency Symbol (optional)

EWT

Block Explorer URL (optional)

You can also use ChainList to quickly add Energy Web Chain as a new network to your MetaMask. To use this tool, please follow this link and click “Add to MetaMask” button.

  • Select Energy Web Chain from the dropdown (by default, the Ethereum Mainnet will be selected) before navigating to the Switchboard dApp homepage.

1.1.a Funding Account

The Switchboard dApp does require users to use Energy Web Tokens (EWT) in order send transactions, sign messages or acquire credentials on the Energy Web Chain.

To learn how to acquire EWT in your wallet, click here

1.2. Secret Engine credentials

Azure KeyVault

Suppose you have a role-based-access-control service principle (sp) created, which is granted full Read and Write permissions to the KeyVault, your sp details may look like

{
 “appId”: “32xxx725-7xx9-46d1-b288-c552xxxxxab35",
 “displayName”: “vault-demo-sp”,
 “password”: “SLxxQ~2ul1J~4wxxNZ-o~sb65l4KuNhxxXaK9c4j”,
 “tenant”: “14e3fxx-fd1f-4exx9-a2aa-4a9xxxxxxx129"
}

You will need above details and the KeyVault uri on the resource creation page.

Learn more about

  • Azure Key Vault documentation

  • Azure Service principle

Hashicorp Vault

You just need

  • vault server url

  • The access token

2. Resource Provisioning.

2.1 Launching Digital Spine Integration Client instance

Login to Azure portal and go to ‘Marketplace’ page.

On the marketplace page, search ‘energyweb’ in the search box as shown below:

You will see the ‘Digital Spine Integration Client by EnergyWeb’ in the search results.

Digital spine integration client app

Click ‘Create’ on the Offer tile. It will take you to the resource creation page.

Follow the user guide on the UI to fill in the required fields for ‘Basics’ and ‘Virtual Machine Settings’.

On the ‘Digital Spine Integration Client Settings’ tab, you can set the configuration for the DSI Client.

Most configurations are pre populated, you just need to select the desired application to integrate with from the `Application Name` dropdown .

There are 3 applications to choose from

  • Global Data Exchange

  • Greenproofs

  • Open Charging Network

If you want to run any other applications, you need to make sure the application is available on the EWC chain. Or feel free to contact [email protected] for assistance (responses are within 1-2 business days)

If you are an Energy Web member organization, you can also use the Member Slack channel #digital_spine.

At the 'Vault Configuration' put in the secret engine details, below is the example for KeyVault.

The VM you are creating must have access to the chosen Secret Engine from a network perspective.

Once all the required fields have been filled. You can proceed to ‘Review + create’ tab, you can double check all the inputs. Then click ‘Create’ to start creating the resources.

After a couple of minutes, the resource creation will complete. You'll find a Virtual Machine under the resource group.

On the VM’s overview page like below, the Digital Spine Integration Client can be accessed at the VM’s DNS in the browser.

2.2 Config DSI Client.

2.2.a Visit Client Application

Open a browser and type in the DSI VM’s DNS; you will be directed to the DSI Client landing page as shown below:

2.3 Configure DID on the DSI Client

Reminder: Integration and identity access management (IAM) for the DSI Client is performed with Energy Web's self-sovereign identity technology stack (i.e DIDs and verifiable credentials). To manage your DID you will need a Digital Wallet and Metamask, with a minimum balance of 0.1 EWT, to execute IAM transactions in the Switchboard application including requesting roles and publishing credentials to your DID document. You can read more about Switchboard and IAM processes here.

  • NOTE: Sending and receiving messages via the DSI Client Gateway does not directly use or interact with the Energy Web Chain; you do NOT need EWT to send and receive messages. EWT is required only for the IAM and enrollment processes.

You will need to acquire the role of 'user' on your DID in order to enroll your DSI Client to the public message broker. Please complete this enrollment form for approval.

The DID will be the public address of the account you are using with your Digital Wallet and MetaMask.

The Energy Web team will review the enrollment request and grant approval within one business day of receipt.

On DSI Client landing page, enter the private key for your DID you will use for enrollment (note: the wallet address will be the DID) and hit ‘Import’.

To extract your private key for your Metamask account:

  1. Click on the Account list dropdown, then click the kebab / three dot icon next to the account, then click 'Account Details'.

  2. That will display a QR code with the Account address, and a button to "Show private key"; click that button and enter your password when prompted to reveal the private key.

  3. Copy the private key and enter it into the form field in the DSI Client landing page.

Entering your private key at this step is a one-time configuration that is necessary to assign your DID to the DSI Client. When you enter the key in this step, it will be securely stored in the secret engine of your choice (i.e. Azure Key Vault or Hashicorp Vault). Energy Web will not have access to your key, and we will never ask you for it.

Be careful to never reveal, share, or paste your private key in any other steps within the DSI configuration and enrollment process.

It can take up to a minute for the DID to be verified and configured (assuming that your DID already has the role 'user'; if not, complete the enrollment form here).

If your wallet does not have sufficient balance (a minimum of 0.1 EWT is recommended) you may receive an ‘insufficient fund’ error message. To learn about transactions and transactions costs, click here; to learn how to acquire EWT in your wallet, click here.

You'll need to have a sufficient balance of EWT in your wallet to pay for gas fees associated with DID enrollment transactions in order to proceed; a minimum balance of 0.1 EWT is recommended. REMINDER: You will only need to pay transaction costs for the IAM and enrollment processes.

Once you have a sufficient balance of EWT to cover the transaction cost, the application will proceed to the next stage of access validation.

2.4 Enroll the DSI Client with DID

If your DID doesn't have the required 'user' role to the application you selected for the Integration Client at resource creation step. You'll see an ‘Unauthorized’ error.

To proceed, click ‘Enroll’ to submit the enrollment request.

Please complete this enrollment form for approval.

The Energy Web team will review the enrollment request and grant approval within one business day of receipt.

When the user role for your selected application is approved, you will see the status is changed to ‘waiting for role to sync’.

2.5 Manually sync role on Switchboard (dApp)

After submitting the enrollment request for your DID, the Energy Web team will contact you via email to notify you of approval. Upon receipt of the approval email, you can publish the newly issued role(s) to your DID document by following the instructions below.

In this guide, we use Metamask, it is the same process for other wallet option to logon dApp Switchboard. Make sure you have Metamask configured.

In a new browser tab, visit Switchboard (https://switchboard.energyweb.org/), click on the Use MetaMask button on the welcome screen of the Switchboard dApp to log in.

The MetaMask plug-in will pop up in the top right corner of the browser and request a signature to log in.

  • If you are logging in with a MetaMask account, you will be prompted to sign the message in the MetaMask Extension.

  • If you are logging in with a hardware wallet account (via MetaMask), you will also be prompted to connect to your hardware wallet and sign the message on that device.

After providing the signature, you will be logged in into Switchboard dApp.

The top right menu icon has a notification. Click to open, you will find one publication available.

Click ‘publish’, on the confirmation modal click ‘CONFIRM’.

The MetaMask plug-in will pop up in the top right corner of the browser and request a signature for the transaction.

Follow along to sign the transaction in Metamask, then you'll see the ‘publish is successful ‘ notification.

When the publish is completed, you can return to the the DSI Client browser tab.

3. Client UI walk through.

This guide is based on the application name ‘marketplace.apps.energyweb.iam.ewc’, It is the same concept and flow for your chosen application

At the time of revisiting the DSI Client, it should successfully redirect you to the dashboard page. If not, check to make sure your Metamask extension is connected to the correct (enrolled) account. If the correct account is active, you may need to refresh the DSI Client landing page and re-enter your private key as described in the previous section.

You may see fewer items under the ‘Scheduler’ section at the first time you log in. Just wait a few moments and refresh the page, there should be more scheduled tasks shown, the time under the task names is when the task was recently completed

When you can see ‘Application refresh’ and ‘Topic Refresh’ with ‘Success’ status, you can navigate to ‘Topic management’ OR ‘Channels’ > ‘My apps and topics’ from the left navigation menu.

Your application will be shown on the list. There is one sample topic created for the application (*one is available at the time of writing, but additional topics will be added over time. You may see more topics available for your application).

If you click on the application, it will show you all the topics

You can also view the topic by clicking on it

Topic is a definition of the data schema. Which will be strictly validated during data exchanging.

You can learn more about topics here

Next we'll explain how to use the topic.

The DSI Client lets you easily create more sophisticated topics based on different business requirements.

You will need the ‘topiccreator’ role to manage(create/update/delete) topic/schema within an application scope.

Please contact [email protected] for ‘topiccreator’ role enrolment or other assistances.

4. Creating Channels.

You can have a better understanding about Digital Spine channels here. Few summarised Key points to bear in mind.

  • "Publish" type channel is for sending data and "Subscribe" type channel is used for retrieving data

  • Channels can be configured to enable one:one, one:many, and/or many:many communications by changing settings for who can receive or send data in the channel scope

  • Topics are used by channels, and it defines what kind of data can be send/retrieved to/from a channel, A channel can have multiple different topics

On the UI, from the left navigation menu, under ‘Channels’, navigate to the ‘Channel management’. Here is the section you manage all your channels

4.1 Creating a Publish Channel

To create a channel, simply click ‘Create’ on the page.

In the pop-up modal, you can define the channel details.

The example below shows creating a ‘Messaging’ Publish channel named ‘demo.pub’; when you have defined your channel details click ‘Next’,

At the ‘Restrictions’ tab, you are able to restrict the recipients by `DID` or ‘Role’, this will make sure only defined recipients will receive messages from this channel.

In Energy Web ecosystem, DIDS and Roles have below format

  • EW main chain DID format: `did:ethr:ewc:WALLET_ADDRESS`

  • EW volta chain DID format: `did:ethr:volta:WALLET_ADDRESS`

  • EW role format: `ROLE_NAME.roles.APP_NAME`

Make sure you click the ‘Save’ button after you put in the recipient DID or Role. To add multiple recipients, repeat this step as necessary.

To proceed to the next step, click “Next”.

On the next screen, you will define what topics to add to this channel.

You can select your desired application from the ‘Select Application’ dropdown, then the available topics belonging to the application will be shown in the ‘topics’ dropdown, click on the topic to add, you can select multiple topics to this channel.

At the last step you can review all the channel details; if you need to revise any settings, click back. When you have confirmed all settings, click "submit" to create the channel.

After clicking ‘submit’, The channel will be shown on the channel list.

A ‘Publish’ channel is used to send data to other recipients. You will need a separate ‘Subscribe’ channel to receive data from others. You can create as many channels as necessary by following the above steps.

4.2 Creating a Subscribe Channel

Creating a ‘Subscribe’ channel is exactly the same process as 'Publish' channel, but selecting the channel type ‘Subscribe’

And at the ‘Restrictions’ section, we can restrict whom we only want to receive data from.

For demonstration purposes, we restrict to only receive data from senders who has role ‘‘admin.roles.marketplace.energyweb.iam.ewc’

On the Topics tab, same concept as above publish channel, here we restrict what kind of data we want to retrieve from this channel.

And review all the details and submit our ‘Subscribe’ channel.

We should have both channels shown under ‘Channel management’

This is all about channel creating and how to implement a topic.

5. Demo Integration - test Sending / Receiving data.

The above video demonstrates client A (DID ends 49Cc9) sends a message by API to client B (DID ends 64946), and client B successfully retrieved the message by API.

The Digital Spine Integration Client has an API swagger page, which shows you the list of endpoints available for integration.

You can access the swagger integration APIs page from ‘Integration APIs’ from the left side nav.

Click ‘Open’ Rest API.

On the swagger page, scroll down to the ‘Messaging’ section

You can find detailed information about how to integrate with those endpoints.

5.1 Example Post data to a Channel

To post a message to the newly created ‘demo.pub’ channel, the example payload will be formatted as shown below:

{
    "fqcn": "demo.pub",
    "topicName": "sample_topic",
    "topicVersion": "0.0.1",
    "topicOwner": "marketplace.apps.energyweb.iam.ewc",
    "payload": "{ \"message\": \"This is my first demo message\" }"
}

You can POST above payload to the D.S.I Client’s endpoint `/api/v2/messages`

You can get all the payload info from the channel details on the D.S.I Client’s UI, click to open the 'demo.pub' channel from the channel list under ‘Channels’ > ‘Channel management’

Here are the channel and topic details

demo.pub channel details modal

sample_topic details

So payload info has below relationship with what is shown on the channel detail and topic detail modals.

Payload field
UI label
Value

fqcn

Namespace on Channel details

demo.pub

topicName

Topic Name

sample_topic

topicVersion

Version on Topic details

0.0.1

topicOwner

Namespace on Topic details

marketplace.apps.energyweb.iam.ewc

5.2 Example Get data from a Channel

To receive data from a channel, by following the documentation, You can retrieve data from GET endpoint '/api/v2/messages'

An example request path can be /api/v2/messages?fqcn=demo.sub&amount=10&topicName=sample_topic&topicOwner=marketplace.apps.energyweb.iam.ewc&clientId=demo_user

Query breakdown will be

  • fqcn = demo.sub

  • amount = 10

  • topicName = sample_topic

  • topicOwner = marketplace.apps.energyweb.iam.ewc

  • clientId = demo_user

The query information can also be retrieved from the channel detail as explained in the previous step.

6. Conclusion

Those are the main steps to get you started with the Digital Spine Integration interface, You can start communicating with other DSI clients integrated with the same application.

And contact us at [email protected] to acquire the 'topiccreator' role to create topics to test scenarios based on your business requirement.

https://rpc.energyweb.org
https://explorer.energyweb.org/
Config DID on Client application
Application Dashboard
Creating Channels
Access enrolment
Sync enrolment on Switchboard
Access Instance
Logo