Socket
Socket
Sign inDemoInstall

@mattrglobal/jsonld-signatures-bbs

Package Overview
Dependencies
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattrglobal/jsonld-signatures-bbs

A JSON-LD linked data proof suite for creating and verifying BBS+ signatures and proofs


Version published
Weekly downloads
1.7K
increased by96.92%
Maintainers
2
Weekly downloads
 
Created
Source

jsonld-signatures-bbs

The following repository contains the specification and a reference implementation for generating linked data signatures using the BBS+ Signature Algorithm using BLS12-381 key pairs.

Due to the properties of a BBS+ Signatures a zero knowledge proof can be derived from the signature, whereby the party generating the proof can elect to selectively disclose statements from the originally signed payload.

Getting Started

To install

yarn install --frozen-lockfile

To run the tests

yarn test

Sample Credential

The following is an example of a signed JSON-LD document featuring a BBS+ linked data signature.

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/citizenship/v1"
  ],
  "type": ["VerifiableCredential", "PermanentResidentCard"],
  "issuer": "did:example:28394728934792387",
  "issuanceDate": "2019-12-03T12:19:52Z",
  "expirationDate": "2029-12-03T12:19:52Z",
  "credentialSubject": {
    "type": ["PermanentResident", "Person"],
    "givenName": "JOHN",
    "familyName": "SMITH",
    "gender": "Male",
    "image": "data:image/png;base64,iVBORw0KGgo...kJggg==",
    "residentSince": "2015-01-01",
    "lprCategory": "C09",
    "lprNumber": "999-999-999",
    "commuterClassification": "C1",
    "birthCountry": "Bahamas",
    "birthDate": "1958-07-17"
  },
  "proof": {
     "type": "BBSSignature2020",
     "signature": "eyJhbGciOiJFZERTQSIsI...wRG2fNmAx60Vi4Ag",
     "requiredRevealStatements": [ 1, 2, 3, 4, 10],
     "proofPurpose": "assertionMethod",
     "verificationMethod": "did:example:28394728934792387#keys-7f83he7s8",
     "subjectVerificationMethod": "did:example13920596349402396#keys-5920692"
  }
}

Whereby the subject is able to generate a zero knowledge proof, from the signed JSON-LD document of the form.

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/citizenship/v1"
  ],
  "type": ["VerifiableCredential", "PermanentResidentCard"],
  "issuer": "did:example:28394728934792387",
  "issuanceDate": "2019-12-03T12:19:52Z",
  "expirationDate": "2029-12-03T12:19:52Z",
  "credentialSubject": {
    "type": ["PermanentResident", "Person"],
    "givenName": "JOHN",
    "familyName": "SMITH",
    "commuterClassification": "C1",
    "birthCountry": "Bahamas",
    "birthDate": "1958-07-17"
  },
  "proof": {
     "type": "BBSSignatureProof2020",
     "proof": "eyJhbGciOiJFZERTQSIsI...wRG2fNmAx60Vi4Ag",
     "domain": "did:example:relying-party",
     "subjectDomainProof": "eigqeivIenvIEiHtiW...6ChjkeIchjs"
     "requiredRevealStatements": [ 1, 2, 3, 4, 10],
     "revealedAttributes": [ 1, 2, 3, 4, 5 ],
     "totalAttributes": 10,
     "proofPurpose": "assertionMethod",
     "verificationMethod": "did:example:28394728934792387#keys-7f83he7s8"
  }
}

References

FAQs

Package last updated on 27 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc