Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DID:SOV DIDDoc does expand shorthand verkey notation for publicKeyBase58 #1091

Open
gmulhearn opened this issue Dec 18, 2023 · 0 comments · May be fixed by #1105
Open

DID:SOV DIDDoc does expand shorthand verkey notation for publicKeyBase58 #1091

gmulhearn opened this issue Dec 18, 2023 · 0 comments · May be fixed by #1105

Comments

@gmulhearn
Copy link
Contributor

part of this series of issues; https://github.com/hyperledger/aries-vcx/issues/

On sovrin ledgers, it is possible to register a NYM's verkey in an abbreviated form with a tilda prefix (e.g. ~CoRER63DVYnWZtK8uAzNbx). Some indy notes on this here: https://hyperledger-indy.readthedocs.io/projects/sdk/en/latest/docs/getting-started/indy-walkthrough.html#step-3-getting-the-ownership-for-steward-s-verinym.

This abbreviated verkey is also what the ledger returns when you do a get_nym:

    let nym_res = profile.ledger_read.get_nym(&profile.institution_did).await.unwrap();
    println!("{}", nym_res);
{"op":"REPLY","result":{"seqNo":1,"txnTime":null,"data":"{\"dest\":\"V4SGRU86Z58d6TV7PBUe6f\",\"identifier\":null,\"role\":\"0\",\"seqNo\":1,\"txnTime\":null,\"verkey\":\"~CoRER63DVYnWZtK8uAzNbx\"}","dest":"V4SGRU ...

since the did_resolver_sov crate is just using the ledger's returned verkey as the publicKeyBase58 for the DID's didDoc.verificationMethod[0], the DIDDoc ends up looking like:

...,
"verificationMethod": [
    {
      "id": "did:sov:V4SGRU86Z58d6TV7PBUe6f",
      "controller": "did:sov:V4SGRU86Z58d6TV7PBUe6f",
      "type": "Ed25519VerificationKey2018",
      "publicKeyBase58": "~CoRER63DVYnWZtK8uAzNbx"
    }
  ],

This is ofcourse invalid. It should be the responsibility of the did_resolver_sov crate to notice if the get_nym verkey is in it's abbreviated form (tilda prefix), and if it is, then it should transform the NYM+Abbreviated-Verkey into the full Verkey, which can then be set as publicKeyBase58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant