Study of the blockchain and JSON Web Token standard to represent W3C Verifiable Credential and to selectively disclose individual claims of the virtual credential.
Table of Contents
This project is based on the following components:
- JSON Web Token: a standard for representing, decode, verify and generate claims securely between two parties.
- W3C DIDs and Verifiable Credential: A globally unique persistent identifier that is controlled by users and a data model and representation format for cryptographically-verifiable digital credentials.
The signature algorithms supported by this project to sign and verify credential are:
- ES256K: ECDSA with the secp256k1 as public key, sha256 as cryptographic hash function, and EcdsaSecp256k1VerificationKey2019 as verification method
- ES256K-R: ECDSA over secp256k1 with encoded recovery bit and EcdsaSecp256k1RecoveryMethod2020 as verification method
- EdDSA: EdDSA signature scheme using SHA-512, Curve25519, and Ed25519VerificationKey2018 as verification algorithm
Tha supported hash functions depends on available digest algorithms of the OpenSSL:
openssl list -digest-algorithms
This software is written in Javascript and in can be runned using node.js 17. DIDs used in this project belong to the did:ethr
method and the can resolved using ethr-did-resolver and ethr-did-registry.
The steps below are necessary to install and setting up the experiments.
- Start a local instance of the blockchain (default: Ganache)
ganache-cli -m "family dress industry stage bike shrimp replace design author amateur reopen script" -p 9545
- Deploy the smart contract registry for DID resolution
truffle migrate
- Install NPM packages
npm install
Configure the execution of the program using https://github.com/andreadesalve/DID-JWT/blob/main/src/config.json and run the scripts by using node
node /path/to/script
Distributed under the MIT License. See LICENSE.txt
for more information.
Andrea De Salve - [email protected] - http://pages.di.unipi.it/desalve/
Project Link: PISA DISTRIBUTED LEDGER LAB