{"_id":"@bloomprotocol/attestations-common","_rev":"12-4b7a82a4384e7bd8a23629aca9f452f8","name":"@bloomprotocol/attestations-common","dist-tags":{"beta":"1.0.0-beta.2","latest":"1.0.1"},"versions":{"1.0.0-beta.0":{"name":"@bloomprotocol/attestations-common","version":"1.0.0-beta.0","main":"dist/index.js","module":"dist/attestations-common.esm.js","typings":"dist/index.d.ts","description":"Shared types and utility functions for attestation related kits","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"license":"Apache-2.0","scripts":{"start":"tsdx watch --tsconfig ./tsconfig.build.json","build":"tsdx build --tsconfig ./tsconfig.build.json","test":"CI=true tsdx test","test:watch":"tsdx test","lint":"tsdx lint src test","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint"},"dependencies":{"@types/eth-sig-util":"^2.1.0","@types/randombytes":"^2.0.0","eth-sig-util":"^2.5.2","ethereumjs-util":"^6.2.0","ethereumjs-wallet":"^0.6.3","js-sha3":"^0.8.0","merkletreejs":"0.1.1","randombytes":"^2.1.0"},"devDependencies":{"@bloomprotocol/eslint-config":"^1.0.0-beta.1","@bloomprotocol/prettier-config":"^1.0.0-beta.1","@types/jest":"^24.0.25","@types/node":"^13.1.4","@typescript-eslint/eslint-plugin":"^2.14.0","@typescript-eslint/parser":"^2.14.0","acorn":"^7.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","prettier":"^1.19.1","tsdx":"^0.12.1","tslib":"^1.10.0","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"publishConfig":{"access":"public"},"gitHead":"53f8df79bc9c04175ffdf7d964dbc1795caa52a6","bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"homepage":"https://github.com/hellobloom/attestations-es#readme","_id":"@bloomprotocol/attestations-common@1.0.0-beta.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-T6L5Po8WldsUux9GnRe77VcWnHSv3ufwxcLwfrm+6vRcD3iQiSHOjlXW9VSJ0PoG+UsLxGeekg95d0/SdAlAMg==","shasum":"e4b7eeaffa892d3d7ec708b41255f71e9d545d26","tarball":"https://registry.npmjs.org/@bloomprotocol/attestations-common/-/attestations-common-1.0.0-beta.0.tgz","fileCount":35,"unpackedSize":578901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF5vZCRA9TVsSAnZWagAAQUEP+wdUAX2hDP1eP6/BO7hH\nli8gbxodd/A6s26WnEfOiVwax9EL1YB0zDOypUSZabt2e7FVeOpvx7e8GVpg\nqjC0KL0Kl+fWh2idO/k7JzdM40kFc2/rli5FkjBHeB/Py8F8E1taogqtKxax\ncBmrxrtqhOVSEr/fx6eqmmjit/X0xk5LIEB49nPv+vWJSkUFg7g4WhJ+t3ym\nDLAGgNTZ94n3P9+sNB+UnMarCe8fIbQwmn45PkFCl1ApG+qRaKf9Jb2v25tk\nNwSLisjmNUxppQ2mUvKSE8mseybH0y4K9UF09gZrz5GUylDuLf4sVoKqf/PF\nTsWaTza2+HpxcHNo5laSXcfXs877Fky73YJmq4yc8+uFhs8WWHGcOHQ70hLx\nxd85ZDeO/aJ1oQHPYnfAYJF1YJ1tJjpphJAI1rxfK5zzHWs5rX7o5TeM3ecV\n0fejXhlV+m1MeuseExXb3qz0sPObNwp8dvR+nvDwHL5DTV/Bil5nWkQN9tg4\npOgfT1FxNMBag6U984ILczauj1S3qbIrd6N898lqki0V9RXsgw+QRu21W9Kj\nnIiz3uHfkUQipZpb/FRENImMA4IFAQQEmCc/8dqZO+9smxQsKWRmRHbEPiQP\nvE0M3ZEeQhVbcI9ZMl5KMExQrtNa4p1mpEMbR0jiVmEiBEjvTeccEMTtJa7J\nLcHo\r\n=GDe1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxQtu/HSoZ5BeeAFqh/qjbRc3R35kBIHd7agBlyrS2wgIhAKytg2zXem29VvMf+mm5tPWdou8JsQ3qGhN38iyAiKdq"}]},"maintainers":[{"name":"djvs","email":"djvs@users.noreply.github.com"},{"name":"izkp","email":"ipatka@gmail.com"},{"name":"jacehensley","email":"jacehensley@gmail.com"},{"name":"eddiebloom","email":"eddie@bloom.co"}],"_npmUser":{"name":"jacehensley","email":"jacehensley@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestations-common_1.0.0-beta.0_1578605528856_0.6100829002803074"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"@bloomprotocol/attestations-common","version":"1.0.0-beta.1","main":"dist/index.js","module":"dist/attestations-common.esm.js","typings":"dist/index.d.ts","description":"Shared types and utility functions for attestation related kits","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"license":"Apache-2.0","scripts":{"start":"tsdx watch --tsconfig ./tsconfig.build.json","build":"tsdx build --tsconfig ./tsconfig.build.json","test":"CI=true tsdx test","test:watch":"tsdx test","lint":"tsdx lint src test","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint"},"dependencies":{"@types/eth-sig-util":"^2.1.0","@types/randombytes":"^2.0.0","eth-sig-util":"^2.5.2","ethereumjs-util":"^6.2.0","ethereumjs-wallet":"^0.6.3","js-sha3":"^0.8.0","merkletreejs":"0.1.1","randombytes":"^2.1.0"},"devDependencies":{"@bloomprotocol/eslint-config":"^1.0.0-beta.1","@bloomprotocol/prettier-config":"^1.0.0-beta.1","@types/jest":"^24.0.25","@types/node":"^13.1.4","@typescript-eslint/eslint-plugin":"^2.14.0","@typescript-eslint/parser":"^2.14.0","acorn":"^7.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","prettier":"^1.19.1","tsdx":"^0.12.1","tslib":"^1.10.0","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"publishConfig":{"access":"public"},"gitHead":"7150694f05ad197498e09c33de413a18cbf62172","readme":"# Attestations Commons Kit\n\nShared types and utility functions for attestation related kits\n\n- [Attestations Commons Kit](#attestations-commons-kit)\n  - [Installation](#installation)\n  - [Extrator](#extractor)\n  - [AttestationData](#attestationdata)\n  - [AttestationTypes](#attestationtypes)\n  - [EthUtils](#ethutils)\n  - [Utils](#utils)\n  - [RFC3339 DateTime](#RFC3339-datetime)\n  - [Validation](#validation)\n  - [Types](#types)\n    - [Verifiable Credential](#verifiable-credential)\n    - [Credential Subject](#credential-subject)\n    - [Authorization](#authorization)\n    - [Credential Proof](#credential-proof)\n    - [Verified Data](#verified-data)\n    - [Batch Proof](#batch-proof)\n    - [On Chain Proof](#on-chain-proof)\n    - [Legacy Proof](#legacy-proof)\n    - [Signed Claim Node](#signed-claim-node)\n    - [Issued Claim Node](#issued-claim-node)\n    - [Issuance Node](#issuance-node)\n    - [Legacy Data Node](#legacy-data-node)\n    - [Legacy Attestation Node](#legacy-attestation-node)\n    - [Merkle Proof](#merkle-proof)\n    - [Presentation Proof](#presentation-proof)\n\n## Installation\n\n```\nnpm install --save @bloomprotocol/att-comm-kit\n```\n\n## Extrator\n\nThe `extractor` function helps extract data from a verifiable credential.\n\n```typescript\nimport {IVerifiableCredential, extract} from '@bloomprotocol/attestations-common'\n\nconst emailCredential: IVerifiableCredential = {...}\n\nconst emailData = extract(emailCredential.credentialSubject.data, 'email', 'email')\n```\n\n## AttestationData\n\n```typescript\nimport {AttestationData} from '@bloomprotocol/attestations-common'\n```\n\nWe define some extensible interfaces that the attestation data will be formatted in. These are use when extracting the data from the VC.\n\n## EthUtils\n\nUtilty functions for dealing with ethereum and general crypto\n\n## Utils\n\nGeneral purpose utily functions\n\n## RFC3339 DateTime\n\n## Validation\n\n## Types\n\nTypes for Verifiable Presentations, Verifiable Credentials, and Verifiable Auth\n\n### Verifiable Credential\n\nFormat of a users verified credential\n\n| Name              | Description                                                            | Type                  |\n| ----------------- | ---------------------------------------------------------------------- | --------------------- |\n| id                | Identifier for this credential                                         | \\`string\\`            |\n| type              | Type name of the credential                                            | \\`string\\`            |\n| issuer            | Identifier of the entity that issued the credential                    | \\`string\\`            |\n| issuanceDate      | RFC3339 Datetime of when the credential was issued                     | \\`string\\`            |\n| credentialSubject | Information about the subject of the credential and the verified data  | \\`CredentialSubject\\` |\n| proof             | Credential proof showing the issuer signed the credential being shared | \\`CredentialProof\\`   |\n\n### Credential Subject\n\nInformation identifying the subject and data of the credential\n\n| Name          | Description                                                                                                  | Type                |\n| ------------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |\n| subject       | Identifier of original subject of the attestation (Eth Address/ DID)                                         | \\`string\\`          |\n| data          | Stringified data containing what was verified and approved for sharing                                       | \\`string\\`          |\n| authorization | Optional array of signatures showing chain of custody between original credential subject and current holder | \\`Authorization[]\\` |\n\n### Authorization\n\nOptional array of signatures showing chain of custody between original credential subject and current holder\n\n| Name       | Description                                                      | Type       |\n| ---------- | ---------------------------------------------------------------- | ---------- |\n| subject    | Address of keypair granting authorization                        | \\`string\\` |\n| recipient  | Address of keypair receiving authorization                       | \\`string\\` |\n| revocation | Hex string to identify this authorization in event of revocation | \\`string\\` |\n| signature  | Hash of subject, recipient, revocation signed by subject pk      | \\`string\\` |\n\n### Credential Proof\n\nInformation identifying the subject and data of the credential\n\n| Name    | Description                                                                    | Type             |\n| ------- | ------------------------------------------------------------------------------ | ---------------- |\n| type    | Identifier of this proof type                                                  | \\`string\\`       |\n| created | RFC3339 Datetime of when this proof was created. Usually same as issuance date | \\`string\\`       |\n| creator | Identifier of attester. Eth address or DID                                     | \\`string\\`       |\n| data    | Proof object containing all data necessary to validate original attestation    | \\`VerifiedData\\` |\n\n### Verified Data\n\nProof defined by the [Selective Disclosure Merkle Tree Spec](https://github.com/hellobloom/specs/blob/master/attestation-data/Bloom-Merkle-Tree-22facf0b-bedb-4b45-bb7d-edcd57213eb0.md)\n\nThere are three types of Verified Data proofs in the spec\n\n| Name           | Description                                                                                               |\n| -------------- | --------------------------------------------------------------------------------------------------------- |\n| Batch Proof    | Proof structure which enables submitting batches of attestations at the same time in a single transaction |\n| On Chain Proof | Proof structure intended for use with the AttestationLogic smart contract                                 |\n| Legacy Proof   | Legacy proof structure similar to On Chain proof. Used with Attestation Logic smart contract              |\n\nThis [linked diagram](https://github.com/hellobloom/specs/blob/master/attestation-data/Combined_Merkle_Tree.png) shows how the proof data structures are formed\n\n### Batch Proof\n\n| Name             | Description                                                      | Type                |\n| ---------------- | ---------------------------------------------------------------- | ------------------- |\n| version          | Identifier of this proof type                                    | \\`string\\`          |\n| batchLayer2Hash  | Attestation hash formed by hashing subject sig with attester sig | \\`string\\`          |\n| batchAttesterSig | Attester's signature of layer2Hash and subject address           | \\`string\\`          |\n| subjectSig       | Subject signature of attestation agreement                       | \\`string\\`          |\n| requestNonce     | Nonce used in subjectSig                                         | \\`string\\`          |\n| layer2Hash       | Hash of rootHash and rootHashNonce                               | \\`string\\`          |\n| rootHash         | Merkle tree root hash                                            | \\`string\\`          |\n| rootHashNonce    | Nonce used with rootHash to create layer2Hash                    | \\`string\\`          |\n| proof            | Array of merkle proof objects                                    | \\`MerkleProof\\`     |\n| stage            | mainnet, rinkeby, local, etc                                     | \\`string\\`          |\n| target           | Node of the merkle tree being shared                             | \\`SignedClaimNode\\` |\n| attester         | Attester Eth address                                             | \\`string\\`          |\n| subject          | Subject Eth address                                              | \\`string\\`          |\n\n### On Chain Proof\n\n| Name          | Description                                           | Type                |\n| ------------- | ----------------------------------------------------- | ------------------- |\n| version       | Identifier of this proof type                         | \\`string\\`          |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`          |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`          |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`          |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`          |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`     |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`          |\n| target        | Node of the merkle tree being shared                  | \\`SignedClaimNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`          |\n\n### Legacy Proof\n\n| Name          | Description                                           | Type               |\n| ------------- | ----------------------------------------------------- | ------------------ |\n| version       | Identifier of this proof type                         | \\`string\\`         |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`         |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`         |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`         |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`         |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`    |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`         |\n| target        | Node of the merkle tree being shared                  | \\`LegacyDataNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`         |\n\n### Signed Claim Node\n\nFormat of target attestation data\n\n| Name        | Description                                                          | Type                |\n| ----------- | -------------------------------------------------------------------- | ------------------- |\n| claimNode   | Object representing the attestation data, type, and revocation links | \\`IssuedClaimNode\\` |\n| attester    | Attester Eth address                                                 | \\`string\\`          |\n| attesterSig | Root hash of claim node tree signed by attester                      | \\`string\\`          |\n\n### Issued Claim Node\n\nFormat of attestation node\n\n| Name     | Description                                                                    | Type                |\n| -------- | ------------------------------------------------------------------------------ | ------------------- |\n| data     | Object containing the data, nonce, and version of the attestation              | \\`AttestationData\\` |\n| type     | Object containing he type, nonce, and optionally a provider of the attestation | \\`AttestationType\\` |\n| aux      | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash  | \\`string\\`          |\n| issuance | Object containing issuance and revocation metadata                             | \\`IssuanceNode\\`    |\n\n### Issuance Node\n\n| Name                  | Description                                                                           | Type       |\n| --------------------- | ------------------------------------------------------------------------------------- | ---------- |\n| localRevocationToken  | Hex string to be used in public revocation registry to revoke this data node          | \\`string\\` |\n| globalRevocationToken | Hex string to be used in public revocation registry to revoke this entire attestation | \\`string\\` |\n| dataHash              | Hash of claim tree                                                                    | \\`string\\` |\n| typeHash              | Hash of type object                                                                   | \\`string\\` |\n| issuanceDate          | RFC3339 datetime of when this claim was issued                                        | \\`string\\` |\n| expirationDate        | RFC3339 datetime of when this claim should be considered expired                      | \\`string\\` |\n\n### Legacy Data Node\n\nFormat of legacy attestation data\n\n| Name              | Description                                                          | Type                      |\n| ----------------- | -------------------------------------------------------------------- | ------------------------- |\n| attestationNode   | Object representing the attestation data, type, and revocation links | \\`LegacyAttestationNode\\` |\n| signedAttestation | Root hash of attestation tree signed by attester                     | \\`string\\`                |\n\n### Legacy Attestation Node\n\n| Name | Description                                                                      | Type                |\n| ---- | -------------------------------------------------------------------------------- | ------------------- |\n| data | Object containing the data, nonce, and version of the attestation                | \\`AttestationData\\` |\n| type | Object containing he type, nonce, and optionally a provider of the attestation   | \\`AttestationType\\` |\n| aux  | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash    | \\`string\\`          |\n| link | Object containing the information used in the event of an attestation revocation | \\`RevocationLinks\\` |\n\n### Merkle Proof\n\nFormat of proof object used to perform merkle proof\n\n| Name     | Description                                                      | Type       |\n| -------- | ---------------------------------------------------------------- | ---------- |\n| position | \\`left\\` or \\`right\\` indicating position of hash in merkle tree | \\`string\\` |\n| data     | Hex string of node hash                                          | \\`string\\` |\n\n### Presentation Proof\n\nFormat of a users verified data\n\n| Name           | Description                                                     | Type       |\n| -------------- | --------------------------------------------------------------- | ---------- |\n| type           | Identifier of this type of presentation proof                   | \\`string\\` |\n| created        | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator        | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce          | Token used to make this request unique                          | \\`string\\` |\n| domain         | Website of recipient where user intends to share the data       | \\`string\\` |\n| credentialHash | Hash of array of layer2Hashes being shared                      | \\`string\\` |\n\n### Authentication Proof\n\nFormat of a users verified data\n\n| Name    | Description                                                     | Type       |\n| ------- | --------------------------------------------------------------- | ---------- |\n| type    | Identifier of this type of presentation proof                   | \\`string\\` |\n| created | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce   | Token used to make this request unique                          | \\`string\\` |\n| domain  | Website of recipient where user intends to share the data       | \\`string\\` |\n\n## AttestationTypes\n\nSome helper types and functions for dealing with attestation types ('email', 'phone', 'pep', etc.)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"homepage":"https://github.com/hellobloom/attestations-es#readme","_id":"@bloomprotocol/attestations-common@1.0.0-beta.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-kW39AvYswJIMNfqtL0hjj5nCOPo5xVXi6WwglFcE5jA51Rp3O3ETtnYdv7ZMW9MeJ2Qq9poC3BVPvwgmcw+FHA==","shasum":"9ce8e1ea297b20f08e0a72133477287ebf0a6a72","tarball":"https://registry.npmjs.org/@bloomprotocol/attestations-common/-/attestations-common-1.0.0-beta.1.tgz","fileCount":35,"unpackedSize":579067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF6+xCRA9TVsSAnZWagAA1zMP/RJzWP99vTarNSFJxMgG\nf5LIzBayYk1mPJqZSl1WcllI5DOiLv16/3RDrOa9widAWOxIWhZ0Ejm3hkaS\nxNA18Wc5KmvjeYMHCJm2ZNqbmELSns9dsd3/H6q2jZFBl5/2aRanfv+BXzch\ndgMAKObOnvWzYUO5AQn98fnZSzhoHepVhw6z7rg7/CK5ZW0VjWJlswnDAGqT\nfEbcFuvZOL6iF7QBS3HHF5QpkAukVkiv1UlVRIIRVavuS9WoaFCCVk9WoYl4\nk96usn8eWIW2/0pO2CyKJcwV7ES09w4gzBrYDO1yG0LLNs9A2AE077DRnAxz\nEIrdrGBcqrCnnCC/Q0yzvDfQp5LogkPLivIfuAWPfxlslb00O27+zxP8N6NC\nNE4web1GhxHhAvno8kz2afkLv1lLR+WBK3Ira27RV6yrowvVhqbjloexaLzw\nxiw3DObE4DoKpqVRlmdBNP5MiwBCKYYUdX4Mt0JuGrFo8lwnYJIMbVdKA0ta\n4lJPjc9TKTOfcCUeu0fKUcfyLt32ITi8fmZ8iPOu5UhoV0QTk3JCzvKGxpfK\nphXd2kkmqNrdftGWsbznLmf6POq0B+ZGyF7JLHBf9+cTb5ussWQWQo0TWDIl\nA9LVhxgbBXccJ2or22RCLG5AXtEOKuvX6YcNd2MScS4Lnge+wAoA8Cija26F\nWT1y\r\n=Sqan\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLNeYA8Dybw6md4VDa7Tk0DC10lF9qPiTD6hH1CSPgcQIhAKNTONQU0uQSlGIKiTcs6H7aNrZ0ogZs4Lda0o3Tlqi8"}]},"maintainers":[{"name":"djvs","email":"djvs@users.noreply.github.com"},{"name":"eddiebloom","email":"eddie@bloom.co"},{"name":"izkp","email":"ipatka@gmail.com"},{"name":"jacehensley","email":"jacehensley@gmail.com"}],"_npmUser":{"name":"jacehensley","email":"jacehensley@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestations-common_1.0.0-beta.1_1578610609453_0.24352436087567164"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"@bloomprotocol/attestations-common","version":"1.0.0-beta.2","main":"dist/index.js","module":"dist/attestations-common.esm.js","typings":"dist/index.d.ts","description":"Shared types and utility functions for attestation related kits","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"license":"Apache-2.0","scripts":{"start":"tsdx watch --tsconfig ./tsconfig.build.json","build":"tsdx build --tsconfig ./tsconfig.build.json","test":"CI=true tsdx test","test:watch":"tsdx test","lint":"tsdx lint src test","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint"},"dependencies":{"@types/crypto-js":"^3.1.43","@types/eth-sig-util":"^2.1.0","@types/randombytes":"^2.0.0","crypto-js":"^3.1.9-1","eth-sig-util":"^2.5.2","ethereumjs-util":"^6.2.0","ethereumjs-wallet":"^0.6.3","js-sha3":"^0.8.0","randombytes":"^2.1.0"},"devDependencies":{"@bloomprotocol/eslint-config":"^1.0.0-beta.1","@bloomprotocol/prettier-config":"^1.0.0-beta.1","@types/jest":"^24.0.25","@types/node":"^13.1.4","@typescript-eslint/eslint-plugin":"^2.14.0","@typescript-eslint/parser":"^2.14.0","acorn":"^7.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","prettier":"^1.19.1","tsdx":"^0.12.1","tslib":"^1.10.0","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"publishConfig":{"access":"public"},"gitHead":"4af41da4ec9d3fb43c17d23b2ba71747a246ef2d","readme":"# Attestations Commons Kit\n\nShared types and utility functions for attestation related kits\n\n- [Attestations Commons Kit](#attestations-commons-kit)\n  - [Installation](#installation)\n  - [Extrator](#extractor)\n  - [AttestationData](#attestationdata)\n  - [AttestationTypes](#attestationtypes)\n  - [EthUtils](#ethutils)\n  - [Utils](#utils)\n  - [RFC3339 DateTime](#RFC3339-datetime)\n  - [Validation](#validation)\n  - [Types](#types)\n    - [Verifiable Credential](#verifiable-credential)\n    - [Credential Subject](#credential-subject)\n    - [Authorization](#authorization)\n    - [Credential Proof](#credential-proof)\n    - [Verified Data](#verified-data)\n    - [Batch Proof](#batch-proof)\n    - [On Chain Proof](#on-chain-proof)\n    - [Legacy Proof](#legacy-proof)\n    - [Signed Claim Node](#signed-claim-node)\n    - [Issued Claim Node](#issued-claim-node)\n    - [Issuance Node](#issuance-node)\n    - [Legacy Data Node](#legacy-data-node)\n    - [Legacy Attestation Node](#legacy-attestation-node)\n    - [Merkle Proof](#merkle-proof)\n    - [Presentation Proof](#presentation-proof)\n\n## Installation\n\n```\nnpm install --save @bloomprotocol/att-comm-kit\n```\n\n## Extrator\n\nThe `extractor` function helps extract data from a verifiable credential.\n\n```typescript\nimport {IVerifiableCredential, extract} from '@bloomprotocol/attestations-common'\n\nconst emailCredential: IVerifiableCredential = {...}\n\nconst emailData = extract(emailCredential.credentialSubject.data, 'email', 'email')\n```\n\n## AttestationData\n\n```typescript\nimport {AttestationData} from '@bloomprotocol/attestations-common'\n```\n\nWe define some extensible interfaces that the attestation data will be formatted in. These are use when extracting the data from the VC.\n\n## EthUtils\n\nUtilty functions for dealing with ethereum and general crypto\n\n## Utils\n\nGeneral purpose utily functions\n\n## RFC3339 DateTime\n\n## Validation\n\n## Types\n\nTypes for Verifiable Presentations, Verifiable Credentials, and Verifiable Auth\n\n### Verifiable Credential\n\nFormat of a users verified credential\n\n| Name              | Description                                                            | Type                  |\n| ----------------- | ---------------------------------------------------------------------- | --------------------- |\n| id                | Identifier for this credential                                         | \\`string\\`            |\n| type              | Type name of the credential                                            | \\`string\\`            |\n| issuer            | Identifier of the entity that issued the credential                    | \\`string\\`            |\n| issuanceDate      | RFC3339 Datetime of when the credential was issued                     | \\`string\\`            |\n| credentialSubject | Information about the subject of the credential and the verified data  | \\`CredentialSubject\\` |\n| proof             | Credential proof showing the issuer signed the credential being shared | \\`CredentialProof\\`   |\n\n### Credential Subject\n\nInformation identifying the subject and data of the credential\n\n| Name          | Description                                                                                                  | Type                |\n| ------------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |\n| subject       | Identifier of original subject of the attestation (Eth Address/ DID)                                         | \\`string\\`          |\n| data          | Stringified data containing what was verified and approved for sharing                                       | \\`string\\`          |\n| authorization | Optional array of signatures showing chain of custody between original credential subject and current holder | \\`Authorization[]\\` |\n\n### Authorization\n\nOptional array of signatures showing chain of custody between original credential subject and current holder\n\n| Name       | Description                                                      | Type       |\n| ---------- | ---------------------------------------------------------------- | ---------- |\n| subject    | Address of keypair granting authorization                        | \\`string\\` |\n| recipient  | Address of keypair receiving authorization                       | \\`string\\` |\n| revocation | Hex string to identify this authorization in event of revocation | \\`string\\` |\n| signature  | Hash of subject, recipient, revocation signed by subject pk      | \\`string\\` |\n\n### Credential Proof\n\nInformation identifying the subject and data of the credential\n\n| Name    | Description                                                                    | Type             |\n| ------- | ------------------------------------------------------------------------------ | ---------------- |\n| type    | Identifier of this proof type                                                  | \\`string\\`       |\n| created | RFC3339 Datetime of when this proof was created. Usually same as issuance date | \\`string\\`       |\n| creator | Identifier of attester. Eth address or DID                                     | \\`string\\`       |\n| data    | Proof object containing all data necessary to validate original attestation    | \\`VerifiedData\\` |\n\n### Verified Data\n\nProof defined by the [Selective Disclosure Merkle Tree Spec](https://github.com/hellobloom/specs/blob/master/attestation-data/Bloom-Merkle-Tree-22facf0b-bedb-4b45-bb7d-edcd57213eb0.md)\n\nThere are three types of Verified Data proofs in the spec\n\n| Name           | Description                                                                                               |\n| -------------- | --------------------------------------------------------------------------------------------------------- |\n| Batch Proof    | Proof structure which enables submitting batches of attestations at the same time in a single transaction |\n| On Chain Proof | Proof structure intended for use with the AttestationLogic smart contract                                 |\n| Legacy Proof   | Legacy proof structure similar to On Chain proof. Used with Attestation Logic smart contract              |\n\nThis [linked diagram](https://github.com/hellobloom/specs/blob/master/attestation-data/Combined_Merkle_Tree.png) shows how the proof data structures are formed\n\n### Batch Proof\n\n| Name             | Description                                                      | Type                |\n| ---------------- | ---------------------------------------------------------------- | ------------------- |\n| version          | Identifier of this proof type                                    | \\`string\\`          |\n| batchLayer2Hash  | Attestation hash formed by hashing subject sig with attester sig | \\`string\\`          |\n| batchAttesterSig | Attester's signature of layer2Hash and subject address           | \\`string\\`          |\n| subjectSig       | Subject signature of attestation agreement                       | \\`string\\`          |\n| requestNonce     | Nonce used in subjectSig                                         | \\`string\\`          |\n| layer2Hash       | Hash of rootHash and rootHashNonce                               | \\`string\\`          |\n| rootHash         | Merkle tree root hash                                            | \\`string\\`          |\n| rootHashNonce    | Nonce used with rootHash to create layer2Hash                    | \\`string\\`          |\n| proof            | Array of merkle proof objects                                    | \\`MerkleProof\\`     |\n| stage            | mainnet, rinkeby, local, etc                                     | \\`string\\`          |\n| target           | Node of the merkle tree being shared                             | \\`SignedClaimNode\\` |\n| attester         | Attester Eth address                                             | \\`string\\`          |\n| subject          | Subject Eth address                                              | \\`string\\`          |\n\n### On Chain Proof\n\n| Name          | Description                                           | Type                |\n| ------------- | ----------------------------------------------------- | ------------------- |\n| version       | Identifier of this proof type                         | \\`string\\`          |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`          |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`          |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`          |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`          |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`     |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`          |\n| target        | Node of the merkle tree being shared                  | \\`SignedClaimNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`          |\n\n### Legacy Proof\n\n| Name          | Description                                           | Type               |\n| ------------- | ----------------------------------------------------- | ------------------ |\n| version       | Identifier of this proof type                         | \\`string\\`         |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`         |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`         |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`         |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`         |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`    |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`         |\n| target        | Node of the merkle tree being shared                  | \\`LegacyDataNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`         |\n\n### Signed Claim Node\n\nFormat of target attestation data\n\n| Name        | Description                                                          | Type                |\n| ----------- | -------------------------------------------------------------------- | ------------------- |\n| claimNode   | Object representing the attestation data, type, and revocation links | \\`IssuedClaimNode\\` |\n| attester    | Attester Eth address                                                 | \\`string\\`          |\n| attesterSig | Root hash of claim node tree signed by attester                      | \\`string\\`          |\n\n### Issued Claim Node\n\nFormat of attestation node\n\n| Name     | Description                                                                    | Type                |\n| -------- | ------------------------------------------------------------------------------ | ------------------- |\n| data     | Object containing the data, nonce, and version of the attestation              | \\`AttestationData\\` |\n| type     | Object containing he type, nonce, and optionally a provider of the attestation | \\`AttestationType\\` |\n| aux      | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash  | \\`string\\`          |\n| issuance | Object containing issuance and revocation metadata                             | \\`IssuanceNode\\`    |\n\n### Issuance Node\n\n| Name                  | Description                                                                           | Type       |\n| --------------------- | ------------------------------------------------------------------------------------- | ---------- |\n| localRevocationToken  | Hex string to be used in public revocation registry to revoke this data node          | \\`string\\` |\n| globalRevocationToken | Hex string to be used in public revocation registry to revoke this entire attestation | \\`string\\` |\n| dataHash              | Hash of claim tree                                                                    | \\`string\\` |\n| typeHash              | Hash of type object                                                                   | \\`string\\` |\n| issuanceDate          | RFC3339 datetime of when this claim was issued                                        | \\`string\\` |\n| expirationDate        | RFC3339 datetime of when this claim should be considered expired                      | \\`string\\` |\n\n### Legacy Data Node\n\nFormat of legacy attestation data\n\n| Name              | Description                                                          | Type                      |\n| ----------------- | -------------------------------------------------------------------- | ------------------------- |\n| attestationNode   | Object representing the attestation data, type, and revocation links | \\`LegacyAttestationNode\\` |\n| signedAttestation | Root hash of attestation tree signed by attester                     | \\`string\\`                |\n\n### Legacy Attestation Node\n\n| Name | Description                                                                      | Type                |\n| ---- | -------------------------------------------------------------------------------- | ------------------- |\n| data | Object containing the data, nonce, and version of the attestation                | \\`AttestationData\\` |\n| type | Object containing he type, nonce, and optionally a provider of the attestation   | \\`AttestationType\\` |\n| aux  | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash    | \\`string\\`          |\n| link | Object containing the information used in the event of an attestation revocation | \\`RevocationLinks\\` |\n\n### Merkle Proof\n\nFormat of proof object used to perform merkle proof\n\n| Name     | Description                                                      | Type       |\n| -------- | ---------------------------------------------------------------- | ---------- |\n| position | \\`left\\` or \\`right\\` indicating position of hash in merkle tree | \\`string\\` |\n| data     | Hex string of node hash                                          | \\`string\\` |\n\n### Presentation Proof\n\nFormat of a users verified data\n\n| Name           | Description                                                     | Type       |\n| -------------- | --------------------------------------------------------------- | ---------- |\n| type           | Identifier of this type of presentation proof                   | \\`string\\` |\n| created        | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator        | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce          | Token used to make this request unique                          | \\`string\\` |\n| domain         | Website of recipient where user intends to share the data       | \\`string\\` |\n| credentialHash | Hash of array of layer2Hashes being shared                      | \\`string\\` |\n\n### Authentication Proof\n\nFormat of a users verified data\n\n| Name    | Description                                                     | Type       |\n| ------- | --------------------------------------------------------------- | ---------- |\n| type    | Identifier of this type of presentation proof                   | \\`string\\` |\n| created | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce   | Token used to make this request unique                          | \\`string\\` |\n| domain  | Website of recipient where user intends to share the data       | \\`string\\` |\n\n## AttestationTypes\n\nSome helper types and functions for dealing with attestation types ('email', 'phone', 'pep', etc.)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"homepage":"https://github.com/hellobloom/attestations-es#readme","_id":"@bloomprotocol/attestations-common@1.0.0-beta.2","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-JGOsrbNlkcYBF3YSNrMiUZdTZPcvD761NkPOLMOVX7p5o966nVT8KW315+O7y3zoYuftWJTTedtyWasRCQOMnQ==","shasum":"f6e6a21d6040bc303636a4f90773f26688f0a32a","tarball":"https://registry.npmjs.org/@bloomprotocol/attestations-common/-/attestations-common-1.0.0-beta.2.tgz","fileCount":36,"unpackedSize":625048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGLeDCRA9TVsSAnZWagAAWDYP/1gnlIsQ4Bcw70VsKjdt\n6Y+eHasla3khXo+2g0U/Af4lM/c2MiWTI0sDsl/fFUG/FZe35KFI7guTlvf4\nWa+odaGREM5vzvJ4R2hqMlQiJ4Meoud4Xl6GHzKlkpXw1sEnqVlu/cKFBGkt\nHQSRA1oS+Tzz98Yg7DJ772DsvSFnhWQva34ddArUF896EeJPp5sLZd19fK/i\n+Nzbb92D/QSXzdRUSrc1JPdw0iui59bRj/LzhBiXkmY50vKGTZii4OvRiP7/\nsVqG6Wei5hZr6VxEbvSTTA5da+oqi8nca2SXoNDaFqK0aCuHlHX2bfqJNwXj\n82eD/92NsO+BBMVESTOkriKE8Gik922RTYjjSz7ZW61U8Iljj29A78kor+Dx\nQp2LMLJZm4AUUecTYZQBxYW4UnFR0DQIRjmo9OfPJ4H7rBBlJ3IkljvSCo9s\neRMuPshJs2w62wmPMPqE50Ec8A4QJ21ZpqQGLrje3rGETYaANzQjiLy9nEOD\nBgtUXOB32uUh/zu1N8QHgPXAYw7kVUPzgPxuIW3c+AtZXto5hMeb+nCMeWlW\n2j33WDUjTRiMCrbzjHotbsIVoRWmq11+klVoCwkeorBvd3vTz5ZRhQeYdOmg\nMnYPSMzKBnWH/bOZ7BkBay8vmcqP/JpxrM7RN3OclGYMidIHzl5ovCewNXvO\nvIl6\r\n=uNaM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGrr1jMBnK2xPGSXTlVKz5VKpKgoEbmrXPwKo6Wd897UAiEAloGnyl1CtHBXxRKCRoKGPEbKZBj7+G/+BMmeG/sqwwc="}]},"maintainers":[{"name":"djvs","email":"djvs@users.noreply.github.com"},{"name":"eddiebloom","email":"eddie@bloom.co"},{"name":"izkp","email":"ipatka@gmail.com"},{"name":"jacehensley","email":"jacehensley@gmail.com"}],"_npmUser":{"name":"jacehensley","email":"jacehensley@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestations-common_1.0.0-beta.2_1578678146590_0.11872553879393477"},"_hasShrinkwrap":false},"1.0.0":{"name":"@bloomprotocol/attestations-common","version":"1.0.0","main":"dist/index.js","module":"dist/attestations-common.esm.js","typings":"dist/index.d.ts","description":"Shared types and utility functions for attestation related kits","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"license":"Apache-2.0","scripts":{"start":"tsdx watch --tsconfig ./tsconfig.build.json","build":"tsdx build --tsconfig ./tsconfig.build.json","test":"CI=true tsdx test","test:watch":"tsdx test","lint":"tsdx lint src test","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint"},"dependencies":{"@types/crypto-js":"^3.1.43","@types/eth-sig-util":"^2.1.0","@types/randombytes":"^2.0.0","crypto-js":"^3.1.9-1","eth-sig-util":"^2.5.2","ethereumjs-util":"^6.2.0","ethereumjs-wallet":"^0.6.3","js-sha3":"^0.8.0","randombytes":"^2.1.0"},"devDependencies":{"@bloomprotocol/eslint-config":"^1.0.0-beta.1","@bloomprotocol/prettier-config":"^1.0.0-beta.1","@types/jest":"^24.0.25","@types/node":"^13.1.4","@typescript-eslint/eslint-plugin":"^2.14.0","@typescript-eslint/parser":"^2.14.0","acorn":"^7.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","prettier":"^1.19.1","tsdx":"^0.12.1","tslib":"^1.10.0","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"publishConfig":{"access":"public"},"gitHead":"f1c870bbc103c0e493c63108273873d82c69269e","bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"homepage":"https://github.com/hellobloom/attestations-es#readme","_id":"@bloomprotocol/attestations-common@1.0.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-q2OU3rvrx8gyLPCx/zldOpc27y+sUdNz1qpth+T3cOg+cViqiRXk8Zk6eNzQAFNxhXIDBstrbd+2GXygDCdlBw==","shasum":"b8639d5510359e3b91505aad1db5e82df8e6e65b","tarball":"https://registry.npmjs.org/@bloomprotocol/attestations-common/-/attestations-common-1.0.0.tgz","fileCount":36,"unpackedSize":620338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGPdaCRA9TVsSAnZWagAAs6AP/iD+hkNk9LyIO0hiSmTz\n7ddy5nSkOoPaRUo2Y84QPWlEsw/lkRfjpDclxOUVsb7KMkyhXlDTD4gorUB4\ndWzXllfIoA8fHbm+XRF39Oec8erjRtzJkNA4BLOUzVYifoQEJ7ljIPjRf7xA\nVE4NIOYOk5AS74gTriDx0a08znJvKOfRki7CTto+kXAo6Fug1nzpJbYJz7Fa\nswbErVpkqCfeYwyDbPNqZ25fR85KK8mpvJTX1r+QwTDVgRlyuoTXV3V0b3Oc\nFA9jvmbcpIg8z7rnP7hxvtp3YPN95cmxopsxuIeEK9VKf8UKr/BZnds/bUV+\n91fwVuudKO4Gv87MW08MQbxryiF4tIZ0fkHnqlZQ4K6PDznOgALYC46M13XL\nFCwD8mUyI7s90iAV0/F8nPzKB2yRodxMVIk7m/beRa326p6OsLVVTcEoVDHw\nlO/xAi8rC7+txFeSgnA+kamuzpSkGGCAdjhOtPS51NYgu+9F1GC6GgNMbM/v\nxIYfsFzTVljV84EjPXHmFWuLRWUY4kBzzaPDbaKZ5W5u6BhfCVeCW/ELgO0R\nKuufogGKuB5XC5Nv186Ytgi8io5+MS4dRk4KocrD7i8sKkePa8jamdkTfoNh\n2ux8ohqAjTn3wCeoGoay8ngqGmJShMvuvhb+fy4+e4yzDmM9CbDgDwTZbQRj\nzzhX\r\n=YlOZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCOJtVVzyD1fC+cFDwKFnuFPcKmoGHHBtxMQM+MNY6mAIhAMNU95hMr2z5wvBVMuXWMlN7S1bWJvIOCh+Kbe/5KhPR"}]},"maintainers":[{"name":"djvs","email":"djvs@users.noreply.github.com"},{"name":"eddiebloom","email":"eddie@bloom.co"},{"name":"izkp","email":"ipatka@gmail.com"},{"name":"jacehensley","email":"jacehensley@gmail.com"}],"_npmUser":{"name":"jacehensley","email":"jacehensley@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestations-common_1.0.0_1578694490139_0.9413065919343222"},"_hasShrinkwrap":false,"deprecated":"The '@bloomprotocol/attestations-common' package is deprecated. Please switch to '@bloomprotocol/vc'."},"1.0.1":{"name":"@bloomprotocol/attestations-common","version":"1.0.1","main":"dist/index.js","module":"dist/attestations-common.esm.js","typings":"dist/index.d.ts","description":"Shared types and utility functions for attestation related kits","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"license":"Apache-2.0","scripts":{"start":"tsdx watch --tsconfig ./tsconfig.build.json","build":"tsdx build --tsconfig ./tsconfig.build.json","test":"CI=true tsdx test","test:watch":"tsdx test","lint":"tsdx lint src test","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint"},"dependencies":{"@types/crypto-js":"^3.1.43","@types/eth-sig-util":"^2.1.0","@types/randombytes":"^2.0.0","crypto-js":"^3.1.9-1","eth-sig-util":"^2.5.2","ethereumjs-util":"^6.2.0","ethereumjs-wallet":"^0.6.3","js-sha3":"^0.8.0","randombytes":"^2.1.0","tslib":"^1.10.0"},"devDependencies":{"@bloomprotocol/eslint-config":"^1.0.0-beta.1","@bloomprotocol/prettier-config":"^1.0.0-beta.1","@types/jest":"^24.0.25","@types/node":"^13.1.4","@typescript-eslint/eslint-plugin":"^2.14.0","@typescript-eslint/parser":"^2.14.0","acorn":"^7.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","prettier":"^1.19.1","tsdx":"^0.12.1","typescript":"^3.7.4"},"jest":{"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"publishConfig":{"access":"public"},"gitHead":"81494949acace4e2a9e20d1ebed8d0ed93691ada","bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"homepage":"https://github.com/hellobloom/attestations-es#readme","_id":"@bloomprotocol/attestations-common@1.0.1","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-TbbZV5MiRZ6uMzSBBbbirp5RCI1cdCetP0Cr7epwLj4DmUqckZx1orv6WRoQtElnIRQfmExw+7/DvHr3EVJ3Cg==","shasum":"2ff9dba79644bf9f02f96565d337ca56190674de","tarball":"https://registry.npmjs.org/@bloomprotocol/attestations-common/-/attestations-common-1.0.1.tgz","fileCount":36,"unpackedSize":620397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2BohCRA9TVsSAnZWagAA3l0P/2YdFkBv6iJwdycngilJ\nSMwTBp26a90VoaPkB1aFSsdQBOaggYIhM/HoDtpEQosd9kpXDV50RZum9tX9\n+1dXKoCHHTIR2DcKueZ61vRFHtCavrqOqXkDC4JIPOAaTY0kkRGjSPzH6WA4\nAv1C1R2PpqotpWOqdQGvaCHhHVE+5ghwES0UmEQE/ktZf80EclEbTIIHXuVj\nK6ZLEMAB/HwMQoVQSYPntlFPE+nMa422gSFQgiS+mS0mn8CtDpr19+ZxPkXw\n+8VYXBAs/ClV/VIDupsIuDV/jvwE6jGRae5BpyXHTQSNuhqszz/jQzwusr80\nVpNObV1NZlxJtkNL+u8e4pKBL9ZBm4utP4x0vq9P2QOSlUpf+4G8h97JM3Uw\np0pYjmSFxucQIt8N/NZ2MuYhaAhlgmAUvgPPjohKLpj9ovoq7oBS6iAskNhp\nN938IaFEgrYWE+HpWAt9lSUfox8Yh27yyELcIz1WME2ZlhCOb5CnyZnGXJ97\n6ZbRU6yLVXuIFOmG7J7moXoq+gt8OG1etk44LS8LOr7Y81Vnu/gKy1Q/fes8\nc5TVihvyscKsC+Uo1XccYAJrI0s1cUeRzKJIIna9BD9s/5VR1dBiNCqV/oZ/\npvjtArP0mEP39JpDaRpZ00pevhGu9GwobEeQV7TPc74GkwG7na2e8OXhot/v\nRx+0\r\n=UsBG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqNHC0fswxGZXnRYgucQFBlQJEp5SnhsRrAIs5ihIUIgIhAIJGpq8Af+35QtI92BLMMrUv23auy/lvfqJ5YOSP9Fvn"}]},"maintainers":[{"name":"djvs","email":"djvs@users.noreply.github.com"},{"name":"eddiebloom","email":"eddie@bloom.co"},{"name":"izkp","email":"ipatka@gmail.com"},{"name":"jacehensley","email":"jacehensley@gmail.com"}],"_npmUser":{"name":"jacehensley","email":"jacehensley@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestations-common_1.0.1_1580249772369_0.5651493587907368"},"_hasShrinkwrap":false,"deprecated":"The '@bloomprotocol/attestations-common' package is deprecated. Please switch to '@bloomprotocol/vc'."}},"time":{"created":"2020-01-09T21:32:08.670Z","1.0.0-beta.0":"2020-01-09T21:32:09.028Z","modified":"2022-06-03T23:56:02.039Z","1.0.0-beta.1":"2020-01-09T22:56:49.616Z","1.0.0-beta.2":"2020-01-10T17:42:26.846Z","1.0.0":"2020-01-10T22:14:50.289Z","1.0.1":"2020-01-28T22:16:12.485Z"},"maintainers":[{"email":"2954343+djvs@users.noreply.github.com","name":"djvs"}],"description":"Shared types and utility functions for attestation related kits","homepage":"https://github.com/hellobloom/attestations-es#readme","repository":{"type":"git","url":"git+https://github.com/hellobloom/attestations-es.git"},"author":{"name":"Bloom Team","email":"team@bloom.co"},"bugs":{"url":"https://github.com/hellobloom/attestations-es/issues"},"license":"Apache-2.0","readme":"# Attestations Commons Kit\n\nShared types and utility functions for attestation related kits\n\n- [Attestations Commons Kit](#attestations-commons-kit)\n  - [Installation](#installation)\n  - [Extrator](#extractor)\n  - [AttestationData](#attestationdata)\n  - [AttestationTypes](#attestationtypes)\n  - [EthUtils](#ethutils)\n  - [Utils](#utils)\n  - [RFC3339 DateTime](#RFC3339-datetime)\n  - [Validation](#validation)\n  - [Types](#types)\n    - [Verifiable Credential](#verifiable-credential)\n    - [Credential Subject](#credential-subject)\n    - [Authorization](#authorization)\n    - [Credential Proof](#credential-proof)\n    - [Verified Data](#verified-data)\n    - [Batch Proof](#batch-proof)\n    - [On Chain Proof](#on-chain-proof)\n    - [Legacy Proof](#legacy-proof)\n    - [Signed Claim Node](#signed-claim-node)\n    - [Issued Claim Node](#issued-claim-node)\n    - [Issuance Node](#issuance-node)\n    - [Legacy Data Node](#legacy-data-node)\n    - [Legacy Attestation Node](#legacy-attestation-node)\n    - [Merkle Proof](#merkle-proof)\n    - [Presentation Proof](#presentation-proof)\n\n## Installation\n\n```\nnpm install --save @bloomprotocol/att-comm-kit\n```\n\n## Extrator\n\nThe `extractor` function helps extract data from a verifiable credential.\n\n```typescript\nimport {IVerifiableCredential, extract} from '@bloomprotocol/attestations-common'\n\nconst emailCredential: IVerifiableCredential = {...}\n\nconst emailData = extract(emailCredential.credentialSubject.data, 'email', 'email')\n```\n\n## AttestationData\n\n```typescript\nimport {AttestationData} from '@bloomprotocol/attestations-common'\n```\n\nWe define some extensible interfaces that the attestation data will be formatted in. These are use when extracting the data from the VC.\n\n## EthUtils\n\nUtilty functions for dealing with ethereum and general crypto\n\n## Utils\n\nGeneral purpose utily functions\n\n## RFC3339 DateTime\n\n## Validation\n\n## Types\n\nTypes for Verifiable Presentations, Verifiable Credentials, and Verifiable Auth\n\n### Verifiable Credential\n\nFormat of a users verified credential\n\n| Name              | Description                                                            | Type                  |\n| ----------------- | ---------------------------------------------------------------------- | --------------------- |\n| id                | Identifier for this credential                                         | \\`string\\`            |\n| type              | Type name of the credential                                            | \\`string\\`            |\n| issuer            | Identifier of the entity that issued the credential                    | \\`string\\`            |\n| issuanceDate      | RFC3339 Datetime of when the credential was issued                     | \\`string\\`            |\n| credentialSubject | Information about the subject of the credential and the verified data  | \\`CredentialSubject\\` |\n| proof             | Credential proof showing the issuer signed the credential being shared | \\`CredentialProof\\`   |\n\n### Credential Subject\n\nInformation identifying the subject and data of the credential\n\n| Name          | Description                                                                                                  | Type                |\n| ------------- | ------------------------------------------------------------------------------------------------------------ | ------------------- |\n| subject       | Identifier of original subject of the attestation (Eth Address/ DID)                                         | \\`string\\`          |\n| data          | Stringified data containing what was verified and approved for sharing                                       | \\`string\\`          |\n| authorization | Optional array of signatures showing chain of custody between original credential subject and current holder | \\`Authorization[]\\` |\n\n### Authorization\n\nOptional array of signatures showing chain of custody between original credential subject and current holder\n\n| Name       | Description                                                      | Type       |\n| ---------- | ---------------------------------------------------------------- | ---------- |\n| subject    | Address of keypair granting authorization                        | \\`string\\` |\n| recipient  | Address of keypair receiving authorization                       | \\`string\\` |\n| revocation | Hex string to identify this authorization in event of revocation | \\`string\\` |\n| signature  | Hash of subject, recipient, revocation signed by subject pk      | \\`string\\` |\n\n### Credential Proof\n\nInformation identifying the subject and data of the credential\n\n| Name    | Description                                                                    | Type             |\n| ------- | ------------------------------------------------------------------------------ | ---------------- |\n| type    | Identifier of this proof type                                                  | \\`string\\`       |\n| created | RFC3339 Datetime of when this proof was created. Usually same as issuance date | \\`string\\`       |\n| creator | Identifier of attester. Eth address or DID                                     | \\`string\\`       |\n| data    | Proof object containing all data necessary to validate original attestation    | \\`VerifiedData\\` |\n\n### Verified Data\n\nProof defined by the [Selective Disclosure Merkle Tree Spec](https://github.com/hellobloom/specs/blob/master/attestation-data/Bloom-Merkle-Tree-22facf0b-bedb-4b45-bb7d-edcd57213eb0.md)\n\nThere are three types of Verified Data proofs in the spec\n\n| Name           | Description                                                                                               |\n| -------------- | --------------------------------------------------------------------------------------------------------- |\n| Batch Proof    | Proof structure which enables submitting batches of attestations at the same time in a single transaction |\n| On Chain Proof | Proof structure intended for use with the AttestationLogic smart contract                                 |\n| Legacy Proof   | Legacy proof structure similar to On Chain proof. Used with Attestation Logic smart contract              |\n\nThis [linked diagram](https://github.com/hellobloom/specs/blob/master/attestation-data/Combined_Merkle_Tree.png) shows how the proof data structures are formed\n\n### Batch Proof\n\n| Name             | Description                                                      | Type                |\n| ---------------- | ---------------------------------------------------------------- | ------------------- |\n| version          | Identifier of this proof type                                    | \\`string\\`          |\n| batchLayer2Hash  | Attestation hash formed by hashing subject sig with attester sig | \\`string\\`          |\n| batchAttesterSig | Attester's signature of layer2Hash and subject address           | \\`string\\`          |\n| subjectSig       | Subject signature of attestation agreement                       | \\`string\\`          |\n| requestNonce     | Nonce used in subjectSig                                         | \\`string\\`          |\n| layer2Hash       | Hash of rootHash and rootHashNonce                               | \\`string\\`          |\n| rootHash         | Merkle tree root hash                                            | \\`string\\`          |\n| rootHashNonce    | Nonce used with rootHash to create layer2Hash                    | \\`string\\`          |\n| proof            | Array of merkle proof objects                                    | \\`MerkleProof\\`     |\n| stage            | mainnet, rinkeby, local, etc                                     | \\`string\\`          |\n| target           | Node of the merkle tree being shared                             | \\`SignedClaimNode\\` |\n| attester         | Attester Eth address                                             | \\`string\\`          |\n| subject          | Subject Eth address                                              | \\`string\\`          |\n\n### On Chain Proof\n\n| Name          | Description                                           | Type                |\n| ------------- | ----------------------------------------------------- | ------------------- |\n| version       | Identifier of this proof type                         | \\`string\\`          |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`          |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`          |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`          |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`          |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`     |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`          |\n| target        | Node of the merkle tree being shared                  | \\`SignedClaimNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`          |\n\n### Legacy Proof\n\n| Name          | Description                                           | Type               |\n| ------------- | ----------------------------------------------------- | ------------------ |\n| version       | Identifier of this proof type                         | \\`string\\`         |\n| tx            | Ethereum transaction which refrences this attestation | \\`string\\`         |\n| layer2Hash    | Hash of rootHash and rootHashNonce                    | \\`string\\`         |\n| rootHash      | Merkle tree root hash                                 | \\`string\\`         |\n| rootHashNonce | Nonce used with rootHash to create layer2Hash         | \\`string\\`         |\n| proof         | Array of merkle proof objects                         | \\`MerkleProof\\`    |\n| stage         | mainnet, rinkeby, local, etc                          | \\`string\\`         |\n| target        | Node of the merkle tree being shared                  | \\`LegacyDataNode\\` |\n| attester      | Attester Eth address                                  | \\`string\\`         |\n\n### Signed Claim Node\n\nFormat of target attestation data\n\n| Name        | Description                                                          | Type                |\n| ----------- | -------------------------------------------------------------------- | ------------------- |\n| claimNode   | Object representing the attestation data, type, and revocation links | \\`IssuedClaimNode\\` |\n| attester    | Attester Eth address                                                 | \\`string\\`          |\n| attesterSig | Root hash of claim node tree signed by attester                      | \\`string\\`          |\n\n### Issued Claim Node\n\nFormat of attestation node\n\n| Name     | Description                                                                    | Type                |\n| -------- | ------------------------------------------------------------------------------ | ------------------- |\n| data     | Object containing the data, nonce, and version of the attestation              | \\`AttestationData\\` |\n| type     | Object containing he type, nonce, and optionally a provider of the attestation | \\`AttestationType\\` |\n| aux      | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash  | \\`string\\`          |\n| issuance | Object containing issuance and revocation metadata                             | \\`IssuanceNode\\`    |\n\n### Issuance Node\n\n| Name                  | Description                                                                           | Type       |\n| --------------------- | ------------------------------------------------------------------------------------- | ---------- |\n| localRevocationToken  | Hex string to be used in public revocation registry to revoke this data node          | \\`string\\` |\n| globalRevocationToken | Hex string to be used in public revocation registry to revoke this entire attestation | \\`string\\` |\n| dataHash              | Hash of claim tree                                                                    | \\`string\\` |\n| typeHash              | Hash of type object                                                                   | \\`string\\` |\n| issuanceDate          | RFC3339 datetime of when this claim was issued                                        | \\`string\\` |\n| expirationDate        | RFC3339 datetime of when this claim should be considered expired                      | \\`string\\` |\n\n### Legacy Data Node\n\nFormat of legacy attestation data\n\n| Name              | Description                                                          | Type                      |\n| ----------------- | -------------------------------------------------------------------- | ------------------------- |\n| attestationNode   | Object representing the attestation data, type, and revocation links | \\`LegacyAttestationNode\\` |\n| signedAttestation | Root hash of attestation tree signed by attester                     | \\`string\\`                |\n\n### Legacy Attestation Node\n\n| Name | Description                                                                      | Type                |\n| ---- | -------------------------------------------------------------------------------- | ------------------- |\n| data | Object containing the data, nonce, and version of the attestation                | \\`AttestationData\\` |\n| type | Object containing he type, nonce, and optionally a provider of the attestation   | \\`AttestationType\\` |\n| aux  | String containing a hash of an \\`IAuxSig\\` object or just a padding node hash    | \\`string\\`          |\n| link | Object containing the information used in the event of an attestation revocation | \\`RevocationLinks\\` |\n\n### Merkle Proof\n\nFormat of proof object used to perform merkle proof\n\n| Name     | Description                                                      | Type       |\n| -------- | ---------------------------------------------------------------- | ---------- |\n| position | \\`left\\` or \\`right\\` indicating position of hash in merkle tree | \\`string\\` |\n| data     | Hex string of node hash                                          | \\`string\\` |\n\n### Presentation Proof\n\nFormat of a users verified data\n\n| Name           | Description                                                     | Type       |\n| -------------- | --------------------------------------------------------------- | ---------- |\n| type           | Identifier of this type of presentation proof                   | \\`string\\` |\n| created        | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator        | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce          | Token used to make this request unique                          | \\`string\\` |\n| domain         | Website of recipient where user intends to share the data       | \\`string\\` |\n| credentialHash | Hash of array of layer2Hashes being shared                      | \\`string\\` |\n\n### Authentication Proof\n\nFormat of a users verified data\n\n| Name    | Description                                                     | Type       |\n| ------- | --------------------------------------------------------------- | ---------- |\n| type    | Identifier of this type of presentation proof                   | \\`string\\` |\n| created | RFC3339 datetime of when this proof was generated and signed    | \\`string\\` |\n| creator | Identifier of holder sharing the credential. Eth address or DID | \\`string\\` |\n| nonce   | Token used to make this request unique                          | \\`string\\` |\n| domain  | Website of recipient where user intends to share the data       | \\`string\\` |\n\n## AttestationTypes\n\nSome helper types and functions for dealing with attestation types ('email', 'phone', 'pep', etc.)\n","readmeFilename":"README.md"}