├── car.png ├── cid.png ├── dcbor42.html ├── masl.png ├── rasl.png ├── banner.png ├── bdasl.png ├── drisl.png ├── banners.pxd ├── polity.json ├── fonts ├── Barlow-Bold.ttf ├── Barlow-Italic.ttf ├── Barlow-Thin.ttf ├── Barlow-Regular.ttf ├── Barlow-BoldItalic.ttf └── Barlow-ThinItalic.ttf ├── README.md ├── package.json ├── .github └── workflows │ └── copy-to-polity.yml ├── ipfs.src.html ├── bdasl.src.html ├── shared.css ├── spec.css ├── .gitignore ├── brutal.css ├── ipfs.html ├── bdasl.html ├── bibliography.json ├── cid.src.html ├── drisl.src.html ├── rasl.src.html ├── cid.html ├── sisl.js ├── car.src.html ├── index.html ├── LICENSE ├── drisl.html ├── rasl.html ├── car.html ├── masl.src.html └── masl.html /car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/car.png -------------------------------------------------------------------------------- /cid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/cid.png -------------------------------------------------------------------------------- /dcbor42.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /masl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/masl.png -------------------------------------------------------------------------------- /rasl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/rasl.png -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/banner.png -------------------------------------------------------------------------------- /bdasl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/bdasl.png -------------------------------------------------------------------------------- /drisl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/drisl.png -------------------------------------------------------------------------------- /banners.pxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/banners.pxd -------------------------------------------------------------------------------- /polity.json: -------------------------------------------------------------------------------- 1 | { 2 | "owner": "darobin", 3 | "repo": "dasl.ing" 4 | } 5 | -------------------------------------------------------------------------------- /fonts/Barlow-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-Bold.ttf -------------------------------------------------------------------------------- /fonts/Barlow-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-Italic.ttf -------------------------------------------------------------------------------- /fonts/Barlow-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-Thin.ttf -------------------------------------------------------------------------------- /fonts/Barlow-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-Regular.ttf -------------------------------------------------------------------------------- /fonts/Barlow-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/Barlow-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/dasl.ing/HEAD/fonts/Barlow-ThinItalic.ttf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dasl.ing 2 | 3 | DASL — Data-Addressed Structures & Links. Go read the spec at https://dasl.ing/! 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dasl.ing", 3 | "type": "module", 4 | "private": true, 5 | "version": "0.0.1", 6 | "author": "Robin Berjon ", 7 | "license": "Apache-2.0", 8 | "scripts": { 9 | "watch": "node --watch ./sisl.js --watch", 10 | "build": "./sisl.js" 11 | }, 12 | "bin": {}, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/darobin/dasl.ing.git" 16 | }, 17 | "eslintConfig": { 18 | "env": { 19 | "browser": true, 20 | "mocha": true, 21 | "es2021": true 22 | }, 23 | "extends": "eslint:recommended", 24 | "overrides": [], 25 | "parserOptions": { 26 | "ecmaVersion": "latest", 27 | "sourceType": "module" 28 | }, 29 | "rules": {} 30 | }, 31 | "devDependencies": { 32 | "chalk": "^5.3.0", 33 | "chokidar": "^4.0.1", 34 | "eslint": "^8.26.0", 35 | "jsdom": "^25.0.1" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.github/workflows/copy-to-polity.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy to polity (static)" 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | scp: 10 | runs-on: ubuntu-latest 11 | name: scp 12 | timeout-minutes: 5 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: copy file via ssh password 16 | uses: appleboy/scp-action@v0.1.7 17 | with: 18 | host: "174.138.76.168" 19 | username: root 20 | passphrase: ${{ secrets.PASSWORD }} 21 | key: ${{ secrets.KEY }} 22 | source: "*,!README.md,!LICENSE,!optimise-pdf.sh,!.git,!.github,!.gitignore,polity.json" 23 | target: "/var/www/dasl.ing/" 24 | rm: true 25 | - name: chown to robin 26 | uses: appleboy/ssh-action@v1.0.3 27 | with: 28 | host: "174.138.76.168" 29 | username: root 30 | key: ${{ secrets.KEY }} 31 | passphrase: ${{ secrets.PASSWORD }} 32 | script: "chown -R robin /var/www/dasl.ing/" 33 | -------------------------------------------------------------------------------- /ipfs.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IPFS Interoperability Considerations 7 | 8 | 9 |
10 |

11 | DASL components are designed to be small and to the extent possible self-contained. 12 | Because of that, despite having roots in IPFS, no DASL component depends on 13 | traditional IPFS implementations. In many cases, systems produced to work with 14 | DASL will interoperate with IPFS, but DASL's independence means that there can 15 | occasionally be impedance mismatch. This document is a non-normative list of 16 | things to consider when using DASL with IPFS systems, particularly with ones based 17 | on the DHT and Bitswap. 18 |

19 |
20 |
21 |

Amino / Bitswap Compatibility

22 |

23 | If you're interoperating with Amino (or other DHTs with similar properties) or 24 | need to use Bitswap: 25 |

26 |
27 |
Block size
28 |
29 | Nothing in DASL assumes a maximum block size, but Bitswap does. DASL does not have 30 | a built-in solution to break files into blocks (and we intend to keep it that way). 31 | In order to plan for interop with Bitswap, you will want to do your own splitting 32 | and probably to have a metadata wrapper to keep track of the split. 33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /bdasl.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Big DASL (BDASL) 7 | 8 | 9 |
10 |

11 | BDASL extends DASL CIDs with a new hash type that works better for large files but isn't 12 | available by default in browsers, and therefore not an appropriate option in most 13 | situations. 14 |

15 |
16 |
17 |

Introduction

18 |

19 | BDASL extends DASL CIDs by adding BLAKE3 support ([[blake3]). BLAKE3 is a powerful hashing 20 | framework that works well for progressive verification of large streams. Unfortunately, 21 | it isn't available in browser (and neither is streaming hashing in general) which makes it 22 | inappriopriate for inclusion as the primary hash function in DASL CIDs. 23 |

24 |

25 | It is recommended to avoid using BDASL CIDs in arbitrary open environments, and rather to 26 | focus on using such CIDs in specific cases in which participants are likely to know how 27 | to handle them. 28 |

29 |
30 |
31 |

Parsing BDASL CIDs

32 |

33 | All the parsing works the same as for DASL CIDs ([[cid]]) with one modification. 34 |

35 |

36 | In the steps to decode a CID, the hash type 37 | may also be equal to 0x1e (BLAKE3) ([[blake3]]). 38 |

39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /shared.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face { 3 | font-family: "Barlow"; 4 | src: url("fonts/Barlow-Regular.ttf"); 5 | font-weight: 400; 6 | font-style: normal; 7 | } 8 | @font-face { 9 | font-family: "Barlow"; 10 | src: url("fonts/Barlow-Regular.ttf"); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | @font-face { 15 | font-family: "Barlow"; 16 | src: url("fonts/Barlow-Italic.ttf"); 17 | font-weight: 400; 18 | font-style: italic; 19 | } 20 | @font-face { 21 | font-family: "Barlow"; 22 | src: url("fonts/Barlow-Bold.ttf"); 23 | font-weight: 700; 24 | font-style: normal; 25 | } 26 | @font-face { 27 | font-family: "Barlow"; 28 | src: url("fonts/Barlow-BoldItalic.ttf"); 29 | font-weight: 700; 30 | font-style: italic; 31 | } 32 | @font-face { 33 | font-family: "Barlow"; 34 | src: url("fonts/Barlow-Thin.ttf"); 35 | font-weight: 100; 36 | font-style: normal; 37 | } 38 | @font-face { 39 | font-family: "Barlow"; 40 | src: url("fonts/Barlow-ThinItalic.ttf"); 41 | font-weight: 100; 42 | font-style: italic; 43 | } 44 | 45 | /* https://colorkit.co/palette/fff500-00ff75-cd76ea-ffb443-ff5e5e-39dbff/ */ 46 | :root { 47 | --yellow: #fff500; 48 | --green: #00ff75; 49 | --purple: #cd76ea; 50 | --orange: #ffb443; 51 | --red: #ff5e5e; 52 | --blue: #39dbff; 53 | --contrasted: #00819e; 54 | --content-width: 80rem; 55 | --spec-width: 800px; 56 | --header-font-size: 1.6rem; 57 | --brutal-border: 5px solid #000; 58 | } 59 | html, body { 60 | margin: 0; 61 | padding: 0; 62 | font-family: Barlow; 63 | } 64 | main { 65 | max-width: var(--content-width); 66 | margin: auto; 67 | min-height: 100vh; 68 | padding: 1rem; 69 | } 70 | dd { 71 | margin-bottom: 1rem; 72 | } 73 | a { 74 | color: var(--contrasted); 75 | text-decoration-thickness: 3px; 76 | text-decoration-color: var(--blue); 77 | } 78 | a:hover { 79 | text-decoration-color: var(--red); 80 | } 81 | dfn { 82 | font-style: normal; 83 | font-weight: 700; 84 | } 85 | var { 86 | text-decoration: underline; 87 | text-decoration-thickness: 3px; 88 | text-decoration-color: #ccc; 89 | } 90 | code, pre { 91 | font-size: 1rem; 92 | } 93 | .early { 94 | display: inline-block; 95 | color: orangered; 96 | font-weight: bold; 97 | margin-left: 1rem; 98 | } 99 | .early::before, .early::after { 100 | display: inline-block; 101 | margin: 0 0.5rem; 102 | content: "💥"; 103 | } 104 | -------------------------------------------------------------------------------- /spec.css: -------------------------------------------------------------------------------- 1 | 2 | @import "shared.css"; 3 | 4 | :root { 5 | --flag-colour: gold; 6 | --flag-border-size: 3px; 7 | } 8 | 9 | body { 10 | line-height: 1.4; 11 | font-size: 1.2rem; 12 | } 13 | .nav-back { 14 | max-width: var(--spec-width); 15 | margin: auto; 16 | text-transform: uppercase; 17 | text-align: right; 18 | } 19 | main { 20 | max-width: var(--spec-width); 21 | } 22 | header { 23 | padding: 4rem 0 1rem 0.5rem; 24 | } 25 | h1 { 26 | font-weight: 400; 27 | font-size: 2rem; 28 | margin: 0.5rem 0; 29 | text-decoration: underline; 30 | text-decoration-color: var(--green); 31 | text-decoration-thickness: 5px; 32 | } 33 | header th { 34 | font-weight: normal; 35 | text-transform: uppercase; 36 | text-align: left; 37 | vertical-align: top; 38 | } 39 | header td { 40 | padding-left: 1rem; 41 | } 42 | header table p { 43 | margin: 0; 44 | } 45 | section, ul, ol { 46 | margin: 0 1rem 1rem 1rem; 47 | max-width: 70ch; 48 | } 49 | section section { 50 | margin: 0 0 1rem 0; 51 | } 52 | ul, ol { 53 | padding-left: 1rem; 54 | max-width: calc(70ch - 1rem); 55 | } 56 | ul > li { 57 | list-style-type: square; 58 | } 59 | dt { 60 | font-weight: bold; 61 | } 62 | h2 { 63 | font-weight: 400; 64 | font-size: var(--header-font-size); 65 | text-decoration: underline; 66 | text-decoration-thickness: 5px; 67 | text-transform: uppercase; 68 | } 69 | h3 { 70 | margin-bottom: 0; 71 | } 72 | h3 + p { 73 | margin-top: 0; 74 | } 75 | header table a, a.ref { 76 | text-decoration: none; 77 | } 78 | a.dfn-ref { 79 | text-decoration-color: var(--purple); 80 | /* text-decoration-thickness: 1px; */ 81 | color: inherit; 82 | } 83 | pre { 84 | /* white-space: pre-wrap; */ 85 | overflow: auto; 86 | } 87 | div.flag { 88 | border: var(--flag-border-size) solid var(--flag-colour); 89 | padding: 1rem; 90 | position: relative; 91 | margin-top: 3rem; 92 | } 93 | div.flag::before { 94 | content: "Issue"; 95 | display: block; 96 | position: absolute; 97 | top: -2.4rem; 98 | background: var(--flag-colour); 99 | left: calc(-1 * var(--flag-border-size)); 100 | border: var(--flag-border-size) solid var(--flag-colour); 101 | padding: 0.4rem 1rem; 102 | text-transform: uppercase; 103 | line-height: 1; 104 | } 105 | dt { 106 | font-weight: bold; 107 | } 108 | 109 | @media only screen and (max-width:800px) { 110 | header table, header tr, header th, header td { 111 | display: block; 112 | } 113 | .nav-back { 114 | font-size: 1rem; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | -------------------------------------------------------------------------------- /brutal.css: -------------------------------------------------------------------------------- 1 | @import "shared.css"; 2 | 3 | header { 4 | display: flex; 5 | border: var(--brutal-border); 6 | } 7 | h1 { 8 | font-weight: 400; 9 | font-size: var(--header-font-size); 10 | margin: 0.5rem; 11 | text-decoration: underline; 12 | text-decoration-color: var(--green); 13 | text-decoration-thickness: 5px; 14 | } 15 | nav { 16 | text-align: right; 17 | flex-grow: 1; 18 | } 19 | nav > ul { 20 | list-style-type: none; 21 | margin: 0.5rem; 22 | padding: 0; 23 | } 24 | nav > ul > li { 25 | font-size: var(--header-font-size); 26 | display: inline-block; 27 | margin-left: 1rem; 28 | } 29 | nav > ul > li > a { 30 | color: #000; 31 | font-weight: 700; 32 | text-transform: uppercase; 33 | text-decoration-thickness: 5px; 34 | } 35 | nav > ul > li > a[href="#what"] { text-decoration-color: var(--orange); } 36 | nav > ul > li > a[href="#what"]:hover { color: var(--orange); } 37 | nav > ul > li > a[href="#how"] { text-decoration-color: var(--purple); } 38 | nav > ul > li > a[href="#how"]:hover { color: var(--purple); } 39 | nav > ul > li > a[href="#code"] { text-decoration-color: var(--blue); } 40 | nav > ul > li > a[href="#code"]:hover { color: var(--blue); } 41 | nav > ul > li > a[href="#spec"] { text-decoration-color: var(--red); } 42 | nav > ul > li > a[href="#spec"]:hover { color: var(--red); } 43 | nav > ul > li > a[href="https://github.com/darobin/dasl.ing"] { text-decoration-color: var(--yellow); } 44 | nav > ul > li > a[href="https://github.com/darobin/dasl.ing"]:hover { color: var(--yellow); } 45 | nav > ul > li > a[href="https://github.com/darobin/dasl.ing/issues"] { text-decoration-color: var(--green); } 46 | nav > ul > li > a[href="https://github.com/darobin/dasl.ing/issues"]:hover { color: var(--green); } 47 | h2 { 48 | border: var(--brutal-border); 49 | font-weight: 400; 50 | font-size: var(--header-font-size); 51 | padding: 0.5rem; 52 | text-decoration: underline; 53 | text-decoration-thickness: 5px; 54 | text-transform: uppercase; 55 | } 56 | h3 { 57 | margin: 1rem; 58 | font-weight: 400; 59 | font-size: var(--header-font-size); 60 | } 61 | p, section > ul, section > ol, section > dl { 62 | margin: 0 1rem 1rem 1rem; 63 | max-width: 70ch; 64 | line-height: 1.4; 65 | font-size: 1.2rem; 66 | } 67 | section > ul, section > ol { 68 | padding-left: 1rem; 69 | max-width: calc(70ch - 1rem); 70 | } 71 | section ul > li { 72 | list-style-type: square; 73 | } 74 | #what > h2 { text-decoration-color: var(--orange); } 75 | #how > h2 { text-decoration-color: var(--purple); } 76 | #code > h2 { text-decoration-color: var(--blue); } 77 | #spec > h2 { text-decoration-color: var(--red); } 78 | footer { 79 | display: flex; 80 | border: var(--brutal-border); 81 | align-items: center; 82 | } 83 | footer p { 84 | margin-top: 0; 85 | margin-bottom: 0; 86 | } 87 | 88 | @media only screen and (max-width:800px) { 89 | header { 90 | display: block; 91 | } 92 | nav { 93 | text-align: left; 94 | } 95 | nav > ul > li { 96 | display: block; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ipfs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | IPFS Interoperability Considerations 21 | 22 |

IPFS Interoperability Considerations

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | DASL components are designed to be small and to the extent possible self-contained. 25 | Because of that, despite having roots in IPFS, no DASL component depends on 26 | traditional IPFS implementations. In many cases, systems produced to work with 27 | DASL will interoperate with IPFS, but DASL's independence means that there can 28 | occasionally be impedance mismatch. This document is a non-normative list of 29 | things to consider when using DASL with IPFS systems, particularly with ones based 30 | on the DHT and Bitswap. 31 |

32 |
33 | 34 |
35 |

Amino / Bitswap Compatibility

36 |

37 | If you're interoperating with Amino (or other DHTs with similar properties) or 38 | need to use Bitswap: 39 |

40 |
41 |
Block size
42 |
43 | Nothing in DASL assumes a maximum block size, but Bitswap does. DASL does not have 44 | a built-in solution to break files into blocks (and we intend to keep it that way). 45 | In order to plan for interop with Bitswap, you will want to do your own splitting 46 | and probably to have a metadata wrapper to keep track of the split. 47 |
48 |
49 |
50 | 51 | 52 |
-------------------------------------------------------------------------------- /bdasl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | Big DASL (BDASL) 21 | 22 |

Big DASL (BDASL)

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | BDASL extends DASL CIDs with a new hash type that works better for large files but isn't 25 | available by default in browsers, and therefore not an appropriate option in most 26 | situations. 27 |

28 |
29 | 30 |
31 |

Introduction

32 |

33 | BDASL extends DASL CIDs by adding BLAKE3 support ([[blake3]). BLAKE3 is a powerful hashing 34 | framework that works well for progressive verification of large streams. Unfortunately, 35 | it isn't available in browser (and neither is streaming hashing in general) which makes it 36 | inappriopriate for inclusion as the primary hash function in DASL CIDs. 37 |

38 |

39 | It is recommended to avoid using BDASL CIDs in arbitrary open environments, and rather to 40 | focus on using such CIDs in specific cases in which participants are likely to know how 41 | to handle them. 42 |

43 |
44 |
45 |

Parsing BDASL CIDs

46 |

47 | All the parsing works the same as for DASL CIDs ([cid]) with one modification. 48 |

49 |

50 | In the steps to decode a CID, the hash type 51 | may also be equal to 0x1e (BLAKE3) ([blake3]). 52 |

53 |
54 | 55 | 56 |

References

[blake3]
J-P. Aumasson, S. Neves, J. O'Connor, Z. Wilcox. The BLAKE3 Hashing Framework. July 2024. URL: https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html
[cid]
Robin Berjon & Juan Caballero. Content IDs (CIDs). 2025-10-20. URL: https://dasl.ing/cid.html
-------------------------------------------------------------------------------- /bibliography.json: -------------------------------------------------------------------------------- 1 | { 2 | "at": "AT Protocol. URL: https://atproto.com/", 3 | "blake3": "J-P. Aumasson, S. Neves, J. O'Connor, Z. Wilcox. The BLAKE3 Hashing Framework. July 2024. URL: https://www.ietf.org/archive/id/draft-aumasson-blake3-00.html", 4 | "cbor": "C. Bormann. & P. Hoffman. Concise Binary Object Representation (CBOR). October 2024. URL: https://www.rfc-editor.org/info/rfc8949", 5 | "cbor-tag42": "J. Caballero. Binary Content Identifiers. May 2025. URL: https://www.ietf.org/archive/id/draft-caballero-cbor-cborc42-00.html#name-binary-content-identifiers", 6 | "cborc": "A. Rundgren. Core CBOR Platform Profile. April 2025. URL: https://datatracker.ietf.org/doc/draft-rundgren-cbor-core/", 7 | "cborc-42": "J. Caballero, R. Berjon. The tag-42 profile of CBOR Core. May 2025. URL: https://datatracker.ietf.org/doc/draft-caballero-cbor-cborc42/", 8 | "cde": "C. Bormann. CBOR Common Deterministic Encoding (CDE). October 2024. URL: https://datatracker.ietf.org/doc/html/draft-ietf-cbor-cde-06", 9 | "dcbor": "W. McNally, C. Allen, C. Bormann, & L. Lundblade. dCBOR: A Deterministic CBOR Application Profile. October 2024. URL: https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/", 10 | "drisl":"J. Caballero, R. Berjon. DRISL specification. May 2025. URL: https://dasl.ing/drisl.html", 11 | "ipfs-principles": "Robin Berjon. IPFS Principles. march 2023. URL: https://specs.ipfs.tech/architecture/principles/", 12 | "leb128": "Wikipedia. LEB128. Retrieved December 2024. URL: https://en.wikipedia.org/wiki/LEB128", 13 | "lexicon": "AT Protocol: Lexicon.", 14 | "manifest": "M. Cáceres, K. Rohde Christiansen, D. González, D. Murphy, C. Liebel. Web Application Manifest. March 2025. URL: https://www.w3.org/TR/appmanifest/", 15 | "rfc2119": "S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. URL: https://www.rfc-editor.org/rfc/rfc2119", 16 | "rfc4648": "S. Josefsson. The Base16, Base32, and Base64 Data Encodings. October 2006. URL: https://www.rfc-editor.org/rfc/rfc4648", 17 | "rfc8742": "C. Bormann. Concise Binary Object Representation (CBOR) Sequences. February 2020. URL: https://www.rfc-editor.org/rfc/rfc8742", 18 | "rfc8949": "C. Bormann, P. Hoffman. Concise Binary Object Representation (CBOR). December 2020. URL: https://www.rfc-editor.org/rfc/rfc8949", 19 | "sha256": "National Institute of Standards and Technology, Secure Hash Algorithm. NIST FIPS 180-2. August 2002.", 20 | "url": "WHATWG. URL. Living Standard. URL: https://url.spec.whatwg.org/", 21 | "varint": "unsigned varint. URL: https://github.com/multiformats/unsigned-varint" 22 | } 23 | -------------------------------------------------------------------------------- /cid.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Content IDs (CIDs) 7 | 8 | 9 |
10 |

11 | DASL CIDs are a simple structured identifier format for content addressing. They encapsulate a hash 12 | with enough metadata to be extensible (to add new hash types in the future) and to indicate whether 13 | they are pointing to raw bytes or to structured data. 14 |

15 |
16 |
17 |

Introduction

18 |

19 | DASL CIDs are a simple structured identifier format for content addressing. They encapsulate a hash 20 | with enough metadata to be extensible (to add new hash types in the future) and to indicate whether 21 | they are pointing to raw bytes or to structured data. If you're simply using DASL CIDs as identifiers, you 22 | can almost certainly just use the string as an opaque ID and worry no further. 23 |

24 |

25 | A DASL CID can be represented as a string or as an array of bytes. If you wish to understand the 26 | internals of a CID, it has the following structure: 27 |

28 |
    29 |
  1. 30 | A b prefix (only in string form). This is an extensibility point for future 31 | CID encodings other than the current base32 to be supported. (Currently this is the only one.) 32 |
  2. 33 |
  3. 34 | A version number, which is currently always 1. 35 |
  4. 36 |
  5. 37 | A content codec, which is a flag indicating whether it is pointing to structured or raw 38 | data. 39 |
  6. 40 |
  7. 41 | A hash type, that is always SHA-256 ([[sha256]]). 42 |
  8. 43 |
  9. 44 | A hash size, that is always 32 (0x20). 45 |
  10. 46 |
  11. 47 | A digest, which is the hash of the content being identified. 48 |
  12. 49 |
50 |
51 |
52 |

Parsing CIDs

53 |

54 | Use the following steps to parse a string-encoded CID, i.e. translate it to a bytestring: 55 |

56 |
    57 |
  1. Accept a string CID.
  2. 58 |
  3. Remove the first character from CID and store it in prefix.
  4. 59 |
  5. If prefix is not equal to b, throw an error.
  6. 60 |
  7. 61 | Decode the rest of CID using 62 | the base32 algorithm from 63 | RFC4648 with a lowercase alphabet and store the result in CID bytes ([[rfc4648]]). 64 |
  8. 65 |
  9. This results in CID bytes, which can be used to decode a CID.
  10. 66 |
67 |

68 | Use the following steps to decode a CID: 69 |

70 |
    71 |
  1. Accept an array of bytes CID bytes.
  2. 72 |
  3. 73 | Remove the first byte in CID bytes and store it in version. 74 |
  4. 75 |
  5. If version is not equal to 1, throw an error.
  6. 76 |
  7. 77 | Remove the next byte in CID bytes and store it in codec. 78 |
  8. 79 |
  9. 80 | If codec is not equal to 0x55 (raw) or 0x71 (DRISL), 81 | throw an error ([[drisl]]). 82 |
  10. 83 |
  11. 84 | Remove the next byte in CID bytes and store it in hash type. 85 |
  12. 86 |
  13. 87 | If hash type is not equal to 0x12 (SHA-256), throw an error ([[sha256]]). 88 |
  14. 89 |
  15. 90 | Read one byte from CID bytes and store it in hash size. If hash size 91 | is any value other than 32 (0x20) , throw an error. 92 |
  16. 93 |
  17. 94 | Read 32 bytes from CID bytes and store them in digest. If there were 95 | fewer than 32 bytes left in CID bytes, throw an error. 96 |
  18. 97 |
  19. 98 | Return version, codec, hash type, hash size, 99 | and digest. 100 |
  20. 101 |
102 |
103 |
104 |

Relationship to IPFS

105 |

106 | You don't need to understand IPFS in order to use DASL. This section is for informational 107 | purposes only. 108 |

109 |

110 | DASL CIDs are a strict subset of IPFS CIDs 111 | with the following properties: 112 |

113 | 136 |
137 | 138 | 139 | -------------------------------------------------------------------------------- /drisl.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DRISL — Deterministic Representation for Interoperable Structures & Links 7 | 8 | 9 |
10 |

11 | DRISL is a serialization format that is deterministic (so that the same 12 | data will have the same CID) and that features native support for using 13 | CIDs as links. 14 | It is based on CBOR, using a narrow profile of CBOR's "Core" featureset called "[[cborc-42]]", specified formally in this IETF document. 15 |

16 |
17 |
18 |

Introduction

19 |

20 | Deterministic encodings that produce the same stream of bytes for any 21 | given data with the same semantics are particularly useful in a content-addressed 22 | context. DRISL provides that, compactly encoded as CBOR. Additionally, it supports CBOR's Tag 42 to compactly encode CIDs ([[cid]]) as bytestreams. This CID can be used for content-addressed linking 23 | between DRISL documents (such as MASL documents), or to resources (best wrapped in MASL documents where renderability as web documents or web apps is desired). 24 |

25 |

26 | DRISL does not fork CBOR, CDE, or dCBOR ([[cbor]], [[cde]], [[dcbor]]), but it is a subset of features defined in CBOR "Core" ([[cborc]]), first defined in the earliest CBOR RFC and largely unaffected by refinements made since. 27 | Any decoder for any version of CBOR since v1 will be able to read DRISL 28 | content as conformant CBOR, and with enough carefully configuration of a powerful CBOR library and in some case pre-processing of the data, DRISL can be encoded anywhere CBOR can. 29 |

30 |
31 |
32 |

Format

33 |

34 | DRISL is an application profile of CBOR ([[cbor]]) that mostly subsets the more established [[cborc]] profile, with the following additional 35 | constraints: 36 |

37 | 85 |

86 | All other requirements are as CBOR/c ([[cborc]]). 87 |

88 |
89 |
90 |

CIDs in CBOR

91 |

92 | CIDs in CBOR are stored in binary format, as CBOR bytestrings under custom tag 42. For historical reasons the null 93 | byte 0x00 is prepended to the binary CID before storing in CBOR. 94 |

95 |

96 | For more information, see the [[cbor-tag42]] appendix to the [[drisl]] specification. 97 |

98 |
99 |
100 |

Conversion with JSON

101 |

102 | JSON lacks a native way to encode tag 42 for CIDs ([[cbor-tag42]], [[cid]]). Historically, there have 103 | been different conventions to represent CIDs in JSON. For example, DAG-JSON, part of IPLD, used 104 | an object with a single / key pointing to the stringified CID. 105 |

106 |

107 | The AT Protocol uses an object with a $link key pointing to the stringified DASL CID: 108 |

109 |
110 |         {
111 |           "someSrc": {
112 |             "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4"
113 |           }
114 |         }
115 |       
116 |

117 | This specification recommends that implementations default to the AT Protocol $link 118 | convention, but may offer the option to support DAG-JSON or other conventions as well. 119 |

120 |
121 | 122 | 123 | -------------------------------------------------------------------------------- /rasl.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RASL — Retrieval of Arbitrary Structures & Links 7 | 8 | 9 |
10 |

11 | RASL is a URL scheme used to identify content-addressed DASL resources 12 | along with a simple HTTP-based retrieval method. 13 |

14 |
15 | 20 |
21 |

Introduction

22 |

23 | Content-addressed resources are "self-certifying," which is to say that 24 | you don't need any external authority to certify that the content you 25 | have when you resolve the identifier is correct: because the identifier 26 | contains a hash, you can (and should) verify that you obtained the right 27 | content yourself ([[ipfs-principles]]). The identifier is enough to 28 | certify the content. This has several implications, but two are 29 | particularly relevant for this specification: 30 |

31 | 50 |

51 | Taking these aspects into consideration, this specification defines a URL 52 | scheme in which the CID is the authority, along with optional hints of 53 | potential look-up locations, and defines a retrieval method but does not 54 | mandate that RASL retrieval rely on it. 55 |

56 |
57 |

The rasl URL Scheme

58 |

59 | RASL URLs look like this: 60 | rasl://bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4/?hint=berjon.com&hint=bsky.app. 61 | This breaks down into the following components: 62 |

63 |
    64 |
  • 65 | The rasl scheme. This is simply used as an entry point into RASL semantics. 66 |
  • 67 |
  • 68 | An authority, which is simply a DASL CID ([[cid]]), here bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 69 |
  • 70 |
  • 71 | A path (here just /) that is empty or / and that is expected 72 | to be ignored since RASL is only used for raw data retrieval. 73 |
  • 74 |
  • 75 | A query string part, that is parsed according to CGI rules and that contains 76 | zero or more hint entries, each of which is a host from which 77 | that CID can be obtained. 78 |
  • 79 |
80 |

81 | Use the following steps to parse a RASL URL: 82 |

83 |
    84 |
  1. Accept a string url and parse it according to the URL Standard ([[url]]).
  2. 85 |
  3. If that's a failure, return the failure.
  4. 86 |
  5. Read the host part of the parsed URL and store that in cid.
  6. 87 |
  7. If cid is not a valid CID ([[cid]]), return failure.
  8. 88 |
  9. 89 | Select all the tuples in the query object associated with the URL ([[url]]) whose name is 90 | exaclty hint. Each value MUST match the syntax of a valid host for the 91 | https scheme and values which do not match this syntax MUST be ignored 92 | and removed from this list. Store the remaining values in hints. If there were none 93 | then hints is an empty array. 94 |
  10. 95 |
  11. Return the URL's parts as well as cid and hints.
  12. 96 |
97 |
98 |
99 |

Fetching RASL

100 |

101 | A user agent may retrieve a CID in whichever way it prefers. This section 102 | provides a simple standard for HTTP-based CID retrieval, to make it 103 | easy for authors to publish content to their own sites and have it 104 | retrieved, without having to worry about operating any infrastructure 105 | beyond the web server they already have. 106 |

107 |

108 | Use the following steps to fetch a RASL URL: 109 |

110 |
    111 |
  1. Accept a string url and parse it according to the steps to parse a RASL URL.
  2. 112 |
  3. 113 | Construct a request using cid from the url as well as hints that may 114 | be from the URL or from elsewhere (this is entirely up to you): 115 |
      116 |
    1. 117 | For each hint, construct a request URL that is the concatenation of https://, 118 | the hint as host, /.well-known/rasl/, and the cid. 119 |
    2. 120 |
    3. 121 | Prepare the request such that it has a method of either GET or HEAD, 122 | that it is stateless (no cookies, no credentials of any kind), and that it uses no content 123 | negotiation. 124 |
    4. 125 |
    126 |
  4. 127 |
  5. 128 | Fetch the requests. How these get prioritised is entirely up to the implementation. It 129 | is common to run them all in parallel and abort them with the first success response. 130 | Note that the .well-known path may redirect, so be ready to handle that. 131 | This makes it possible to create sites that are published the usual way and to have a RASL that 132 | is simply a redirect to the resource. So for instance, you may have an existing 133 | https://berjon.com/kitten.jpg the CID for which is 134 | bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 135 | This can be published as this RASL URL: 136 | rasl://bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4/?hint=berjon.com. 137 | A client can retrieve it by constructing the a request to this URL: 138 | https://berjon.com/.well-known/rasl/bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 139 | In turn, the latter may simply return a 307 redirect back to https://berjon.com/kitten.jpg. 140 | (Yes, this is HTTP with extra steps, but the extra steps get you self-certifying content.) 141 |
  6. 142 |
  7. 143 | If the response is a redirect but not a 307, the client SHOULD treat it as if it 144 | had been a 307 anyway. 145 |
  8. 146 |
  9. 147 | If none of the responses are successful, return failure. 148 |
  10. 149 |
  11. 150 | Set the response's media type to application/octet-stream. (The server should have 151 | done that already, but may not have done so, notably if it relied on a redirect.) The purpose 152 | of RASL is to retrieve data in ways that are independent of the server — any media type 153 | processing must therefore take place at another layer. Without this, we lose the self-certifying 154 | nature of the system. (Note that servers are encouraged to enforce that so as not to have their 155 | RASL endpoints used for general-purpose web serving, which can be a security vector depending on 156 | where the data being served came from.) 157 |
  12. 158 |
  13. 159 | Produce a CID for the retrieved data. If that CID does not match the requested cid, 160 | return failure. 161 |
  14. 162 |
  15. 163 | Return the data. 164 |
  16. 165 |
166 |
167 |
168 |
169 |

RASL Pathing

170 |

171 | Implementations SHOULD ignore paths in RASL URLs. They may be used in a future 172 | iteration of this specification. 173 |

174 |
175 | 176 | 177 | -------------------------------------------------------------------------------- /cid.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | Content IDs (CIDs) 21 | 22 |

Content IDs (CIDs)

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | DASL CIDs are a simple structured identifier format for content addressing. They encapsulate a hash 25 | with enough metadata to be extensible (to add new hash types in the future) and to indicate whether 26 | they are pointing to raw bytes or to structured data. 27 |

28 |
29 | 30 |
31 |

Introduction

32 |

33 | DASL CIDs are a simple structured identifier format for content addressing. They encapsulate a hash 34 | with enough metadata to be extensible (to add new hash types in the future) and to indicate whether 35 | they are pointing to raw bytes or to structured data. If you're simply using DASL CIDs as identifiers, you 36 | can almost certainly just use the string as an opaque ID and worry no further. 37 |

38 |

39 | A DASL CID can be represented as a string or as an array of bytes. If you wish to understand the 40 | internals of a CID, it has the following structure: 41 |

42 |
    43 |
  1. 44 | A b prefix (only in string form). This is an extensibility point for future 45 | CID encodings other than the current base32 to be supported. (Currently this is the only one.) 46 |
  2. 47 |
  3. 48 | A version number, which is currently always 1. 49 |
  4. 50 |
  5. 51 | A content codec, which is a flag indicating whether it is pointing to structured or raw 52 | data. 53 |
  6. 54 |
  7. 55 | A hash type, that is always SHA-256 ([sha256]). 56 |
  8. 57 |
  9. 58 | A hash size, that is always 32 (0x20). 59 |
  10. 60 |
  11. 61 | A digest, which is the hash of the content being identified. 62 |
  12. 63 |
64 |
65 |
66 |

Parsing CIDs

67 |

68 | Use the following steps to parse a string-encoded CID, i.e. translate it to a bytestring: 69 |

70 |
    71 |
  1. Accept a string CID.
  2. 72 |
  3. Remove the first character from CID and store it in prefix.
  4. 73 |
  5. If prefix is not equal to b, throw an error.
  6. 74 |
  7. 75 | Decode the rest of CID using 76 | the base32 algorithm from 77 | RFC4648 with a lowercase alphabet and store the result in CID bytes ([rfc4648]). 78 |
  8. 79 |
  9. This results in CID bytes, which can be used to decode a CID.
  10. 80 |
81 |

82 | Use the following steps to decode a CID: 83 |

84 |
    85 |
  1. Accept an array of bytes CID bytes.
  2. 86 |
  3. 87 | Remove the first byte in CID bytes and store it in version. 88 |
  4. 89 |
  5. If version is not equal to 1, throw an error.
  6. 90 |
  7. 91 | Remove the next byte in CID bytes and store it in codec. 92 |
  8. 93 |
  9. 94 | If codec is not equal to 0x55 (raw) or 0x71 (DRISL), 95 | throw an error ([drisl]). 96 |
  10. 97 |
  11. 98 | Remove the next byte in CID bytes and store it in hash type. 99 |
  12. 100 |
  13. 101 | If hash type is not equal to 0x12 (SHA-256), throw an error ([sha256]). 102 |
  14. 103 |
  15. 104 | Read one byte from CID bytes and store it in hash size. If hash size 105 | is any value other than 32 (0x20) , throw an error. 106 |
  16. 107 |
  17. 108 | Read 32 bytes from CID bytes and store them in digest. If there were 109 | fewer than 32 bytes left in CID bytes, throw an error. 110 |
  18. 111 |
  19. 112 | Return version, codec, hash type, hash size, 113 | and digest. 114 |
  20. 115 |
116 |
117 |
118 |

Relationship to IPFS

119 |

120 | You don't need to understand IPFS in order to use DASL. This section is for informational 121 | purposes only. 122 |

123 |

124 | DASL CIDs are a strict subset of IPFS CIDs 125 | with the following properties: 126 |

127 |
    128 |
  • Only modern CIDv1 CIDs are used, not legacy CIDv0.
  • 129 |
  • 130 | Only the lowercase base32 multibase encoding (the b prefix) is used for human-readable 131 | (and subdomain-usable) string encoding. 132 |
  • 133 |
  • 134 | Only the raw binary multicodec (0x55) and dag-cbor multicodec (0x71), with the 135 | latter used only for [drisl]-conformant DAGs of CBOR objects. 136 |
  • 137 |
  • Only SHA-256 (0x12) for the hash function .
  • 138 |
  • 139 | The CID isn't the boss of anyone, but the expectation is that, regardless of size, resources 140 | should not be "chunked" into a DAG or Merkle tree (as historically done with UnixFS canonicalization 141 | in IPFS systems) but rather hashed in their entirety and content-addressed directly. That being 142 | said, a DASL CID can point to a piece of [drisl] metadata that describes this kind of 143 | chunking, if needed. (A separate specification may be added for that.) 144 |
  • 145 |
  • 146 | This set of options has the added advantage that all the aforementioned single-byte prefixes require no 147 | additional varint processing or byte-fiddling. 148 |
  • 149 |
150 |
151 | 152 | 153 |

References

[drisl]
Robin Berjon & Juan Caballero. DRISL — Deterministic Representation for Interoperable Structures & Links. 2025-10-20. URL: https://dasl.ing/drisl.html
[rfc4648]
S. Josefsson. The Base16, Base32, and Base64 Data Encodings. October 2006. URL: https://www.rfc-editor.org/rfc/rfc4648
[sha256]
National Institute of Standards and Technology, Secure Hash Algorithm. NIST FIPS 180-2. August 2002.
-------------------------------------------------------------------------------- /sisl.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import { argv, exit } from 'node:process'; 3 | import { dirname, basename, join } from 'node:path'; 4 | import { rm, readFile, writeFile, readdir } from 'node:fs/promises'; 5 | import chokidar from 'chokidar'; 6 | import chalk from 'chalk'; 7 | import { JSDOM } from 'jsdom'; 8 | 9 | // SISL — Simple Implementation of a Specification Language 10 | // This is just a basic spec generator. Here's what it does: 11 | // - Watches *.src.html to know which specs to generate. 12 | // - Pulls metadata from those specs so they can reference one another. 13 | // - Watches bibliography.json for references that specs can use. 14 | // - Parses [[ref]] as a reference. 15 | // - Manages metadata and styling for specs. 16 | // - Creates anchors for definitions and the such 17 | 18 | class SISL { 19 | constructor (dir) { 20 | this.baseDir = dir; 21 | } 22 | async watch () { 23 | // For reasons that baffle me, chokidar's ignored option doesn't work correctly. So 24 | // we filter ourselves. 25 | const buildIfMatch = (path) => { 26 | if (basename(path) !== 'bibliography.json' && !path.endsWith('.src.html')) return; 27 | this.build(); 28 | }; 29 | const removeIfMatch = (path) => { 30 | if (!path.endsWith('.src.html')) return; 31 | this.removeSpec(path); 32 | }; 33 | chokidar 34 | .watch(this.baseDir, { 35 | depth: 0, 36 | ignoreInitial: true, 37 | }) 38 | .on('add', (path) => buildIfMatch(path)) 39 | .on('change', (path) => buildIfMatch(path)) 40 | .on('unlink', (path) => removeIfMatch(path)) 41 | .on('ready', () => this.build()) 42 | ; 43 | } 44 | async build () { 45 | // load the bibliography 46 | let bibliography; 47 | try { 48 | bibliography = JSON.parse(await readFile(join(this.baseDir, 'bibliography.json'))); 49 | } 50 | catch (err) { 51 | this.die(err.message); 52 | } 53 | // list specs 54 | const specs = {}; 55 | const specList = (await readdir(this.baseDir)).filter(f => /\.src\.html$/.test(f)); 56 | for (const s of specList) { 57 | const dom = new JSDOM(await readFile(s, 'utf8')); 58 | const { window: { document: doc } } = dom; 59 | specs[basename(s).replace(/\.src\.html$/, '')] = { dom, doc }; 60 | } 61 | // extract metadata from all src and add to biblio 62 | Object.keys(specs).forEach(shortname => { 63 | bibliography[shortname] = this.htmlifyReference({ 64 | author: 'Robin Berjon & Juan Caballero', 65 | title: specs[shortname].doc.title, 66 | date: today(), 67 | url: `https://dasl.ing/${shortname}.html`, 68 | }); 69 | }); 70 | for (const shortname of Object.keys(specs)) { 71 | const { dom, doc } = specs[shortname]; 72 | const el = makeEl(doc); 73 | console.warn(`--- Processing ${shortname} "${doc.title}" (${doc.body.innerHTML.length}) ---`); 74 | // css 75 | const abstract = doc.querySelector('#abstract'); 76 | if (!abstract) this.err(`Missing abstract in ${doc.title}`); 77 | const head = doc.querySelector('head'); 78 | const cmt = doc.createComment(` 79 | 80 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 81 | !!!!! GENERATED SPEC — DO NOT EDIT. Look for the .src.html instead !!!! 82 | !!!!! !!!! 83 | !!!!! HEY YOU !!!! 84 | !!!!! YES ***YOU****! !!!! 85 | !!!!! !!!! 86 | !!!!! You're about to edit a generated document. !!!! 87 | !!!!! Don't do that! Why would you do that. !!!! 88 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 89 | 90 | `); 91 | head.prepend(doc.createTextNode('\n\n'), cmt, doc.createTextNode('\n\n')); 92 | el('link', { rel: 'stylesheet', href: 'spec.css' }, [], head); 93 | el('link', { rel: 'icon', href: 'data:image/svg+xml,' }, [], head); 94 | el('meta', { name: 'twitter:card', content: 'summary_large_image' }, [], head); 95 | el('meta', { name: 'twitter:title', property: 'og:title', content: `DASL: ${doc.title}` }, [], head); 96 | if (abstract) el('meta', { name: 'twitter:description', property: 'og:description', content: norm(abstract.textContent) }, [], head); 97 | el('meta', { name: 'twitter:image', property: 'og:image', content: `https://dasl.ing/${shortname}.png` }, [], head); 98 | el('meta', { name: 'twitter:image:alt', content: 'Very colourful stripes, so colourful it hurts' }, [], head); 99 | el('meta', { name: 'twitter:url', property: 'og:url', content: 'https://dasl.ing/' }, [], head); 100 | el('meta', { property: 'og:site_name', content: 'DASL' }, [], head); 101 | el('meta', { property: 'og:locale', content: 'en' }, [], head); 102 | el('meta', { name: 'theme-color', content: '#00ff75' }, [], head); 103 | 104 | // main & header 105 | const main = doc.createElement('main'); 106 | const header = el('header', {}, [el('h1', {}, [doc.title])], main); 107 | el( 108 | 'table', 109 | {}, 110 | [ 111 | el('tr', {}, [ 112 | el('th', {}, ['date']), 113 | el('td', {}, [today()]), 114 | ]), 115 | el('tr', {}, [ 116 | el('th', {}, ['editors']), 117 | el('td', {}, [ 118 | el('a', { href: 'https://berjon.com/' }, ['Robin Berjon']), 119 | ' <', el('a', { href: 'mailto:robin@berjon.com' }, ['robin@berjon.com']), '>', 120 | el('br'), 121 | el('a', { href: 'https://bumblefudge.com/' }, ['Juan Caballero']), 122 | ' <', el('a', { href: 'mailto:bumblefudge@learningproof.xyz' }, ['bumblefudge@learningproof.xyz']), '>', 123 | ]), 124 | ]), 125 | el('tr', {}, [ 126 | el('th', {}, ['issues']), 127 | el('td', {}, [ 128 | el('a', { href: 'https://github.com/darobin/dasl.ing/issues' }, ['list']), 129 | ', ', 130 | el('a', { href: 'https://github.com/darobin/dasl.ing/issues/new' }, ['new']), 131 | ]), 132 | ]), 133 | el('tr', {}, [ 134 | el('th', {}, ['abstract']), 135 | el('td', {}, [abstract]), 136 | ]), 137 | ], 138 | header 139 | ); 140 | main.append(...doc.body.childNodes); 141 | doc.body.append(main); 142 | // nav back 143 | const bk = el('div', { class: 'nav-back' }, [ 144 | 'A specification of the ', 145 | el('a', { href: '/' }, ['DASL Project']), 146 | '.' 147 | ]); 148 | doc.body.prepend(bk); 149 | // definitions & xrefs 150 | [...doc.querySelectorAll('dfn')].forEach(dfn => { 151 | const id = slugify(doc, dfn, 'dfn', true); 152 | dfn.setAttribute('id', id); 153 | }); 154 | [...doc.querySelectorAll('a:not([href])')].forEach(a => { 155 | const id = slugify(doc, a, 'dfn'); 156 | if (doc.getElementById(id)) { 157 | a.setAttribute('href', `#${id}`); 158 | a.className = 'dfn-ref'; 159 | } 160 | else { 161 | this.err(`Empty link "${a.textContent}" (#${id}) has no matching dfn.`); 162 | } 163 | }); 164 | // references 165 | const refs = {}; 166 | main.innerHTML = main.innerHTML.replace( 167 | /\[\[([\w-]+)\]\]/g, 168 | (_, ref) => { 169 | if (!bibliography[ref]) { 170 | this.err(`No "${ref}" entry in the bibliography.`); 171 | return `[[${ref}]]`; 172 | } 173 | refs[ref] = bibliography[ref]; 174 | return `[${ref}]`; 175 | } 176 | ); 177 | if (Object.keys(refs).length) { 178 | const refSec = el('section', {}, [el('h2', {}, ['References'])], main); 179 | const dl = el('dl', {}, [], refSec); 180 | Object.keys(refs).sort().forEach(r => { 181 | el('dt', { id: `ref-${r}` }, [`[${r}]`], dl); 182 | const dd = el('dd', {}, [], dl); 183 | dd.innerHTML = refs[r]; 184 | }); 185 | } 186 | // save 187 | await writeFile(join(this.baseDir, `${shortname}.html`), dom.serialize()); 188 | } 189 | } 190 | async removeSpec (absPath) { 191 | await rm(this.srcToSpec(absPath)); 192 | } 193 | htmlifyReference ({ author, title, date, url }) { 194 | return `${esc(author)}. ${esc(title)}. ${esc(date)}. URL: ${esc(url)}` 195 | } 196 | srcToSpec (path) { 197 | return path.replace(/\.src\.html$/, '.html'); 198 | } 199 | err (str) { 200 | console.error(chalk.red(str)); 201 | } 202 | die (str) { 203 | this.err(str); 204 | exit(1); 205 | } 206 | } 207 | 208 | function makeEl (doc) { 209 | return (n, attr, kids, parent) => { 210 | const el = doc.createElement(n); 211 | if (attr) Object.keys(attr).forEach((k) => el.setAttribute(k, attr[k])); 212 | if (kids) { 213 | kids.forEach(k => { 214 | if (typeof k === 'string') k = doc.createTextNode(k); 215 | el.append(k); 216 | }); 217 | } 218 | if (parent) parent.append(el); 219 | return el; 220 | }; 221 | } 222 | 223 | function slugify (doc, el, pfx, unique) { 224 | if (el.hasAttribute('id')) return el.getAttribute('id'); 225 | let suf; 226 | const txt = (norm(el.textContent) || 'empty').toLowerCase().replace(/\W/g, '-').replace(/-{2,}/g, '-').replace(/^-|-$/g, ''); 227 | const idify = () => [pfx, txt, suf].filter(Boolean).join('-'); 228 | let id = idify(); 229 | if (unique) { 230 | while (doc.getElementById(id)) { 231 | if (!suf) suf = 0; 232 | suf++; 233 | id = idify(); 234 | } 235 | } 236 | return id; 237 | } 238 | 239 | function today () { 240 | return new Date().toISOString().replace(/T.+/, ''); 241 | } 242 | 243 | function esc (str) { 244 | return (str || '').replace(/&/g, '&').replace(/ 2 | 3 | 4 | 5 | 6 | Content-Addressable aRchives (CAR) 7 | 8 | 9 |
10 |

11 | The CAR format offers a serialized representation of set of content-addressed 12 | resources in one single concatenated stream, alongside a header that describes 13 | that content. 14 |

15 |
16 |
17 |

Introduction

18 |

19 | The CAR format (Content Addressable aRchives) is used to store series of 20 | content-addressable objects as a sequence of bytes. It packages that stream of 21 | objects with a header. 22 |

23 |

24 | Much of the content of this specification was initially developed as part 25 | of the IPLD project. This specification 26 | was developed based on demand from the community to have just the one simplified 27 | document. Note that a CARv2 specification was developed at some point to add 28 | support for an index trailer, but it met with limited adoption and so was not 29 | considered when bringing CAR into DASL. 30 |

31 |
32 |
33 |

Parsing CAR

34 |

35 | The CAR format is made of a Header followed by a Body. The Header is a length-prefixed 36 | chunk of DRISL ([[drisl]]) and the Body is a sequence of zero or more length-prefixed 37 | blocks that contain a tuple of a DASL CID ([[cid]]) which is always 36 bytes long and 38 | the data addressed by that CID. 39 | The length prefix in a CAR is encoded as an unsigned variable-length 40 | integer ([[varint]], a variant of LEB128). 41 | This integer specifies the number of remaining bytes, excluding 42 | the bytes used to encode the integer, but including the CID for Body blocks. 43 |

44 |
|------ Header -----| |------------------- Body -------------------|
 45 | [ int | DRISL block ] [ int | CID | data ] [ int | CID | data ] …
 46 |       
47 |

48 | The steps to parse a CAR are: 49 |

50 |
    51 |
  1. 52 | Accept a byte stream bytes that is consumed with every step 53 | that reads from it. 54 |
  2. 55 |
  3. 56 | Run the steps to parse a CAR header with bytes to obtain 57 | metadata. 58 |
  4. 59 |
  5. 60 | Set up array blocks and run these substeps: 61 |
      62 |
    1. If bytes is empty, terminate these substeps.
    2. 63 |
    3. 64 | Run the steps to parse a CAR block header with bytes 65 | to obtain cid and data size. 66 |
    4. 67 |
    5. 68 | Read data size bytes from bytes and store the 69 | result in data. 70 |
    6. 71 |
    7. 72 | Push an entry onto blocks containing cid, 73 | data size, and data. 74 |
    8. 75 |
    9. Return to the beginning of these substeps.
    10. 76 |
    77 |
  6. 78 |
  7. 79 | Return metadata and blocks. 80 |
  8. 81 |
82 |

83 | Note that the CAR header contains a near-arbitrary DRISL object that is to be 84 | treated as metadata ([[drisl]]). For historical reasons, there are two 85 | constraints on the header: 86 |

87 | 102 |

103 | Some implementations will only return version and roots, 104 | but it is RECOMMENDED that they make the entire metadata object 105 | available. A best practice for authors is to use the metadata 106 | to capture MASL content, which is able to provide metadata and a pathing 107 | mapping for the entire content of the CAR stream if needed ([[masl]]). 108 |

109 |

110 | The steps to parse a CAR header are: 111 |

112 |
    113 |
  1. Accept a byte stream bytes.
  2. 114 |
  3. Read an unsigned varint length from bytes ([[varint]]).
  4. 115 |
  5. If length is 0, throw an error.
  6. 116 |
  7. 117 | Read length bytes from bytes and decode them as 118 | DRISL ([[drisl]]) into metadata. If metadata is 119 | not a map, throw an error. 120 |
  8. 121 |
  9. 122 | If metadata does not have a version key entry 123 | with integer value 1, throw an error. Otherwise, store 124 | version in version. 125 |
  10. 126 |
  11. 127 | If metadata does not have a roots key entry 128 | that is an array, or if that array contains anything other than DASL 129 | CIDs, throw an error. Otherwise, store roots in 130 | roots. 131 |
  12. 132 |
  13. 133 | Return metadata. (For implementations that only report 134 | version and roots, return those.) 135 |
  14. 136 |
137 |

138 | After its header, CAR contains a series of blocks each of which is 139 | length-prefixed and has a small header capturing a CID followed by 140 | the block's body data. 141 |

142 |

143 | The steps to parse a CAR block header are: 144 |

145 |
    146 |
  1. Accept a byte stream bytes.
  2. 147 |
  3. Read an unsigned varint length from bytes ([[varint]]).
  4. 148 |
  5. If length is 0, throw an error.
  6. 149 |
  7. 150 | Read a CID ([[cid]]) from bytes and store it in cid. 151 | Note: the length of the CID is always 36 bytes. 152 |
  8. 153 |
  9. Set data size to length minus 36 (the CID length).
  10. 154 |
  11. 155 | Return data size and cid. 156 |
  12. 157 |
158 |
159 |
160 |

Additional Considerations

161 |
162 |

Conformance

163 |

164 | A CAR stream must only feature DASL CIDs. 165 |

166 |

167 | A CAR stream must have CIDs that match the data body that follows 168 | them. A CAR implementation should verify that CIDs match block body data, though 169 | it may delegate verification to other components. (Keep in mind that not 170 | verifying at all negates the value of content addressing.) 171 |

172 |

173 | A CAR stream's stated roots must match CIDs contained in the Body. 174 | However, implementations frequently operate in a streaming fashion such that 175 | they have no way of knowing whether a CAR stream conforms to this 176 | requirement before having processed the entire stream. Checking 177 | correctness with respect to this requirement may therefore be more 178 | readily performed via a warning (at end of processing) or a dedicated 179 | validator. 180 |

181 |
182 |
183 |

Determinism

184 |

185 | Deterministic CAR creation is not covered by this specification. However, deterministic 186 | generation of a CAR from a given graph is possible and is relied upon by certain uses of 187 | the format, most notably, Filecoin. 188 | dCAR may be the topic of a future specification. 189 |

190 |

191 | Care regarding the ordering of the roots array in the Header and avoidance 192 | of duplicate blocks may also be required for strict determinism. 193 |

194 |
195 |
196 |

Security & Verifiability

197 |

198 | The roots specified by the Header of a CAR is expected to appear somewhere in its Body section, 199 | however there is no requirement that the roots define entire DAGs, nor that all blocks 200 | in a CAR must be part of DAGs described by the root CIDs in the Header. Therefore, the 201 | roots must not be used alone to determine or differentiate the contents of a CAR. 202 |

203 |

204 | The CAR format contains no internal means, beyond the blocks and their CIDs, to verify 205 | or differentiate contents. Where such a requirement exists, this must be performed 206 | externally, such as creating a digest of the entire CAR (and refer to it using a CID). 207 |

208 |
209 |
210 |
211 |

Appendix: Media Type

212 |

213 | The media type for CAR is 214 | application/vnd.ipld.car. 215 |

216 |

217 | The conventional file extension for CAR is .car. 218 |

219 |
220 | 221 | 222 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | DASL — Data-Addressed Structures & Links 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |

DASL — Data-Addressed Structures & Links

23 | 31 |
32 |
33 |

What is this?

34 |

35 | DASL ("dazzle") is a small set of simple, standard primitives for working with content-addressed, 36 | linked data. It builds on content addressing, a proven approach used in Git and 37 | IPFS to 38 | create reliable content identifiers (known as CIDs) through cryptographic hashing. Content addressing 39 | enables robust data integrity checks and efficient networking: systems can verify they received exactly 40 | what they asked for and avoid downloading the same content twice. The linked data part lets you link to 41 | stuff by its hash. You can build very big graphs with these primitives, such as the graph behind Bluesky. 42 |

43 |

44 | We call DASL "data-addressed" because it supports a data serialization component that makes 45 | content-addressing sweet and easy when 46 | working with data. The design is inspired by subcomponents of the 47 | IPFS universe, but simplified to improve 48 | interoperability, decrease costs, and work well with the web. More specifically, our priorities are: 49 |

50 |
    51 |
  • 52 | pave the cowpaths: we focus on supporting what people trying to solve real-world 53 | problems actually use. This takes over any consideration of engineering ideals or theoretical purity. 54 | We're retconning the spec to what people actually use implement — as it should be. 55 |
  • 56 |
  • 57 | extensibility vs optionality: extensibility is important for long-lived distributed 58 | systems, because the world will happen and you will need to change. But introducing optionality 59 | reduces interoperability and increases cost of both implementation and adoption. So rather than 60 | require support for many options now, we have extension points now but deliberately don't use their 61 | full range. 62 |
  • 63 |
  • 64 | don't make me think: you don't want to be thinking about content addressing. You 65 | want to grab this off the shelf and have something that works out of the box. Nothing weird, no 66 | impedance mismatch with the systems you know and love (or maybe know and hate, but whatever, it 67 | just works). 68 |
  • 69 |
  • 70 | lightweight loading: some people like JavaScript, others don't. We don't care, we 71 | just want things that work. What's certain is that you can't ignore it and be relevant. The ability 72 | to ship small code to the browser is critical. 73 |
  • 74 |
  • 75 | Unix philosophy: all of our specs are tiny and meant to compose together in simple 76 | ways that can be implemented independently from one another. 77 |
  • 78 |
79 |

80 | This is intended to work for the community, to grow support for what we need. If you have thoughts, don't 81 | be shy and submit an issue! No stupid questions, 82 | don't assume everyone else has context that you don't. If this page isn't enough to understand DASL, 83 | then we're the ones who screwed up. 84 |

85 |
86 |
87 |

How

88 |

89 | This section describes how to use DASL patterns. It's work in progress! 90 |

91 |
92 |
93 |

Implementations

94 |

95 | DASL is a strict subset of IPFS CIDs and IPLD, so existing IPFS and IPLD implementations will just 96 | read DASL CIDs and the MASL documents they point to without so much as a hiccup. Some implementations also specifically target a DASL subset. 97 |

98 |

Here are some implementations that partially or fully support DASL:

99 |
    100 |
  • 101 | atcute (JS/TS): a collection of lightweight 102 | packages to make working with Bluesky and the ATmosphere easy. 103 |
  • 104 |
  • 105 | dag-cbrrr (Python): fast DAG-CBOR 106 | implementation. 107 |
  • 108 |
  • 109 | python-libipld (Python): a Python 110 | wrapper around Rust, focused on the ATmosphere. 111 |
  • 112 |
  • 113 | ipld-core (Rust): fast Rust implementation. 114 |
  • 115 |
  • 116 | @dasl/rasl (TS/JS): an implementation of RASL 117 | that's a drop-in handler for ExpressJS. 118 |
  • 119 |
  • 120 | rust_cid_npm (Rust): Fast and tiny rust 121 | library, CLI tool, and npm package to generate CIDs. 122 |
  • 123 |
  • 124 | go-cid (Go): implements the CID spec 125 |
  • 126 |
  • 127 | Kubo/Boxo (Go): 128 | the Swiss-Army chainsaw of all things IPFS. 129 |
  • 130 |
  • 131 | Helia (JS/TS): a browser- and CDN-friendly, modular, "import only what you need" JS implementation of IPFS. 132 |
  • 133 |
134 |

As of June 2025, a DASL test suite is in development. View the compliance matrix or the source code.

135 |
136 |
137 |

Specifications

138 |
139 |
140 | Content Identifiers (CIDs) 141 |
142 |
143 | CIDs (Content IDs) are identifiers used for addressing resources by their contents, essentially a hash 144 | with limited metadata. 145 |
146 |
147 | Deterministic Representation for Interoperable Structures and Links (DRISL) 148 |
149 |
150 | DRISL is a profile of deterministic CBOR used to ensure that the same data will have the same CID; 151 | it features native support for using binary CIDs as compact links between documents. 152 |
153 |
154 | Content-Addressable aRchives (CAR) 155 |
156 |
157 | The CAR format offers a serialized representation of set of content-addressed 158 | resources in one single concatenated stream, alongside a header that describes 159 | that content. 160 |
161 |
162 | MASL — Metadata for Arbitrary Structures & Links 163 |
164 |
165 | MASL is a type of CBOR metadata document that is designed to work well with content-addressed 166 | and decentralised systems, to enable fully self-contained, self-certified content 167 | distribution. 168 |
169 |
170 | RASL — Retrieval of Arbitrary Structures & Links 171 |
172 |
173 | RASL is a URL scheme used to identify content-addressed DASL resources 174 | along with a simple HTTP-based retrieval method. 175 |
176 |
177 | Big DASL (BDASL) 178 |
179 |
180 | This extends DASL CIDs with a new hash type that works better for large files but isn't 181 | available by default in browsers, and therefore not an appropriate option in most 182 | situations. 183 |
184 |
185 | IPFS Interoperability Considerations 186 |
187 |
188 | DASL components are designed to be small and to the extent possible self-contained. 189 | Because of that, despite having roots in IPFS, no DASL component depends on 190 | traditional IPFS implementations. In many cases, systems produced to work with 191 | DASL will interoperate with IPFS, but DASL's independence means that there can 192 | occasionally be impedance mismatch. This document is a non-normative list of 193 | things to consider when using DASL with IPFS systems, particularly with ones based 194 | on the DHT and Bitswap. 195 |
196 |
197 |
198 |
199 |

200 | Made with 👾 by the IPFS Foundation. 201 |

202 | 208 |
209 |
210 | 211 | 212 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /drisl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | DRISL — Deterministic Representation for Interoperable Structures & Links 21 | 22 |

DRISL — Deterministic Representation for Interoperable Structures & Links

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | DRISL is a serialization format that is deterministic (so that the same 25 | data will have the same CID) and that features native support for using 26 | CIDs as links. 27 | It is based on CBOR, using a narrow profile of CBOR's "Core" featureset called "[cborc-42]", specified formally in this IETF document. 28 |

29 |
30 | 31 |
32 |

Introduction

33 |

34 | Deterministic encodings that produce the same stream of bytes for any 35 | given data with the same semantics are particularly useful in a content-addressed 36 | context. DRISL provides that, compactly encoded as CBOR. Additionally, it supports CBOR's Tag 42 to compactly encode CIDs ([cid]) as bytestreams. This CID can be used for content-addressed linking 37 | between DRISL documents (such as MASL documents), or to resources (best wrapped in MASL documents where renderability as web documents or web apps is desired). 38 |

39 |

40 | DRISL does not fork CBOR, CDE, or dCBOR ([cbor], [cde], [dcbor]), but it is a subset of features defined in CBOR "Core" ([cborc]), first defined in the earliest CBOR RFC and largely unaffected by refinements made since. 41 | Any decoder for any version of CBOR since v1 will be able to read DRISL 42 | content as conformant CBOR, and with enough carefully configuration of a powerful CBOR library and in some case pre-processing of the data, DRISL can be encoded anywhere CBOR can. 43 |

44 |
45 |
46 |

Format

47 |

48 | DRISL is an application profile of CBOR ([cbor]) that mostly subsets the more established [cborc] profile, with the following additional 49 | constraints: 50 |

51 |
    52 |
  • 53 | Implementations MUST support Tag 42 in the CBOR 54 | Tag registry; this tag compactly encodes CIDs as bytestrings, as specified below. 55 |
  • 56 |
  • 57 | Implementations MUST reject all other tags, including any of the tags 58 | listed in the section 59 | 3.4 of RFC 8949. 60 |
  • 61 |
  • 62 | Implementations MUST reject map keys that are not strings. 63 |
  • 64 |
  • 65 | Floating-point numbers MUST always be encoded as a 64-bit IEEE 754 binary floating-point, never as a "half-precision" (16-byte, major 7-25) or "single-precision (32-byte, major 7-26)" CBOR key. 66 | NOTE: It is RECOMMENDED that users avoid encoding floating-point numbers as much as possible 67 | to minimize interoperability and tooling issues. 68 |
      69 |
    • 70 | Completely avoiding floating-point numbers is RECOMMENDED to minimize interoperability and tooling issues. 71 |
    • 72 |
    • 73 | Even where floating-point numbers are used, most of the IEEE 754 "special" floating points (infinity, negative infinity, minimal NaN, and NaN with payloads) MUST NOT be encoded. 74 | Negative zero is the only allowed special floating point. 75 |
    • 76 |
    77 |
  • 78 |
  • 79 | Indefinite-length arrays (and the "break" code making them usable, in major type 7) are not allowed. 80 |
  • 81 |
  • 82 | Similarly, indefinite, incomplete, or streaming CBOR cannot be hashed and thus cannot be referenced by CID; for this reason, DRISL can only encode finite, bounded documents and resources. 83 |
  • 84 |
  • 85 | Concatenation of DRISL objects is generally discouraged and incurs both performance and interoperability risks. 86 |
      87 |
    • 88 | Note that DRISL objects cannot be streamed as CBOR streams (defined in RFC 8742) except in MIME-type aware contexts, as per the CBOR streams specification. 89 |
    • 90 |
    • 91 | Applications are discouraged from handling concatenated DRISL objects or appending extra bytes of any kind to a DRISL object in memory or across interfaces, as doing so breaks the DRISL-wide assumption that each CID refers to one complete, discrete, and valid CBOR object, and that DRISL systems only ever will be expected to handle such objects. 92 |
    • 93 |
    94 |
  • 95 |
  • 96 | Encoders MUST NOT encode any simple values other than true, false, and null (20, 21, and 22 in section 3.3 of [rfc8949]). 97 |
  • 98 |
99 |

100 | All other requirements are as CBOR/c ([cborc]). 101 |

102 |
103 |
104 |

CIDs in CBOR

105 |

106 | CIDs in CBOR are stored in binary format, as CBOR bytestrings under custom tag 42. For historical reasons the null 107 | byte 0x00 is prepended to the binary CID before storing in CBOR. 108 |

109 |

110 | For more information, see the [cbor-tag42] appendix to the [drisl] specification. 111 |

112 |
113 |
114 |

Conversion with JSON

115 |

116 | JSON lacks a native way to encode tag 42 for CIDs ([cbor-tag42], [cid]). Historically, there have 117 | been different conventions to represent CIDs in JSON. For example, DAG-JSON, part of IPLD, used 118 | an object with a single / key pointing to the stringified CID. 119 |

120 |

121 | The AT Protocol uses an object with a $link key pointing to the stringified DASL CID: 122 |

123 |
        {
124 |           "someSrc": {
125 |             "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4"
126 |           }
127 |         }
128 |       
129 |

130 | This specification recommends that implementations default to the AT Protocol $link 131 | convention, but may offer the option to support DAG-JSON or other conventions as well. 132 |

133 |
134 | 135 | 136 |

References

[cbor]
C. Bormann. & P. Hoffman. Concise Binary Object Representation (CBOR). October 2024. URL: https://www.rfc-editor.org/info/rfc8949
[cbor-tag42]
J. Caballero. Binary Content Identifiers. May 2025. URL: https://www.ietf.org/archive/id/draft-caballero-cbor-cborc42-00.html#name-binary-content-identifiers
[cborc]
A. Rundgren. Core CBOR Platform Profile. April 2025. URL: https://datatracker.ietf.org/doc/draft-rundgren-cbor-core/
[cborc-42]
J. Caballero, R. Berjon. The tag-42 profile of CBOR Core. May 2025. URL: https://datatracker.ietf.org/doc/draft-caballero-cbor-cborc42/
[cde]
C. Bormann. CBOR Common Deterministic Encoding (CDE). October 2024. URL: https://datatracker.ietf.org/doc/html/draft-ietf-cbor-cde-06
[cid]
Robin Berjon & Juan Caballero. Content IDs (CIDs). 2025-10-20. URL: https://dasl.ing/cid.html
[dcbor]
W. McNally, C. Allen, C. Bormann, & L. Lundblade. dCBOR: A Deterministic CBOR Application Profile. October 2024. URL: https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/
[drisl]
Robin Berjon & Juan Caballero. DRISL — Deterministic Representation for Interoperable Structures & Links. 2025-10-20. URL: https://dasl.ing/drisl.html
[rfc8949]
C. Bormann, P. Hoffman. Concise Binary Object Representation (CBOR). December 2020. URL: https://www.rfc-editor.org/rfc/rfc8949
-------------------------------------------------------------------------------- /rasl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | RASL — Retrieval of Arbitrary Structures & Links 21 | 22 |

RASL — Retrieval of Arbitrary Structures & Links

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | RASL is a URL scheme used to identify content-addressed DASL resources 25 | along with a simple HTTP-based retrieval method. 26 |

27 |
28 | 29 | 34 |
35 |

Introduction

36 |

37 | Content-addressed resources are "self-certifying," which is to say that 38 | you don't need any external authority to certify that the content you 39 | have when you resolve the identifier is correct: because the identifier 40 | contains a hash, you can (and should) verify that you obtained the right 41 | content yourself ([ipfs-principles]). The identifier is enough to 42 | certify the content. This has several implications, but two are 43 | particularly relevant for this specification: 44 |

45 |
    46 |
  • 47 | When resolving a content-addressed identifier, you can obtain the content 48 | from anyone. It doesn't have to be the content's author. You can even 49 | obtain it from entirely untrusted sources — given that you can always 50 | certify it, you don't need to trust whoever gives it to you. As a result, 51 | the authority part of a URL — the part that can certify the content you 52 | get, which is the domain part in an https URL — is the 53 | CID itself ([cid]). 54 |
  • 55 |
  • 56 | Because it doesn't matter where you get content from, content-addressed 57 | URLs are inherently transport-independent. There are benefits to agreeing 58 | on transport (if only so that people can find one another's content) 59 | but as a client, if you know of several potential ways of obtaining a 60 | CID you are free to use whichever you prefer or to try several in 61 | whatever order. 62 |
  • 63 |
64 |

65 | Taking these aspects into consideration, this specification defines a URL 66 | scheme in which the CID is the authority, along with optional hints of 67 | potential look-up locations, and defines a retrieval method but does not 68 | mandate that RASL retrieval rely on it. 69 |

70 |
71 |

The rasl URL Scheme

72 |

73 | RASL URLs look like this: 74 | rasl://bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4/?hint=berjon.com&hint=bsky.app. 75 | This breaks down into the following components: 76 |

77 |
    78 |
  • 79 | The rasl scheme. This is simply used as an entry point into RASL semantics. 80 |
  • 81 |
  • 82 | An authority, which is simply a DASL CID ([cid]), here bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 83 |
  • 84 |
  • 85 | A path (here just /) that is empty or / and that is expected 86 | to be ignored since RASL is only used for raw data retrieval. 87 |
  • 88 |
  • 89 | A query string part, that is parsed according to CGI rules and that contains 90 | zero or more hint entries, each of which is a host from which 91 | that CID can be obtained. 92 |
  • 93 |
94 |

95 | Use the following steps to parse a RASL URL: 96 |

97 |
    98 |
  1. Accept a string url and parse it according to the URL Standard ([url]).
  2. 99 |
  3. If that's a failure, return the failure.
  4. 100 |
  5. Read the host part of the parsed URL and store that in cid.
  6. 101 |
  7. If cid is not a valid CID ([cid]), return failure.
  8. 102 |
  9. 103 | Select all the tuples in the query object associated with the URL ([url]) whose name is 104 | exaclty hint. Each value MUST match the syntax of a valid host for the 105 | https scheme and values which do not match this syntax MUST be ignored 106 | and removed from this list. Store the remaining values in hints. If there were none 107 | then hints is an empty array. 108 |
  10. 109 |
  11. Return the URL's parts as well as cid and hints.
  12. 110 |
111 |
112 |
113 |

Fetching RASL

114 |

115 | A user agent may retrieve a CID in whichever way it prefers. This section 116 | provides a simple standard for HTTP-based CID retrieval, to make it 117 | easy for authors to publish content to their own sites and have it 118 | retrieved, without having to worry about operating any infrastructure 119 | beyond the web server they already have. 120 |

121 |

122 | Use the following steps to fetch a RASL URL: 123 |

124 |
    125 |
  1. Accept a string url and parse it according to the steps to parse a RASL URL.
  2. 126 |
  3. 127 | Construct a request using cid from the url as well as hints that may 128 | be from the URL or from elsewhere (this is entirely up to you): 129 |
      130 |
    1. 131 | For each hint, construct a request URL that is the concatenation of https://, 132 | the hint as host, /.well-known/rasl/, and the cid. 133 |
    2. 134 |
    3. 135 | Prepare the request such that it has a method of either GET or HEAD, 136 | that it is stateless (no cookies, no credentials of any kind), and that it uses no content 137 | negotiation. 138 |
    4. 139 |
    140 |
  4. 141 |
  5. 142 | Fetch the requests. How these get prioritised is entirely up to the implementation. It 143 | is common to run them all in parallel and abort them with the first success response. 144 | Note that the .well-known path may redirect, so be ready to handle that. 145 | This makes it possible to create sites that are published the usual way and to have a RASL that 146 | is simply a redirect to the resource. So for instance, you may have an existing 147 | https://berjon.com/kitten.jpg the CID for which is 148 | bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 149 | This can be published as this RASL URL: 150 | rasl://bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4/?hint=berjon.com. 151 | A client can retrieve it by constructing the a request to this URL: 152 | https://berjon.com/.well-known/rasl/bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4. 153 | In turn, the latter may simply return a 307 redirect back to https://berjon.com/kitten.jpg. 154 | (Yes, this is HTTP with extra steps, but the extra steps get you self-certifying content.) 155 |
  6. 156 |
  7. 157 | If the response is a redirect but not a 307, the client SHOULD treat it as if it 158 | had been a 307 anyway. 159 |
  8. 160 |
  9. 161 | If none of the responses are successful, return failure. 162 |
  10. 163 |
  11. 164 | Set the response's media type to application/octet-stream. (The server should have 165 | done that already, but may not have done so, notably if it relied on a redirect.) The purpose 166 | of RASL is to retrieve data in ways that are independent of the server — any media type 167 | processing must therefore take place at another layer. Without this, we lose the self-certifying 168 | nature of the system. (Note that servers are encouraged to enforce that so as not to have their 169 | RASL endpoints used for general-purpose web serving, which can be a security vector depending on 170 | where the data being served came from.) 171 |
  12. 172 |
  13. 173 | Produce a CID for the retrieved data. If that CID does not match the requested cid, 174 | return failure. 175 |
  14. 176 |
  15. 177 | Return the data. 178 |
  16. 179 |
180 |
181 |
182 |
183 |

RASL Pathing

184 |

185 | Implementations SHOULD ignore paths in RASL URLs. They may be used in a future 186 | iteration of this specification. 187 |

188 |
189 | 190 | 191 |

References

[cid]
Robin Berjon & Juan Caballero. Content IDs (CIDs). 2025-10-20. URL: https://dasl.ing/cid.html
[ipfs-principles]
Robin Berjon. IPFS Principles. march 2023. URL: https://specs.ipfs.tech/architecture/principles/
[url]
WHATWG. URL. Living Standard. URL: https://url.spec.whatwg.org/
-------------------------------------------------------------------------------- /car.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | Content-Addressable aRchives (CAR) 21 | 22 |

Content-Addressable aRchives (CAR)

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | The CAR format offers a serialized representation of set of content-addressed 25 | resources in one single concatenated stream, alongside a header that describes 26 | that content. 27 |

28 |
29 | 30 |
31 |

Introduction

32 |

33 | The CAR format (Content Addressable aRchives) is used to store series of 34 | content-addressable objects as a sequence of bytes. It packages that stream of 35 | objects with a header. 36 |

37 |

38 | Much of the content of this specification was initially developed as part 39 | of the IPLD project. This specification 40 | was developed based on demand from the community to have just the one simplified 41 | document. Note that a CARv2 specification was developed at some point to add 42 | support for an index trailer, but it met with limited adoption and so was not 43 | considered when bringing CAR into DASL. 44 |

45 |
46 |
47 |

Parsing CAR

48 |

49 | The CAR format is made of a Header followed by a Body. The Header is a length-prefixed 50 | chunk of DRISL ([drisl]) and the Body is a sequence of zero or more length-prefixed 51 | blocks that contain a tuple of a DASL CID ([cid]) which is always 36 bytes long and 52 | the data addressed by that CID. 53 | The length prefix in a CAR is encoded as an unsigned variable-length 54 | integer ([varint], a variant of LEB128). 55 | This integer specifies the number of remaining bytes, excluding 56 | the bytes used to encode the integer, but including the CID for Body blocks. 57 |

58 |
|------ Header -----| |------------------- Body -------------------|
 59 | [ int | DRISL block ] [ int | CID | data ] [ int | CID | data ] …
 60 |       
61 |

62 | The steps to parse a CAR are: 63 |

64 |
    65 |
  1. 66 | Accept a byte stream bytes that is consumed with every step 67 | that reads from it. 68 |
  2. 69 |
  3. 70 | Run the steps to parse a CAR header with bytes to obtain 71 | metadata. 72 |
  4. 73 |
  5. 74 | Set up array blocks and run these substeps: 75 |
      76 |
    1. If bytes is empty, terminate these substeps.
    2. 77 |
    3. 78 | Run the steps to parse a CAR block header with bytes 79 | to obtain cid and data size. 80 |
    4. 81 |
    5. 82 | Read data size bytes from bytes and store the 83 | result in data. 84 |
    6. 85 |
    7. 86 | Push an entry onto blocks containing cid, 87 | data size, and data. 88 |
    8. 89 |
    9. Return to the beginning of these substeps.
    10. 90 |
    91 |
  6. 92 |
  7. 93 | Return metadata and blocks. 94 |
  8. 95 |
96 |

97 | Note that the CAR header contains a near-arbitrary DRISL object that is to be 98 | treated as metadata ([drisl]). For historical reasons, there are two 99 | constraints on the header: 100 |

101 |
    102 |
  • 103 | The object MUST contain a version map entry, the value of which 104 | is always integer-type 1. Version numbers in data formats are 105 | an anti-pattern, and as a result this number is guaranteed never to change. 106 |
  • 107 |
  • 108 | The object MUST contain a roots entry, which MUST be of type 109 | array. It MAY be empty, but if it isn't then it must be an array of CIDs 110 | encoded using tag 42 ([cid]). A CAR can be used 111 | to contain one or more DAGs of [drisl] content and the purpose of the 112 | roots is to list one or more roots for those DAGs. The array 113 | may be empty if you do not care about encoding DAGs. 114 |
  • 115 |
116 |

117 | Some implementations will only return version and roots, 118 | but it is RECOMMENDED that they make the entire metadata object 119 | available. A best practice for authors is to use the metadata 120 | to capture MASL content, which is able to provide metadata and a pathing 121 | mapping for the entire content of the CAR stream if needed ([masl]). 122 |

123 |

124 | The steps to parse a CAR header are: 125 |

126 |
    127 |
  1. Accept a byte stream bytes.
  2. 128 |
  3. Read an unsigned varint length from bytes ([varint]).
  4. 129 |
  5. If length is 0, throw an error.
  6. 130 |
  7. 131 | Read length bytes from bytes and decode them as 132 | DRISL ([drisl]) into metadata. If metadata is 133 | not a map, throw an error. 134 |
  8. 135 |
  9. 136 | If metadata does not have a version key entry 137 | with integer value 1, throw an error. Otherwise, store 138 | version in version. 139 |
  10. 140 |
  11. 141 | If metadata does not have a roots key entry 142 | that is an array, or if that array contains anything other than DASL 143 | CIDs, throw an error. Otherwise, store roots in 144 | roots. 145 |
  12. 146 |
  13. 147 | Return metadata. (For implementations that only report 148 | version and roots, return those.) 149 |
  14. 150 |
151 |

152 | After its header, CAR contains a series of blocks each of which is 153 | length-prefixed and has a small header capturing a CID followed by 154 | the block's body data. 155 |

156 |

157 | The steps to parse a CAR block header are: 158 |

159 |
    160 |
  1. Accept a byte stream bytes.
  2. 161 |
  3. Read an unsigned varint length from bytes ([varint]).
  4. 162 |
  5. If length is 0, throw an error.
  6. 163 |
  7. 164 | Read a CID ([cid]) from bytes and store it in cid. 165 | Note: the length of the CID is always 36 bytes. 166 |
  8. 167 |
  9. Set data size to length minus 36 (the CID length).
  10. 168 |
  11. 169 | Return data size and cid. 170 |
  12. 171 |
172 |
173 |
174 |

Additional Considerations

175 |
176 |

Conformance

177 |

178 | A CAR stream must only feature DASL CIDs. 179 |

180 |

181 | A CAR stream must have CIDs that match the data body that follows 182 | them. A CAR implementation should verify that CIDs match block body data, though 183 | it may delegate verification to other components. (Keep in mind that not 184 | verifying at all negates the value of content addressing.) 185 |

186 |

187 | A CAR stream's stated roots must match CIDs contained in the Body. 188 | However, implementations frequently operate in a streaming fashion such that 189 | they have no way of knowing whether a CAR stream conforms to this 190 | requirement before having processed the entire stream. Checking 191 | correctness with respect to this requirement may therefore be more 192 | readily performed via a warning (at end of processing) or a dedicated 193 | validator. 194 |

195 |
196 |
197 |

Determinism

198 |

199 | Deterministic CAR creation is not covered by this specification. However, deterministic 200 | generation of a CAR from a given graph is possible and is relied upon by certain uses of 201 | the format, most notably, Filecoin. 202 | dCAR may be the topic of a future specification. 203 |

204 |

205 | Care regarding the ordering of the roots array in the Header and avoidance 206 | of duplicate blocks may also be required for strict determinism. 207 |

208 |
209 |
210 |

Security & Verifiability

211 |

212 | The roots specified by the Header of a CAR is expected to appear somewhere in its Body section, 213 | however there is no requirement that the roots define entire DAGs, nor that all blocks 214 | in a CAR must be part of DAGs described by the root CIDs in the Header. Therefore, the 215 | roots must not be used alone to determine or differentiate the contents of a CAR. 216 |

217 |

218 | The CAR format contains no internal means, beyond the blocks and their CIDs, to verify 219 | or differentiate contents. Where such a requirement exists, this must be performed 220 | externally, such as creating a digest of the entire CAR (and refer to it using a CID). 221 |

222 |
223 |
224 |
225 |

Appendix: Media Type

226 |

227 | The media type for CAR is 228 | application/vnd.ipld.car. 229 |

230 |

231 | The conventional file extension for CAR is .car. 232 |

233 |
234 | 235 | 236 |

References

[cid]
Robin Berjon & Juan Caballero. Content IDs (CIDs). 2025-10-20. URL: https://dasl.ing/cid.html
[drisl]
Robin Berjon & Juan Caballero. DRISL — Deterministic Representation for Interoperable Structures & Links. 2025-10-20. URL: https://dasl.ing/drisl.html
[masl]
Robin Berjon & Juan Caballero. MASL — Metadata for Arbitrary Structures & Links. 2025-10-20. URL: https://dasl.ing/masl.html
[varint]
unsigned varint. URL: https://github.com/multiformats/unsigned-varint
-------------------------------------------------------------------------------- /masl.src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MASL — Metadata for Arbitrary Structures & Links 7 | 8 | 9 |
10 |

11 | MASL is a CBOR-based metadata system that is designed to work well with content-addressed 12 | and decentralised systems, to enable fully self-contained, self-certified content 13 | distribution. 14 |

15 |
16 |
17 |

Introduction

18 |

19 | Anywhere you have resources that will be deployed in real-world systems, the potential 20 | metadata needs of those systems are effectively unbounded. This is particularly true of 21 | decentralised systems that need to exhibit "web-like" behaviour: in order to have 22 | reproducible and safe execution when content is sourced from arbitrary origins, it is 23 | necessary to have an equivalent to HTTP headers that is as verifiable as the content 24 | itself and not suffer the lossy behaviour that can occur when one treats the web as a file system (which it is not). 25 |

26 |

27 | Designing or constraining a syntax for all metadata needs would be hubris and madness. 28 | Instead, this document tries to minimally constrain applications while illustrating "where to stick" 29 | that metadata, as there are so few layers and hiding places in the DASL system. 30 |

31 |
32 |
33 |

How to use a MASL document

34 |

35 | The recommended structure for DASL metadata is to insert a [[drisl]] document "between" each 36 | CID and its resource(s), essentially using DRISL to encode headers for one or more CID-addressed resources. 37 | To do this, simply replace the CID of a resource with the CID of a DRISL object that contains a 38 | top-level (tag 42) property named src. 39 | To bundle a set of CIDs in a logical unit, drop the top-level src and replace it with a mapping of paths-from-domain-root to DRISL metadata objects including a src property containing the resource's CID. 40 |

41 |

42 | It is preferable to nest any metadata in a top-level object to namespace your own metadata 43 | vocabulary (inside an object named, for example, `my-cool-project-v1`) rather than using opaque UUIDs, version-bits inserted into values, or magic numbers. 44 | There are a few reserved words at the top-level, but even these can be avoided by nesting any conflicts as needed. 45 |

46 |

47 | There are many metadata standards that can be embedded in this way to facilitate the preservation of 48 | metadata at ingress as well as translatability. For example, the IPFS-based storage system Storacha 49 | has a robust CID-based metadata system called 50 | content credentials which includes UCAN-based 51 | permissioning, inclusion attestations, and CID "equivalences," e.g. mappings of multiple IPFS CIDs equivalent to each other and/or to a given DASL CID. 52 |

53 |
54 |

Using MASL with CAR

55 |

56 | CAR files ([[car]]) have a space reserved for metadata in their header. 57 | A MASL metadata document can occupy that metadata header-space, 58 | and the variant using a resources map is particularly well-suited to be used there. 59 | The resources field can be used to map paths to the CIDs of resources contained in subsequent CAR 60 | blocks after the metadata header. 61 |

62 |

63 | In order to be inserted directly as metadata object within CAR files, MASL documents need to contain a top-level version property whose value MUST 64 | be set to integer 1 and a top-level roots array that must contain 0 or more tag 42 CIDs and nothing else. 65 | Neither of these fields has any meaning in MASL, but they must be provided in the context of a CAR header for historical compatibility 66 | reasons. 67 | Note that there is no requirements that all the CIDs in a roots array also appear in the resources mapping or vice versa. 68 |

69 |
70 |
71 |
72 |

Fields

73 |

74 | MASL is designed to host arbitrary metadata but for interoperability purposes a number of root 75 | fields have predetermined values. Authors are invited to add their own metadata by creating 76 | namespaced objects at the top level. 77 |

78 |

79 | NOTE: In examples below, whenever we represent a CID as JSON for, say, field 80 | src, we use "src": { "$link": "CID value…" } as a readability convention. 81 |

82 |
83 |

Single or Multiple Resources

84 |

85 | MASL documents are primarily used to wrap around other resources for which they provide 86 | metadata. This can happen in one of two modes: 87 |

88 |
    89 |
  • 90 | Single Mode (using src): the metadata is only for one 91 | resource, which is the one that can be retrieved from the CID pointed to by src. 92 | HTTP metadata, if specified, goes at the root. App manifest metadata on a single resource 93 | can be used if that resource a fully standalone document (e.g. a PDF). 94 |
  • 95 |
  • 96 | Bundle Mode (using resources): the metadata is used to 97 | describe a whole set of resources. These resources SHOULD be related to one another in some 98 | way (e.g. components that go into building an app or document). The keys of the resources 99 | map are complete paths that MUST start with / and the values are metadata 100 | objects that MUST have an src field pointing to the resource's CID and SHOULD have a 101 | content-type field giving its MIME type, along with other HTTP headers. 102 | Any other properties present which do not map to HTTP headers MUST be ignored. 103 |
  • 104 |
105 |

106 | Note that if both src and resources are specified, then 107 | src MUST be ignored. 108 |

109 |

110 | The Bundle Mode has some specific processing rules: 111 |

112 |
    113 |
  • 114 | Default: The entry with path / is the default path that is loaded if the bundle 115 | itself gets rendered, e.g. in a browser or other user-agent. Implementations MUST only recognise this as the default 116 | and MUST NOT automatically decide to pick a given entry (e.g. /index.html). 117 |
  • 118 |
  • 119 | Relative: When loading a bundle into a web context, the root of the bundle is given an opaque origin, 120 | and all internal links are resolved relative to that. 121 |
  • 122 |
  • 123 | No directory: There is no notion of directory. If a resource is indicated as sitting at /cats/reds/kitsune.jpg 124 | this does not entail that /cats/ or /cats/reds/ somehow exist. As 125 | in web contexts, it is the full path that is matched, not /-separated subsets. URLs 126 | do not map to file systems. 127 |
  • 128 |
  • 129 | Query strings: When resolving a URL inside of a bundle, implementation MUST only make use of the URL's pathname and 130 | MUST ignore the query string. (Note that this departs from typical URL processing but makes it easier 131 | to pass parameters between resources internally.) 132 |
  • 133 |
134 |

135 | There is no requirement in MASL that bundles have to be stored or dereferenced in any specific manner. The relevant CIDs 136 | may be loaded through whatever way the implementation knows about such as RASL ([[rasl]]) or may be 137 | provided in a CAR file ([[car]]). 138 | Note that one value of this approach when compared to bundling resources for instance into Zip archives (or CAR files!) 139 | is that the resource map can contain an arbitrarily high number or volume of resources; an implementation may load an 140 | arbitrary subset of the resources, may parallelize loading, in an arbitrary order informed by types and HTTP headers, 141 | or load some resources on-demand. 142 |

143 |
144 | Specify a scheme and fetch rules properly. 145 |
146 |

147 | Example with src: 148 |

149 |
150 | {
151 |   "src": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" },
152 |   "content-type": "application/pdf",
153 | }
154 |         
155 |

156 | Example with resources: 157 |

158 |
159 | {
160 |   "name": "A Simple Page With Pic",
161 |   "resources": {
162 |     "/": {
163 |       "src": { "$link": "bafk…" },
164 |       "content-type": "text/html"
165 |     },
166 |     "/picture.jpg": {
167 |       "src": { "$link": "bafk…" },
168 |       "content-type": "image/jpeg"
169 |     }
170 |   }
171 | }
172 |         
173 |
174 |
175 |

HTTP Headers

176 |

177 | MASL supports a subset of HTTP response headers that are meaningful in decentralised 178 | contexts. This doesn't preclude headers not listed here from being used, but implementations 179 | that support using HTTP headers SHOULD NOT reflect the value of arbitrary HTTP headers 180 | without considering the potential attack surface they create. 181 |

182 |

183 | When using HTTP headers as MASL metadata, there are two modes. If the MASL document 184 | contains a root resources field then it is a MASL document for multiple resources 185 | and the HTTP headers are only meaningful if they are set on values of the resources 186 | map (and MUST be ignored if set on the root object). Conversely, if this MASL document 187 | contains a src field (and no resources) then the HTTP headers MUST 188 | be set on the root and ignored otherwise. If neither src nor resources 189 | are specified, the meaning of HTTP fields is undefined. 190 |

191 |

192 | All HTTP headers, where specified, are lowercased. Implementations MUST ignore headers 193 | with a different casing. 194 |

195 |

196 | Supported headers: 197 |

198 |
    199 |
  • content-disposition
  • 200 |
  • content-encoding
  • 201 |
  • content-language
  • 202 |
  • 203 | content-security-policy: keep in mind however that runtime contexts are likely 204 | to already have a strict CSP that will override or constrain this one. 205 |
  • 206 |
  • content-type
  • 207 |
  • link
  • 208 |
  • permissions-policy
  • 209 |
  • referrer-policy
  • 210 |
  • service-worker-allowed
  • 211 |
  • 212 | sourcemap: this must point to another resource in the resources map. 213 | Implementations SHOULD verify that this is the case as source maps could otherwise be used to 214 | exfiltrate information. 215 |
  • 216 |
  • 217 | speculation-rules: this must point to another resource in the resources map. 218 |
  • 219 |
  • supports-loading-mode
  • 220 |
  • x-content-type-options
  • 221 |
222 |

223 | Example with src: 224 |

225 |
226 | {
227 |   "src": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" },
228 |   "content-type": "text/html",
229 |   "content-language": "en",
230 |   "service-worker-allowed": "/"
231 | }
232 |         
233 |

234 | Example with resources: 235 |

236 |
237 | {
238 |   "name": "My Doc",
239 |   "resources": {
240 |     "/": {
241 |       "src": { "$link": "bafk…" },
242 |       "content-type": "text/html",
243 |       "content-encoding": "gzip",
244 |       "content-language": "fr"
245 |     },
246 |     "/interactive.js": {
247 |       "src": { "$link": "bafk…" },
248 |       "content-type": "application/javascript",
249 |       "sourcemap": "/interactive.js.map"
250 |     },
251 |     "/interactive.js.map": {
252 |       "src": { "$link": "bafk…" },
253 |       "content-type": "application/json"
254 |     },
255 |     "/picture.jpg": {
256 |       "src": { "$link": "bafk…" },
257 |       "content-type": "image/jpeg"
258 |     }
259 |   }
260 | }
261 |         
262 |
263 |
264 |

App Manifest

265 |

266 | One useful pattern with MASL is to describe an entire app or document, with all of its 267 | resources available for content addressing, possibly within a common CAR ([[car]]). Such 268 | docs or apps should use Web App Manifest metadata ([[manifest]]) as it is widely understood. 269 |

270 |

271 | The following manifest fields are guaranteed to be usable: 272 | background_color, 273 | categories, 274 | description, 275 | icons, 276 | id, 277 | name, 278 | screenshots, 279 | short_name, and 280 | theme_color. 281 | Note: other manifest fields MAY be used, but their behaviour is not guaranteed in the kind 282 | of web and web-like contexts for which MASL is optimized. 283 |

284 |

285 | For both icons and screenshots, the src field MUST 286 | be a path that matches an entry in the resources map, and the type 287 | field that is normally accepted in manifests there MUST NOT be used and MUST be ignored 288 | if specified. Media type information for that resource is specific on the resource entry 289 | that src maps to. 290 |

291 |

292 | Example: 293 |

294 |
295 | {
296 |   "name": "Unicorn Editor",
297 |   "short_name": "Unicorn",
298 |   "description": "This is simply the best app to edit unicorns with.",
299 |   "background_color": "#00ff75",
300 |   "icons": [{ "src": "/unicorn.svg" }],
301 |   "resources": {
302 |     "/": {
303 |       "src": { "$link": "bafk…" },
304 |       "content-type": "text/html"
305 |     },
306 |     "/unicorn.svg": {
307 |       "src": { "$link": "bafk…" },
308 |       "content-type": "image/svg"
309 |     }
310 |   }
311 | }
312 |         
313 |
314 |
315 |

CAR Compatibility

316 |

317 | As indicated in the CAR specification ([[car]]), the metadata object in the CAR header 318 | must contain a version field set to integer 1 and a 319 | roots field set to an array (that may be empty) of tag 42 CIDs. These 320 | fields have no meaning for MASL, but are expected to be set when MASL is used for CAR 321 | metadata for historical compatibility. Note that using versions in this way is an 322 | antipattern, and we expect the value never to change. 323 |

324 |

325 | Example: 326 |

327 |
328 | {
329 |   "name": "Get in the CAR if you want to live",
330 |   "version": 1,
331 |   "roots": []
332 | }
333 |         
334 |
335 |
336 |

AT Compatibility

337 |

338 | When used with the AT Protocol ([[at]]), it is common that objects will need to feature 339 | a $type field. If present, it MUST be a string and SHOULD be set to the 340 | value ing.dasl.masl. 341 |

342 |
343 |
344 |

Versioning

345 |

346 | When manipulating DAGs, it can be useful to keep track of history by referencing 347 | earlier versions of the same data or metadata. This can be done using the prev 348 | field, which if present MUST be a tag 42 CID pointing to a previous MASL document. 349 |

350 |

351 | Example: 352 |

353 |
354 | {
355 |   "name": "Unicorn Editor",
356 |   "prev": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" }
357 | }
358 |         
359 |
360 |
361 |
362 |

Lexicon

363 |

364 | Making a precise lexicon ([[lexicon]]) for MASL is impossible because lexicons lack a way of 365 | constraining objects with arbitrary keys. However, the following may still prove useful when 366 | MASL is integrated with the AT Protocol ([[at]]). 367 |

368 |
369 | {
370 |   "lexicon": 1,
371 |   "id": "ing.dasl.masl",
372 |   "defs": {
373 |     "main": {
374 |       "type": "object",
375 |       "properties": {
376 |         "src": { "type": "cid-link" },
377 |         "resources": {
378 |           "type": "unknown"
379 |         },
380 |         // HTTP
381 |         "content-type": { "type": "string" },
382 |         "content-disposition": { "type": "string" },
383 |         "content-encoding": { "type": "string" },
384 |         "content-language": { "type": "string" },
385 |         "content-security-policy": { "type": "string" },
386 |         "link": { "type": "string" },
387 |         "permissions-policy": { "type": "string" },
388 |         "referrer-policy": { "type": "string" },
389 |         "service-worker-allowed": { "type": "string" },
390 |         "sourcemap": { "type": "string" },
391 |         "speculation-rules": { "type": "string" },
392 |         "supports-loading-mode": { "type": "string" },
393 |         "x-content-type-options": { "type": "string" },
394 |         // Manifest
395 |         "background_color": {
396 |           "type": "string"
397 |         },
398 |         "categories": {
399 |           "type": "array",
400 |           "items": {
401 |             "type": "string"
402 |           }
403 |         },
404 |         "description": {
405 |           "type": "string"
406 |         },
407 |         "icons": {
408 |           "type": "array",
409 |           "items": {
410 |             "type": "object",
411 |             "required": ["src"],
412 |             "properties":{
413 |               "src": { "type": "string" },
414 |               "sizes": { "type": "string" },
415 |               "purpose": { "type": "string" }
416 |             }
417 |           }
418 |         },
419 |         "name": {
420 |           "type": "string"
421 |         },
422 |         "screenshots": {
423 |           "type": "array",
424 |           "items": {
425 |             "type": "object",
426 |             "required": ["src"],
427 |             "properties":{
428 |               "src": { "type": "string" },
429 |               "sizes": { "type": "string" },
430 |               "label": { "type": "string" },
431 |               "form_factor": {
432 |                 "type": "string",
433 |                 "knownValues": ["narrow", "wide"]
434 |               },
435 |               "platform": {
436 |                 "type": "string",
437 |                 "knownValues": ["android", "chromeos", "ios", "ipados", "kaios", "macos", "windows", "xbox", "chrome_web_store", "itunes", "microsoft", "microsoft", "play"]
438 |               }
439 |             }
440 |           }
441 |         },
442 |         "short_name": {
443 |           "type": "string"
444 |         },
445 |         "theme_color": {
446 |           "type": "string"
447 |         },
448 |         // CAR compatibility
449 |         "version": {
450 |           "type": "integer",
451 |           "const": 1
452 |         },
453 |         "roots": {
454 |           "type": "array",
455 |           "items": { "type": "cid-link" }
456 |         },
457 |         // versioning
458 |         "prev": { "type": "cid-link" }
459 |       }
460 |     }
461 |   }
462 | }
463 |       
464 |
465 | 466 | 467 | -------------------------------------------------------------------------------- /masl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | 20 | MASL — Metadata for Arbitrary Structures & Links 21 | 22 |

MASL — Metadata for Arbitrary Structures & Links

date2025-10-20
editorsRobin Berjon <robin@berjon.com>
Juan Caballero <bumblefudge@learningproof.xyz>
issueslist, new
abstract
23 |

24 | MASL is a CBOR-based metadata system that is designed to work well with content-addressed 25 | and decentralised systems, to enable fully self-contained, self-certified content 26 | distribution. 27 |

28 |
29 | 30 |
31 |

Introduction

32 |

33 | Anywhere you have resources that will be deployed in real-world systems, the potential 34 | metadata needs of those systems are effectively unbounded. This is particularly true of 35 | decentralised systems that need to exhibit "web-like" behaviour: in order to have 36 | reproducible and safe execution when content is sourced from arbitrary origins, it is 37 | necessary to have an equivalent to HTTP headers that is as verifiable as the content 38 | itself and not suffer the lossy behaviour that can occur when one treats the web as a file system (which it is not). 39 |

40 |

41 | Designing or constraining a syntax for all metadata needs would be hubris and madness. 42 | Instead, this document tries to minimally constrain applications while illustrating "where to stick" 43 | that metadata, as there are so few layers and hiding places in the DASL system. 44 |

45 |
46 |
47 |

How to use a MASL document

48 |

49 | The recommended structure for DASL metadata is to insert a [drisl] document "between" each 50 | CID and its resource(s), essentially using DRISL to encode headers for one or more CID-addressed resources. 51 | To do this, simply replace the CID of a resource with the CID of a DRISL object that contains a 52 | top-level (tag 42) property named src. 53 | To bundle a set of CIDs in a logical unit, drop the top-level src and replace it with a mapping of paths-from-domain-root to DRISL metadata objects including a src property containing the resource's CID. 54 |

55 |

56 | It is preferable to nest any metadata in a top-level object to namespace your own metadata 57 | vocabulary (inside an object named, for example, `my-cool-project-v1`) rather than using opaque UUIDs, version-bits inserted into values, or magic numbers. 58 | There are a few reserved words at the top-level, but even these can be avoided by nesting any conflicts as needed. 59 |

60 |

61 | There are many metadata standards that can be embedded in this way to facilitate the preservation of 62 | metadata at ingress as well as translatability. For example, the IPFS-based storage system Storacha 63 | has a robust CID-based metadata system called 64 | content credentials which includes UCAN-based 65 | permissioning, inclusion attestations, and CID "equivalences," e.g. mappings of multiple IPFS CIDs equivalent to each other and/or to a given DASL CID. 66 |

67 |
68 |

Using MASL with CAR

69 |

70 | CAR files ([car]) have a space reserved for metadata in their header. 71 | A MASL metadata document can occupy that metadata header-space, 72 | and the variant using a resources map is particularly well-suited to be used there. 73 | The resources field can be used to map paths to the CIDs of resources contained in subsequent CAR 74 | blocks after the metadata header. 75 |

76 |

77 | In order to be inserted directly as metadata object within CAR files, MASL documents need to contain a top-level version property whose value MUST 78 | be set to integer 1 and a top-level roots array that must contain 0 or more tag 42 CIDs and nothing else. 79 | Neither of these fields has any meaning in MASL, but they must be provided in the context of a CAR header for historical compatibility 80 | reasons. 81 | Note that there is no requirements that all the CIDs in a roots array also appear in the resources mapping or vice versa. 82 |

83 |
84 |
85 |
86 |

Fields

87 |

88 | MASL is designed to host arbitrary metadata but for interoperability purposes a number of root 89 | fields have predetermined values. Authors are invited to add their own metadata by creating 90 | namespaced objects at the top level. 91 |

92 |

93 | NOTE: In examples below, whenever we represent a CID as JSON for, say, field 94 | src, we use "src": { "$link": "CID value…" } as a readability convention. 95 |

96 |
97 |

Single or Multiple Resources

98 |

99 | MASL documents are primarily used to wrap around other resources for which they provide 100 | metadata. This can happen in one of two modes: 101 |

102 |
    103 |
  • 104 | Single Mode (using src): the metadata is only for one 105 | resource, which is the one that can be retrieved from the CID pointed to by src. 106 | HTTP metadata, if specified, goes at the root. App manifest metadata on a single resource 107 | can be used if that resource a fully standalone document (e.g. a PDF). 108 |
  • 109 |
  • 110 | Bundle Mode (using resources): the metadata is used to 111 | describe a whole set of resources. These resources SHOULD be related to one another in some 112 | way (e.g. components that go into building an app or document). The keys of the resources 113 | map are complete paths that MUST start with / and the values are metadata 114 | objects that MUST have an src field pointing to the resource's CID and SHOULD have a 115 | content-type field giving its MIME type, along with other HTTP headers. 116 | Any other properties present which do not map to HTTP headers MUST be ignored. 117 |
  • 118 |
119 |

120 | Note that if both src and resources are specified, then 121 | src MUST be ignored. 122 |

123 |

124 | The Bundle Mode has some specific processing rules: 125 |

126 |
    127 |
  • 128 | Default: The entry with path / is the default path that is loaded if the bundle 129 | itself gets rendered, e.g. in a browser or other user-agent. Implementations MUST only recognise this as the default 130 | and MUST NOT automatically decide to pick a given entry (e.g. /index.html). 131 |
  • 132 |
  • 133 | Relative: When loading a bundle into a web context, the root of the bundle is given an opaque origin, 134 | and all internal links are resolved relative to that. 135 |
  • 136 |
  • 137 | No directory: There is no notion of directory. If a resource is indicated as sitting at /cats/reds/kitsune.jpg 138 | this does not entail that /cats/ or /cats/reds/ somehow exist. As 139 | in web contexts, it is the full path that is matched, not /-separated subsets. URLs 140 | do not map to file systems. 141 |
  • 142 |
  • 143 | Query strings: When resolving a URL inside of a bundle, implementation MUST only make use of the URL's pathname and 144 | MUST ignore the query string. (Note that this departs from typical URL processing but makes it easier 145 | to pass parameters between resources internally.) 146 |
  • 147 |
148 |

149 | There is no requirement in MASL that bundles have to be stored or dereferenced in any specific manner. The relevant CIDs 150 | may be loaded through whatever way the implementation knows about such as RASL ([rasl]) or may be 151 | provided in a CAR file ([car]). 152 | Note that one value of this approach when compared to bundling resources for instance into Zip archives (or CAR files!) is that the resource map can contain an arbitrarily high number or volume of resources; an implementation may load an arbitrary subset of the resources, may parallelize loading, in an arbitrary order informed by types and HTTP headers, or load some resources on-demand. 153 |

154 |
155 | Specify a scheme and fetch rules properly. 156 |
157 |

158 | Example with src: 159 |

160 |
{
161 |   "src": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" },
162 |   "content-type": "application/pdf",
163 | }
164 |         
165 |

166 | Example with resources: 167 |

168 |
{
169 |   "name": "A Simple Page With Pic",
170 |   "resources": {
171 |     "/": {
172 |       "src": { "$link": "bafk…" },
173 |       "content-type": "text/html"
174 |     },
175 |     "/picture.jpg": {
176 |       "src": { "$link": "bafk…" },
177 |       "content-type": "image/jpeg"
178 |     }
179 |   }
180 | }
181 |         
182 |
183 |
184 |

HTTP Headers

185 |

186 | MASL supports a subset of HTTP response headers that are meaningful in decentralised 187 | contexts. This doesn't preclude headers not listed here from being used, but implementations 188 | that support using HTTP headers SHOULD NOT reflect the value of arbitrary HTTP headers 189 | without considering the potential attack surface they create. 190 |

191 |

192 | When using HTTP headers as MASL metadata, there are two modes. If the MASL document 193 | contains a root resources field then it is a MASL document for multiple resources 194 | and the HTTP headers are only meaningful if they are set on values of the resources 195 | map (and MUST be ignored if set on the root object). Conversely, if this MASL document 196 | contains a src field (and no resources) then the HTTP headers MUST 197 | be set on the root and ignored otherwise. If neither src nor resources 198 | are specified, the meaning of HTTP fields is undefined. 199 |

200 |

201 | All HTTP headers, where specified, are lowercased. 202 |

203 |

204 | Supported headers: 205 |

206 |
    207 |
  • content-disposition
  • 208 |
  • content-encoding
  • 209 |
  • content-language
  • 210 |
  • 211 | content-security-policy: keep in mind however that runtime contexts are likely 212 | to already have a strict CSP that will override or constrain this one. 213 |
  • 214 |
  • content-type
  • 215 |
  • link
  • 216 |
  • permissions-policy
  • 217 |
  • referrer-policy
  • 218 |
  • service-worker-allowed
  • 219 |
  • 220 | sourcemap: this must point to another resource in the resources map. 221 | Implementations SHOULD verify that this is the case as source maps could otherwise be used to 222 | exfiltrate information. 223 |
  • 224 |
  • 225 | speculation-rules: this must point to another resource in the resources map. 226 |
  • 227 |
  • supports-loading-mode
  • 228 |
  • x-content-type-options
  • 229 |
230 |

231 | Example with src: 232 |

233 |
{
234 |   "src": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" },
235 |   "content-type": "text/html",
236 |   "content-language": "en",
237 |   "service-worker-allowed": "/"
238 | }
239 |         
240 |

241 | Example with resources: 242 |

243 |
{
244 |   "name": "My Doc",
245 |   "resources": {
246 |     "/": {
247 |       "src": { "$link": "bafk…" },
248 |       "content-type": "text/html",
249 |       "content-encoding": "gzip",
250 |       "content-language": "fr"
251 |     },
252 |     "/interactive.js": {
253 |       "src": { "$link": "bafk…" },
254 |       "content-type": "application/javascript",
255 |       "sourcemap": "/interactive.js.map"
256 |     },
257 |     "/interactive.js.map": {
258 |       "src": { "$link": "bafk…" },
259 |       "content-type": "application/json"
260 |     },
261 |     "/picture.jpg": {
262 |       "src": { "$link": "bafk…" },
263 |       "content-type": "image/jpeg"
264 |     }
265 |   }
266 | }
267 |         
268 |
269 |
270 |

App Manifest

271 |

272 | One useful pattern with MASL is to describe an entire app or document, with all of its 273 | resources available for content addressing, possibly within a common CAR ([car]). Such 274 | docs or apps should use Web App Manifest metadata ([manifest]) as it is widely understood. 275 |

276 |

277 | The following manifest fields are guaranteed to be usable: 278 | background_color, 279 | categories, 280 | description, 281 | icons, 282 | id, 283 | name, 284 | screenshots, 285 | short_name, and 286 | theme_color. 287 | Note: other manifest fields MAY be used, but their behaviour is not guaranteed in the kind 288 | of web and web-like contexts for which MASL is optimized. 289 |

290 |

291 | For both icons and screenshots, the src field MUST 292 | be a path that matches an entry in the resources map, and the type 293 | field that is normally accepted in manifests there MUST NOT be used and MUST be ignored 294 | if specified. Media type information for that resource is specific on the resource entry 295 | that src maps to. 296 |

297 |

298 | Example: 299 |

300 |
{
301 |   "name": "Unicorn Editor",
302 |   "short_name": "Unicorn",
303 |   "description": "This is simply the best app to edit unicorns with.",
304 |   "background_color": "#00ff75",
305 |   "icons": [{ "src": "/unicorn.svg" }],
306 |   "resources": {
307 |     "/": {
308 |       "src": { "$link": "bafk…" },
309 |       "content-type": "text/html"
310 |     },
311 |     "/unicorn.svg": {
312 |       "src": { "$link": "bafk…" },
313 |       "content-type": "image/svg"
314 |     }
315 |   }
316 | }
317 |         
318 |
319 |
320 |

CAR Compatibility

321 |

322 | As indicated in the CAR specification ([car]), the metadata object in the CAR header 323 | must contain a version field set to integer 1 and a 324 | roots field set to an array (that may be empty) of tag 42 CIDs. These 325 | fields have no meaning for MASL, but are expected to be set when MASL is used for CAR 326 | metadata for historical compatibility. Note that using versions in this way is an 327 | antipattern, and we expect the value never to change. 328 |

329 |

330 | Example: 331 |

332 |
{
333 |   "name": "Get in the CAR if you want to live",
334 |   "version": 1,
335 |   "roots": []
336 | }
337 |         
338 |
339 |
340 |

AT Compatibility

341 |

342 | When used with the AT Protocol ([at]), it is common that objects will need to feature 343 | a $type field. If present, it MUST be a string and SHOULD be set to the 344 | value ing.dasl.masl. 345 |

346 |
347 |
348 |

Versioning

349 |

350 | When manipulating DAGs, it can be useful to keep track of history by referencing 351 | earlier versions of the same data or metadata. This can be done using the prev 352 | field, which if present MUST be a tag 42 CID pointing to a previous MASL document. 353 |

354 |

355 | Example: 356 |

357 |
{
358 |   "name": "Unicorn Editor",
359 |   "prev": { "$link": "bafkreifn5yxi7nkftsn46b6x26grda57ict7md2xuvfbsgkiahe2e7vnq4" }
360 | }
361 |         
362 |
363 |
364 |
365 |

Lexicon

366 |

367 | Making a precise lexicon ([lexicon]) for MASL is impossible because lexicons lack a way of 368 | constraining objects with arbitrary keys. However, the following may still prove useful when 369 | MASL is integrated with the AT Protocol ([at]). 370 |

371 |
{
372 |   "lexicon": 1,
373 |   "id": "ing.dasl.masl",
374 |   "defs": {
375 |     "main": {
376 |       "type": "object",
377 |       "properties": {
378 |         "src": { "type": "cid-link" },
379 |         "resources": {
380 |           "type": "unknown"
381 |         },
382 |         // HTTP
383 |         "content-type": { "type": "string" },
384 |         "content-disposition": { "type": "string" },
385 |         "content-encoding": { "type": "string" },
386 |         "content-language": { "type": "string" },
387 |         "content-security-policy": { "type": "string" },
388 |         "link": { "type": "string" },
389 |         "permissions-policy": { "type": "string" },
390 |         "referrer-policy": { "type": "string" },
391 |         "service-worker-allowed": { "type": "string" },
392 |         "sourcemap": { "type": "string" },
393 |         "speculation-rules": { "type": "string" },
394 |         "supports-loading-mode": { "type": "string" },
395 |         "x-content-type-options": { "type": "string" },
396 |         // Manifest
397 |         "background_color": {
398 |           "type": "string"
399 |         },
400 |         "categories": {
401 |           "type": "array",
402 |           "items": {
403 |             "type": "string"
404 |           }
405 |         },
406 |         "description": {
407 |           "type": "string"
408 |         },
409 |         "icons": {
410 |           "type": "array",
411 |           "items": {
412 |             "type": "object",
413 |             "required": ["src"],
414 |             "properties":{
415 |               "src": { "type": "string" },
416 |               "sizes": { "type": "string" },
417 |               "purpose": { "type": "string" }
418 |             }
419 |           }
420 |         },
421 |         "name": {
422 |           "type": "string"
423 |         },
424 |         "screenshots": {
425 |           "type": "array",
426 |           "items": {
427 |             "type": "object",
428 |             "required": ["src"],
429 |             "properties":{
430 |               "src": { "type": "string" },
431 |               "sizes": { "type": "string" },
432 |               "label": { "type": "string" },
433 |               "form_factor": {
434 |                 "type": "string",
435 |                 "knownValues": ["narrow", "wide"]
436 |               },
437 |               "platform": {
438 |                 "type": "string",
439 |                 "knownValues": ["android", "chromeos", "ios", "ipados", "kaios", "macos", "windows", "xbox", "chrome_web_store", "itunes", "microsoft", "microsoft", "play"]
440 |               }
441 |             }
442 |           }
443 |         },
444 |         "short_name": {
445 |           "type": "string"
446 |         },
447 |         "theme_color": {
448 |           "type": "string"
449 |         },
450 |         // CAR compatibility
451 |         "version": {
452 |           "type": "integer",
453 |           "const": 1
454 |         },
455 |         "roots": {
456 |           "type": "array",
457 |           "items": { "type": "cid-link" }
458 |         },
459 |         // versioning
460 |         "prev": { "type": "cid-link" }
461 |       }
462 |     }
463 |   }
464 | }
465 |       
466 |
467 | 468 | 469 |

References

[at]
AT Protocol. URL: https://atproto.com/
[car]
Robin Berjon & Juan Caballero. Content-Addressable aRchives (CAR). 2025-10-20. URL: https://dasl.ing/car.html
[drisl]
Robin Berjon & Juan Caballero. DRISL — Deterministic Representation for Interoperable Structures & Links. 2025-10-20. URL: https://dasl.ing/drisl.html
[lexicon]
AT Protocol: Lexicon.
[manifest]
M. Cáceres, K. Rohde Christiansen, D. González, D. Murphy, C. Liebel. Web Application Manifest. March 2025. URL: https://www.w3.org/TR/appmanifest/
[rasl]
Robin Berjon & Juan Caballero. RASL — Retrieval of Arbitrary Structures & Links. 2025-10-20. URL: https://dasl.ing/rasl.html
--------------------------------------------------------------------------------