provared 0.5.0 → 0.6.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.
@@ -87,7 +87,7 @@ method was used. Because it is part of the signed bytes, a signature made
87
87
  for one kind of record can never pass as another kind.
88
88
 
89
89
  In this draft the protected header, once decoded, MUST be **exactly** one
90
- of these twenty-two texts, byte for byte. A checker compares the bytes and does
90
+ of these twenty-six texts, byte for byte. A checker compares the bytes and does
91
91
  not interpret anything else.
92
92
 
93
93
  | Record | Method | Protected header |
@@ -114,6 +114,10 @@ not interpret anything else.
114
114
  | Withdrawal | ML-DSA-87 | `{"typ":"vnd.provared.withdrawal.v0+json","alg":"ML-DSA-87"}` |
115
115
  | Pass | Ed25519 | `{"typ":"vnd.provared.pass.v0+json","alg":"Ed25519"}` |
116
116
  | Pass | ML-DSA-87 | `{"typ":"vnd.provared.pass.v0+json","alg":"ML-DSA-87"}` |
117
+ | Denial | Ed25519 | `{"typ":"vnd.provared.denial.v0+json","alg":"Ed25519"}` |
118
+ | Denial | ML-DSA-87 | `{"typ":"vnd.provared.denial.v0+json","alg":"ML-DSA-87"}` |
119
+ | Witness statement | Ed25519 | `{"typ":"vnd.provared.witness.v0+json","alg":"Ed25519"}` |
120
+ | Witness statement | ML-DSA-87 | `{"typ":"vnd.provared.witness.v0+json","alg":"ML-DSA-87"}` |
117
121
 
118
122
  `typ` is the media type of the record (RFC 7515, section 4.1.9), used as
119
123
  explicit typing (RFC 8725, section 3.11). `alg` names the signing method
@@ -204,7 +208,25 @@ written in only one way. RFC 8032 does not say to refuse such keys, and
204
208
  libraries differ in whether they do; a checker refuses them itself
205
209
  (`bad-key`), so that two checkers cannot disagree. For the same reason,
206
210
  an Ed25519 signature whose first 32 bytes (the point R) are such a point,
207
- or hold a y not less than p, is invalid, whatever the key.
211
+ or hold a y not less than p, is invalid, whatever the key; and so is one
212
+ whose last 32 bytes, read as a little-endian number S, are not less than
213
+ L = 2^252 + 27742317777372353535851937790883648493, the order of the
214
+ base point. RFC 8032, section 5.1.7, requires the check of S; libraries
215
+ differ in whether they make it, so a checker makes it itself. A key of
216
+ mixed order (a point of large order with a small-order part) is not
217
+ refused, and a signature under it is checked with the equation
218
+ S·B = R + k·A, without the cofactor, k being the SHA-512 hash of R, A and
219
+ the message, read as a little-endian number and reduced modulo L before
220
+ the multiplication. The cases of the paper "Taming the many EdDSAs"
221
+ (Chalkias, Garillot, Kondi and Nikolaenko, 2020) are in the shared test
222
+ files (`test-vectors/ed25519-signatures.json`), each with the answer
223
+ these rules give.
224
+
225
+ An ES256 key MUST be a point on the curve P-256: each half a number less
226
+ than the prime of the curve, and the two satisfying the curve's equation.
227
+ A checker refuses any other (`bad-key`) before it tries any signature
228
+ under it: such a key can check no signature, and libraries report it in
229
+ different ways.
208
230
 
209
231
  A key is named for people by its **thumbprint**: the JSON Web Key
210
232
  Thumbprint with SHA-256 (RFC 7638; for ML-DSA keys, RFC 9964 section 6).
@@ -535,18 +557,24 @@ in place of the narrowed content), and is one of:
535
557
  - `{"refusal": refusal record}`
536
558
  - `{"terms": terms record}`
537
559
  - `{"seal": seal record}`, which MAY also hold `"stamps": list of 1 to 4
538
- time-stamps` (section 21)
560
+ time-stamps` (section 21) and `"witnesses": list of 1 to 4 witness
561
+ statements` (section 29)
539
562
  - `{"cancellation": cancellation record}`, which MAY also hold `"stamps"`
540
563
  (section 22)
541
564
  - `{"acknowledgement": acknowledgement record}` (section 26)
542
565
  - `{"vouching": vouching record}` and `{"withdrawal": withdrawal record}`
543
566
  (section 23)
544
567
  - `{"pass": pass record}` (section 25)
568
+ - `{"denial": denial record}` (section 28)
545
569
 
546
570
  A slip MUST come before the entries that rely on it, and a set of terms
547
571
  before the stubs that rely on it. A book MUST NOT hold
548
572
  the same slip twice, nor more than 100,000 entries. A line MUST NOT be
549
- longer than 131,072 bytes.
573
+ longer than 131,072 bytes. Those two limits together allow a book of
574
+ about 13 gigabytes, so a checker SHOULD bound the total size of a book it
575
+ accepts (`too-large`), and MAY stop at the first problem it finds. This
576
+ library takes a book as one text, so it can check no book larger than one
577
+ text the device can hold.
550
578
 
551
579
  ## 10. The tree and the top fingerprint
552
580
 
@@ -586,7 +614,7 @@ of RFC 6962, section 2.1.1).
586
614
  ```
587
615
 
588
616
  A Show MAY also hold `"seal"`: an entry of the form `{"seal": seal
589
- record}`, with or without `"stamps"`. The Show is then of the book as it
617
+ record}`, with or without `"stamps"` and `"witnesses"` (section 29). The Show is then of the book as it
590
618
  stood when that seal was made: the seal's `size` and `root` MUST equal the
591
619
  Show's (`seal-mismatch`), and a checker checks the seal and its
592
620
  time-stamps as section 21 sets out. Its `id` MUST NOT be that of a
@@ -625,6 +653,11 @@ block time-stamp where the whole book sets that time-stamp aside and
625
653
  passes. The last two need a block that states a time far behind the
626
654
  true time.
627
655
 
656
+ A checker does not use seals held elsewhere (section 21.5) with a Show,
657
+ and MUST say so where any are handed over: single pages cannot show what
658
+ the book holds at the place a seal states, nor that the book goes on to
659
+ it.
660
+
628
661
  Nothing fixes the time-stamps beside the seal that comes with a Show.
629
662
  They stand outside the tree and outside the seal's signatures, so
630
663
  whoever hands the Show over can put a later time-stamp in the place of
@@ -636,7 +669,7 @@ the seal's own date (section 21.1, rule 4).
636
669
 
637
670
  | Missing | What follows |
638
671
  |---|---|
639
- | A public place where seals are kept | The last seal of a book, with everything after it, can be removed unnoticed, unless someone else holds a copy of that seal or of its top fingerprint and number of entries |
672
+ | A public place where seals are kept, which gathers the seals of many books and proves it dropped none | The last seal of a book, with everything after it, can be removed unnoticed, unless someone else holds a copy of that seal, and hands it to the checker (section 21.5), or holds its top fingerprint and number of entries. A witness (section 29) holds the latest seal it signed for, and can be asked for it; nothing obliges a recorder to show its seals to a witness |
640
673
  | A quantum-safe time-stamp | Time-stamp services sign with methods of today's kind |
641
674
  | Covered fields outside a slip's names and purpose | Every other field of an entry is visible to whoever holds it |
642
675
  | A compact binary form | Records are JSON text only |
@@ -648,6 +681,9 @@ the seal's own date (section 21.1, rule 4).
648
681
  - A one-sided stub proves what the agent's side said, not what the other
649
682
  side did.
650
683
  - A refusal proves what the service's side said, not what the agent did.
684
+ - A denial proves what the agent's side said it did not do, and why. It
685
+ does not prove that the action was not taken some other way, and an
686
+ agent that writes no denial leaves no trace of the refusal.
651
687
  - A rule of conduct in a slip, such as "never claim to be a human being",
652
688
  is the person's signed instruction. No check can show that the agent
653
689
  kept it.
@@ -666,6 +702,11 @@ the seal's own date (section 21.1, rule 4).
666
702
  one call, not that the call did what either says. A matching
667
703
  fingerprint of a request, an answer, arguments or an error shows only
668
704
  that the content matches, not that it was the same call.
705
+ - A witness statement (section 29) shows that a witness saw a seal, by
706
+ the time it states, and undertook to sign for no seal of that book that
707
+ does not extend it. It does not show that the entries are true, when
708
+ the seal was made, or anything of a book, or the end of one, that was
709
+ never shown to the witness.
669
710
 
670
711
  ## 14. Standards used
671
712
 
@@ -682,9 +723,9 @@ the seal's own date (section 21.1, rule 4).
682
723
  | FIPS 186-5; RFC 7518; RFC 8017 | The signing methods passkeys use (ES256, RS256) |
683
724
  | RFC 4648, section 5 | Base64url |
684
725
  | RFC 3339 | Times |
685
- | RFC 6962, section 2.1; RFC 9162, section 2.1.3.2 | The tree and its proofs |
726
+ | RFC 6962, section 2.1; RFC 9162, sections 2.1.3.2 and 2.1.4 | The tree, the proof that one entry is in it, and the proof that one tree extends another (section 29.1) |
686
727
  | FIPS 205 | SLH-DSA-SHA2-256s, the third signature on a seal |
687
- | RFC 3161; RFC 5652; RFC 5280; ITU-T X.690 | Time-stamps: the statement, its signed wrapper, the certificate, and the byte layout (DER) |
728
+ | RFC 3161; RFC 5652; RFC 5035; RFC 5280; RFC 8419, section 3.1; ITU-T X.690 | Time-stamps: the statement, its signed wrapper, how it names the certificate that signed, the certificate, Ed25519 with SHA-512 in a time-stamp, and the byte layout (DER) |
688
729
  | The OpenTimestamps proof file, version 1 (an open format; not the work of a standards body) | Block time-stamps: the steps from a fingerprint to the Merkle root of a block |
689
730
  | RFC 9901 (Selective Disclosure for JSON Web Tokens) | Covered fields |
690
731
  | RFC 9421 (HTTP Message Signatures), section 2.5, only its way of writing a message as text; RFC 9530 (Digest Fields); RFC 9110, section 5.6.2 | The texts that the reserved document names `provared.http-request` and `provared.http-response` stand for (section 27). Nothing is signed with RFC 9421 |
@@ -751,6 +792,23 @@ is frozen.
751
792
  Content-Digest, and an absent body none; no header covered; SHA-256
752
793
  only; only the three identifiers may be named more than once; the
753
794
  form of a trace-id not checked.
795
+ 20. Seals held elsewhere, section 21.5: at most 64; compared with the
796
+ book by the seal's content, its signatures and time-stamps not;
797
+ counted only for a recorder the person named, and on a device
798
+ without SLH-DSA on its first two signatures; its time-stamps not used
799
+ for the entries of the book.
800
+ 21. The rules of section 3.8 that go beyond their standards: an Ed25519
801
+ key of small order, or written in more than one way, is refused as a
802
+ key, and a signature whose R is such a point is invalid under any key
803
+ (RFC 8032 leaves both to the implementation); an ES256 key that is
804
+ not a point on its curve is refused as a key. The check of S against
805
+ L restates RFC 8032, section 5.1.7, and is made by the checker
806
+ itself, whatever the library beneath it does.
807
+ 22. Where a time-stamp names the certificate that signed it in both
808
+ forms of RFC 5035 (section 21.2, item 3), the newer form names it
809
+ and the older is not compared with it. RFC 5035, section 7, lets a
810
+ reader refuse a time-stamp whose two forms disagree, and leaves the
811
+ choice to the reader.
754
812
 
755
813
  ## 16. The shared list: actions, kinds of action, rules of conduct
756
814
 
@@ -972,7 +1030,9 @@ record, with its approval and a countersignature, could be longer than a
972
1030
  line of a book may be (section 9) is not allowed either (`too-large`).
973
1031
 
974
1032
  This is a help to whoever runs the agent. It is not evidence: nothing in a
975
- record shows that the check was made.
1033
+ record shows that the check was made. Where the check refuses an action,
1034
+ the agent's side MAY write a denial (section 28): its own signed
1035
+ statement that the action was not taken, and why.
976
1036
 
977
1037
  ## 21. The Seal and the outside time-stamp
978
1038
 
@@ -991,7 +1051,8 @@ Content:
991
1051
  | `by` | The recorder | `{"keys": the recorder's three keys, "name": text}` |
992
1052
  | `size` | How many entries the book held | A whole number, 1 or more |
993
1053
  | `root` | The top fingerprint of those entries | A fingerprint (section 10) |
994
- | `previous` | The seal before this one in the book. Absent for the first | That seal's fingerprint |
1054
+ | `previous` | The seal before this one in the book. Absent for the first seal of the first book; for the first seal of a later book, the last seal of the book before (section 21.6) | That seal's fingerprint |
1055
+ | `book` | The book's number among the books its recorder keeps under one permission (section 21.6). Absent for the first book | A whole number, 2 or more |
995
1056
  | `when` | When it was made, as the recorder states | A time |
996
1057
 
997
1058
  It is signed with the three keys in `by`, with the seal labels of section
@@ -1006,7 +1067,11 @@ otherwise report a problem:
1006
1067
  2. `size` is the number of entries before the seal, and `root` is their
1007
1068
  top fingerprint (`seal-mismatch`).
1008
1069
  3. `previous` is the fingerprint of the seal before it in the book, and
1009
- is absent if there is none (`seal-chain-broken`).
1070
+ is absent if there is none (`seal-chain-broken`). The one exception is
1071
+ the first seal of a book that gives `book`: its `previous` names the
1072
+ last seal of the book before, which is not in this book, and is not
1073
+ compared (section 21.6). Every seal of a book gives the same `book`
1074
+ (`seal-chain-broken`).
1010
1075
  4. `when` is not earlier than the `when` of the seal before it
1011
1076
  (`time-went-backwards`). `when` is also not more than 300 seconds
1012
1077
  earlier than the latest time stated by an entry it covers that passed
@@ -1054,10 +1119,35 @@ signatures failed. For each time-stamp it MUST confirm all of these, and
1054
1119
  otherwise report a problem:
1055
1120
 
1056
1121
  1. It is laid out as RFC 3161 and RFC 5652 set out, in strict DER
1057
- (`stamp-bad-data`). Every part is read, including parts the checker
1058
- does not otherwise use: a whole number or an object identifier that is
1059
- not in its shortest form, a part that does not fill what holds it, or a
1060
- part the standards do not allow in that place, is refused. The signed
1122
+ (`stamp-bad-data`). Every part the checker can tell apart is read,
1123
+ including parts it does not otherwise use: a whole number or an object
1124
+ identifier that is not in its shortest form, a string of bits that
1125
+ counts more than seven unused bits or whose unused bits are not zero
1126
+ (X.690, section 11.2.1), a string of bits, bytes or characters, or a
1127
+ time, written in parts (the constructed form, which X.690, section
1128
+ 10.2, forbids in DER), a set whose items are not in the order of X.690,
1129
+ section 11.6 (their encodings compared as bytes, the shorter padded at
1130
+ its end with zeros; equal items may stand side by side), a part that
1131
+ does not fill what holds it, or a part the standards do not allow in
1132
+ that place, is refused. The order of a set is held only where a
1133
+ standard requires DER: the signed attributes, which RFC 5652, section
1134
+ 5.3, requires to be DER, and every set inside them; the statement
1135
+ (TSTInfo), which RFC 3161, section 2.4.2, requires to be DER, and
1136
+ every set inside it; and each certificate, which RFC 5280, section
1137
+ 4.1, requires to be DER, and every set inside it. The signed data's
1138
+ own sets (the list of fingerprint methods, the list of certificates,
1139
+ the list of withdrawn certificates and the list of signers), and the
1140
+ parts of a signer outside its signed attributes, may be in any order:
1141
+ CMS does not require DER of them, and services in use list their
1142
+ certificates in chain order, the signing certificate before its
1143
+ issuer. What a part holds as bytes (the value of an octet string, such
1144
+ as an extension's) is read as bytes only, so a string of bits inside
1145
+ one is not held to these rules; the statement, which sits in an octet
1146
+ string, is read in full as DER. A part under a tag that hides its kind
1147
+ (a context tag) that is written in parts has the parts inside it read
1148
+ like any other, but is itself neither refused as a string written in
1149
+ parts nor held to the order of a set, since its tag does not say which
1150
+ it is; written in one piece, its value is read as bytes only. The signed
1061
1151
  data is of version 3, with exactly one signer. The public key in the
1062
1152
  certificate that signed is written exactly as its own standard sets
1063
1153
  out, with no unused bits: RSA as RFC 3279, section 2.3.1 (the
@@ -1069,7 +1159,14 @@ otherwise report a problem:
1069
1159
  3. Its signed attributes name a time-stamp statement, hold the
1070
1160
  fingerprint of the statement, and name the certificate that signed, by
1071
1161
  the "signing certificate" attribute that RFC 3161, section 2.4.2,
1072
- requires (in the form of RFC 5035, or the older form of RFC 2634). The
1162
+ requires (in the form of RFC 5035, or the older form of RFC 2634). Each
1163
+ of the two forms appears at most once, as RFC 5035 requires (section 3
1164
+ for the newer form; section 5, which writes section 5.4.2 of RFC 2634,
1165
+ for the older): a time-stamp in which either form appears twice is
1166
+ refused (`stamp-invalid`). Where both forms appear once each, the
1167
+ newer form names the certificate and the older is not compared with it:
1168
+ a choice of this format (section 15, item 22), where RFC 5035, section
1169
+ 7, lets a reader refuse a time-stamp whose two forms disagree. The
1073
1170
  time-stamp carries that certificate, and the signature over the
1074
1171
  attributes fits its public key (`stamp-invalid`). A certificate with
1075
1172
  the same key and other contents is another certificate.
@@ -1079,8 +1176,15 @@ otherwise report a problem:
1079
1176
  The signing methods are RSA (PKCS #1 version 1.5; keys of 2,048 to
1080
1177
  8,192 bits, with an odd public number from 3 to 2^32 - 1: never 1,
1081
1178
  under which anyone can make a signature that checks), ECDSA on the
1082
- curves P-256 and P-384, and Ed25519 (not a key of small order, as
1083
- section 3.8 sets out). A key of any other kind, or on another curve,
1179
+ curves P-256 and P-384, and Ed25519 (not a key of small order, and
1180
+ not a signature whose S is not below L, as section 3.8 sets out; the
1181
+ signer MUST name SHA-512 as the fingerprint method, with no
1182
+ parameters, and MUST give the signing method no parameters, as RFC
1183
+ 8419, section 3.1, requires, so a time-stamp signed with Ed25519 that
1184
+ names SHA-256 or SHA-384, or gives either method parameters, is
1185
+ refused, `stamp-invalid`, in words that say so; the list of
1186
+ fingerprint methods in the signed data is read for its form only). A
1187
+ key of any other kind, or on another curve,
1084
1188
  is refused (`stamp-invalid`). The checker does not try to find out
1085
1189
  whether an RSA modulus can be factored: a service's key is the
1086
1190
  service's business, and a checker trusts a service only by the
@@ -1094,7 +1198,13 @@ otherwise report a problem:
1094
1198
  seconds after the time it states (`dated-after-stamp`). A block
1095
1199
  time-stamp that section 21.3 sets aside is the one exception.
1096
1200
 
1097
- The time a time-stamp states is taken to the second, rounded down.
1201
+ The time a time-stamp states is read to the millisecond: a fraction of a
1202
+ second, where it states one, is kept to three decimal places, rounded
1203
+ down, and the rest dropped. A checker shows the time to the second,
1204
+ rounded down, and compares it in milliseconds: with a record's `when`,
1205
+ which is whole seconds, and with the time of another time-stamp under
1206
+ section 21.3. So two time-stamps 300.5 seconds apart are more than 300
1207
+ seconds apart.
1098
1208
 
1099
1209
  **Whom to trust is the checker's choice.** The person checking gives the
1100
1210
  fingerprint (SHA-256, in base64url) of the certificate of each time-stamp
@@ -1150,7 +1260,8 @@ Show that comes with a seal (section 11).
1150
1260
 
1151
1261
  The earliest time that a counted time-stamp from a service gives a seal
1152
1262
  MUST NOT be more than 300 seconds earlier than the latest such time that
1153
- a service gave any seal before it (`time-went-backwards`). So the times
1263
+ a service gave any seal before it (`time-went-backwards`; both times in
1264
+ milliseconds, as section 21.2 sets out). So the times
1154
1265
  cannot step backwards a little at a time. A block time-stamp is never
1155
1266
  reported under this rule: it is made hours after its seal, and one that
1156
1267
  states an earlier time is set aside (the second case above).
@@ -1195,8 +1306,8 @@ entries after it are not time-stamped.
1195
1306
  What a seal and a time-stamp do not fix: the last seal of a book, with
1196
1307
  everything after it, can be removed, and what is left still checks. Only
1197
1308
  a copy of that seal, or of its top fingerprint and number of entries,
1198
- held by someone else shows it. And a time-stamp service signs with a
1199
- method of today's kind.
1309
+ held by someone else shows it (section 21.5). And a time-stamp service
1310
+ signs with a method of today's kind.
1200
1311
 
1201
1312
  ### 21.4 A block time-stamp
1202
1313
 
@@ -1320,6 +1431,258 @@ its fingerprint with sources they trust. A proof is complete only one to
1320
1431
  several hours after it is asked for, so it is an addition to a
1321
1432
  time-stamp from a service, not a replacement.
1322
1433
 
1434
+ ### 21.5 Seals held elsewhere
1435
+
1436
+ Whoever keeps a book can cut off its end, the last seal with it, and
1437
+ what is left still checks (section 21.3). A copy of a seal kept out of
1438
+ the recorder's reach shows it: by the person, an auditor, a second copy
1439
+ of the book, or any party the recorder handed the seal to.
1440
+
1441
+ A checker MAY be handed, beside a book, up to 64 seals held elsewhere,
1442
+ each as the entry it is in a book: `{"seal": seal record}`, with or
1443
+ without `"stamps"` and `"witnesses"` (sections 9 and 29.2). More than 64, or anything that is not a
1444
+ list, is refused (`bad-field`). An empty list is none. The same seal MUST
1445
+ NOT be handed over twice (`bad-field`).
1446
+
1447
+ Each seal handed over is checked as a seal in a book is: its three
1448
+ signatures (`signature-invalid`), its recorder against the recorders the
1449
+ person expects (`sealer-not-expected`, rule 5 of section 21.1), and its
1450
+ time-stamps as section 21.2 sets out. Its `size` and `root` are not
1451
+ worked out again here: the book's own seal at that place is (rule 2 of
1452
+ section 21.1). A seal handed over that does not pass its own check is a
1453
+ problem with the check as a whole: it is never set aside silently.
1454
+
1455
+ A seal handed over **counts** only where all of these hold:
1456
+
1457
+ 1. it passed its own check;
1458
+ 2. the person named the recorders they expect, and its recorder is one
1459
+ of them. Otherwise anyone could make a seal with keys of their own and
1460
+ have a sound book reported; a checker MUST say that it was not used;
1461
+ 3. the device checked its Ed25519 and ML-DSA-87 signatures. Where the
1462
+ device does not have SLH-DSA (the Python version, and browsers that
1463
+ have ML-DSA, such as Edge and Brave 155 when tested), the seal counts
1464
+ on those two, and a checker MUST say that its third signature was not
1465
+ checked. On a device without ML-DSA, or without Ed25519, it is not
1466
+ used. A seal held elsewhere can only show a problem with a book, never
1467
+ excuse one.
1468
+
1469
+ For a seal that counts, at entry n (its `size`), a checker MUST report a
1470
+ problem with the book:
1471
+
1472
+ - `book-cut-short`, where the book has n entries or fewer: it ends
1473
+ before the place where the seal stands, so its end was cut off after
1474
+ the seal was made;
1475
+ - `seal-not-in-book`, where the entry at n is not a seal with the same
1476
+ content: the same fingerprint (section 3.5), which fixes `size` and
1477
+ `root`, and so the entries before it. The book was changed after the
1478
+ seal was made, or the seal is of another book.
1479
+
1480
+ Nothing in a seal names its book. So a seal of another book by the same
1481
+ recorder (a book it kept before, when it started a new one) is reported
1482
+ as `seal-not-in-book` where it stands, or as `book-cut-short` where the
1483
+ other book was longer: hand over only seals of the book being checked.
1484
+ Where the seals give book numbers (section 21.6) and the book holds a
1485
+ seal, a seal handed over whose number is not the book's is not compared
1486
+ by its place: section 21.6 says what is done with it.
1487
+
1488
+ Where the book holds the seal at entry n, the checker MUST say so. Where
1489
+ that entry did not pass its own check, it MUST say that too. The same
1490
+ content with other signatures is the same seal: only someone who holds
1491
+ the recorder's keys can sign it again, and it fixes the same entries. It
1492
+ is not a fault of the book, and a checker MUST say that the signatures
1493
+ differ. (So a copy whose third signature was changed, on a device that
1494
+ cannot check that signature, agrees with the book; on a device that can,
1495
+ it does not pass its own check.) The time-stamps of the copy stand
1496
+ outside the seal's signatures (section 11), so they may differ from
1497
+ those beside the same seal in the book; a checker MUST say where they
1498
+ do. The copy's own time-stamps are shown,
1499
+ and are not used for the entries of the book: the time by which an entry
1500
+ existed (section 21.3) comes from the book alone.
1501
+
1502
+ A checker that is carried on (one that reads a book and then more lines)
1503
+ applies this to the book as it stands at each answer. What rests on a
1504
+ seal handed over alone (its signatures, its recorder, its time-stamps)
1505
+ it MAY check once and keep.
1506
+
1507
+ What this closes: the end of a book cut off after a seal that someone
1508
+ else holds, back to any place before that seal; and a second history of
1509
+ a book, shown to someone who holds a seal of the first, since the seal
1510
+ does not fit it. What it does not close: a book cut back after the
1511
+ latest seal anyone holds; a book, or the part of one, never shown to
1512
+ anyone who keeps a seal; and a recorder that hands its seals to nobody.
1513
+ Witnesses (section 29), which sign for each seal and keep the latest
1514
+ they signed for, narrow the last two: a seal a witness signed for is one
1515
+ anyone who names that witness can ask it for. Statements that witnesses
1516
+ signed for a seal MAY be handed over with it, as `{"seal": seal record,
1517
+ "witnesses": [...]}` (section 29.2).
1518
+
1519
+ ### 21.6 The books of one permission
1520
+
1521
+ A recorder may keep the record of one permission in several books, one
1522
+ after another: it seals a book, and starts a new one that begins with the
1523
+ same permission as its first line. A seal MAY say which book it is of, in
1524
+ `book`: 2 for the second book of that permission, 3 for the third, and so
1525
+ on. The first book carries no number, so every seal written before this
1526
+ member existed reads as the seal of a first book, exactly as before; `1`
1527
+ is not written (`bad-field`), so that there is one way to write each
1528
+ number. A seal that gives `book` MUST give `previous` (`bad-field`).
1529
+ A recorder numbers in one sequence all the books it keeps for one person
1530
+ and one agent, whichever of their permissions each book starts from, a
1531
+ renewal included: that is how a witness knows them (section 29.3).
1532
+
1533
+ The first seal of book n names, as `previous`, the last seal of book
1534
+ n − 1. A checker that holds only book n cannot see that seal: it MUST NOT
1535
+ report the `previous` of that first seal, MUST say that it was not
1536
+ compared, and keeps it. Every later seal of book n names the seal before
1537
+ it in book n, and gives the same `book` (rule 3 of section 21.1). Among
1538
+ the pages of a Show, seals that give different numbers cannot be of one
1539
+ book (`seal-chain-broken`).
1540
+
1541
+ Where a book holds a seal, its number is that of its first seal, and a
1542
+ seal held elsewhere (section 21.5) whose number is another is not
1543
+ compared with the book at all. It is not used, and a checker MUST NOT
1544
+ count it as compared: where any seal handed over was not compared, the
1545
+ check gives no pass, as where no recorder was named (section 21.5), even
1546
+ for an honest book: a reader who hands the seal of book n − 1 over
1547
+ beside book n gets no pass for book n, and should check book n − 1 with
1548
+ it instead. The
1549
+ number is the recorder's own word, so a book cut short could be sealed
1550
+ again under another number; the reader learns that the seal they hold
1551
+ was not compared, not that the book is whole. A checker MUST then say
1552
+ which of these the seal is:
1553
+
1554
+ - **the last seal of the book before**, which the first seal of this
1555
+ book names: where it is signed with the same key set as that first
1556
+ seal, and not dated after it, a checker says that this book follows on
1557
+ from it; where it is signed with another key set
1558
+ (`seal-chain-broken`), or dated after that first seal
1559
+ (`time-went-backwards`), it reports a problem;
1560
+ - **a seal of the book before that the first seal of this book does not
1561
+ name**: this book then does not show whether the book before was cut
1562
+ short, nor that this book follows on from it, and a checker MUST say so;
1563
+ - **a seal of the next book that names a seal of this book** as the seal
1564
+ before it: the next book follows on from this one there;
1565
+ - a seal of a later or an earlier book: this book does not show whether
1566
+ that book was cut short.
1567
+
1568
+ In every case it does not show whether the book of the seal held was
1569
+ cut short: check that book with it.
1570
+
1571
+ To compare book n − 1 with the seal that book n starts from, check book
1572
+ n − 1 with that seal handed over beside it: it must hold that seal at its
1573
+ place, as section 21.5 sets out.
1574
+
1575
+ What the numbers do not show: that a book is the whole of its number; a
1576
+ checker of one book cannot tell whether the seal the next book starts
1577
+ from is the last of this book, or a seal of the next book handed over is
1578
+ its first. Nor does a checker count a limit across books: it counts within the
1579
+ book it checks.
1580
+
1581
+ ### 21.7 A seal made by a sealer that sees only fingerprints
1582
+
1583
+ The recorder's keys need not sit beside the agent. A seal MAY be signed
1584
+ by a **central sealer**: a party that holds the recorder's keys and is
1585
+ sent, for each line of the book, only its leaf fingerprint (the SHA-256
1586
+ of the byte 0x00 and the line, without its line feed, as section 10
1587
+ sets out), never the line. From these it builds the same tree as a
1588
+ checker builds from the lines, and signs a seal over its own number of
1589
+ entries and its own top fingerprint. Nothing in any record changes: such
1590
+ a seal is the same record, byte for byte in its content, as one signed
1591
+ over the book itself, and it is checked exactly as section 21.1 sets
1592
+ out. A sealer sent a wrong fingerprint signs a seal the book does not
1593
+ pass (`seal-mismatch`).
1594
+
1595
+ A sealer SHOULD sign only over a tree it built itself from the
1596
+ fingerprints it was sent, never over a number of entries and a top
1597
+ fingerprint handed to it; SHOULD take each line's fingerprint once, at
1598
+ its place, so that no line it has sealed can be replaced; SHOULD name,
1599
+ as `previous`, the latest seal it signed of that book (for the first
1600
+ seal of a later book, the last seal of the book before, section 21.6);
1601
+ SHOULD treat every book that starts with the same first line as one
1602
+ chain, so that a book whose first line it already holds starts only as
1603
+ the next book after the latest book with that first line, following it;
1604
+ SHOULD, where it serves several recorders with one key set, keep one
1605
+ record of every book for all of them, each book, and every book after
1606
+ it, belonging to the recorder that started it; SHOULD, where it serves
1607
+ recorders that do not trust each other, start a book only from its
1608
+ first line itself, a permission (section 4) for an agent that the
1609
+ recorder was named for, each agent named for one recorder only, so that
1610
+ no recorder can start a book whose first line is a permission for
1611
+ another recorder's agent; SHOULD limit the books each recorder may hold;
1612
+ SHOULD keep, of a seal entry it is handed, only what it checks, the
1613
+ seal, and what is bounded, its time-stamps, read for their form only
1614
+ (sections 21.2 and 21.4: how many, how long, in base64url, none
1615
+ twice; a sealer that checks no time-stamp's signature vouches for
1616
+ none), and
1617
+ refuse an entry
1618
+ longer than a line of a book may be, so that no recorder can make its
1619
+ record too large to keep; and MUST keep what it has signed safely
1620
+ before it gives a seal out.
1621
+
1622
+ What such a sealer shows, and what it does not. With its record kept, it
1623
+ never signs two different histories of one first line: each line is
1624
+ taken once at its place, and the books of one first line follow one
1625
+ another. Where it starts books only from permissions for each
1626
+ recorder's own agents, one recorder cannot have a book sealed whose
1627
+ first line is a permission for another recorder's agent (a renewal that
1628
+ stands in that recorder's book, say), and so cannot hold that
1629
+ permission back from the recorder whose book it is; nor, with its
1630
+ record begun again, bring another recorder's book in first. It sees
1631
+ only fingerprints after the first line, so it cannot tell that a book
1632
+ which starts from another first line (another permission for the same
1633
+ agent, or, where it does not read first lines, any record the agent's
1634
+ side can sign) repeats lines of a book it has sealed; nor that a later
1635
+ book repeats lines of the book before (section 21.6).
1636
+
1637
+ In particular, a recorder, through its own calls alone, can start a book from a permission for one of its own agents and copy into
1638
+ it permissions and stubs of another recorder's agent, leaving out any
1639
+ it chooses, and the sealer seals it. Where one person's passkey signed
1640
+ the permissions for agents of both recorders, a reader who names that
1641
+ passkey and the sealer's key set finds that book intact and within its
1642
+ slips, and nothing reports the copy. A seal of the other recorder's own
1643
+ book held elsewhere (section 21.5), handed to the checker with the
1644
+ copied book, shows a problem with it (`book-cut-short` or
1645
+ `seal-not-in-book`); where the two books' numbers differ, it cannot be
1646
+ compared (sections 21.5 and 21.6), and a checker says so and gives no
1647
+ pass. A
1648
+ witness statement on such a seal is never
1649
+ counted, because the seal covers a permission for another agent than
1650
+ the first line's (section 29.2, "When a statement counts"), so the seal does not read as
1651
+ witnessed; but nothing reports why. Readers of books from a sealer that
1652
+ serves recorders which do not trust each other SHOULD hold each
1653
+ recorder's own seals elsewhere and hand them to the checker; an
1654
+ organisation MAY instead run a sealer, with a key set of its own, for
1655
+ each recorder.
1656
+
1657
+ A sealer that loses its record, or is put back to an older copy, can be
1658
+ made to sign a second history of a book, as a witness can (section
1659
+ 29.3), and two records kept with one key set are two sealers. Witnesses
1660
+ (section 29) are the outside check for these: a witness knows a
1661
+ sequence by the recorder's keys, the person's passkey and the agent, so
1662
+ a second history shown to it would need it to sign for it too, and a
1663
+ book that does not start from a permission of the passkey the reader
1664
+ named is never read as witnessed. A checker cannot tell whether a seal
1665
+ was made by a central sealer or beside the agent: who holds the
1666
+ recorder's keys is not in the record.
1667
+
1668
+ The library's `openSealer` is such a sealer. Its record keeps, for each
1669
+ book, the first line's leaf fingerprint, the book's number, the recorder
1670
+ it belongs to, the book it follows, whether a later book follows it, and
1671
+ its latest seal with the tree at that seal; a book with no seal yet is
1672
+ kept at its first line. Lines that no seal covers are not kept: a sealer
1673
+ opened again asks for them again. A recorder may be named with the
1674
+ fingerprints of the key sets of its agents (section 21.1 gives the
1675
+ form), and with the most books it may hold; where any recorder is named
1676
+ with agents, every book is started with its first line itself, which
1677
+ the sealer reads as a permission and does not check further (the
1678
+ passkey's signature is the book's own check), and the sealer so learns
1679
+ that permission. A book that holds no seal can be released: nothing was
1680
+ signed for it. It keeps at most 1,000 books, and its record is written
1681
+ whole at each change that must last, so its size grows with the number
1682
+ of books (about 52 KB for each sealed book, most of it the latest
1683
+ seal's three signatures).
1684
+
1685
+
1323
1686
  ## 22. Cancelling a slip
1324
1687
 
1325
1688
  The person who signed a slip can end it early, with the same passkey.
@@ -1840,6 +2203,307 @@ with the body `{"hello": "world"}` is written as these four lines:
1840
2203
  one no longer passes its check. A checker that does not know this
1841
2204
  section reads a reserved name as a label.
1842
2205
 
2206
+ ## 28. The denial
2207
+
2208
+ A record shows what the agent did, not how often it was stopped. A
2209
+ denial closes part of that gap from the agent's own side: the agent's
2210
+ software states that it did not take an action that was asked for, and
2211
+ who said no. It is the agent's side's own word, like a one-sided stub.
2212
+
2213
+ Content:
2214
+
2215
+ | Member | Meaning | Form |
2216
+ |---|---|---|
2217
+ | `type` | The kind of content | `provared.denial.v0` |
2218
+ | `id` | A unique number | Section 3.7 |
2219
+ | `slip` | The slip the agent acts under | A fingerprint |
2220
+ | `pass` | Optional. For a helper agent: the pass it acts under | A fingerprint |
2221
+ | `action` | What was asked for | Text in the form of an action name. As in a refusal (section 18), a name that begins `provared.` need not be on the shared list here: what was asked for is written down as it was asked |
2222
+ | `amount` | Optional | As in a stub (section 5.1) |
2223
+ | `with` | Optional. The service asked for, as asked | The form of a service's `id`; it need not be one the slip names |
2224
+ | `details` | Optional. Documents, by their fingerprints only | As in a stub, with the reserved names of section 27 |
2225
+ | `source` | Who said no | `check`, `person` or `rule`, as below |
2226
+ | `codes` | Why, where `source` is `check`; absent otherwise | A list of 1 to 16 finding codes from the list below, none repeated |
2227
+ | `when` | When the action was refused, as the agent's side states it | A time |
2228
+
2229
+ | Source | Meaning |
2230
+ |---|---|
2231
+ | `check` | The check before acting (section 20) did not allow the action. |
2232
+ | `person` | The person refused, or gave no approval when asked. |
2233
+ | `rule` | A rule of the software around the agent, outside the slip. |
2234
+
2235
+ The format's own list of finding codes, from which `codes` is drawn, is
2236
+ every code a checker or the check before acting gives: `not-json`, `bad-envelope`, `bad-base64url`, `too-large`, `unknown-type`, `bad-signatures-layout`, `payload-not-canonical`, `payload-type-mismatch`, `bad-field`, `bad-key`, `signature-invalid`, `passkey-wrong-type`, `passkey-challenge-mismatch`, `passkey-origin-mismatch`, `passkey-rpid-mismatch`, `passkey-user-not-present`, `passkey-user-not-verified`, `passkey-bad-data`, `issuer-not-expected`, `slip-missing`, `slip-unusable`, `chain-broken`, `time-went-backwards`, `duplicate-id`, `duplicate-slip`, `countersignature-invalid`, `countersignature-wrong-stub`, `countersignature-not-possible`, `line-not-canonical`, `unknown-entry`, `approval-mismatch`, `approval-reused`, `approval-invalid`, `approval-not-found`, `approval-dated-after-stub`, `terms-not-found`, `terms-unusable`, `terms-mismatch`, `pass-missing`, `pass-mismatch`, `pass-too-deep`, `cover-invalid`, `cancellation-invalid`, `cancellation-not-found`, `acknowledgement-mismatch`, `vouching-missing`, `seal-mismatch`, `seal-chain-broken`, `sealer-not-expected`, `book-cut-short`, `seal-not-in-book`, `witness-invalid`, `dated-after-stamp`, `stamp-bad-data`, `stamp-wrong-data`, `stamp-invalid`, `headers-invalid`, `record-not-sound`, `proof-invalid`, `root-mismatch`, `check-failed`, `action-not-allowed`, `party-not-allowed`, `outside-valid-time`, `amount-missing`, `over-limit`, `over-each-limit`, `over-count-limit`, `over-period-limit`, `countersignature-missing`, `approval-missing`, `prohibited`, `pass-not-allowed`, `pass-wider`, `after-cancellation`, `outside-terms`.
2237
+ A code not on this list MUST be refused (`bad-field`), as MUST `codes`
2238
+ where `source` is not `check`, and its absence where it is.
2239
+
2240
+ It is signed as a stub is (section 5.2), with the denial labels of
2241
+ section 3.2: with the two keys of the agent the slip names or, where it
2242
+ holds `pass`, with the `to.keys` of that pass (`signature-invalid`),
2243
+ exactly as an acknowledgement is (section 26). It speaks for one agent.
2244
+
2245
+ **In a book.** The slip MUST be earlier in the book (`slip-missing`),
2246
+ and so MUST the pass, under the same slip (`pass-missing`,
2247
+ `pass-mismatch`); among the pages of a Show, both MUST be among the
2248
+ pages. A denial is in no chain (section 7): it changes no stub's `seq`
2249
+ or `previous`, and adds to no running total, count or period. It is
2250
+ compared with nothing: no rule ties its `when` to the slip's time or to
2251
+ any stub, and a checker does not judge whether the refusal was right.
2252
+
2253
+ **What a checker says about it.** A checker MUST show a denial as the
2254
+ agent's side's own statement that it did not take the action, with who
2255
+ said no and the codes it gives, and MUST count it (`denials` among the
2256
+ counts). It MUST NOT count a denial against the agent, nor take it as
2257
+ evidence that the action was not taken in some other way. A denial
2258
+ whose signatures this device could not check, or under a slip it could
2259
+ not confirm, is not shown as fact.
2260
+
2261
+ **How it differs from a refusal.** A refusal (section 18) is signed by
2262
+ the service and is the other side's word; a denial is signed by the
2263
+ agent's own keys and is the agent's side's word. A book may hold both
2264
+ for one attempt: the agent's side asked, the service refused, and the
2265
+ agent's software then wrote a denial with `source` `rule`. A checker
2266
+ shows both and links neither.
2267
+
2268
+ **Whoever writes denials** SHOULD write one only for an action that was
2269
+ not taken, and never both a stub and a denial for one request. A
2270
+ denial names what was asked for: its action, its amount and its service
2271
+ are in clear, and its documents are fingerprints only; arguments and
2272
+ the contents of documents MUST NOT be written into it. A writer SHOULD
2273
+ keep to a set number of denials in any hour of its own clock, counting
2274
+ each it writes at the time it writes it, so that an agent that asks
2275
+ again and again cannot fill its book (section 9) quickly, and SHOULD say
2276
+ how many it did not write. At 600 an hour, a book's 100,000 entries
2277
+ still fill in about a week.
2278
+
2279
+ What a denial does not show: that the action was not taken some other
2280
+ way; that the agent was asked at all, beyond its own word; or how often
2281
+ an agent was stopped, where it wrote no denial. Nothing obliges an
2282
+ agent's side to write one: a book with no denial shows nothing about
2283
+ refusals. A checker that does not know this section refuses a book that
2284
+ holds a denial (`unknown-entry`).
2285
+
2286
+ ## 29. Witnesses
2287
+
2288
+ A seal fixes everything before it (section 21), but whoever keeps a book
2289
+ can show different histories to different readers, each sealed, since a
2290
+ reader who holds one copy cannot see another (a "split view"). A
2291
+ **witness** is a party, with a key set of its own, that keeps, for each
2292
+ recorder, person and agent, the latest seal it has signed for, and signs
2293
+ a statement for a new seal only where the new seal extends that one: in
2294
+ the same book, or as the first seal of the next book (section 21.6). A
2295
+ person and an agent are those the permission on a book's first line
2296
+ names: its passkey and the agent's key set.
2297
+
2298
+ What a witness can then show is narrow, and is said exactly here: to a
2299
+ reader who fixed the start of a book (the permission it starts from,
2300
+ signed by a passkey the reader named) and its recorder (a key set the
2301
+ reader named), a second history sealed by that same recorder and
2302
+ starting from any permission that passkey gave that agent, renewals
2303
+ included, would need the witness to sign for it too. It shows nothing
2304
+ about a history that is sealed with other keys, or that starts from a
2305
+ permission for another agent.
2306
+
2307
+ ### 29.1 Consistency proofs
2308
+
2309
+ The tree of section 10 is the tree of RFC 9162, section 2.1. The proof
2310
+ that the tree of the first m entries of a book is the first part of the
2311
+ tree of its first n entries (a **consistency proof**) is made as RFC
2312
+ 9162, section 2.1.4.1, sets out, and checked with the steps of section
2313
+ 2.1.4.2. Each value of a proof is 32 bytes.
2314
+
2315
+ RFC 9162 defines a proof for 0 < m < n. Where m is larger than n, the
2316
+ proof does not check. Where m equals n, the proof is empty and the two
2317
+ top fingerprints MUST be the same. Where m is 0 (no seal is), the proof
2318
+ is empty and the earlier top fingerprint MUST be that of the empty tree,
2319
+ the SHA-256 hash of nothing. Anything that is not a proof of the two
2320
+ sizes it is checked for, including an empty proof for 0 < m < n, does
2321
+ not check.
2322
+
2323
+ ### 29.2 The witness statement
2324
+
2325
+ Content:
2326
+
2327
+ | Member | Meaning | Form |
2328
+ |---|---|---|
2329
+ | `type` | The kind of content | `provared.witness.v0` |
2330
+ | `id` | A unique number | Section 3.7 |
2331
+ | `seal` | The seal it speaks of | That seal's fingerprint (section 3.5) |
2332
+ | `size`, `root` | Repeated from the seal, so that the statement stands alone | As in the seal (section 21.1) |
2333
+ | `by` | The witness | `{"keys": the witness's two keys, "name": text}`; the name is a label |
2334
+ | `when` | When the witness signed, as the witness states | A time |
2335
+
2336
+ It is signed with the two keys in `by`, with the witness labels of
2337
+ section 3.2. It means: "I saw this seal by this time; for the recorder
2338
+ that signed it, and the person and agent of the permission its book
2339
+ starts from, it extends every earlier seal I signed for; I will sign for
2340
+ no seal of that recorder, person and agent that does not extend it."
2341
+
2342
+ **Beside a seal.** An entry that holds a seal MAY hold, in `witnesses`,
2343
+ 1 to 4 statements, beside `stamps` (section 9). A line of a book is a
2344
+ leaf of its tree, so the statements on it are those the line held when
2345
+ it was written. Statements that came later MAY be handed to a checker
2346
+ with a copy of the seal, as a seal held elsewhere (section 21.5):
2347
+ `{"seal": seal record, "stamps": [...], "witnesses": [...]}`. A seal is
2348
+ about 52,000 bytes and a statement about 12,000, so a seal with four
2349
+ statements and four of the largest time-stamps would pass the longest a
2350
+ line may be (section 9): whoever writes such a line keeps fewer on it,
2351
+ and hands the others over beside the book.
2352
+
2353
+ A checker MUST confirm, for each statement, and otherwise report a
2354
+ problem:
2355
+
2356
+ 1. the list holds 1 to 4 statements (`bad-field`);
2357
+ 2. its envelope and content, as for any record (section 3);
2358
+ 3. both its signatures check against `by.keys` (`witness-invalid`);
2359
+ 4. its `seal`, `size` and `root` are the fingerprint, `size` and `root`
2360
+ of the seal it stands beside (`witness-invalid`);
2361
+ 5. its `when` is not more than 300 seconds earlier than the seal's own
2362
+ `when` (`witness-invalid`): a witness cannot have seen a seal before
2363
+ it was made;
2364
+ 6. no two statements beside one seal are signed with the same key set
2365
+ (`bad-field`);
2366
+ 7. on a line of a book, its `id` is that of no other record in the book
2367
+ (`duplicate-id`), as for every record (section 7).
2368
+
2369
+ A statement on a seal's line that does not pass is a problem with that
2370
+ entry. A statement handed over with a seal held elsewhere that does not
2371
+ pass is a problem with the check as a whole, and is not used; the seal
2372
+ is used all the same, as an acknowledgement is (section 26).
2373
+
2374
+ **When a statement counts.** A witness knows which books are one
2375
+ sequence only by the passkey and the agent of the permission on their
2376
+ first line and the keys of their recorder (section 29.3), and the
2377
+ recorder chooses both the first line and its keys. So a
2378
+ statement counts only where the reader fixed both. All of these must
2379
+ hold:
2380
+
2381
+ 1. it passed its check, and both its signatures were checked on this
2382
+ device;
2383
+ 2. the person checking named its witness among the witnesses they
2384
+ trust, by the fingerprint of its key set (section 21.1); a statement
2385
+ from any other witness is shown, with that fingerprint, and not
2386
+ counted;
2387
+ 3. the person named the passkeys they trust, and the book's first line
2388
+ (for a Show: its page 0) is a permission that passed its check,
2389
+ signed by one of them;
2390
+ 4. the person named the recorders they expect, so that a seal by any
2391
+ other recorder is a problem (rule 5 of section 21.1);
2392
+ 5. every permission among the entries the seal covers names the same
2393
+ passkey key and the same agent's key set as the permission on the
2394
+ first line. A witness keeps the books of each person and agent apart
2395
+ (section 29.3), so a book that starts with a permission for one agent
2396
+ and holds a permission for another, or from another passkey, further
2397
+ on could be the first book of a sequence the witness never saw, and so
2398
+ a fork of the other's. A renewal by the same person for the same agent
2399
+ meets this rule. Among the pages of a Show, the pages MUST hold every
2400
+ entry the seal covers: single pages cannot show that no other
2401
+ permission stands between them, and a Show never counts a statement
2402
+ that the whole book would not;
2403
+ 6. the seal it stands beside passed its own check, and its Ed25519 and
2404
+ ML-DSA-87 signatures were checked on this device. As for a seal held
2405
+ elsewhere (section 21.5), its third signature (SLH-DSA) may be one
2406
+ the device cannot check: the statement speaks of the seal's content,
2407
+ which its fingerprint fixes;
2408
+ 7. for a statement handed over with a seal held elsewhere: that seal
2409
+ counts (section 21.5), and the book holds the same seal at its place;
2410
+ the statement then counts for the book's seal there.
2411
+
2412
+ Where a statement from a witness the person trusts is not counted
2413
+ because of rule 3, 4 or 5, a checker MUST say why. A witness cannot
2414
+ apply rule 5 itself: it sees a book's first line, not its entries. A checker MUST say,
2415
+ for the book, the latest seal for which a statement counts, the entries
2416
+ it covers, the witnesses whose statements count for it, and every seal
2417
+ for which one counts; and where none does, that none does. Where a
2418
+ problem was found, nothing is said to be witnessed.
2419
+
2420
+ **What being witnessed changes in the answer: nothing else.** It never
2421
+ excuses a fault, never makes a record pass that does not, and is not
2422
+ needed for a pass. It gives no time: a statement's `when` is the
2423
+ witness's own word, and is not used as a time-stamp (section 21.2). A
2424
+ statement that does not pass is a problem like any other.
2425
+
2426
+ ### 29.3 What a witness SHOULD check before it signs
2427
+
2428
+ A checker cannot test how a witness behaved: a person names a witness
2429
+ they trust to do the following.
2430
+
2431
+ 1. **Know a sequence of books** by the fingerprint of the recorder's key
2432
+ set (section 21.1) with the thumbprint of the passkey key (RFC 7638)
2433
+ and the fingerprint of the agent's key set that the permission on the
2434
+ book's first line names. So every permission one person gives one
2435
+ agent, under one recorder, is one sequence, renewals included: a book
2436
+ that starts with a later permission must follow on from the seal the
2437
+ witness holds, as any new book. This is written into no record. A book
2438
+ whose first line is not a permission (an entry that holds only a slip)
2439
+ is not one a witness keeps. One recorder key set therefore keeps one
2440
+ sequence for each person and agent: books kept side by side for one
2441
+ agent need recorder keys of their own, and are then other sequences.
2442
+ 2. **Check the seal** as a seal that stands alone: its envelope, its
2443
+ content and all three of its signatures. A witness on a device that
2444
+ cannot check one of the three signs nothing.
2445
+ 3. Where it holds no seal of that sequence: confirm that the audit path
2446
+ of the book's first line, at place 0, leads to the new seal's top
2447
+ fingerprint (RFC 9162, section 2.1.3.2), so that the first line it was
2448
+ given is the book's.
2449
+ 4. Where it holds a seal of that sequence, of book k (section 21.6):
2450
+ - a seal of book k: confirm that it covers more entries; that its
2451
+ `previous` names the seal it holds (a seal it was not shown is shown
2452
+ to it first, in order); and that a consistency proof (section 29.1)
2453
+ from the size and top fingerprint of the seal it holds to those of
2454
+ the new seal checks;
2455
+ - a seal of book k + 1: confirm that its `previous` names the seal it
2456
+ holds, and that the audit path of the book's first line leads to its
2457
+ top fingerprint, as in item 3. From then on, book k is closed to it;
2458
+ - a seal of an earlier book than k, or of a book after k + 1: refuse
2459
+ it;
2460
+ - in every case, that its `when` is not earlier than that of the seal
2461
+ it holds.
2462
+ 5. **Never sign two different seals of one book at one size**, nor a
2463
+ seal that does not extend the one it holds. Shown the seal it holds
2464
+ again, give the same statement again.
2465
+ 6. Refuse a seal dated more than 300 seconds after its own clock, and
2466
+ date its statement by its own clock.
2467
+ 7. **Keep, before it gives a statement out, that it now holds the new
2468
+ seal.** A witness that loses what it holds, or is put back to an
2469
+ older copy of it, can be made to sign a fork. Opened again from what
2470
+ it kept, it SHOULD sign nothing new until it has been brought up to
2471
+ date from a copy, kept apart, of the statements it gave out.
2472
+
2473
+ ### 29.4 What a witness shows, and what it does not
2474
+
2475
+ For a book whose first line is a permission signed by a passkey the
2476
+ reader named, sealed by a recorder the reader named, whose every
2477
+ permission before the seal is from that passkey for the same agent: the
2478
+ witness saw the
2479
+ seal, and so the entries before it by their top fingerprint, by the time
2480
+ it states; and a second history of those entries, sealed by the same
2481
+ recorder and starting from any permission that passkey gave the same
2482
+ agent, shown to someone else, needs that witness to sign for it too,
2483
+ which a witness that keeps section 29.3 does not. That holds across the
2484
+ books of that person and agent: a new book cannot start from an earlier
2485
+ seal than the latest the witness holds. Two witnesses need two to fail. With the latest seal a witness
2486
+ holds, handed over beside the book it is of (section 21.5), the end of
2487
+ that book cannot be cut off back to before that seal unnoticed.
2488
+
2489
+ It does not show:
2490
+
2491
+ - anything about a history sealed with another key set, even one the
2492
+ reader also named (a reader who names two recorders should know that a
2493
+ fork sealed with the second reads as witnessed), or one that starts
2494
+ from a permission for another agent: to a witness, each is another
2495
+ sequence;
2496
+ - that a later book does not repeat or leave out what an earlier book
2497
+ holds: each book is checked on its own;
2498
+ - anything that was never shown to it: a book, or the end of a book
2499
+ after the latest seal it signed for. Nothing obliges a recorder to
2500
+ show its seals to a witness;
2501
+ - that the entries are true: a witness sees fingerprints, not entries;
2502
+ - when the seal was made: its `when` is its own word;
2503
+ - that what a witness keeps was not changed. Whoever can change it can
2504
+ make a witness forget a sequence, and it then signs again for that
2505
+ sequence from any seal.
2506
+
1843
2507
  ---
1844
2508
 
1845
2509
  Copyright 2026 Pavel Izmaylov. This document is licensed under the