Energy Web Documentation
  • Energy Web Ecosystem
  • Launchpad by Energy Web
  • EWC Validator Documentation
  • Community Ressources
  • Legacy documentation
  • Welcome to Energy Web
  • Glossary
  • Solutions 2023
    • ↔️Data Exchange
      • Data Exchange Overview
      • Data Exchange Architecture
      • Use Cases and Refrence Implementations
        • Digital Spine for Electricity Markets
          • Digital Spine Integration Client Deployment Guide - from Azure marketplace
        • E-Mobility Management
    • 🔌Open Charging Network
      • Create and Manage an OCN Identity
      • Connect an OCPI/OCN Party to a Node
        • 1. Make your backend service OCN-ready
        • 2. Select an OCN Node and register in OCN Registry
        • 3. Manage your Whitelist and Blacklist
        • 4. Connect your service to an OCN Node
      • Run an OCN Node
      • Use the OCN Service Interface
        • Offer an OCN Service
        • Sign up for an OCN Service
      • Develop on the Test Network
      • Develop on the Production Network
      • Open Source Development
        • Maturity Model, Feature Roadmap and Releases
        • Developer Community Calls
      • E-Mobility Dashboard v0.1
  • EW-DOS Technology Components 2023
    • EW-DOS Overview
    • Worker Nodes
      • Worker Node Process Diagrams
      • Worker Node Architecture
      • Worker Node Guides
        • Deploy Worker Nodes
        • Customize Worker Logic
    • Identity and Access Management (IAM)
      • IAM Guides
        • Implement an SSI Hub instance
        • Verifiable Credential API
        • Sign-In with Ethereum
        • Using Switchboard
          • Switchboard Transaction Cost Estimates
      • IAM Patterns
        • Assets as Ownable Smart Contracts
        • Credential Lifecycle
        • Credential Metadata
        • SSI Credential Governance using ENS Domains
      • IAM Libraries
      • SSI Hub
      • Switchboard Application
    • Decentralized Data Hub (DDHub)
      • DDHub Message Broker
      • DDHub Client Gateway
      • DDHub Patterns
        • Channels and Topics
      • DDHub Guides
    • Green Proofs Contracts
    • Energy Web X
    • The Energy Web Chain
      • EWC Overview
      • System Architecture
        • Proof-of-Authority Consensus Mechanism
        • System Contracts
          • Name Registry
          • Holding Contract
          • Block Reward Contract
          • Validator-Set Contracts
        • Validator Node Architecture
      • Energy Web Block Explorer
      • Validator Node Installation Specifications
        • Volta Test Network: Validator Node Installation
      • Energy Web Chain Governance
      • EWC Guides and Tutorials
        • Getting started with Energy Web Chain
        • Developing on the Volta Test Network and Main Network (Energy Web Chain)
        • Run a Local RPC Node
          • Run RPC Node using Nethermind client
        • Deploy a Smart Contract on Volta with Remix
        • Interacting with Smart Contracts in EW-DOS
        • Set up MetaMask to interact with Energy Web Chain
        • Using the Ethereum Name Service
        • Using Oracles
      • Energy Web Token (EWT)
  • 🧠Foundational Concepts
    • Open-Source Software
    • Scaling Access to Grid Flexibility
    • Facilitating Clean Energy Purchases
    • Ethereum
      • Transactions and Transaction Costs
    • Self-Sovereign-Identity
      • Self-Sovereign Use Case Interaction
    • Cryptocurrency Wallets
      • Software cryptocurrency wallets
        • Metamask
        • Mycrypto wallet
      • Hardware cryptocurrency wallets
      • Hierarchical Deterministic (HD) Wallets
Powered by GitBook
On this page
  • Credentials Overview
  • Credentials in the Energy Web Stack
  • 'On-Chain' Credentials
  • 'Off-Chain' Credentials
  • On-Chain vs. Off-Chain Registration Rationale
  • IAM Stack Credential Lifecycle
  • 1. Request Credential
  • 2. Issue Credential
  • 3. Publish Credential
  • 4. Revoke Credential
  • 5. Verify Credential
  • Related Content
Export as PDF
  1. EW-DOS Technology Components 2023
  2. Identity and Access Management (IAM)
  3. IAM Patterns

Credential Lifecycle

The credential lifecycle in the IAM stack

PreviousAssets as Ownable Smart ContractsNextCredential Metadata

Last updated 2 years ago

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 ). 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 . This protocol continues to evolve. Verifiable credentials are one of the three core pillars of , along with and distributed ledger technology.

See the W3Cs use cases and requirements for verifiable credentials

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 that is anchored on the . Energy Web's Switchboard application provides a user interface for creating, requesting, issuing and revoking role-based credentials. facilitate the full lifecycle of verifiable credentials. The serves as the trust or verification layer for digital proof. This documentation provides references to these libraries, and to supporting 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

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.

Credentials in the Energy Web Stack

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

Credential Smart Contracts

Contract
Purpose
Address - Energy Web Chain
Address - Volta

Holds mapping of issued verifiable credentials; Provides methods for credential verification

'Off-Chain' Credentials

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 Schema

For each off-chain credential request, iam-client-library issues two credentials of different format and proof type.

1. JSON Web Token with EIP-191 signature

2. JSON-LD Verifiable Credential with EIP-712 signature

  • 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.

IAM Stack Credential Lifecycle

1. Request Credential

Claim requests are persisted in the SSI Hub.

Example

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.

The verifiable presentation and issued token are appended to the claim data, which is updated in the SSI Hub.

3. Publish Credential

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.

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.

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.

  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.

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.

5. Verify Credential

  1. The credential proof (typically the digital signature) is valid.

  2. 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.

Off-Chain Verification Sequence:

Related Content

A is an assertion that is made about a A claim could assert, for example, that a battery meets specific manufacturing standards.

A is a claim(s) made by an about a subject. When the credential issuer makes a claim about a subject, they issue a . 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 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. , such as .

External proofs, which are commonly expressed by . 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 . Verifiable Credentials expressed as JSON Web Tokens in the IAM stack is discussed.

Embedded proofs, in which the proof is included directly in the credential's JSON data. To be compatible with , the credential JSON Verifiable credentials expressed as JSON/JSON Linked Data in the IAM stack are discussed .

The Energy Web IAM stack provides API methods to , , and credentials.

Our ecosystem offers persistence for credentials on the , and off the blockchain using the decentralized file system .

Credentials that are persisted on the Energy Web Chain are referred to as

Credentials that are persisted off-chain are referred to as

On-chain credentials are registered on the in the Claim Manager . The contract source code can be found . A credential is registered in the contract when the credential is by the holder.

The 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.

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 .

Claim Manager

Claims Revocation Registry

Holds mapping of

Off-Chain credentials are not referenced on the blockchain. Off-chain credential data is persisted as a on , 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 that points to its location on the file system. This CID is linked to the credential's corresponding through a . 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.

Both signature mechanisms can be performed by .

A JSON web token is a common standard for transferring encoded, verifiable data between parties. The payload is generated from the claim data.

Proof Mechanism: 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 .

Persistence: The issued token is included in an object that contains other data about the issued credential request. (Read more about claim issuance ). The token is persisted in the SSI Hub's database when the , and persisted in when a by the subject. The credential's location in IPFS is referenced in the user's DID Document's service endpoints.

Proof Mechanism: specification. This allows the credential data to be displayed in a human-readable format when digitally signing the message:

See the W3C documentation on the EIP-712 signature .

Data Model/Interface: The Verifiable Presentation interface conforms to W3C credential schema, which includes 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 .

Off-chain credentials in IPFS do not require any that are associated with a blockchain, and can be resolved by an IPFS client in any application.

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 ‘.

iam-client-library contains high-level methods to initiate credential requests. These methods indicate whether a credential should be registered or .

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 ) 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 or .

Using the **** 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 ) with their digital signature using an .

Issuing

If a credential has an **'**on-chain' , the verified credential is registered in the .

Issuing

As discussed , off-chain credentials are issued in two formats:

A ****

A signed ****

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 and/or . Persistence for on-chain credentials is discussed above . Persistence for off-chain credentials is discussed above .

The IAM stack provides methods for a to revoke a credential after it has been issued.

Revocation for Energy Web credentials is executed based on the . Only an authorised revoker (a DID or any DID with specific role credential) can revoke a credential.

Revoking

When an on-chain credential is revoked, the revocation is registered in the . This smart contract holds a reference to every revoked credential. The ClaimsRevocationRegistry contract references the to ensure that the revoker has the right authority to execute revocation and 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 .

For a revocation to be registered on-chain it is necessary that the credential first be registered on-chain with , where holder has provided their consent to make the credential publicly available.

Having the credential in the ClaimManager allows the to provide verifiability of:

Revoking

When an off-chain credential is revoked, the credential JSON is updated with a "credentialStatus" property that is conformant to 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 .

When a credential is revoked using iam-client-library, which utilises module to append this credentialStatus property to credentials, the credentialStatus will have a statusPurpose that reflects it has been revoked:

More detailed documentation around StatusList2021 can be found

A verifier is responsible for verifying the authenticity of a credential. The criteria for this evaluation is specified by the W3C Verification standards . iam-client-library provides verification methods that evaluates these criteria, namely:

The credential is not .

This verification is executed for off-chain credentials and relies on the subject's (holder or issuer) resolution.

claim
subject.
credential
issuer
verifiable credential
proof mechanism
Energy Web's IAM libraries support digital signatures of Ethereum-compatible wallets
MetaMask
Energy Web blockchain
IPFS
Energy Web Chain
@energyweb/onchain-claims package
JSON web token
IPFS
Ethereum-based wallets such as MetaMask
JSON web token
EIP-191 signature
here
EIP-712 signature
here
JSON-LD (JSON Linked Data)
here
transaction costs
subject’
registration type
Claim Manager smart contract
verifiable presentation
Role Governance
ClaimsRevocationRegistry smart contract
ENSRegistry contracts
ClaimManager
ClaimManager
ClaimsRevocationRegistry
W3C's StatusList2021
here
status-list
here
here
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
JSON Web Tokens
here
below
W3C Verifiable Credentials standard
must have a property of 'proof'.
below
request,
issue
publish
verify
revoke
'on-chain' credentials
'off-chain' credentials
Energy Web blockchain
smart contract
here
published
IPFS
below
credential is issued
credential is published
'on-chain'
'off-chain'
proof
Ethereum- compatible wallet such as MetaMask
example
On-Chain Credentials
Off-Chain Credentials
above
JSON Web token
on-chain
off-chain
here
here
On-Chain Credentials
published on-chain
Off-Chain Credentials
revoked
Source Code
'0x23b026631A6f265d17CFee8aa6ced1B244f3920C'
'0x5339adE9332A604A1c957B9bC1C6eee0Bcf7a031'
Source Code
'0xd72B4c8D5B1a1A4C7085259548bDF1A175CFc48D'
'0x9876d992D124f8E05e3eB35132226a819aaC840A'
revoked credentials
World Wide Web Consortium (W3C)
self-sovereign identity
decentralized identifiers (DID)
here
Energy Web Chain
Energy Web blockchain
W3C
below - 'Credentials Overview'
content identifier (CID)
service endpoint
on-chain
off-chain
System design for your whole team; in sync with realityIcePanel
Click to navigate to IAM architecture
revoker
DID Document
DID
DID Document
DID
Energy Web's IAM libraries and APIs
On-Chain Credential Persistence
Off-Chain Credential Persistence
EIP-712 signature request
Logo