Concept

Substitutes: prebuilt items and trust

The short version

A substitute is a prebuilt store item you can download instead of building. Vessel's design for channel substitutes is settled, but it isn't built yet. It would bind package identities to exact output paths and bytes, so a machine could use the same closure whether it built locally or fetched from an untrusted mirror.

Why a recipe signature isn't enough

A signed channel tells you which recipe was published. It can't tell you whether another machine actually ran that recipe or returned the right bytes. The design adds an output binding naming the full store path, derivation, package identity, target, hashes and references. One digest also covers executable modes, which the existing Sigil directory hash doesn't cover.

Lookup uses a build key: package identity, system, derivation schema, seed toolchain and sandbox mode. A snapshot alone can't predict every store path, because derivations include realized toolchain outputs and measured build-input references. A substitute set pins the toolchain output as well.

The registry signing service would verify build receipts and unpacked outputs, then sign a set for one snapshot and system under the channel-substitutes role. A short-lived channel head would select current sets and carry withdrawals. Clients would verify from a trusted registry root to the set, binding, archive and unpacked tree. Mirrors would supply bytes without receiving signing authority.

The intended update behavior

The planned vessel substitutes check would show which packages have substitutes and what would need a local build. The planned input updater would prefer the newest fully substituted snapshot. Neither command exists yet. Machine-specific system items would still be built locally.

A missing substitute normally permits a local build. A withdrawn binding is different: a local build of the same build key could occupy the same poisoned path, so the design waits for a fixed identity unless explicitly overridden. A head's freshness and withdrawal policy would still apply when using cached bytes. A second independent builder would provide evidence about reproducibility; a signature alone isn't evidence of an independent rebuild.

What exists today

Sigil has a first substitute format for fetching outputs named by an environment lock. It keys discovery by output hash and installs a fetched tree under a content-derived substitute name. Vessel packages embed their input-addressed paths, so that mechanism can't serve this channel protocol unchanged. It also lacks the binding's reference and mode-sensitive digest data.

On a Vessel machine, the proposed store service would repeat the admission checks before accepting bytes into the shared store. That service isn't implemented either. The current generation receiver isn't a substitute verifier, and a successful receive doesn't establish output authenticity.

In practice

Read Channels for authenticated recipes and The store for closures and admission limits. A guide to using substitutes will follow once they exist.

Created with Sigil