@atlasauth/pca-aggsig 0.1.0 → 0.3.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 +72 -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,72 @@
1
+ # @atlasauth/pca-aggsig
2
+
3
+ BLS12-381 signature aggregation for Proof-Carrying Authority (PCA). A whole delegation chain's per-hop signatures, or a transparency-ledger witness quorum's cosignatures, collapse into one 96-byte aggregate that is checked with a single pairing-product verification. The scheme is BLS with proof-of-possession (`draft-irtf-cfrg-bls-signature`), minimal-pubkey-size variant (48-byte G1 keys, 96-byte G2 signatures).
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm i @atlasauth/pca-aggsig
9
+ ```
10
+
11
+ Depends on `@atlasauth/pca`, `@noble/curves` and `@noble/hashes` (installed transitively).
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import {
17
+ keyGen, blsPublicKey, mintBlsRoot, blsDelegate,
18
+ aggregateChainSignatures, verifyAggregatedChain,
19
+ cosignTreeHead, aggregateWitnessCosignatures, verifyAggregatedWitnessCosignatures,
20
+ } from '@atlasauth/pca-aggsig';
21
+
22
+ // A two-hop delegation chain: principal -> alice -> bob.
23
+ const principal = keyGen(), alice = keyGen(), bob = keyGen();
24
+ const principalPub = blsPublicKey(principal.secretKey);
25
+
26
+ const root = mintBlsRoot({
27
+ principalSecret: principal.secretKey,
28
+ principalPublic: principalPub,
29
+ holder: blsPublicKey(alice.secretKey),
30
+ caveats: [{ type: 'scope', value: 'payments:write' }],
31
+ });
32
+ const hop1 = blsDelegate(root, blsPublicKey(bob.secretKey), [{ type: 'max_amount', limit: 100 }], alice.secretKey);
33
+
34
+ const chain = [root, hop1];
35
+ const aggSig = aggregateChainSignatures(chain); // one 96-byte signature
36
+ verifyAggregatedChain(chain, aggSig, principalPub); // { ok: true }
37
+
38
+ // A witness quorum cosigning one signed tree head.
39
+ const statement = { size: 1024, root: 'cm9vdEA=', prev_root: 'cHJldg==', guardian_epoch: 3 };
40
+ const cosigs = [keyGen(), keyGen(), keyGen()].map((w) => cosignTreeHead(statement, w.secretKey));
41
+ const agg = aggregateWitnessCosignatures(cosigs);
42
+ verifyAggregatedWitnessCosignatures(statement, cosigs.map((c) => c.key), agg); // true
43
+ ```
44
+
45
+ `verifyAggregatedChain` also checks structure: depth bound, parent hash-links, holder-to-issuer continuity and append-only caveats. It never throws and returns `{ ok: false, reason }` on failure.
46
+
47
+ ## API
48
+
49
+ - Core BLS: `keyGen`, `publicKeyOf`, `keyValidate`, `sign`, `verify`, `aggregate`, `aggregatePublicKeys`, `aggregateVerify`, `fastAggregateVerify`, `popProve`, `popVerify`.
50
+ - Capability chain (suite `bls12-381-pop`): `mintBlsRoot`, `blsAttenuate`, `blsDelegate`, `blsPublicKey`, `capHash`, `aggregateChainSignatures`, `verifyAggregatedChain`.
51
+ - Witness cosignatures: `cosignTreeHead`, `verifyWitnessCosignature`, `aggregateWitnessCosignatures`, `verifyAggregatedWitnessCosignatures`.
52
+
53
+ ## Status
54
+
55
+ Part of [Proof-Carrying Authority](https://github.com/Atlas-Authorization/pca). **Experimental and unaudited.** BLS12-381 is not post-quantum.
56
+
57
+ What is validated (proof-of-possession scheme, public keys in G1, signatures in G2):
58
+
59
+ - **Reference vectors**: the 90 community-standard vectors of `ethereum/bls12-381-tests` v0.1.2 for this exact ciphersuite (sign, verify, aggregate, fast-aggregate-verify, aggregate-verify, and G1/G2 point deserialization), vendored in `test-vectors/` with source, release hash and per-file SHA-256. All pass, including infinity-key, infinity-signature, tampered-signature, wrong-key, extra-key and malformed-encoding cases. The IETF draft itself publishes no test vectors (its test-vector appendix is still to be written), so these are the reference vectors for the scheme, not vectors from the draft text.
60
+ - **Independent implementation**: `py_ecc` 8.0.0. Its public keys, proofs of possession, signatures and aggregates are reproduced byte-for-byte, and artifacts produced here verify there (and tampered ones are rejected there).
61
+ - **Rogue-key behavior** is exercised: a key chosen as `a*G - pk_victim` lets an adversary forge a same-message aggregate, which is why `fastAggregateVerify` must only be given keys admitted with `popVerify`; the adversary cannot produce a valid proof of possession for such a key. Proofs of possession and message signatures are domain-separated.
62
+
63
+ What is not validated:
64
+
65
+ - Only the minimal-pubkey-size, proof-of-possession variant is implemented. The basic and message-augmentation schemes and the signatures-in-G1 variant are not.
66
+ - `aggregateVerify` additionally refuses repeated messages (stricter than the proof-of-possession scheme requires).
67
+ - The delegation-chain and witness-cosignature layers are PCA-specific and have no external standard; they are covered by this package's own tests only.
68
+ - Not constant-time, and no independent security audit.
69
+
70
+ ## License
71
+
72
+ MIT - see LICENSE
package/package.json CHANGED
@@ -1,7 +1,27 @@
1
1
  {
2
2
  "name": "@atlasauth/pca-aggsig",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "BLS signature aggregation for PCA: collapse a delegation chain per-hop signatures and transparency-ledger witness cosignatures into one compact BLS12-381 aggregate with aggregate-verify.",
5
+ "keywords": [
6
+ "bls",
7
+ "signature aggregation",
8
+ "bls12-381",
9
+ "transparency",
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-aggsig"
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.3.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
  },