Skip to content

Commit e5eb9d0

Browse files
author
Robin Berjon
committed
make it clear that CAR metadata is arbitrary and MASL is good
1 parent a55487a commit e5eb9d0

File tree

10 files changed

+78
-60
lines changed

10 files changed

+78
-60
lines changed

bdasl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Big DASL (BDASL)</title>
77
<link rel="stylesheet" href="spec.css"><link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><rect x=%220%22 y=%220%22 width=%22100%22 height=%22100%22 fill=%22%2300ff75%22></rect></svg>"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" property="og:title" content="DASL: Big DASL (BDASL)"><meta name="twitter:description" property="og:description" content="BDASL extends DASL CIDs with a new hash type that works better for large files but isn't available by default in browsers, and therefore not an appropriate option in most situations."><meta name="twitter:image" property="og:image" content="https://dasl.ing/bdasl.png"><meta name="twitter:image:alt" content="Very colourful stripes, so colourful it hurts"><meta name="twitter:url" property="og:url" content="https://dasl.ing/"><meta property="og:site_name" content="DASL"><meta property="og:locale" content="en"><meta name="theme-color" content="#00ff75"></head>
8-
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Big DASL (BDASL)</h1><table><tbody><tr><th>date</th><td>2025-03-17</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:robin@berjon.com">robin@berjon.com</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:bumblefudge@learningproof.xyz">bumblefudge@learningproof.xyz</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
8+
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Big DASL (BDASL)</h1><table><tbody><tr><th>date</th><td>2025-05-05</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:robin@berjon.com">robin@berjon.com</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:bumblefudge@learningproof.xyz">bumblefudge@learningproof.xyz</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
99
<p>
1010
BDASL extends DASL CIDs with a new hash type that works better for large files but isn't
1111
available by default in browsers, and therefore not an appropriate option in most
@@ -39,4 +39,4 @@ <h2>Parsing BDASL CIDs</h2>
3939
</section>
4040

4141

42-
<section><h2>References</h2><dl><dt id="ref-blake3">[blake3]</dt><dd>J-P. Aumasson, S. Neves, J. O'Connor, Z. Wilcox. <a href="https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html"><cite>The BLAKE3 Hashing Framework</cite></a>. July 2024. URL:&nbsp;<a href="https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html">https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html</a></dd><dt id="ref-cid">[cid]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/cid.html"><cite>Content IDs (CIDs)</cite></a>. 2025-03-17. URL:&nbsp;<a href="https://dasl.ing/cid.html">https://dasl.ing/cid.html</a></dd></dl></section></main></body></html>
42+
<section><h2>References</h2><dl><dt id="ref-blake3">[blake3]</dt><dd>J-P. Aumasson, S. Neves, J. O'Connor, Z. Wilcox. <a href="https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html"><cite>The BLAKE3 Hashing Framework</cite></a>. July 2024. URL:&nbsp;<a href="https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html">https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html</a></dd><dt id="ref-cid">[cid]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/cid.html"><cite>Content IDs (CIDs)</cite></a>. 2025-05-05. URL:&nbsp;<a href="https://dasl.ing/cid.html">https://dasl.ing/cid.html</a></dd></dl></section></main></body></html>

car.html

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Content-Addressable aRchives (CAR)</title>
77
<link rel="stylesheet" href="spec.css"><link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><rect x=%220%22 y=%220%22 width=%22100%22 height=%22100%22 fill=%22%2300ff75%22></rect></svg>"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" property="og:title" content="DASL: Content-Addressable aRchives (CAR)"><meta name="twitter:description" property="og:description" content="The CAR format offers a serialized representation of set of content-addressed resources in one single concatenated stream, alongside a header that describes that content."><meta name="twitter:image" property="og:image" content="https://dasl.ing/car.png"><meta name="twitter:image:alt" content="Very colourful stripes, so colourful it hurts"><meta name="twitter:url" property="og:url" content="https://dasl.ing/"><meta property="og:site_name" content="DASL"><meta property="og:locale" content="en"><meta name="theme-color" content="#00ff75"></head>
8-
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Content-Addressable aRchives (CAR)</h1><table><tbody><tr><th>date</th><td>2025-03-17</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:robin@berjon.com">robin@berjon.com</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:bumblefudge@learningproof.xyz">bumblefudge@learningproof.xyz</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
8+
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Content-Addressable aRchives (CAR)</h1><table><tbody><tr><th>date</th><td>2025-05-05</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:robin@berjon.com">robin@berjon.com</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:bumblefudge@learningproof.xyz">bumblefudge@learningproof.xyz</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
99
<p>
1010
The CAR format offers a serialized representation of set of content-addressed
1111
resources in one single concatenated stream, alongside a header that describes
@@ -54,7 +54,7 @@ <h2>Parsing CAR</h2>
5454
</li>
5555
<li>
5656
Run the steps to <a href="#dfn-parse-a-car-header" class="dfn-ref">parse a CAR header</a> with <var>bytes</var> to obtain
57-
<var>version</var> and <var>roots</var>.
57+
<var>metadata</var>.
5858
</li>
5959
<li>
6060
Set up array <var>blocks</var> and run these substeps:
@@ -76,21 +76,38 @@ <h2>Parsing CAR</h2>
7676
</ol>
7777
</li>
7878
<li>
79-
Return <var>version</var>, <var>roots</var>, and <var>blocks</var>.
79+
Return <var>metadata</var> and <var>blocks</var>.
8080
</li>
8181
</ol>
8282
<p>
83-
The CAR header encodes both a <code>version</code>, which is always 1, and
84-
an array of <code>roots</code>, which is a list of CIDs. A CAR can be used
85-
to contain one or more DAGs of dCBOR42 content and the purpose of the
86-
<code>roots</code> is to list one or more roots for those DAGs. The array
87-
may be empty if you do not care about encoding DAGs.
83+
Note that the CAR header contains a near-arbitrary dCBOR42 object that is to be
84+
treated as metadata ([<a href="#ref-dcbor42" class="ref">dcbor42</a>]). For historical reasons, there are two
85+
constraints on the header:
8886
</p>
87+
<ul>
88+
<li>
89+
The object MUST contain a <code>version</code> map entry, the value of which
90+
is always integer-type <code>1</code>. Version numbers is data formats are
91+
an anti-pattern, and as a result this number is guaranteed never to change.
92+
</li>
93+
<li>
94+
The object MUST contain a <code>roots</code> entry, which MUST be of type
95+
array. It MAY be empty, but if it isn't then it must be an array of CIDs
96+
encoded using tag 42 ([<a href="#ref-cid" class="ref">cid</a>]). A CAR can be used
97+
to contain one or more DAGs of dCBOR42 content and the purpose of the
98+
<code>roots</code> is to list one or more roots for those DAGs. The array
99+
may be empty if you do not care about encoding DAGs. <strong>NOTE</strong>:
100+
Some implementations expect there to always be at least one root. If you do
101+
not wish to indicate a root but have to interoperate with those implementations,
102+
you can always use the empty DASL CID <code>\x01\x55\x12\x00</code> instead.
103+
</li>
104+
</ul>
89105
<p>
90-
<strong>NOTE</strong>: Some implementations expect there to always be at
91-
least one root. If you do not wish to indicate a root but have to
92-
interoperate with those implementations, you can always use the empty
93-
DASL CID <code>\x01\x55\x12\x00</code> instead.
106+
Some implementations will only return <var>version</var> and <var>roots</var>,
107+
but it is RECOMMENDED that they make the entire <var>metadata</var> object
108+
available. A best practice for authors is to use the <var>metadata</var>
109+
to capture MASL content, which is able to provide metadata and a pathing
110+
mapping for the entire content of the CAR stream if needed ([<a href="#ref-masl" class="ref">masl</a>]).
94111
</p>
95112
<p>
96113
The steps to <dfn id="dfn-parse-a-car-header">parse a CAR header</dfn> are:
@@ -101,22 +118,22 @@ <h2>Parsing CAR</h2>
101118
<li>If <var>length</var> is 0, throw an error.</li>
102119
<li>
103120
Read <var>length</var> bytes from <var>bytes</var> and decode them as
104-
dCBOR42 ([<a href="#ref-dcbor42" class="ref">dcbor42</a>]) into <var>object</var>. If <var>object</var> is
121+
dCBOR42 ([<a href="#ref-dcbor42" class="ref">dcbor42</a>]) into <var>metadata</var>. If <var>metadata</var> is
105122
not a map, throw an error.
106123
</li>
107124
<li>
108-
If <var>object</var> does not have a <code>version</code> key entry
125+
If <var>metadata</var> does not have a <code>version</code> key entry
109126
with integer value <code>1</code>, throw an error. Otherwise, store
110127
<code>version</code> in <var>version</var>.
111128
</li>
112129
<li>
113-
If <var>object</var> does not have a <code>roots</code> key entry
130+
If <var>metadata</var> does not have a <code>roots</code> key entry
114131
that is an array, or if that array contains anything other than DASL
115132
CIDs, throw an error. Otherwise, store <code>roots</code> in
116133
<var>roots</var>.
117134
</li>
118135
<li>
119-
Return <var>version</var> and <var>roots</var>.
136+
Return <var>metadata</var>.
120137
</li>
121138
</ol>
122139
<p>
@@ -210,4 +227,4 @@ <h2>Appendix: Media Type</h2>
210227
</section>
211228

212229

213-
<section><h2>References</h2><dl><dt id="ref-cid">[cid]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/cid.html"><cite>Content IDs (CIDs)</cite></a>. 2025-03-17. URL:&nbsp;<a href="https://dasl.ing/cid.html">https://dasl.ing/cid.html</a></dd><dt id="ref-dcbor42">[dcbor42]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/dcbor42.html"><cite>Deterministic CBOR with tag 42 (dCBOR42)</cite></a>. 2025-03-17. URL:&nbsp;<a href="https://dasl.ing/dcbor42.html">https://dasl.ing/dcbor42.html</a></dd><dt id="ref-leb128">[leb128]</dt><dd>Wikipedia. <a href="https://en.wikipedia.org/wiki/LEB128"><cite>LEB128</cite></a>. Retrieved December 2024. URL:&nbsp;<a href="https://en.wikipedia.org/wiki/LEB128">https://en.wikipedia.org/wiki/LEB128</a></dd></dl></section></main></body></html>
230+
<section><h2>References</h2><dl><dt id="ref-cid">[cid]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/cid.html"><cite>Content IDs (CIDs)</cite></a>. 2025-05-05. URL:&nbsp;<a href="https://dasl.ing/cid.html">https://dasl.ing/cid.html</a></dd><dt id="ref-dcbor42">[dcbor42]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/dcbor42.html"><cite>Deterministic CBOR with tag 42 (dCBOR42)</cite></a>. 2025-05-05. URL:&nbsp;<a href="https://dasl.ing/dcbor42.html">https://dasl.ing/dcbor42.html</a></dd><dt id="ref-leb128">[leb128]</dt><dd>Wikipedia. <a href="https://en.wikipedia.org/wiki/LEB128"><cite>LEB128</cite></a>. Retrieved December 2024. URL:&nbsp;<a href="https://en.wikipedia.org/wiki/LEB128">https://en.wikipedia.org/wiki/LEB128</a></dd><dt id="ref-masl">[masl]</dt><dd>Robin Berjon &amp; Juan Caballero. <a href="https://dasl.ing/masl.html"><cite>MASL — Metadata for Arbitrary Structures &amp; Links</cite></a>. 2025-05-05. URL:&nbsp;<a href="https://dasl.ing/masl.html">https://dasl.ing/masl.html</a></dd></dl></section></main></body></html>

car.src.html

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h2>Parsing CAR</h2>
5454
</li>
5555
<li>
5656
Run the steps to <a>parse a CAR header</a> with <var>bytes</var> to obtain
57-
<var>version</var> and <var>roots</var>.
57+
<var>metadata</var>.
5858
</li>
5959
<li>
6060
Set up array <var>blocks</var> and run these substeps:
@@ -76,21 +76,38 @@ <h2>Parsing CAR</h2>
7676
</ol>
7777
</li>
7878
<li>
79-
Return <var>version</var>, <var>roots</var>, and <var>blocks</var>.
79+
Return <var>metadata</var> and <var>blocks</var>.
8080
</li>
8181
</ol>
8282
<p>
83-
The CAR header encodes both a <code>version</code>, which is always 1, and
84-
an array of <code>roots</code>, which is a list of CIDs. A CAR can be used
85-
to contain one or more DAGs of dCBOR42 content and the purpose of the
86-
<code>roots</code> is to list one or more roots for those DAGs. The array
87-
may be empty if you do not care about encoding DAGs.
83+
Note that the CAR header contains a near-arbitrary dCBOR42 object that is to be
84+
treated as metadata ([[dcbor42]]). For historical reasons, there are two
85+
constraints on the header:
8886
</p>
87+
<ul>
88+
<li>
89+
The object MUST contain a <code>version</code> map entry, the value of which
90+
is always integer-type <code>1</code>. Version numbers is data formats are
91+
an anti-pattern, and as a result this number is guaranteed never to change.
92+
</li>
93+
<li>
94+
The object MUST contain a <code>roots</code> entry, which MUST be of type
95+
array. It MAY be empty, but if it isn't then it must be an array of CIDs
96+
encoded using tag 42 ([[cid]]). A CAR can be used
97+
to contain one or more DAGs of dCBOR42 content and the purpose of the
98+
<code>roots</code> is to list one or more roots for those DAGs. The array
99+
may be empty if you do not care about encoding DAGs. <strong>NOTE</strong>:
100+
Some implementations expect there to always be at least one root. If you do
101+
not wish to indicate a root but have to interoperate with those implementations,
102+
you can always use the empty DASL CID <code>\x01\x55\x12\x00</code> instead.
103+
</li>
104+
</ul>
89105
<p>
90-
<strong>NOTE</strong>: Some implementations expect there to always be at
91-
least one root. If you do not wish to indicate a root but have to
92-
interoperate with those implementations, you can always use the empty
93-
DASL CID <code>\x01\x55\x12\x00</code> instead.
106+
Some implementations will only return <var>version</var> and <var>roots</var>,
107+
but it is RECOMMENDED that they make the entire <var>metadata</var> object
108+
available. A best practice for authors is to use the <var>metadata</var>
109+
to capture MASL content, which is able to provide metadata and a pathing
110+
mapping for the entire content of the CAR stream if needed ([[masl]]).
94111
</p>
95112
<p>
96113
The steps to <dfn>parse a CAR header</dfn> are:
@@ -101,22 +118,22 @@ <h2>Parsing CAR</h2>
101118
<li>If <var>length</var> is 0, throw an error.</li>
102119
<li>
103120
Read <var>length</var> bytes from <var>bytes</var> and decode them as
104-
dCBOR42 ([[dcbor42]]) into <var>object</var>. If <var>object</var> is
121+
dCBOR42 ([[dcbor42]]) into <var>metadata</var>. If <var>metadata</var> is
105122
not a map, throw an error.
106123
</li>
107124
<li>
108-
If <var>object</var> does not have a <code>version</code> key entry
125+
If <var>metadata</var> does not have a <code>version</code> key entry
109126
with integer value <code>1</code>, throw an error. Otherwise, store
110127
<code>version</code> in <var>version</var>.
111128
</li>
112129
<li>
113-
If <var>object</var> does not have a <code>roots</code> key entry
130+
If <var>metadata</var> does not have a <code>roots</code> key entry
114131
that is an array, or if that array contains anything other than DASL
115132
CIDs, throw an error. Otherwise, store <code>roots</code> in
116133
<var>roots</var>.
117134
</li>
118135
<li>
119-
Return <var>version</var> and <var>roots</var>.
136+
Return <var>metadata</var>.
120137
</li>
121138
</ol>
122139
<p>

0 commit comments

Comments
 (0)