Skip to content

Commit 82b0b79

Browse files
authored
Merge pull request #71 from SmithSamuelM/revised-format
Change terminator character of V2.XX version string to be unique rela…
2 parents ffebbe7 + 6d99221 commit 82b0b79

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

spec/spec.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,12 +1209,12 @@ Non-CESR serializations, namely, JSON, CBOR, and MGPK when interleaved in a CESR
12091209

12101210
The Version String, `v` field shall be the first field in any top-level field map of any interleaved JSON, CBOR, or MGPK serialization. It provides a regular expression target for determining a serialized field map's serialization format and size (character count) of its enclosing field map. A Stream parser may use the Version String to extract and deserialize (deterministically) any serialized Stream field maps. Each field map in a Stream may use a different serialization type from the JSON, CBOR, or MGPK set.
12111211

1212-
The format of the Version String is `PPPPVVVKKKKBBBB_`. It is 16 characters in length and is divided into five parts:
1212+
The format of the Version String is `PPPPVVVKKKKBBBB.`. It is 16 characters in length and is divided into five parts:
12131213
* Protocol: `PPPP` four character version string (for example, `KERI` or `ACDC`)
12141214
* Version: `VVV` three character major minor version (described below)
12151215
* Serialization kind: `KKKK` four character string of the types (`JSON`, `CBOR`, `MGPK`, `CESR`)
12161216
* Serialization length: `BBBB` integer encoded in Base64
1217-
* terminator character `_`
1217+
* version 2.XX terminator character `.`
12181218

12191219
The first four characters, `PPPP` indicate the protocol. Each genus of a given CESR code table set may support multiple protocols.
12201220

@@ -1224,7 +1224,7 @@ The next four characters, `KKKK` indicate the serialization kind in uppercase. T
12241224

12251225
The next four characters, `BBBB`, provide in Base64 notation the total length of the serialization, inclusive of the Version String and any prefixed characters or bytes. This length is the total number of characters in the serialization of the field map. The maximum length of a given field map serialization is thereby constrained to be 64<sup>4</sup> = 2<sup>24</sup> = 16,777,216 characters in length. This is deemed generous enough for the vast majority of anticipated applications. For serializations that may exceed this size, a secure hash chain of Messages may be employed where the value of a field in one Message is the cryptographic digest, SAID of the following Message. The total size of the chain of Messages may, therefore, be some multiple of 2<sup>24</sup>.
12261226

1227-
The final character `_` is the Version String terminator. This enables later Versions of a protocol to change the total Version String size and thereby enable versioned changes to the composition of the fields in the Version String while preserving deterministic regular expression extractability of the Version String.
1227+
The final character `.` is the Version String terminator. This enables later Versions of a protocol to change the total Version String size and thereby enable versioned changes to the composition of the fields in the Version String while preserving deterministic regular expression extractability of the Version String.
12281228

12291229
Although a given field map serialization kind may have characters or bytes such as field map delimiters or Framing Codes that appear before, i.e., prefix the Version String field in a serialization, the set of possible prefixes for each of the supported serialization kinds is sufficiently constrained by the allowed serialization protocols to guarantee that a regular expression can determine unambiguously the start of any ordered field map serialization that includes the Version String as the first field value. Given the length of the serialization provided by the Version String, a parser may then determine the end of the serialization to extract the full field map serialization from the Stream without first deserializing it. This enables performant Stream parsing and off-loading of Streams that include any or all of the supported serialization types.
12301230

@@ -1237,7 +1237,7 @@ The format of the Version String for version 1.XX is `PPPPvvKKKKllllll_`. It is
12371237
* Version: `vv` twocharacter major minor version (described below)
12381238
* Serialization kind: `KKKK` four character string of the types (`JSON`, `CBOR`, `MGPK`, `CESR`)
12391239
* Serialization length: `llllll` integer encoded in lowercase hexidecimal (Base 16) format
1240-
* terminator character `_`
1240+
* legacy version terminator character `_`
12411241

12421242
The first four characters, `PPPP` indicate the protocol.
12431243

@@ -1568,7 +1568,7 @@ Signatures on SAD content require signing the serialized encoding format of the
15681568

15691569
```json
15701570
{
1571-
"v": "KERI10JSON00011c_"
1571+
"v": "KERICAAJSONAAQB."
15721572
}
15731573
```
15741574

@@ -1592,7 +1592,7 @@ The SAD Path Signature Group provides a four-character Count Code, `-J##`, for a
15921592

15931593
```json
15941594
{
1595-
"v": "KERI10JSON00011c_",
1595+
"v": "KERICAAJSONAAQB.",
15961596
"t": "exn",
15971597
"dt": "2020-08-22T17:50:12.988921+00:00",
15981598
"r": "/credential/offer",
@@ -1678,7 +1678,7 @@ The root path is the single `-` character meaning that all subsequent SAD Paths
16781678

16791679
```json
16801680
{
1681-
"v": "ACDC10JSON00011c_",
1681+
"v": "ACDCCAAJSONAAQB.",
16821682
"d": "EBdXt3gIXOf2BBWNHdSXCJnFJL5OuQPyM5K0neuniccM",
16831683
"i": "EmkPreYpZfFk66jpf3uFv7vklXKhzBrAqjsKAn2EDIPM",
16841684
"s": "E46jrVPTzlSkUPqGGeIZ8a8FWS7a6s4reAXRZOkogZ2A",
@@ -1702,7 +1702,7 @@ To support nesting of signed SAD content in other SAD content, the root path of
17021702

17031703
```json
17041704
{
1705-
"v": "KERI10JSON00011c_",
1705+
"v": "KERICAAJSONAAQB.",
17061706
"t": "exn",
17071707
"dt": "2020-08-22T17:50:12.988921+00:00",
17081708
"r": "/credential/offer",
@@ -1749,7 +1749,7 @@ When signing nested SAD content, the serialization used at the time of signing i
17491749

17501750
```json
17511751
{
1752-
"v": "ACDC10JSON00011c_",
1752+
"v": "ACDCCAAJSONAAQB.",
17531753
"d": "EBdXt3gIXOf2BBWNHdSXCJnFJL5OuQPyM5K0neuniccM",
17541754
"i": "EmkPreYpZfFk66jpf3uFv7vklXKhzBrAqjsKAn2EDIPM",
17551755
"s": "E46jrVPTzlSkUPqGGeIZ8a8FWS7a6s4reAXRZOkogZ2A",
@@ -1772,7 +1772,7 @@ To sign the SAD located at the path `-a`, JSON serialization would be used becau
17721772

17731773
```json
17741774
{
1775-
"v": "KERI10JSON00011c_",
1775+
"v": "KERICAAJSONAAQB.",
17761776
"t": "exn",
17771777
"dt": "2020-08-22T17:50:12.988921+00:00"
17781778
"r": "/credential/apply"
@@ -1802,7 +1802,7 @@ Applying signatures to a SAD with SAIDs in place of fully expanded nested SAD co
18021802

18031803
```json
18041804
{
1805-
"v": "ACDC10JSON00011c_",
1805+
"v": "ACDCCAAJSONAAQB.",
18061806
"d": "EBdXt3gIXOf2BBWNHdSXCJnFJL5OuQPyM5K0neuniccM",
18071807
"i": "EmkPreYpZfFk66jpf3uFv7vklXKhzBrAqjsKAn2EDIPM",
18081808
"s": "E46jrVPTzlSkUPqGGeIZ8a8FWS7a6s4reAXRZOkogZ2A",
@@ -1844,7 +1844,7 @@ The three nested blocks of the `a` block `legalName`, `address` and `phone` are
18441844

18451845
```json
18461846
{
1847-
"v": "ACDC10JSON00011c_",
1847+
"v": "ACDCCAAJSONAAQB.",
18481848
"d": "EBdXt3gIXOf2BBWNHdSXCJnFJL5OuQPyM5K0neuniccM",
18491849
"i": "EmkPreYpZfFk66jpf3uFv7vklXKhzBrAqjsKAn2EDIPM",
18501850
"s": "E46jrVPTzlSkUPqGGeIZ8a8FWS7a6s4reAXRZOkogZ2A",

0 commit comments

Comments
 (0)