Socket
Socket
Sign inDemoInstall

@dyne/did

Package Overview
Dependencies
262
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @dyne/did

Create and manage did:dyne identifiers


Version published
Weekly downloads
3
increased by200%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Create and manage Dyne.org's W3C-DID in JavaScript

Dyne.org

Dyne W3C-DID js bindings 🧰
Dyne W3C-DID js bindings provides a javascript wrapper of Dyne.org's W3C-DID client side.

Dyne.org



🚀 Quick start

Start by reading the documentation to understand better how Dyne.org's W3C-DID works

https://dyne.org/W3C-DID

💾 Install

Stable releases are published on https://www.npmjs.com/package/dyne-did that have a slow pace release schedule that you can install with

yarn add @dyne/did
# or if you use npm
npm install @dyne/did

🎮 Usage

The bindings are composed of four main functions:

  • createKeyring: takes as input a string that will be used as description inside the did document and return the string under the key controller along with your keyring.
  • createRequest: takes as input the output of the above function along with a string containg the domain and a DidActions value and return an unsigned request that will later be signed by an admin.
  • signRequest: takes as input an unsigned request, the signer keyring and the signer domain and return the signed request ready to be sent in order to create, update or deactivate a did document.
  • sendRequest: takes as input an endpoint and a request and sends the latter to did.dyne.org/*endpoint*.

There are other functions related to particular domains as well, but the functioning is almost identical.

All functions return a Promise.

To start using the Dyne.org's W3C-DID you have to create a domain admin request and send it to us. This can be created by using:

import { createKeyring, createRequest, DidActions } from "@dyne/did";
// or if you don't use >ES6
// const { createKeyring, createRequest, DidActions } = require('@dyne/did')

// Create a new did document request
const keyring = await createKeyring("new_domain_admin_request");
const request = await createRequest(keyring, "domain_A", DidActions.CREATE);
console.log(request);

Once your request has been accepted people can create a request for a special context of your domain in the following way:

import { createKeyring, createRequest, DidActions } from "@dyne/did";
// or if you don't use >ES6
// const { createKeyring, createRequest, DidActions } = require('@dyne/did')

// Create a new did document request
const keyring = await createKeyring("new_domain_context_admin_request");
const request = await createRequest(keyring, "domain.context_A", DidActions.CREATE);
console.log(request);

This request will be sent to you and you will have to sign it and you or the participant will send the result to did.dyne.org in order to create the new did document.

import { signRequest, sendRequest } from "@dyne/did";
// or if you don't use >ES6
// const { signRequest, sendRequest } = require('@dyne/did')

//Sign and send did document request
const signedRequest = await signRequest(request, keyring, "domain_A");
const result = await sendRequest("api/v1/domain/pubkeys-accept.chain", signedRequest);

Update and deactivate procedure follow the same idea.

😍 Acknowledgements

Copyright (C) 2022-2023 by Dyne.org foundation, Amsterdam

Designed, written and maintained by Denis Jaromil, Puria Nafisi Azizi, Andrea D'Intino, Alberto Lerda and Matteo Cristino.


👤 Contributing

Please first take a look at the Dyne.org - Contributor License Agreement then

  1. 🔀 FORK IT
  2. Create your feature branch git checkout -b feature/branch
  3. Commit your changes git commit -am 'Add some fooBar'
  4. Push to the branch git push origin feature/branch
  5. Create a new Pull Request
  6. Thank you

💼 License

dyne-did js - a javascript wrapper of Dyne.org's W3C-DID
Copyright (C) 2022-2023 Dyne.org foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Keywords

FAQs

Last updated on 12 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc