Skip to content

Releases

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 31 Oct 02:06
ba52112

v0.7.0 — anymirror

  • 📦 Readers on their own. @anymirror/core holds the readers without the map adapters, one entry point per kind of content, so a page bundles only what it reads: 4.4 KB gzipped for a raw file, 6.8 KB for a bundle, 8.5 KB for a ranged file.
  • 🧭 A router contract. @anymirror/router is the router contract as types alone; @anymirror/fisl-router now depends on it alone and works with any reader.
  • 🔌 Hints as a plugin. Hints documents are a client option, off unless a page passes hints(); veritiles keeps them on, and its API is unchanged.
  • 🏠 A new home. The repository is anymirror-dev/anymirror, and the packer is anymirror-pack.
Detailed changes

Added

  • @anymirror/core: the readers on their own, without the map adapters, each behind its own entry point: @anymirror/core/file (VerifiedFile, one large file by byte ranges), @anymirror/core/raw (VerifiedRaw, one small file), @anymirror/core/bundle (VerifiedBundle, a MASL bundle) and @anymirror/core/hints (hints()). A page carries only the reader it uses: gzipped, a raw file costs 4.4 KB, a bundle 6.8 KB and a ranged file 8.5 KB, where every page carried 8.4 to 9.2 KB before. assetKind(cid) says which reader an asset anchor needs.
  • @anymirror/router: the router contract (Router, FetchContext, Verdict, RouterOption), types alone. It changes only with the contract, so a router depends on nothing else and keeps working across releases.
  • @anymirror/fisl-router joins the repository and the version line. It depends on the contract alone, no longer on veritiles, so any anymirror reader takes it as its router; its behavior is unchanged.

Changed

  • Hints as a plugin (SPEC.md §5): hints documents and discovery are a client option, off in anymirror's readers unless a page passes hints(). veritiles keeps them on by default.
  • veritiles is built on @anymirror/core and pins it at the same version. Its API and behavior are unchanged; the map bundle grows by 0.5 KB gzipped (11.7 to 12.2 KB) for the seams between the readers.
  • The repository is now anymirror-dev/anymirror, and the spec is the anymirror spec. The packer is anymirror-pack, installed with cargo install --path packer; the TypeScript packer stays in the repository, for the tests.

Fixed

  • The MapLibre examples (packages/veritiles/examples/maplibre.html, hints.html, assets.html) and the README's MapLibre snippet import MapLibre GL's ES module. MapLibre 6 ships no maplibre-gl.js, so they stopped at a 404 before drawing a tile. They now pin MapLibre GL 6.16.0 and PMTiles 4.5.0.
  • The OpenLayers example pins OpenLayers 9.2.4: ol-pmtiles 2.0.2's browser bundle throws on the first tile with OpenLayers 10, so the example drew nothing.

Notes

  • No format changes: anchors, proofs and bundles packed for 0.6 read as before.

Full Changelog: v0.6.1...v0.7.0

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 16:06
6b11b76

v0.6.1 — Verified sprites

  • 🖼️ Verified sprites. assetProtocol answers MapLibre's JSON requests with parsed JSON, so a sprite sheet served from a verified bundle loads its icons.
Detailed changes

Fixed

  • assetProtocol answers each request in the form MapLibre asks for: a json request, such as a sprite index or a style, with the parsed value, a string request with the text, any other with the bytes. MapLibre parses nothing a protocol returns, so a sprite sheet in a verified bundle ("sprite": "verified://<anchor>/sprite", as in the README) loaded no icons.

Full Changelog: v0.6.0...v0.6.1

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 12:07
2f493da

v0.6.0 — Routers

  • 🧭 Routers. A router option on VerifiedSource, VerifiedFile and VerifiedAsset finds a CID's hosts at runtime, from a content-routing index, a gateway or a table, so a page can ship only its anchor: every byte still verifies against it.
  • 📡 Routers learn. A router can also carry the requests: it gets each one's verdict, verified, rejected, failed or unused, and so learns which hosts serve, how fast, and which lie.
  • 🔁 Smarter failover. A location that fails now moves behind the ones that have not failed until it serves again, and one that serves wrong bytes stays banned for the whole session, for that CID only.
  • ⚡ No wait for hints. A page that configures its locations and names a hints document sends its first requests at once, and fetches the document in the background.
  • 📦 Bare manifests. pack assets also writes a bundle's manifest block beside its CAR (bundle.car → bundle.masl), the file a router names for a bundle; clients accept it wherever they read a bundle proof.
Detailed changes

Added

  • Routers (SPEC.md §6): every location now comes from a router. The built-in one follows source, proof and hints as before; a router option on VerifiedSource, VerifiedFile and VerifiedAsset replaces it with your own — a content-routing index, a gateway, a table — so a page can ship only its anchor and find hosts at runtime. A router's locate(cid, { defaults }) yields the URLs of a CID's bytes, best first, and gets the built-in router's locations as defaults, so its yield order is its strategy: the page's own hosts first, its own first, or whichever answer first. The client reads the stream lazily, taking the next location only when the ones it holds have failed, and asks again once all have. A located URL is where the CID's own bytes are, the rule of FISL: for a ranged file's anchor that is {proof}/root, and the client reads the proof tree beside it. A router may also carry the requests (fetch): each comes with the CID, the location, the client's own fetch, and a verdict — verified, rejected, failed or unused — so a router learns which hosts serve, how fast, and which lie, and can add credentials. Routers are as untrusted as hints documents: every byte still verifies against the anchor. The README shows a router over a FISL index in a few lines.
  • pack assets also writes the manifest block alone beside the CAR (bundle.car → bundle.masl): the anchor's own bytes, the file a router names for a bundle. Clients accept a bare manifest block wherever they read a bundle proof: a body that hashes to the anchor is the block, anything else is read as a CAR.

Changed

  • A failing location is demoted. A location that fails in transport — a network error, a non-2xx status, a 200 to a Range request, a missing proof file — now moves behind the ones that have not failed until it serves again, instead of being tried first on every read; a fetch asks the router for a fresh location before going back to it, and gives up after 16 failed locations. A location that serves wrong bytes is still banned, now for the client's whole session (a failed open no longer forgets it), and only for the CID it got wrong: for any other it is demoted.
  • Explicit hints documents no longer hold up the open. A page that configures its locations and names a hints document sends root, the first proof piece and the first read's range at once, and fetches the document in the background; its URLs still back up the configured ones.
  • A bundle file that fails verification at a configured base bans that file's URL, not the whole base: the base still serves the bundle's other files.
  • The router specification lands in SPEC.md as §6 Routers; the previous §6–§9 (Hosts, Publishing, IPFS interoperability, Non-goals) are renumbered §7–§10.

Fixed

  • A response body that arrives in one piece is copied before it is verified: a fetchFn (or a router's fetch) that reuses its buffers can no longer change bytes after they verified.
  • A read whose signal aborts stops waiting for a file's open or a bundle's manifest; the open goes on for other reads.

Full Changelog: v0.5.0...v0.6.0

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 13:42
v0.5.0
5c8a133

v0.5.0 — Planet scale

  • ⚡ Faster first paint. The client fetches the descriptor, the first proof shard and the first read in one round trip: a cold view of the Protomaps planet shows its first tile in 301–366 ms instead of 764–1,350 ms (plain PMTiles: 201–266 ms; 50 ms RTT, 20 Mbit/s).
  • 📦 Smaller downloads. PMTiles packs pick a 16–64 KiB tile group per archive instead of 1 MiB, so a cold view downloads 21% more than plain PMTiles instead of 323% more.
  • 🎬 Verified video. The new mp4 profile gives each fragment its own leaf: a YouTube-style stream starts in 247 ms instead of 947 ms (unverified: 265 ms).
  • 🦀 Rust packer. Packs files of any size, such as the 130 GiB planet, with output byte-identical to the TS packer.
  • ⚠️ Breaking. A descriptor's map is now the file's BLAKE3 CID: re-pack v0.4 data before moving a page to veritiles@0.5 (v0.4 clients cannot read v0.5 packs).
Detailed changes

Added

  • Rust packer (packer/, npm run pack:rs -- …): a port of the repository packer for files the TS packer cannot hold in memory (~2 GiB and up, such as a planet-scale PMTiles). It memory-maps the input, hashes in parallel, and writes the same bytes as tools/pack.ts — anchor, proof files, CARs, stdout and stderr — enforced by a differential test (test/pack-diff.test.ts). Local files only; its verify checks every byte. See packer/README.md.
  • npm run test:diff runs that differential test; npm test no longer does. CI builds the binary and fails, rather than skips, without it.
  • mp4 packer profile. --profile auto packs a fragmented MP4 (an ftyp box first, then a top-level moof) with one leaf per fragment: its moof and mdats, with any styp, emsg or prft boxes that open it. The init section and any boxes after the last mdat (an mfra) get a leaf each. A player that reads each fragment at the range its sidx lists, as Media Source Extensions players do, downloads exactly that fragment in one round trip instead of the whole 1 MiB leaves around it. Verified playback then keeps pace with an unverified player: a YouTube-style source (video and audio tracks) starts in 247 ms instead of 947 ms at 50 ms RTT and 20 Mbit/s (unverified: 265 ms), downloading 0.49 MB instead of 2.23 MB, and seeks in 453 ms instead of 892 ms (unverified: 451 ms). Audio-only .m4a files qualify; a regular MP4 still packs as fixed, and --profile mp4 forces the profile. Once a file is taken as fragmented MP4, a malformed box, such as a truncated download, fails the pack.

Changed

  • Breaking: a descriptor's map is the file's raw BLAKE3 CID (BDASL, bafkr4i…) instead of its sha2-256 CID. No client computes map — it names the file, for content hints — so the packers no longer run the one step that could not be parallelized: a single SHA-256 stream over the whole file. The Rust packer packs a file in memory 2–3.5× faster, and a file larger than RAM is now bound by the disk rather than the hash. Clients reject a sha2-256 map, so v0.4 packs must be re-packed, and v0.4 clients reject v0.5 packs. Every hash a client checks — anchors, proof files, leaves, assets — stays sha2-256 (WebCrypto). Hints documents accept raw BLAKE3 CIDs as keys. The TS packer computes BLAKE3 with the hash-wasm dev dependency.
  • Faster first paint. The client requests the descriptor, the first proof shard (0) and the first read's range in one round trip, each still verified before use, and requests the proof shards covering a read (after any directory metas) before that read's speculative tile data, so a shard never waits behind tile bytes. With the new tile-group default below, a cold view of the Protomaps planet shows its first tile in 301–366 ms instead of 764–1,350 ms at 50 ms RTT and 20 Mbit/s (plain PMTiles: 201–266 ms); on a terrain archive shaped like Mapterhorn's planet (331 GiB, z0–z12), a cold z12 view in 358 ms instead of 1,081 ms (plain: 228 ms).
  • PMTiles packs choose their tile group from the archive. Without --tile-group, the packers use the smallest of 16, 32 and 64 KiB whose shards all fit in the descriptor's top meta, else 64 KiB, so every zoom band is listed there directly whenever the archive allows it. The old 1 MiB default made a reader fetch a whole 1 MiB group around each tile: the Protomaps planet now gets 64 KiB, and a cold view downloads 21% more than plain PMTiles instead of 323% more. The budget used, chosen or explicit, is printed on stderr after the proofs: line (tile group: 65536 bytes). An explicit --tile-group N (including 0) is unchanged.
  • Fragmented MP4s packed with --profile auto now get the mp4 profile and new anchors; --chunk on such a file needs --profile fixed.
  • A zoom band too large for the top meta splits into small subdirectories of at most 399 shards each (child metas of at most 16 KiB), each listed in the top meta, their sizes differing by at most one shard: the first view into such a band waits on one small meta instead of a meta of up to 256 KiB. Only when the top meta has no room for them does the band become one nested subdirectory, as before.
  • Packer CLI is strict: unknown flags, flags without a value, extra arguments, an unknown --profile, --profile pmtiles on a non-PMTiles file (previously a silent fixed pack), --chunk with the pmtiles profile, --tile-group with the fixed profile, and --out or --full-car naming the input file are errors instead of being ignored. The packer also refuses an --out directory that contains the input (--out contains the input file) and a --full-car whose <path>.tmp is the input.
  • PMTiles directories and metadata may decompress to at most 256 MiB each (larger blocks fail as PMTiles <codec> decompression failed), and an archive may list at most 2^30 tile entries (PMTiles has more than 2^30 tile entries), so a small hostile archive cannot exhaust memory.
  • A zstd-compressed PMTiles directory or metadata block must be exactly one complete zstd frame: a truncated frame, a second or skippable frame, or trailing bytes now fail as PMTiles zstd decompression failed. Node 22 ignored truncation and anything after the first frame, while Node 24 rejects truncation, so the TS packer accepted different archives depending on the Node version. One zstd compression call writes one frame, so ordinary archives are unaffected.
  • The top meta keeps one slot per remaining zoom band when inlining a band, so archives such as one band of 1,598 shards followed by a small band now pack (the large band moves into subdirectories) instead of failing with top meta needs … entries.
  • --full-car: the <path>.tmp file is opened before the proof files are written; an open failure is still reported after them. Any later failure removes <path>.tmp before the error is reported.
  • The packer also refuses an existing output that is the input file itself, reached through a symlink or a hard link (compared by device and inode): a proof file (--out contains the input file) or <full-car>.tmp (--full-car resolves to the input file). Nothing is written in that case, only the proof directories.
  • pack verify reads proof files on demand instead of loading the whole --proofs directory, so unrelated entries (such as a dangling symlink) no longer fail it.
  • PMTiles inputs must have tile lengths ≤ 0xffffffff and safe-integer tile ids. Decompression and metadata JSON failures report fixed messages (PMTiles gzip decompression failed, PMTiles metadata is not valid JSON, …) instead of library text.
  • --full-car writes blocks in canonical DAG post-order (children left to right, then the parent; each block once), replacing the importer's internal put order. Only files over 174 chunks (> 43.5 MiB) get different CAR bytes; the DAG, its root CID and ipfs dag import results are unchanged. The CAR is written to <path>.tmp and renamed when complete.
  • The proof directory's root is written last, so a present root means every file it names exists.
  • pack verify prints verify OK, drops --reads (fixed at 64 spot reads), and rejects a file whose length differs from the descriptor's mapSize; a trailing byte previously passed.

Fixed

  • PMTiles archives whose metadata or leaf directories come after the tile data — the layout of the Protomaps planet builds — failed to pack with tile leaf at … matches no tile group. Those sections now form a last band of their own. Archives that packed before are unaffected.
  • The TS packer failed with a stack overflow (Maximum call stack size exceeded) on a PMTiles leaf directory of more than ~125,000 entries.
  • pack assets inlined every file up to the 8 MiB CAR section cap, so a typical directory's "proof" carried a complete second copy of the content (a 6.2 MB glyph directory emitted a 6.28 MB CAR for a 32 KB manifest), defeating lazy verification. Inlining is now all-or-nothing under a fixed 256 KiB budget: a directory whose files total at most 256 KiB travels whole in the CAR — one fetch serves the bundle — and anything larger emits the manifest alone, so clients fetch content from {base}/{path} as specified. Anchors are unaffected: the anchor hashes the manifest block alone, so existing published anchors stay valid and only the bag shrinks.
  • examples/assets.html pinned a pre-MASL dag-pb fonts anchor that parseAssetAnchor rejects, so the example failed against its own library. The fixture is regenerated with the shipped packAssets (the generator previously used a test helper), and npm test now runs examples/build-assets.ts, whose drift guard keeps page and fixture in sync.
  • pack assets wrote one CAR section per file, so identical files produced duplicate sections and the client rejected the bundle. Each distinct block is now written once, and the 256 KiB inline budget counts unique bytes.
  • pack assets took the extension from the whole path, so ...
Read more

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 27 Aug 14:29
beb4612

v0.4.0 — Routing hints

Routing hints separate where from what: an untrusted hints.json beside the page (or beside the data) maps CIDs to candidate locations, so hosts can move — or pages can ship anchor-only — without touching a verified byte. The layer is fully optional: a configured client never fetches a hint, wrong hints waste a request at worst, and every byte still verifies against the anchor.

Added

  • Routing hints (SPEC.md §5): an untrusted hints.json maps CIDs to candidate locations, so a page can ship only its anchor and keep host locations in a sibling file that changes on its own cadence. Every byte fetched through a hint is still verified against the anchor exactly as a configured URL is. One new option on VerifiedSource / VerifiedFile / VerifiedAsset: hints (string | string[]) — document URL(s), defaulting to ./hints.json beside the page, fetched lazily only when a location is missing. Relative URLs inside a document resolve against the document's own URL — the final URL after redirects — so a copied or redirected hints file is correct on any mirror. Document bodies are bounded to a fixed 1 MiB pre-parse.
  • Tolerant hints parser: salvages every valid entry and ignores malformed keys, values, and URLs individually; only a non-object body or the size cap rejects a whole document.
  • In-directory discovery: the directory holding published artifacts — a proof base, a bundle base, or the directory containing a proof CAR or content file — may publish hints.json, probed only when a location class is missing (location → document → location, bounded by a 16-document-per-client cap).
  • examples/hints.html — an anchor-only page backed by a sibling hints.json.

Changed

  • source is now optional on VerifiedFile / VerifiedAsset: a hints document may supply the location. Every location option (source, proof, hints) is optional; a fully configured client fetches zero hint documents.
  • A query-string source no longer requires an explicit proof when an explicit hints document supplies the proof location; the defaulted document never lifts that requirement.
  • Hints faults are transport-level — they never increment rejected and never ban a source; a hinted URL, once merged, is an ordinary source under the existing failover, ban, and speculative-range rules.
  • The routing-hints specification lands in SPEC.md as §5 Routing hints; the previous §5–§8 (Hosts, Publishing, IPFS interoperability, Non-goals) are renumbered §6–§9.

Notes

  • No breaking changes: the descriptor, shard-tree, and MASL formats are unchanged, and every existing API keeps its signature and behavior.

Full Changelog: v0.3.1...v0.4.0

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 07 Aug 22:21
f7d6e30

Highlights

  • Optional UnixFS/IPFS bridge for VerifiedFile — pack with --unixfs to embed a standard, reproducible UnixFS root CID (the same layout ipfs add --cid-version 1 produces) in the descriptor alongside the existing raw map CID. Combine with --full-car <path> to emit a complete, pinnable CAR of that UnixFS DAG for ipfs dag import / pinning services. This does not change the map CID or the proof tree — it's purely additive.
  • SPEC.md significantly condensed and reorganized — rewritten as a tighter, more DASL/MASL-aligned specification (CIDs restricted to DASL-style raw/dag-cbor, clearer separation of ranged-file vs. asset proof systems, streamlined client-behavior and host-contract sections). No behavioral changes to the existing formats — only the CARv1 framing/section-caps wording and structure were clarified.
  • VerifiedAsset docs correction — the options list in the README now accurately reflects the shipped API (dropped a stray checkProofCompleteness mention that doesn't exist on VerifiedAsset).
  • Docs: README.md updated with --unixfs/--full-car/pack assets usage examples and clarified that the packer is a repository dev tool (clone + npm ci), not part of the published npm package.
  • Version bump only — package.json/package-lock.json to 0.3.1.

Full Changelog: v0.3.0...v0.3.1

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 07 Aug 21:48
a43629c

Highlights

  • New VerifiedFile client — a general-purpose range-verified file reader (not just PMTiles). VerifiedSource is now a thin pmtiles adapter over it.
  • New proof format for range reads — replaces the old CARv1-based map package format with a dag-cbor descriptor ({proof}/root) plus a tree of binary meta/shard files. The anchor CID codec changes from dag-pb to dag-cbor, and the old metadata.json bootstrap manifest is gone entirely.
  • VerifiedSource/VerifiedFile API change: rootCid → cid, and source now points directly at the file itself rather than a package directory; proofs default to {source}.proofs instead of a sibling proofs/ directory.
  • VerifiedAsset proof format overhaul (MASL) — the old strict-CARv1/UnixFS DAG-walking proof is replaced with a dag-cbor manifest bundle (raw content CIDs + a MASL-style resources map), read as an untrusted "bag of blocks" and verified lazily on first use rather than via a whole-body proof hash.
  • New npm run pack CLI (tools/pack.ts) — generates the descriptor + proof tree for a file (fixed and pmtiles publisher profiles, with zoom-shaped proof trees for PMTiles archives), plus a pack assets subcommand for MASL bundles.
  • VerifiedAsset.stat() — new method returning { size, contentType? } for a manifest entry.
  • Docs: SPEC.md fully rewritten around the new descriptor/shard-tree and MASL-CAR proof systems; README.md updated with new API examples and host requirements.
  • Examples and fixtures updated to the new anchor/CID scheme (MAP_ANCHOR instead of MAP_ROOT, etc.) — the previously hosted demo package is noted as incompatible with the new format until republished.
  • Bumped maplibre-gl example dependency to 6.2.0; added @ipld/dag-cbor as a dev dependency.

Breaking changes

  • VerifiedSource/VerifiedFile anchor CID codec changed (dag-pb → dag-cbor); old map packages and their root CIDs are incompatible.
  • VerifiedAsset DAG/CARv1 proof anchor codec (car) is retired; new anchors use raw or dag-cbor (MASL manifest).
  • rootCid option renamed to cid across the public API.
  • source/proof semantics changed: source now targets the file directly, not a package base directory.

Full Changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@guillaumemichel guillaumemichel released this 07 Aug 21:43
2387d8b

Highlights

  • Verified whole-file assets — support for verifying single-file downloads (not just PMTiles byte ranges), with new examples added to demonstrate usage.
  • Unified SPEC.md — consolidated the verification spec into a single document for easier reference.
  • Docs: examples now load veritiles from the CDN by default, making it easier to try out without a local build.

Full Changelog: https://github.com/guillaumemichel/veritiles/commits/v0.2.0