New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@identity.com/dids

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@identity.com/dids

This library is a simple client library for generating DIDs for use with Solana applications.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
3
Weekly downloads
 
Created
Source

DIDS (Decentralized Identity library for Solana)

This library is a simple client library for generating DIDs for use with Solana applications.

It supports two DID methods:

  • did-key: A static DID method based on X25519 ECC Curve keys, that are compatible with Solana public keys.
  • did-sol: A Solana-native DID method.

Quick Start

To register a DID from a Solana public key:

const DIDs = require('@identity.com/dids');
const dids = new DIDs({ payer: payerAccount.secretKey });

const owner = new Account().publicKey;
const keyIdentifier = await dids.register('key', owner);
const solIdentifier = await dids.register('sol', owner);

To retrieve a DID document:

const identifier = 'did:key:z6MkszyYuyjZ31XZKXT4qdb5HqsWjAZGZoVvGzsoX1Tnno9s';
const document = await dids.get(identifier);

For more examples, see tests/index.test.ts

Testing & Development

Note: Before contributing to this project, please check out the code of conduct and contributing guidelines.

DIDS uses nvm and yarn

nvm i
yarn

Running the tests

DIDS uses the mocha and chai test libraries

Run the tests using:

yarn test

Note: DIDS was bootstrapped and is packaged using TSDX, which includes Jest. Jest has a bug when importing some dependencies of this project, so mocha is used instead.

Repl

To test using the repl, run

yarn repl

Then try:

await dids.register('sol', new Account().publicKey)
await dids.register('key', new Account().publicKey)

await dids.get('<YOUR IDENTIFIER HERE>')

FAQs

Package last updated on 20 Apr 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc