sealedrecord 0.1.1 → 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.
- package/README.md +2 -0
- package/docs/FORMAT.md +5 -5
- package/package.json +1 -1
- package/src/attest.js +1 -1
- package/src/pkg.js +1 -1
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ npm ci
|
|
|
48
48
|
npm test
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
Releases: bump the version and CHANGELOG, commit, push a `vX.Y.Z` tag. CI publishes to npm through trusted publishing; nothing is published by hand.
|
|
52
|
+
|
|
51
53
|
To develop against a consuming app without editing its manifest: `npm link` here, then `npm link sealedrecord` in the app. A plain `npm install` there restores the published version.
|
|
52
54
|
|
|
53
55
|
## License
|
package/docs/FORMAT.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Sealed record format, version `
|
|
1
|
+
# Sealed record format, version `sealedrecord/package.v3`
|
|
2
2
|
|
|
3
3
|
This document specifies the record completely enough to implement an independent reader. Where it and the reference implementation disagree, the reference implementation is the bug report; the record bytes are the authority.
|
|
4
4
|
|
|
5
|
-
The format identifier `
|
|
5
|
+
The format identifier `sealedrecord/package.v3` and the receipt tag `sealedrecord/receipt.v1` are opaque protocol constants. Readers compare them byte for byte and attach no meaning to them. The version suffix counts revisions of the digest rules (v3 is the third), and the namespace is simply where this specification lives; a namespace was renamed once before any record left the room, which is why the suffix did not restart at v1.
|
|
6
6
|
|
|
7
7
|
## 1. Encoding
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ A record is one UTF-8 JSON document. All digests and signatures are lowercase he
|
|
|
12
12
|
|
|
13
13
|
| Field | Type | Committed | Notes |
|
|
14
14
|
|---|---|---|---|
|
|
15
|
-
| `format` | string | no | Must equal `
|
|
15
|
+
| `format` | string | no | Must equal `sealedrecord/package.v3`. Anything else is `malformed`. |
|
|
16
16
|
| `note` | string | no | Free text for humans. Readers ignore it. |
|
|
17
17
|
| `session` | object | partly | `id` (optional string), `code`, `title`. Only `id` participates in receipts (§7). |
|
|
18
18
|
| `sealedAt` | string | no | The `t` of the sealing entry. Display only. |
|
|
@@ -110,7 +110,7 @@ When the record carries no `signers`, or the runtime cannot do Ed25519, signatur
|
|
|
110
110
|
|
|
111
111
|
### 5.1 Malformed
|
|
112
112
|
|
|
113
|
-
Return `{ kind: "malformed", detail }` when: the value is not an object; `format` differs from `
|
|
113
|
+
Return `{ kind: "malformed", detail }` when: the value is not an object; `format` differs from `sealedrecord/package.v3`; `entries` is not a non-empty array; `entries.length > 10000`; `signers` has more than 200 keys.
|
|
114
114
|
|
|
115
115
|
### 5.2 Walk
|
|
116
116
|
|
|
@@ -184,7 +184,7 @@ A receipt for entry `seq` is valid when
|
|
|
184
184
|
|
|
185
185
|
```
|
|
186
186
|
Ed25519.verify( attestations.key, sig_bytes, UTF8(canonical) ) == true
|
|
187
|
-
canonical = "
|
|
187
|
+
canonical = "sealedrecord/receipt.v1|" + session.id + "|" + seq + "|" + hash + "|" + received_at
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
with `hash` taken from the entry (verify the chain first; receipts vouch for time, not content) and `session.id` stringified as in §4.1 (a missing id commits as `undefined`). Drop any JWK `alg` member before importing `attestations.key`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sealedrecord",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Verify a sealed session record: recompute the SHA-256 chain, check Ed25519 entry signatures and time receipts, and match audio files to their anchors. WebCrypto only, browser and Node.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/src/attest.js
CHANGED
|
@@ -10,7 +10,7 @@ import { importPublicJwk, verifyText } from "./crypto.js";
|
|
|
10
10
|
|
|
11
11
|
/* The signing side must byte-match this canonical form. */
|
|
12
12
|
export const receiptCanonical = ({ sessionId, seq, hash, receivedAt }) =>
|
|
13
|
-
`
|
|
13
|
+
`sealedrecord/receipt.v1|${sessionId}|${seq}|${hash}|${receivedAt}`;
|
|
14
14
|
|
|
15
15
|
export const verifyReceipts = async (pkg) => {
|
|
16
16
|
const entries = pkg.entries ?? [];
|
package/src/pkg.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/* v3: artifact commits gain the PCM secondary anchor, and entries commit
|
|
8
8
|
derivation links (derivedFrom) and the reserved signature-scheme field
|
|
9
9
|
(alg). v1 and v2 never shipped; no legacy records to honor. */
|
|
10
|
-
export const PKG_FORMAT = "
|
|
10
|
+
export const PKG_FORMAT = "sealedrecord/package.v3";
|
|
11
11
|
|
|
12
12
|
/* Free text for humans, never committed, never read by a verifier. */
|
|
13
13
|
export const DEFAULT_NOTE = "Sealed record: SHA-256 chain digests, Ed25519 entry signatures. Attestations (time receipts, timestamp proofs) are metadata about the chain, never part of it.";
|