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

Closed
gmulhearn opened this issue Dec 18, 2023 · 0 comments · Fixed by #1105
Closed

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

gmulhearn opened this issue Dec 18, 2023 · 0 comments · 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.

gmulhearn pushed a commit that referenced this issue Aug 7, 2024
…nd expands shorthand verkey notation for publicKeyBase58 (#1105)

* lli - Added Solution/Tests

Signed-off-by: lli <lli@anonyome.com>

* lli - merge issue 1090

Signed-off-by: lli <lli@anonyome.com>

* lli - Add Resolution Test back

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Clippy fixes

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix Expanding Verkey Fn

Signed-off-by: lli <lli@anonyome.com>

* lli - Fix unwrapping err

Signed-off-by: lli <lli@anonyome.com>

* lli - Remove unwraps

Signed-off-by: lli <lli@anonyome.com>

* lli - use ddo_id to retrieve nym

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Merge Conflicts

Signed-off-by: lli <lli@anonyome.com>

* Fixing Test

Signed-off-by: lli <lli@anonyome.com>

* formatting

Signed-off-by: lli <lli@anonyome.com>

* Fix tests

Signed-off-by: lli <lli@anonyome.com>

* Clippy

Signed-off-by: lli <lli@anonyome.com>

* Fix Endpoint Test

Signed-off-by: lli <lli@anonyome.com>

* Remove print

Signed-off-by: lli <lli@anonyome.com>

* Log response error

Signed-off-by: lli <lli@anonyome.com>

---------

Signed-off-by: lli <lli@anonyome.com>
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