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

eosio-did-resolver

v0.1.6

Published

Resolve Decentralized Identifier (DID) documents based on EOSIO blockchains

Downloads

10

Readme

Contributions

The EOSIO Identity Working Group is an open working group where we, the EOSIO community, discuss identity on EOSIO chains and progress work such as this DID specification and it's implementation. We have a weekly meeting and a Slack channel.

Join the EOSIO Identity Working Group

Comments regarding this document are welcome. Please file issues and PRs directly on Github. Contributors are recognized through adding commits to the code base.

See README.tsdx.md for instructions on how to run, build, test and test this library.

Contributors:

Gimly Europechain Digital Scarcity rewired.one Block One

EOSIO DID Resolver

This library is intended to use EOSIO accounts as fully self managed Decentralized Identifiers and wrap them in a DID Document

It supports the proposed Decentralized Identifiers spec from the W3C Credentials Community Group.

It requires the did-resolver library, which is the primary interface for resolving DIDs.

The DID specification can be found at eosio-did-registry.

DID method

The DID Method schema can be consumed in either of the following two formats:

  1. Registered chain name schema
  2. Chain-id schema

For example:

  • did:eosio:4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11:example
  • did:eosio:telos:example

both resolve the same DID from the Telos blockchain.

DID Document

The did resolver takes the EOSIO account name and retreives it's permission data from the blockchain to make the DID document.

{
    "@context": [
        "https://www.w3.org/ns/did/v1",
        "https://w3c-ccg.github.io/verifiable-conditions/contexts/verifiable-conditions-2021-v1.json"
    ],
    "id": "did:eosio:eos:testnet:jungle:lioninjungle",
    "verificationMethod": [
        {
            "id": "did:eosio:eos:testnet:jungle:lioninjungle#active",
            "controller": "did:eosio:eos:testnet:jungle:lioninjungle",
            "type": "VerifiableCondition",
            "threshold": 1,
            "conditionWeightedThreshold": [
                {
                    "condition": {
                        "id": "did:eosio:eos:testnet:jungle:lioninjungle#active-0",
                        "controller": "did:eosio:eos:testnet:jungle:lioninjungle",
                        "type": "EcdsaSecp256k1VerificationKey2019",
                        "publicKeyJwk": {
                            "crv": "secp256k1",
                            "kty": "EC",
                            "x": "jbXSqQffgSNrtF4SBriENexUuXstjPDRFV_3PRCFU7o",
                            "y": "J20YqTFJgZ3P5KXZBEcOmWX-Nxaqogtt4NyWtvx8Ryk",
                            "kid": "PUB_K1_7ueKyvQJpBLVjuNgLedAgJakw3bLyd4GBx1N4jXswpBhE5SbJK"
                        }
                    },
                    "weight": 1
                }
            ],
            "relationshipParent": [
                "did:eosio:eos:testnet:jungle:lioninjungle#owner"
            ]
        },
        {
            "id": "did:eosio:eos:testnet:jungle:lioninjungle#owner",
            "controller": "did:eosio:eos:testnet:jungle:lioninjungle",
            "type": "VerifiableCondition",
            "threshold": 1,
            "conditionWeightedThreshold": [
                {
                    "condition": {
                        "id": "did:eosio:eos:testnet:jungle:lioninjungle#owner-0",
                        "controller": "did:eosio:eos:testnet:jungle:lioninjungle",
                        "type": "EcdsaSecp256k1VerificationKey2019",
                        "publicKeyJwk": {
                            "crv": "secp256k1",
                            "kty": "EC",
                            "x": "jbXSqQffgSNrtF4SBriENexUuXstjPDRFV_3PRCFU7o",
                            "y": "J20YqTFJgZ3P5KXZBEcOmWX-Nxaqogtt4NyWtvx8Ryk",
                            "kid": "PUB_K1_7ueKyvQJpBLVjuNgLedAgJakw3bLyd4GBx1N4jXswpBhE5SbJK"
                        }
                    },
                    "weight": 1
                }
            ]
        }
    ],
    "service": [
        {
            "id": "https://jungle3.cryptolions.io",
            "type": "LinkedDomains",
            "serviceEndpoint": "https://jungle3.cryptolions.io"
        }
    ]
}

Note this uses the Verifiable Conditions verification method type.

Building a DID document

The DID document is built from the account data on the EOSIO blockchain.

Resolving a DID document

Resolving from pre-registered EOSIO chains

import { Resolver } from 'did-resolver'
import { getResolver } from 'eosio-did-resolver'

async function resolve() {
  const didResolver = new Resolver(getResolver())

  const didDoc = await didResolver.resolve('did:eosio:eos:example');
}

Resolving with a custom EOSIO chain or custom API

import { Resolver } from 'did-resolver'
import { getResolver } from 'eosio-did-resolver'

async function resolve() {

  // Multiple entries can exist for multiple eosio chains
  const config = {
    eos: {
        chainId: "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
        service: [
            {
                id: "https://eos.greymass.com",
                type: [
                    LinkedDomains
                ],
                serviceEndpoint: "https://eos.greymass.com"
            }
        ]
    }
  }
  const didResolver = new Resolver(getResolver(config))

  const didDoc = await didResolver.resolve('did:eosio:eos:example');
}