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

feat: added support for BBS+ Signature scheme #366

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

arnabghose997
Copy link
Contributor

This PR adds support for BBS+ Signature Scheme.

Sample DID Document with Verification Method of type Bls12381G2Key2020:

{
  "didDocument": {
    "context": [
    ],
    "id": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ",
    "controller": [
      "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ"
    ],
    "alsoKnownAs": [
    ],
    "verificationMethod": [
      {
        "id": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ#k1",
        "type": "Bls12381G2Key2020",
        "controller": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ",
        "publicKeyMultibase": "zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ",
        "blockchainAccountId": ""
      }
    ],
    "authentication": [
    ],
    "assertionMethod": [
    ],
    "keyAgreement": [
    ],
    "capabilityInvocation": [
    ],
    "capabilityDelegation": [
    ],
    "service": [
    ]
  },
  "didDocumentMetadata": {
    "created": "2023-07-31T06:56:59Z",
    "updated": "2023-07-31T06:56:59Z",
    "deactivated": false,
    "versionId": "84179388239C126624125D886679E63B0FB9F3C9257D19FF193E39DB90E0FBE7"
  }
}

Sample Schema Document with Proof of BbsBlsSignature2020 type:

{
  "schema": [
    {
      "type": "https://schema.org/Person",
      "modelVersion": "v1.0",
      "id": "sch:hid:devnet:zsCgr3E9YyN5d3q1XHzC3qVgYf4Z6jEKQvRjjZqP2T5GNxGFxYDxzCbZRme32ox2TPX2gqrPGz76hjc38oMYBaeeavAqz5BNx5dW1yEiuHZLoymhzeLaCayLHkHVs2pHWV48:1.0",
      "name": "Person",
      "author": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ",
      "authored": "2022-08-16T10:22:12Z",
      "schema": {
        "schema": "https://json-schema.org/draft-07/schema#",
        "description": "Person Schema",
        "type": "object",
        "properties": "{givenName:{type:string},gender:{type:string},email:{type:text},address:{type:text}}",
        "required": [
          "givenName",
          "address"
        ],
        "additionalProperties": false
      },
      "proof": {
        "type": "BbsBlsSignature2020",
        "created": "2022-08-16T10:22:12Z",
        "verificationMethod": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ#k1",
        "proofPurpose": "assertion",
        "proofValue": "tB3zAx9DM9oCqU2jSIVnDRK7W8oltm8c0ojUD4UVqAqLOxkFXtGGyRbSXl1KKTjQCnKA7E27u8QRG47ipqPA/0hpyjE5r3mtV0OCNxJKIlxEbnmU0LlGmvo0MAeUo3jbWiRIY3K3gWIAIS0SMqpjLQ=="
      }
    }
  ]
}

Sample Credential Status Document with Proof of BbsBlsSignature2020 type:

{
  "credStatus": {
    "claim": {
      "id": "vc:hid:devnet:z22YQgL2CFmZ7JPyq5AruyL9KbjeBB9Zoqk947yoAWTtS2VafZ9wE9a8W2BF19HUwggHWsAb6kuouaPueedb42BZuvu7Jry41Xn82ApVCFwWo9vEQkJqoF7n2wVVwBhhZkoKY",
      "currentStatus": "Live",
      "statusReason": "Credential Active"
    },
    "issuer": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ",
    "issuanceDate": "2022-08-16T09:37:12Z",
    "expirationDate": "2023-08-16T09:40:12Z",
    "credentialHash": "f35c3a4e3f1b8ba54ee3cf59d3de91b8b357f707fdb72a46473b65b46f92f80b",
    "proof": {
      "type": "BbsBlsSignature2020",
      "created": "2022-08-16T09:37:12Z",
      "updated": "2022-08-16T09:37:12Z",
      "verificationMethod": "did:hid:devnet:zqy3vA3GLHGK5fBiHnzjZWqHHRb8g9oXvQtkeJYS51zMjXF6nC5XdXGB6MR7AV4zeF6WepbchAn6bwTBZ8TxyKN6hWBsA7wNnvJTVzi4kfG5AhDQ6YYbm5L9r2Tr59b1snaJ#k1",
      "proofPurpose": "assertion",
      "proofValue": "ju20Hz8Z81j0pAdW9C9JGUOrc+2gp8R/xu6QkMFxU3or6QVa5I36/r4KXvZCHF3iNiKXEY8yCWAVLeeL3N/wxkmPzeDlfAoo0nlf2k/GLy4CbJbzAZqZFJWTKY8nL2xHcVeSYMFytRqBUZFkLiXgZQ=="
    }
  }
}

@arnabghose997 arnabghose997 added enhancement New feature or request ssi labels Jul 31, 2023
@arnabghose997 arnabghose997 self-assigned this Jul 31, 2023
@arnabghose997 arnabghose997 merged commit faee4f7 into develop Aug 2, 2023
2 checks passed
@arnabghose997 arnabghose997 deleted the bbs-signatures branch August 2, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ssi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants