@atlasauth/pca-bbs 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -0
  3. package/package.json +27 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Atlas Authorization
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @atlasauth/pca-bbs
2
+
3
+ BBS signatures (BLS12-381-SHA-256, following the IRTF CFRG BBS draft) for Proof-Carrying Authority (PCA). A PCA capability is issued as a multi-message BBS credential, then presented with selective disclosure and an unlinkable zero-knowledge proof of possession. An agent can reveal only the attributes a tool needs (for example the scope caveat) while hiding the rest (holder, budget, expiry), and two presentations of the same credential cannot be correlated.
4
+
5
+ There are two layers:
6
+
7
+ - the BBS core: `keyGen`, `createGenerators`, `messagesToScalars`, `sign`, `verify`, `proofGen`, `proofVerify`;
8
+ - the PCA layer: map a capability to an ordered attribute vector (`iss`, `sub`, then `cav:<i>:<type>` per caveat), issue it, present a subset, verify the presentation.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm i @atlasauth/pca-bbs
14
+ ```
15
+
16
+ Depends on `@atlasauth/pca`, `@noble/curves` and `@noble/hashes` (installed automatically).
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import {
22
+ generateKeyPair, issueCapabilityCredential, presentCredential, verifyCredential, verifyPresentation,
23
+ } from '@atlasauth/pca-bbs';
24
+
25
+ const bytes = (s: string) => new TextEncoder().encode(s);
26
+
27
+ const capability = {
28
+ issuer: 'issuer-public-key',
29
+ holder: 'agent-public-key',
30
+ caveats: [
31
+ { type: 'scope', actions: ['search:read'] },
32
+ { type: 'budget_alloc', limit: 100 },
33
+ ],
34
+ };
35
+
36
+ const { sk, pk } = generateKeyPair();
37
+ const cred = issueCapabilityCredential(capability, { sk, pk });
38
+ verifyCredential(cred); // true: every attribute is signed by the issuer
39
+
40
+ // Reveal only the scope caveat, bound to one action so the proof cannot be replayed elsewhere.
41
+ const pres = presentCredential(cred, {
42
+ disclose: ['cav:0:scope'],
43
+ presentationHeader: bytes('action:search?q=atlas'),
44
+ });
45
+
46
+ verifyPresentation(pres); // true
47
+ verifyPresentation(pres, { pk, presentationHeader: bytes('action:search?q=atlas') }); // pin issuer + context
48
+ ```
49
+
50
+ `presentCredential` throws if a requested attribute name does not exist. Pass a pinned `pk` and your own `presentationHeader` to `verifyPresentation` so the verifier asserts its own expectations rather than trusting the values carried in the presentation.
51
+
52
+ ## Status
53
+
54
+ Cryptography is unaudited. The BBS implementation follows the CFRG draft and is checked against its test vectors, but the draft is not a final standard. BBS on BLS12-381 is not post-quantum.
55
+
56
+ Source and issues: https://github.com/Atlas-Authorization/pca
57
+
58
+ ## License
59
+
60
+ MIT - see LICENSE
package/package.json CHANGED
@@ -1,7 +1,27 @@
1
1
  {
2
2
  "name": "@atlasauth/pca-bbs",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "BBS signatures (CFRG draft) for PCA: issue a capability as a multi-message BBS credential, then present it with selective disclosure + unlinkable zero-knowledge proof-of-possession, so an agent reveals only the attributes a tool needs and uses can't be correlated.",
5
+ "keywords": [
6
+ "bbs signatures",
7
+ "selective disclosure",
8
+ "zero-knowledge",
9
+ "credentials",
10
+ "agent authorization",
11
+ "proof-carrying authority",
12
+ "pca",
13
+ "ai agents"
14
+ ],
15
+ "license": "MIT",
16
+ "homepage": "https://github.com/Atlas-Authorization/pca#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/Atlas-Authorization/pca/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Atlas-Authorization/pca.git",
23
+ "directory": "packages/pca-bbs"
24
+ },
5
25
  "main": "./dist/index.js",
6
26
  "types": "./dist/index.d.ts",
7
27
  "exports": {
@@ -14,7 +34,7 @@
14
34
  "dependencies": {
15
35
  "@noble/curves": "^1.6.0",
16
36
  "@noble/hashes": "^1.5.0",
17
- "@atlasauth/pca": "0.1.0"
37
+ "@atlasauth/pca": "0.2.0"
18
38
  },
19
39
  "devDependencies": {
20
40
  "typescript": "^5.6.3",
@@ -22,8 +42,12 @@
22
42
  },
23
43
  "files": [
24
44
  "dist",
25
- "README.md"
45
+ "README.md",
46
+ "LICENSE"
26
47
  ],
48
+ "engines": {
49
+ "node": ">=20"
50
+ },
27
51
  "publishConfig": {
28
52
  "access": "public"
29
53
  },