The file
A package is the transport form of an application: its bundle archived, with a fixed-size footer appended. Nothing runs from a package, and nothing is read out of it until the checks below have passed.
| Part | What it is |
|---|---|
| the name | <id>-<version>.yoke — com.yoke.station-2.1.0.yoke |
| the payload | a Zip archive whose root entries are the bundle's: yoke.yaml, manifests/, components/ |
| the footer | 512 bytes appended at the end, never inside the archive |
- Everything a host decides on is in the footer, found by reading the last bytes of the file without interpreting the archive, and readable when the payload is sealed.
- A package that is not sealed opens with ordinary tools:
unzipand any Zip library find the archive's directory by scanning backwards, past the footer.
The footer
512 bytes, [SIG(256)][META(256)]. SIG begins at EOF-512 and META at EOF-256. Every
multi-byte field is little-endian. The payload region is every byte before the footer.
META
| Offset | Size | Field | Holds |
|---|---|---|---|
| 0 | 8 | magic | YOKEPKG1, in ASCII |
| 8 | 2 | format | the version of this footer format: 1 |
| 10 | 2 | header_len | the bytes of META the checksum covers: 252 |
| 12 | 2 | model | the version of the description model the descriptor is written against |
| 14 | 1 | hash_id | the digest algorithm |
| 15 | 1 | sig_id | the signature algorithm, 0 where there is none |
| 16 | 1 | seal_id | the seal algorithm, 0 where the payload is in clear |
| 17 | 7 | — | reserved, zero |
| 24 | 8 | payload_size | the bytes of the payload region as it sits in the file |
| 32 | 8 | built_at | nanoseconds since the epoch, UTC |
| 40 | 32 | digest | the digest of the payload |
| 72 | 32 | key_id | the SHA-256 of the signing public key; zero where there is no signature |
| 104 | 48 | id | the application's namespaced identifier |
| 152 | 32 | version | the application's version |
| 184 | 12 | arch | the architecture the bundle's executables are built for |
| 196 | 24 | core | the range of Core versions the application declares |
| 220 | 32 | — | reserved, zero |
| 252 | 4 | crc32 | the checksum over bytes [0, 252) of META |
- The identity fields are the descriptor's own, carried so a host can decide whether it wants a file before opening it. The data range is not among them.
- Text fields are UTF-8, zero-padded, with no terminator. A value that does not fit cannot be carried: a package is not produced rather than truncated.
- Reserved bytes are zero, and covered by the checksum and the signature. A reader of format
1refuses a footer whose reserved bytes are not zero. - There is no flags field. Whether a package is signed or sealed is what
sig_idandseal_idsay. - Nothing reads the clock.
built_atis reported and never checked; nothing in a package expires.
SIG
The signature bytes, left-aligned and zero-padded to 256; all zeros where sig_id is 0. It covers
META, checksum included, and is covered by nothing.
The algorithms
An identifier is one byte, and a value this host does not know is refused, naming it — reported as cannot decide, distinctly from a check that decided against the file.
| Field | Value | Means |
|---|---|---|
hash_id | 1 | SHA-256, filling the 32-byte digest |
sig_id | 0 | no signature |
sig_id | 1 | Ed25519, 64 bytes — the reference algorithm |
sig_id | 2 | RSA-2048, PKCS#1 v1.5 over SHA-256, 256 bytes |
seal_id | 0 | the payload is in clear |
seal_id | 1 | AES-256-GCM, a 12-byte nonce and a 16-byte tag |
The checksum is CRC-32 (ISO 3309), the polynomial Zip uses, stored little-endian.
Three checks, three different things
| Check | Establishes | Does not establish |
|---|---|---|
the CRC over META | the block is intact and was written by something implementing this format | anything against an adversary, who recalculates it |
| the digest of the payload | the payload is the one META describes: no corruption, not the wrong file | anything deliberate: whoever replaces the payload writes its digest |
the signature over META | authenticity — the only one of the three that survives an adversary | that this host wants the application |
The signature covers the metadata, and the metadata covers the payload: one signature, covering everything transitively.
The order a host checks in
| # | Step | A failure here is |
|---|---|---|
| 1 | read the last 512 bytes; check magic, then format, then the CRC | not a package, or a damaged or foreign file |
| 2 | verify SIG over META against a trusted key; where the policy requires a signature and there is none, stop | a failure of trust; the payload is untouched |
| 3 | compare arch, model and core against this host | this host does not want it, each named |
| 4 | unseal, where seal_id is not 0 | a refusal: no credential, the wrong one, or a tag that does not verify |
| 5 | recompute the payload's digest and compare | not the payload META describes |
| 6 | expand — and only now read what the application says about itself | — |
- Steps 1 and 2 decide whether the host wants the file while it holds only the last 512 bytes. The descriptor is not read until step 6.
- The digest covers the payload as it is after unsealing. Sealing does not change an artifact's digest; the ciphertext's integrity is the seal's tag, checked at step 4.
- Nothing step 4 produces is used before step 5 has passed.
Sealing
Sealing is optional, independent of signing, and outside the footer. A sealed payload region is
[nonce · 12 B][ciphertext][tag · 16 B], and payload_size counts all three. The footer stays in
clear, so a host refuses a package from an unknown signer without holding any key for it.
- The seal acts once, at install. It protects the package in transit and decides who can bring it into service. The installed bundle is in clear, and nothing consults the seal again.
- Where the credential that opens it comes from is the trust store's.
Architecture, identity and versions
- A package is built for one architecture and says which. There is no value meaning any; a package of images and interpreted code names the architecture of the host it is for.
- An application is named by a namespaced identifier that survives every version: an instance record, an installed bundle and a package all carry it.
- A version must parse as a semantic version, or the package is refused at install.
- A pre-release installs and runs, and is never removed automatically.