Skip to content

Capsule digests

A capsule digest is a capsule's identity: sha256:40e4f7107cd51aaf3f71dfa261b1db2a8c4f7f2c50f5c92965f4dce90124d537. It is the SHA-256 of four things taken together:

  1. the hash of every file in the block folder;
  2. the block's interface id;
  3. its interface hash;
  4. its dependency intent.

Why the interface is part of it

The digest names the block's code, its contract and what it declares it needs, together. Folding the interface id, interface hash and dependency intent in beside the files ties the capsule's identity directly to the block's contract and declarations, so the identity a closure binds and a cell reuses states both.

A change to any file in the block, to the block's interface (a method, a type, an effect or retry declaration), or to its dependency or environment declaration gives a new capsule digest.

Where it is used

The capsule digest is the capsule's name everywhere after bake:

  1. the capsule manifest and executable surface index are stamped with it;
  2. publish releases the capsule under it, and the control plane's attestation signs it;
  3. every resolved runtime closure built from the capsule binds it;
  4. every cell running the capsule has it in its reuse key.

The digests around a package

A package carries several digests, each identifying something different:

Digest Identifies
Capsule digest One block's capsule: files, interface and dependency intent
Bundle digest The package's file tree
Archive SHA-256 The exact archive bytes that are uploaded
Interface hash The block's interface contract
Manifest digest The capsule manifest document, signed at publish

See Execution capsules and Canonical interface hashing.