-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdcbor42.src.html
77 lines (77 loc) · 2.85 KB
/
dcbor42.src.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Deterministic CBOR with tag 42 (dCBOR42)</title>
</head>
<body>
<div id="abstract">
<p>
dCBOR42 is a serialization format that is deterministic (so that the same
data will have the same CID) and that features native support for using
CIDs as links.
</p>
</div>
<section>
<h2>Introduction</h2>
<p>
Deterministic encodings that produce the same stream of bytes for any
given data with the same semantics are particularly useful in a content-addressed
context. dCBOR42 provides that. Additionally, it supports CBOR Tag 42 that
contains a CID ([[cid]]). This CID can be used for content-addressed linking
between dCBOR42 documents and to raw resources.
</p>
<p>
dCBOR42 does not fork CBOR, CDE, or dCBOR ([[cbor]], [[cde]], [[dcbor]]).
Any decoder for any of those CBOR variants will be able to read dCBOR42
content, and an encoder for those variants should be able to produce
correct dCBOR42 if configured with the right option and given
appropriately-prepared data.
</p>
</section>
<section>
<h2>Format</h2>
<p>
dCBOR42 is an application profile of dCBOR ([[dcbor]]) with the following
constraints:
</p>
<ul>
<li>
Implementations must support Tag 42 (see <a href="https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml">CBOR
Tag registry</a>).
</li>
<li>
Implementations must reject all other tags, this includes any of the tags
listed in <a href="https://tools.ietf.org/html/rfc8949#section-3.4">section
3.4 of RFC 8949</a>.
</li>
<li>
Implementations must reject map keys that are not strings.
</li>
</ul>
<p>
All other requirements are as dCBOR ([[dcbor]]).
</p>
</section>
<section>
<h2>Debugging Considerations</h2>
<p>
It is often convenient to represent dCBOR42 in textual formats for debugging
purposes, for example using JSON.
</p>
<p>
One common convention to do so is "DAG-JSON" which is a JSON expression
of the dCBOR42 data in which CIDs are represented as
<code>{ "/": "string CID" }</code>. Another option is
<a href="https://datatracker.ietf.org/doc/draft-ietf-cbor-edn-literals/">CBOR
Extended Diagnostic Notation</a>.
</p>
<p>
In any case, note that the CIDs used in such debugging outputs that may
point to <em>other</em> parts of the debugging output should be the CIDs
of the dCBOR42 content, not of the debugging resources.
</p>
</section>
</body>
</html>