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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@empe/identity

v3.9.0

Published

A TypeScript implementation of Self-Sovereign Identity (SSI) components following W3C standards for Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs).

Downloads

74

Readme

@empe/identity

A TypeScript implementation of Self-Sovereign Identity (SSI) components following W3C standards for Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs).

Overview

This package provides comprehensive functionality for working with decentralized identity, including:

  • Decentralized Identifiers (DIDs): Creation, management, and resolution of DIDs
  • Verifiable Credentials (VCs): Issuance, verification, and storage of credentials
  • Verifiable Presentations (VPs): Creation and verification of credential presentations
  • Cryptographic Primitives: Key management, signatures, and proofs

The implementation follows the W3C Decentralized Identifiers and W3C Verifiable Credentials Data Model specifications.

Key Components

Decentralized Identifiers (DIDs)

  • CoreDID: Core implementation of DIDs following the standard format did:method:id
  • CoreDocument: Basic DID Document implementation
  • EmpeDocument: Extended DID Document for the Empe method

Verifiable Credentials

  • VerifiableCredential: Implementation of the W3C Verifiable Credential data model
  • VerifiablePresentation: Container for presenting one or more credentials with proof of ownership

Identity Roles

  • Issuer: Entity that creates and signs verifiable credentials
  • Holder: Entity that receives and stores credentials and can create presentations
  • Verifier: Entity that verifies credentials and presentations (implicit in the verification methods)

Key Management

  • KeyService: Management of cryptographic keys
  • JwkService: JSON Web Key operations
  • MnemonicService: Mnemonic phrase generation and handling

Cryptography

  • Proof: Cryptographic proofs for credentials and presentations
  • JWS: JSON Web Signature implementation
  • Signature: Digital signature creation and verification

Usage

Creating a DID

import { CoreDID, JwkService, Secp256k1Factory } from '@empe/identity';
import { MemKeyStorageAdapter } from '@empe/common';

// Create a new DID
const storage = new MemKeyStorageAdapter();
const keyService = new JwkService(storage, new Secp256k1Factory());
const did = await CoreDID.from(keyService);

Creating a Verifiable Credential

import { VerifiableCredential, Issuer, IssuerConfiguration, Client, Network, CoreDID } from '@empe/identity';
import { MemKeyStorageAdapter } from '@empe/common';

// Create a client and document
const storage = new MemKeyStorageAdapter();
const client = new Client({ storage, network: Network.TESTNET });
const document = await client.createEmpeDocument();

// Configure issuer
const config: IssuerConfiguration = {
    document: document,
};
const issuer = client.issuerFromConfiguration(config);

// Issue a verifiable credential
const holderDid = CoreDID.parse('did:empe:testnet:example');
const credential = await issuer.issueVerifiableCredential(holderDid, {
    name: 'John Doe',
    degree: 'Bachelor of Science',
});

Creating a Verifiable Presentation

import { Holder, HolderConfiguration, VerifiablePresentation } from '@empe/identity';
import { MemKeyStorageAdapter } from '@empe/common';

// Configure holder
const config: HolderConfiguration = {
    document: document,
};
const holder = new Holder(config, keyService);

// Create and sign a presentation
const presentation = await holder.issueVerifiablePresentation(
    recipientDid, // DID of the entity receiving the presentation
    holderDid, // DID of the holder creating the presentation
    [credential] // Array of credentials to include
);

Core Standards Support

  • DID Core: Support for did:empe method
  • VC Data Model: Implementation of Verifiable Credentials and Presentations
  • Cryptographic Suites: Support for various cryptographic algorithms
  • JSON-LD Context: Standard contexts for semantic interoperability
  • Proof Formats: JWT and JSON-LD proof formats

Additional Features

  • Schema validation for credentials
  • Key derivation and management
  • Mnemonics for key recovery
  • JWT serialization

Related Packages

This package is part of a larger SSI ecosystem and works with other packages like @empe/common for shared functionality.

License

MIT