🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sovrahq/did-registry

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sovrahq/did-registry

This package exposes the functionality to create and publish DIDs using Modena Registry.

latest
npmnpm
Version
1.5.3
Version published
Weekly downloads
64
481.82%
Maintainers
2
Weekly downloads
 
Created
Source

DID Registry

This package exposes the functionality to create and publish DIDs using Modena Registry.

To create a new DID, you need to provide some public keys. You can use Extrimian KMS to generate the private keys.

The next example shows how to create a new DID using Extrimian Registry and Extrimian KMS.

import { KMSClient } from "@quarkid/kms-client";
import { Did } from "@quarkid/did-registry";
import { AssertionMethodPurpuse, KeyAgreementPurpose } from "@quarkid/did-core";
import { LANG, Suite } from "@quarkid/kms-core";

const kms = new KMSClient({
    lang: LANG.en,
    storage: new SecureStorage(),
});

const updateKey = await kms.create(Suite.ES256k);
const recoveryKey = await kms.create(Suite.ES256k);

const didComm = await kms.create(Suite.DIDComm);
const bbsbls = await kms.create(Suite.Bbsbls2020);

const didService = new Did();

const longDID = await didService.createDID({
    updateKey: updateKey.publicKeyJWK,
    recoveryKey: recoveryKey.publicKeyJWK,
    verificationMethods: [{
        id: "bbsbls",
        type: "Bls12381G1Key2020",
        publicKeyJwk: bbsbls.publicKeyJWK,
        purpose: [new AssertionMethodPurpuse()]
    },
    {
        id: "didComm",
        type: "X25519KeyAgreementKey2019",
        publicKeyJwk: didComm.publicKeyJWK,
        purpose: [new KeyAgreementPurpose()]
    }],
})

KMS applies dependency inversion concepts so it requires send a SecureStorage by its constructor.

To learn more about the Extrimian KMS read the documentation: @quarkid/kms-client

createDID request returns a CreateDIDResponse

export interface CreateDIDResponse {
    recoveryKey: IJWK;
    updateKey: IJWK;
    document: IonDocumentModel;
    longDid: string;
    didUniqueSuffix: string;
}

Then you could publish your LongDID using the CreateDIDResponse:

const registry = new Did();

return await registry.publishDID({
    modenaApiURL: getModenaApiURL(),
    createDIDResponse: createDID,
});

Publish a did requires a Modena API URL, which represents a modena node running as a service.

You can provide your own Modena node or use a public node.

FAQs

Package last updated on 02 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts