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

Create did ssi module #24

Merged
merged 3 commits into from
Feb 10, 2022
Merged

Create did ssi module #24

merged 3 commits into from
Feb 10, 2022

Conversation

arnabghose997
Copy link
Contributor

The create-did module in SSI has the following CLI Signature:

$ hid-noded tx ssi create-did
Usage:
  hid-noded tx ssi create-did [did-doc-string] [verification-method-id] [flags]
Flags:
       --ver-key string           Base64 encoded ed25519 private key to sign identity message with. 

Following is the test to verify the validation of Verification Key:

Valid CLI Command

hid-noded tx ssi create-did  '{
"context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/v1",
"https://schema.org"
],
"type": "https://schema.org/Person",
"id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
"name": "Vishwas",
"publicKey": [
{
"context": "https://w3id.org/security/v2",
"id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1",
"type": "Ed25519VerificationKey2020",
"publicKeyBase58": "zEJuPAFyH8vYTNiV7mzVdc93QrQeGFTy2JGmHn89qC4mr"
}
],
"authentication": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"assertionMethod": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"keyAgreement": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"capabilityInvocation": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"created": "2021-04-06T14:13:14.018Z",
"updated": "2021-04-06T14:13:14.018Z"
}' did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1 --ver-key 72xLgsLCnjHwkFouJJy4taIKvqAXIRGoopyA3BX2i9/FvghKTFvPzj6mApmFh9U2hW3iivlo785PXMeCtfPxjQ== --from alice --chain-id hidnode

Invalid CLI Command (Notice the change in PublicKeyBase58 field)

hid-noded tx ssi create-did  '{
"context": [
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/v1",
"https://schema.org"
],
"type": "https://schema.org/Person",
"id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
"name": "Vishwas",
"publicKey": [
{
"context": "https://w3id.org/security/v2",
"id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1",
"type": "Ed25519VerificationKey2020",
"publicKeyBase58": "zEJuPAFyH8vYTNiV7mzVdc93QrQeGFTy2JGmHn89qC4mp"
}
],
"authentication": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"assertionMethod": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"keyAgreement": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"capabilityInvocation": [
"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1"
],
"created": "2021-04-06T14:13:14.018Z",
"updated": "2021-04-06T14:13:14.018Z"
}' did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#key1 --ver-key 72xLgsLCnjHwkFouJJy4taIKvqAXIRGoopyA3BX2i9/FvghKTFvPzj6mApmFh9U2hW3iivlo785PXMeCtfPxjQ== --from alice --chain-id hidnode

Result:

code: 107
codespace: ssi
data: ""
events:
- attributes:
  - index: false
    key: ZmVl
    value: ""
  type: tx
- attributes:
  - index: false
    key: YWNjX3NlcQ==
    value: Y29zbW9zMWZmaHJmdTh4NHd3bmV4eXNucWRzNm51cGNqOTdjbTM5eG1sajdtLzE=
  type: tx
- attributes:
  - index: false
    key: c2lnbmF0dXJl
    value: R3FnMDV0Yy82aENWVlBLZDJ0eUh2VThiZjQ2RW5WYmpPSzdLV0hiYnpMQXhtUzl2L3lLNDBaSGFmaW5RT05kSWNLUzFqMjZqSlVrN1VDV0ZJSE90dWc9PQ==
  type: tx
gas_used: "45081"
gas_wanted: "200000"
height: "17"
info: ""
logs: []
raw_log: 'failed to execute message; message index: 0: did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51:
  invalid signature detected'
timestamp: ""
tx: null

@arnabghose997 arnabghose997 self-assigned this Feb 10, 2022
@arnabghose997 arnabghose997 merged commit fccb58b into main Feb 10, 2022
@arnabghose997 arnabghose997 deleted the create-did-ssi-module branch February 21, 2022 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant