question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DID method creates new Ethr-DID without passing singer or private key

See original GitHub issue

Description In the documentation, it is mentioned that ‘either signer or privateKey’ is required to create a new Ethr-DID. However, a new Ethr-Did can be created just passing the Ethereum address.

To Reproduce

  1. init npm project
  2. paste the following code into inde.js
  3. configure the provider
  4. install the dependencies ethjs-provider-http@0.1.6 and ethr-did@1.1.0
  5. run node index.js

Sample Code

const HttpProvider = require('ethjs-provider-http')
const provider = new HttpProvider('http://127.0.0.1:8545')

const EthrDID = require('ethr-did');

let createDid = async () => {

    const address = '0xCF402F0891f9551eA0e2cEE7A7e491C4e83Fc079';
    const ethrDid = new EthrDID({ address });
    console.log(ethrDid);

}

createDid()

Expected behavior It should throw an error stating ‘either signer or private key is required’.

Actual behavior It successfully creates a new did.

Screenshots image

Dependencies:

  • Node.js: 10.16.3
  • ethjs-provider-http: ^0.1.6
  • ethr-did: ^1.1.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
m-yahyacommented, Sep 2, 2019

Thank you very much for your explanation.

1reaction
mirceaniscommented, Sep 2, 2019

It was at the time of writing the resolver. However, the W3C spec regarding the public keys has changed. The owner is no longer a recognized property of a public key. The spec describes a controller property but that may have slightly different semantics.

I suggest not using the owner property of the resolved document at this time/version. If your use case requires that you find the owner as you expect, it is probably safer to call the registry contract directly instead of relying on the property that may disappear in a future version.

Thanks for spotting this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started | uPort Developer Portal
We provide a convenient method to easily create one EthrDID.createKeyPair() which returns an object containing an Ethereum address and private key. const ...
Read more >
bigchaindb/js-bigchaindb-driver - Gitter
I was trying out the tutorial here: https://www.bigchaindb.com/developers/guide/tutorial-piece-of-art/. After creating a painting asset, I got an id.
Read more >
ethr-did - npm
Create, manage and use did:ethr identifiers. Latest version: 2.2.4, last published: 18 days ago. Start using ethr-did in your project by ...
Read more >
Analysis and Evaluation of Blockchain-based Self-Sovereign ...
and implemented systems based on the DID methods to create a decentralized ... Further, the concepts of a decentralized public key infrastructure (DPKI)...
Read more >
Blockchain 101 - Part 2 - Public / Private Keys and Signing
The details of how public keys relate to private keys are hard to ... the private key ) to decipher the original number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found