npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vc-notarization

v1.1.0

Published

Notarize verifiable credentials on DLT for provability and order

Downloads

8

Readme

Tests

vc-notarization

Notarize verifiable credentials on DLT for provability and order

General Idea

The signature of a verifiable credential (VC) ensures integrity and immutability of the contained data by a digital signature. By default a VC also proclaims an issuance date which is singed along with the other data. The issue is that the issuer can sign an arbitrary date as the issuance date for the VC, what makes this particular data field gameable for the issuer. In order to make the issuance date verifiable, the VC has to be notarized upon creation. To do this we use distributed ledgers as a trusted third party, providing and immutable order and thereby timestamps to events.

Supported DLTs

Public Permissionless

Private Permissioned

  • Hyperledger (Indy,Fabric ...?) tbd.

Technical Explanations

W3C JSON-LD Credentials

For notarizing VCs it is necessary to extract an uniquely identifying hash from them. In the case of W3C JSON-LD VCs the approach is to use the proof value, i.e. the signature value of the linked data signature. Doing this has the advantage that the linked data signature is created over the canonilized form of the VC, what makes two identical VCs identifiable as the same one, indendently of their form of appearance.

Proof of Inclusion

When using a non persistent DLT like shimmer, the nodes prune the transactrion history and thereby the data included in them. In order to verify the existence and timestamp a proof of inlcusion has to be given, which uses merkle trees to proof the existence of the transaction in the DLT at a certain time.

Specs: https://github.com/iotaledger/tips/blob/milestone-with-signature-blocks/tips/TIP-0029/tip-0029.md
Example implementation: https://wiki.iota.org/shimmer/tutorials/proof-inclusion-of-a-block
Module: https://github.com/iotaledger/inx-poi

Examples

Install the npm package

npm i vc-notarization

Notarize VC

Notarize a VC in order to create a verifiable timestamp on the DLT

import { notarize, VerifiableCredential, NotarizationResponse } from 'vc-notarization';


const credential: VerifiableCredential = {
    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://ssi.eecc.de/api/registry/context/productpassport",
        "https://w3id.org/security/suites/ed25519-2020/v1"
    ],
    "id": "https://ssi.eecc.de/api/registry/vc/cf43356c-a9f3-418a-a3ff-baca5a14d668",
    "type": [
        "VerifiableCredential",
        "ProductPassportCredential"
    ],
    "issuer": {
        "id": "did:web:ssi.eecc.de",
        "image": "https://id.eecc.de/assets/img/logo_big.png",
        "name": "EECC"
    },
    "issuanceDate": "2023-01-25T16:01:26Z",
    "credentialSubject": {
        "id": "https://id.eecc.de/01/04012345999990/10/20210401-A/21/XYZ-1234",
        "digital_link": "https://id.eecc.de/01/04012345999990/10/20210401-A/21/XYZ-1234"
    },
    "proof": {
        "type": "Ed25519Signature2020",
        "created": "2023-01-25T16:01:26Z",
        "proofPurpose": "assertionMethod",
        "verificationMethod": "did:web:ssi.eecc.de#z6MkoHWsmSZnHisAxnVdokYHnXaVqWFZ4H33FnNg13zyymxd",
        "proofValue": "z5YUnCUVWgAwc1iTQ61jtUyjBNLZELGMxnbsekFDQLd4ZNbPo45we4xxZjV5pqb3jqPo7ryKMmMY9dySNERz1huLJ"
    }
}


notarize(credential)
    .then((res: NotarizationResponse) => {
        console.log(`The credentials hash was published by transaction ${res.transactionId}`)
    });

Verify VC Timestamp

Verify the issuance date of a VC using the notarized timestamp on the DLT if it exists

import { verifyTimestamp, VerifiableCredential } from 'vc-notarization';


const credential: VerifiableCredential = {
    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://ssi.eecc.de/api/registry/context/productpassport",
        "https://w3id.org/security/suites/ed25519-2020/v1"
    ],
    "id": "https://ssi.eecc.de/api/registry/vc/cf43356c-a9f3-418a-a3ff-baca5a14d668",
    "type": [
        "VerifiableCredential",
        "ProductPassportCredential"
    ],
    "issuer": {
        "id": "did:web:ssi.eecc.de",
        "image": "https://id.eecc.de/assets/img/logo_big.png",
        "name": "EECC"
    },
    "issuanceDate": "2023-01-25T16:01:26Z",
    "credentialSubject": {
        "id": "https://id.eecc.de/01/04012345999990/10/20210401-A/21/XYZ-1234",
        "digital_link": "https://id.eecc.de/01/04012345999990/10/20210401-A/21/XYZ-1234"
    },
    "proof": {
        "type": "Ed25519Signature2020",
        "created": "2023-01-25T16:01:26Z",
        "proofPurpose": "assertionMethod",
        "verificationMethod": "did:web:ssi.eecc.de#z6MkoHWsmSZnHisAxnVdokYHnXaVqWFZ4H33FnNg13zyymxd",
        "proofValue": "z5YUnCUVWgAwc1iTQ61jtUyjBNLZELGMxnbsekFDQLd4ZNbPo45we4xxZjV5pqb3jqPo7ryKMmMY9dySNERz1huLJ"
    }
}

verifyTimestamp(credential)
    .then((timestamp: Date) => {
        console.log(timestamp)
    });