Repository navigation
Description
Affected sections
In this proposal, "part A" to "part E" are the parts of the proposed change. Spec sections are always named with
their document.
- Package spec:
- §1.1 The document set: a row for the new document.
- §2 Terms: encrypted package, envelope, outline, key provider, issued copy, issuer.
- §4.1 Properties:
distribution, and the key by which a publisher allows issued copies (part C.4). - §6.2 What is not part of a package: no change; cross-reference from the new document.
- §10 Attestations: the issued-copy statement.
- §11 Capabilities:
signedandreviewedon an issued copy. - §12 Storage and transport: a pointer to the envelope.
- §13 Security considerations: §13.2 (stanzas are package data), §13.3 (an encrypted package is the one case
where a holder cannot read every file), §13.5 (issued copies are not forgeries), §13.6 (new personal data). - §14 Versioning: new markers.
- New document: spec/moca-encrypted-package.md.
- Attestations:
- §1 Scope: three statements, not two.
- New §3a Issued-copy attestations.
- §4 Review attestations: reviews on changed files.
- §6 Trust roots: the
issued-copyrole, added to the closedrolesenum. - §7 Verifying an attestation: two passes.
- §8 What attestations do not prove.
- Reader contract:
- §3 Opening a package: envelopes and limits.
- §4 What a Reader must never do: age plugins.
- §7 Citation records: issued copies;
L002. - §11 Diagnostics: the
Efamily, the validity rule,L002. - §13 Degradation.
- §14 Demonstrating conformance: optional feature
encryption.
- Reader interface:
- §3 What the host supplies: the key provider.
- §4 Reading: the
keyProvideroption and new result fields.
- Sidecar index spec: §2 and §5.2, the encrypted index inside an envelope.
- Schemas:
- new
moca-enc.schema.jsonandissued-copy-predicate.schema.json; manifest.schema.json(distributionand the issued-copy consent key);trust-root.schema.json(roles);citation-record.schema.json(issued copies).
- new
- Repository files: conformance/README.md and cases, MIGRATIONS.md, CHANGELOG.md, SECURITY.md.
Problem
Today a package is either handed over in full or kept on a server and quoted. Three cases have no standard way to be
expressed:
- Confidential packages. Organisations exchange policies, procedures and regulated material that only named
people, or holders of an organisation's keys, should be able to decrypt. A lost laptop or a copied file should
not expose the content to anyone else. - Packages for offline use by one licensee. A publisher wants each copy encrypted for one licensee. The issuer
wants to be able to mark the copy, so it can recognise the copy later if it leaks unaltered, and the copy should
still verify as the publisher's. - Packages meant to be read only on a server. Hosts already do this, but a package cannot declare it, so a
catalogue cannot tell a reader what they will get.
Each host could invent its own encrypted format. An encrypted package from one host would then be unreadable
everywhere else, and the standard would lose the portability that is its point.
Proposed change
Part A. A distribution manifest property
| Property | Required | Meaning |
|---|---|---|
distribution |
No | How the publisher intends the package to be handed out: open (the default), encrypted-only or service-only. A label, not access control (package spec §13.3). |
open: the package may be handed over in full.encrypted-only: the package is handed over only as an encrypted package (part B). The recipients may be named
people, an organisation's keys or one licensee. An issued copy (part C) is one use.service-only: the package is meant to be read only by a host that returns citation records, not files.
A Reader reads the package exactly as if the property were absent. It exposes the value in the package result, so
a host or a catalogue can show it, or compare it with how the package was delivered. A Reader never refuses a
package because of it, and it never configures the Reader (package spec §4.5, §13.2). The property is covered by the
digest, so it is the publisher's signed intent. Changing it needs a new version.
An unknown value fails the schema, so the enum is closed. A later value needs a new minor release.
Part B. Encrypted packages (new document: moca-encrypted-package.md)
An encrypted package is a .moca archive inside an envelope. Once opened, it is that .moca archive. Every
rule of the package spec and the Reader contract then applies to it unchanged, and it gives the same digest.
Package spec §12 keeps its three forms and points here.
Sign, then encrypt. Attestations are made over the plain package, as today. They travel inside the encrypted
archive and are verified after decryption, as today.
Encryption gives confidentiality only. It does not show who made the file. Anyone who holds a recipient's
public key can make an envelope that recipient will open. Any recipient of a file can make a new file that the other
recipients will open. Provenance comes only from attestations verified after decryption. A host that opens
envelopes from more than one source SHOULD read with requireSignature.
B.1 Layout
The file is a Zip archive, conventionally named <name>.moca.enc. Every archive rule and limit in Reader contract §3
applies to it, with the same codes. It contains only these entries:
| Entry | Plain or encrypted | Required | Contents |
|---|---|---|---|
moca-enc.json |
Plain | Yes | The format marker and the optional outline (B.2), valid against moca-enc.schema.json. |
package.age |
Encrypted | Yes | The .moca archive, encrypted with age v1 (B.3). Stored, not deflated. |
outline/structure.ttl |
Plain | No | A byte-for-byte copy of the inner structure.ttl. Opt-in (B.2). |
index.age |
Encrypted | No | A sidecar index in its Zip form, encrypted with age v1 to the same recipients (B.8). Stored. |
- Directory entries are ignored.
- Any other entry, including a hidden one, makes the envelope invalid.
- So does a missing or repeated required entry, or a
moca-enc.jsonwith an unknownformat. All of these are
E005_ENVELOPE_INVALID(error). - A Zip with both
moca.jsonandmoca-enc.jsonat its root is alsoE005.
A Reader recognises an envelope by its content, never by its name: a Zip with moca-enc.json at its root and no
moca.json. A host source may supply an envelope only as archive bytes.
B.2 The marker and the outline
{
"format": "moca-enc-v1",
"outline": {
"id": "https://example.com/moca/handbook",
"version": "3.0.0",
"title": "Staff handbook"
}
}formatis REQUIRED and ismoca-enc-v1. It changes only when this format breaks (package spec §14).outlineis OPTIONAL. It may carry any of these inner manifest properties, copied as JSON values:id,
version,title,description,language,license,publisher,mocaVersion,distribution.- A Producer includes only what the publisher chooses. The default, and the minimum that tools write, is
id,
versionandtitle. A Producer MAY write no outline at all. outline/structure.ttlis opt-in. It reveals the package's concept graph.
The outline is unverified until the envelope is opened. Nothing signs it. Before opening, a host MAY show it,
and if it does it SHOULD mark it as unverified. A Reader MUST NOT report signed, reviewed, signers or review
status for an envelope it has not opened.
The outline check. After decryption, the Reader compares each outline property with the same property of the
inner moca.json, as parsed JSON values. A property in the outline that is absent from the manifest, or has another
value, is E004_OUTLINE_MISMATCH (error). So is an outline/structure.ttl that is not byte-for-byte equal to the
inner structure.ttl, or one present when the inner file is not.
B.3 Encryption
- Format.
package.ageandindex.ageare age v1 files (C2SP age). - Recipients a Reader unwraps itself. These are
X25519andscrypt. A Reader that implements the
encryptionfeature MUST unwrap both, given an identity or a passphrase from the key provider. - Other stanzas. Any other stanza type is data. The Reader passes it to the key provider unchanged.
- No plugins. A Reader MUST NOT run age plugins or any other program (Reader contract §4).
- Passphrase files. age allows an
scryptstanza only as the single stanza of a file, so a passphrase file has
exactly one recipient. Its strength is the passphrase's: it can be guessed offline. - Work factor. An
scryptstanza names its own work factor. A Reader MUST refuse one abovemaxScryptWorkFactor
without running scrypt (B.6).
B.4 The key provider
The host supplies a key provider with the read options (Reader interface §3, §4). A Reader opens an envelope only
through it, and never contacts anything itself.
keyProvider(request) → result, or nothing; MAY be asynchronous
request: { stanzas: [{ type, args: [string], body: bytes }], outline: object | absent, file: "package" | "index" }
result: { identities: [string] } age X25519 secret keys ("AGE-SECRET-KEY-1…")
| { passphrase: string }
| { fileKey: bytes(16) } a file key the host unwrapped itself
- The provider may be called once per encrypted entry.
- Nothing returned, an exception, or no identity that matches a stanza is
E001_ENCRYPTED_NO_KEY(error). - A key that was supplied but fails is
E002_DECRYPTION_FAILED(error). That covers a wrong passphrase, a failed
stanza unwrap, and a header MAC that does not verify, including against a returnedfileKey. - An exception is never thrown to the caller.
- The outline in the request is unverified. A key provider SHOULD choose a key by stanza type and host
configuration, not by the outline alone. - A key provider MUST NOT contact, or send credentials to, an address taken from a stanza or the outline. Key routes
come only from host configuration (package spec §13.2).
B.5 Opening an envelope
A Reader that implements encryption opens an envelope in this order. The first failure ends the read with its
code.
- Outer archive. Apply Reader contract §3 to the outer Zip (
T003,P001–P003). - Entries. Check the entry set and
moca-enc.json(B.1, B.2) (E005). - age header. Parse the header of
package.age. A malformed or unsupported header, anscryptstanza that is
not alone, a work factor over the limit, or a header over 64 KiB isE006_AGE_HEADER_INVALID(error). - Key. Call the key provider and unwrap (
E001,E002). - Header MAC. Verify it (
E002). - Decrypt. Decrypt and authenticate the whole payload, including the final chunk, before using any of it.
- A failed chunk, a truncated stream or a missing final chunk is
E003_PAYLOAD_CORRUPT(error), and no plaintext
is used. - Decrypted bytes count against
maxBytesas they are produced (T003).
- A failed chunk, a truncated stream or a missing final chunk is
- Inner archive. Read the decrypted bytes as a
.mocaarchive under Reader contract §3 and §5. - Outline check. Compare the outline (B.2) (
E004). - Attestations. Verify the inner
attestations/(attestations §7). - Results. Derive capabilities and build the result.
Nothing from the inner archive (manifest, nodes, digest or attestation results) is exposed before step 8 passes.
A Reader that does not implement encryption recognises an envelope (B.1), runs steps 1 and 2, and reports E001.
B.6 Limits
These are added to the Reader contract §3 limits table:
| Limit | Option | Default | When exceeded |
|---|---|---|---|
| age scrypt work factor (log2 N) | maxScryptWorkFactor |
20 | E006, without running scrypt |
| Decrypted bytes | maxBytes (existing) |
512 MiB | T003 |
B.7 What stays in memory
- A Reader MUST NOT itself write decrypted bytes to any file, including temporary files. It holds them in memory.
- Each Reader's own tests check this by reading an envelope with a temporary directory it cannot write to. The
corpus cannot observe it. - Swap, crash dumps, caches and the stores a host feeds are outside the Reader's control (B.9).
B.8 Derived data
Indexes and embeddings can reveal content, and embeddings can be partly turned back into text.
- A Producer that builds a sidecar index for an encrypted package SHOULD put it in the envelope as
index.age,
encrypted to the same recipients. Only the Producer knows the recipients; a Reader holding one identity cannot
learn the others. - A Reader binds
index.ageonly after opening the envelope, through the same key provider. - A host SHOULD keep indexes it builds itself, and chats, summaries, traces and store records made from an encrypted
package, encrypted at rest.
B.9 What encryption does not do
The new document states this list plainly:
- Anyone who can decrypt a package can copy its content, re-encrypt it to anyone, or remove the envelope.
- Removing
distributionfrom a decrypted copy changes the digest, so the publisher's signature no longer verifies.
The copy is still readable unsigned. - The plain part is public:
moca-enc.json, the outline if any,outline/structure.ttlif included, and the
approximate size of the package. - age hides who the recipients are, but not how many there are.
- age cannot withdraw access to a file already delivered. Removing a recipient means a new file. Copies already held
stay readable. - Content shown on a screen or sent to a model is plain on that device (Reader contract §12).
Part C. Issued copies (new predicate)
An issuer may mark a licensee's copy: it changes the body text of some content or media files, so that it can
recognise the copy later. Any change alters file hashes and the package digest. The publisher's package attestation
would then report A008_PACKAGE_DIGEST_MISMATCH, and reviews of those files would stop counting.
The issued-copy attestation binds the copy to the publisher's package. The Reader checks the binding itself.
{
"_type": "https://in-toto.io/Statement/v1",
"subject": [
{ "name": "https://example.com/moca/course@2.1.0",
"digest": { "sha256": "<digest of this issued copy>" } }
],
"predicateType": "https://w3id.org/moca/attestation/issued-copy/v1",
"predicate": {
"original": { "sha256": "<digest of the publisher's package>" },
"changedFiles": {
"content/lesson-3.md": { "original": "<sha256 of the publisher's bytes>" }
}
}
}C.1 The statement
subject.nameis the originalid@version. The subject digest is the copy's computed digest. It MUST differ from
original.changedFilesMUST be non-empty. Each key is an NFC package path undercontent/ormedia/. It MUST NOT be
moca.json,structure.ttl, anything undersources/orattestations/, a hidden entry, or a file a profile
defines.- An issuer MUST NOT change a node's frontmatter. Frontmatter carries audience, status, validity and evidence, which
the default policy reads. A Reader cannot check this rule: it never has the original bytes, and a file hash cannot
be split into parts. So the rule binds issuers, and trusting an issuer means trusting it on this (C.4, C.5). - The copy has exactly the same set of paths as the original: no file added, removed or renamed.
- The statement names no licensee. The issuer keeps its own record of which copy (by subject digest) went to whom.
C.2 Verification (attestations §7, two passes)
Pass 1: the issued-copy attestation. A Reader verifies it with role issued-copy (C.4), then:
- its subject matches the copy's
id@versionand computed digest; - every
changedFilesentry obeys C.1, and its current hash differs from itsoriginal; - the Reader rebuilds the digest manifest (package spec §6.4), using each changed file's
originalhash in place
of its current hash. The result MUST equaloriginal.
Any failure makes that attestation invalid (A002). Several valid issued-copy attestations that disagree on
original or changedFiles are each A002, and none is used.
Pass 2: the publisher's attestations. With exactly one valid issued-copy attestation (or several that agree):
- package attestations are compared with the rebuilt original digest.
A008applies only to a mismatch with it. signedholds when a package attestation verifies against the rebuilt digest.signersnames the publisher.- A review subject for a changed file never counts. It is listed in
attestedReviewswithfileChanged: true. So a
copy whose reviewed files were marked is notreviewed. Issuers mark files that no review covers. requireSignatureis met whensignedholds this way.
Without a valid issued-copy attestation, today's rules apply unchanged.
C.3 Results and records
- Citation record. The record's
packagegainsissuedCopy: { originalDigest, issuers }.issuerslists the
signers of valid issued-copy attestations. A node from a changed file carriesissuedChange: true. - Digests.
package.digeststays the computed digest of the copy. A host that shares citations outside the
licensee's own use SHOULD useoriginalDigest, which is the same for every copy and identifies no one. - Libraries (Reader contract §7). A library that holds two packages with the same
id@versionand different
digests, both bound by valid issued-copy attestations to the sameoriginal, keeps the first and reports
L002_ISSUED_COPY_DUPLICATE(info). It does not reportL001. - Package spec §13.5 states that issued copies are the one expected case of two digests for one version, and
that they are recognised only through a valid issued-copy attestation.
C.4 The issued-copy role
- Trust roots gain a role,
issued-copy. The role is named after the predicate, likepackageandreview. - For this role,
idsis REQUIRED. An entry with noidsvouches for no package. That is the reverse ofpackage,
where a missingidsonly removes relation authority. - The
rolesenum stays closed and gainsissued-copy. 0.6 Readers refuse a trust root that lists it
(MIGRATIONS.md). This is a breaking change. We accept it before 1.0. - Publisher consent. An issued copy is valid only if the publisher allowed it. The publisher's manifest names the
issuers it allows (by trust-rootidsor key) and the paths they may mark (withincontent/andmedia/). The
manifest is never changed in a copy, so the consent is covered by the publisher's signature and checked in pass 2.
A copy from an issuer the publisher did not name, or with a change outside the allowed paths, is refused. The
exact shape of this manifest key will be proposed in a comment on this issue before it goes into the spec text. - Issuers SHOULD sign with a DSSE key. Keyless Sigstore signing would put each issue in a public log. An issuer's key
expiry endssignedon every copy it issued, so issuers re-issue before keys expire, as publishers re-sign.
C.5 What this proves, and what it does not (attestations §8)
- The Reader proves that the copy differs from the publisher's package only in the listed files, all under
content/ormedia/.moca.json,structure.ttl,sources/and every other file are the publisher's bytes. - It cannot prove that the listed files changed only by marks in the body, nor that the marked text means the same
as the original. That is the issuer's assertion alone. Every record from a changed file showsissuedChangeand
names the issuer, so an application can tell "the publisher's bytes" from "the publisher's bytes as changed by
the issuer". - Marks may let an issuer recognise a copy that leaks unaltered. They do not survive deliberate removal, especially
by someone who compares two copies. They are lost in paraphrase or extracted text. They identify a copy, not a
person. - The
originalhashes inchangedFileslet the holder of a copy confirm a guess at the original bytes. Hiding them
would stop the Reader rebuilding the digest. The trade-off is accepted and stated. - How marks are made is out of scope. The spec defines only the binding.
Part D. Diagnostics
The new E family:
| Code | Severity | Meaning |
|---|---|---|
E001_ENCRYPTED_NO_KEY |
error | The envelope was not opened: no key provider, no key returned, or no key matched a stanza. |
E002_DECRYPTION_FAILED |
error | A key was supplied, but unwrapping or the header MAC failed. |
E003_PAYLOAD_CORRUPT |
error | The encrypted payload failed authentication or was truncated. |
E004_OUTLINE_MISMATCH |
error | The outline differs from the decrypted manifest or structure. |
E005_ENVELOPE_INVALID |
error | The envelope has a missing, repeated or unexpected entry, an invalid moca-enc.json, or an unknown format. |
E006_AGE_HEADER_INVALID |
error | The age header is malformed or unsupported, or breaks the scrypt rules or limits. |
Also new: L002_ISSUED_COPY_DUPLICATE (info). Issued-copy failures use A002.
Reader contract §11's validity rule becomes: a package is valid when it has no error in the T, P, M, C or E
families.
For each outcome, the package result is:
- Not opened (
E001):valid: false;envelope: { format, opened: false, outline }. There is no digest, no
manifest and no nodes. - Failed (
E002–E006): the same, with the code. - Opened: the normal result, plus
envelope: { format, opened: true }.
encrypted is not a capability. Capabilities describe what a package contains, and every one needs core.
Part E. Conformance and versions
- Optional feature
encryption(Reader contract §14). Corpus cases that need it sayrequires: ["encryption"].
A Reader without it passes the recognition cases (E001) and is run with--without encryption. - Issued copies are core attestation behaviour. Every 0.7 Reader implements them, because they are digest
arithmetic over files the Reader already reads. - Version markers (package spec §14):
moca-enc-v1, inmoca-enc.json;- predicate
…/issued-copy/v1; - schemas stay
v1, since every change only widens them.
- Fixtures. Encrypted fixtures are committed as fixed bytes, made once with a published test X25519 key and a
test passphrase, and never regenerated byrefresh:derived. This is the same approach the Sigstore cases take with
their self-made test CA. - The age test kit. Each Reader's own CI also runs the C2SP age test vectors (CCTV).
Impact
- No existing package changes meaning.
distributionis optional and defaults toopen. - 0.6 Readers:
- An envelope has no
moca.jsonat its root, so a 0.6 Reader reportsT002_MANIFEST_NOT_FOUND. - An issued copy is an ordinary package. A 0.6 Reader ignores the unknown predicate, reports the publisher's
attestation asA008, and refuses the copy underrequireSignature. That fails safe. - A 0.6 Reader refuses a trust root that lists
issued-copy. - A 0.6 Reader ignores the publisher-consent key as an unknown key (package spec §4.5).
- An envelope has no
- Readers gain:
- the
distributionvalue and theenveloperesult; - the
Efamily and the new validity rule; - two-pass attestation verification,
L002and the citation-record fields; issued-copyin the closedrolesenum;- the publisher-consent check on issued copies;
- optionally, the
encryptionfeature: a key provider, age decryption for X25519 and scrypt, the opening order and
the new limit.
- the
- Capabilities: none added.
signedandreviewedgain the issued-copy rules (part C.2). - Tools:
- moca-lint learns
distributionandmoca-enc.json. - moca-sign gains
encryptanddecrypt(X25519 and passphrase recipients; outline fields by choice), andissue.
issuecompares a marked copy with the original, writes thechangedFilesmap and signs the statement. It does
not mark anything. - moca-index can write
index.ageinto an envelope.
- moca-lint learns
- MIGRATIONS.md: the trust-root role, the validity rule, the result fields and the 0.6 behaviour above.
- Conformance corpus:
- Envelopes: X25519; passphrase; minimal outline; no outline; structure copy.
- Failure cases:
E001, with no provider and with a wrong-type key;E002, with a wrong key and a wrong passphrase;E003, truncated and with a flipped byte;E004, for the manifest and for the structure;E005, for an extra entry, a missingpackage.age, an unknown format, and both markers;E006, for an scrypt stanza with another, and for a work factor over the limit.
- Issued copies:
- valid;
- wrong
original; - a right
originalwith one wrongchangedFileshash; moca.jsonlisted;- an unchanged file listed;
- an empty map;
- an untrusted issuer;
- an issuer outside its
ids; - an issuer the publisher's manifest does not name;
- a change outside the paths the publisher allows;
- a package whose manifest allows no issuers;
- two that conflict;
- a review on a changed file;
L002.
- The rest:
distributionexposed; a trust root with an unknown role is refused.
Evidence
- Organisations exchanging confidential knowledge (policies, procedures, regulated material) need it unreadable
without a key. A Zip password is not adequate:- ZipCrypto is broken;
- Zip AES leaves file names visible and allows offline guessing;
- Zip encryption cannot encrypt to named people or to an organisation's keys.
- Publishers of courses and other paid knowledge need offline use for one licensee, and a copy that still verifies as
theirs when it is marked. - Without a standard, each host encrypts packages its own way, and an encrypted package stops being portable.
Alternatives considered
- Zip AES password. Rejected; see Evidence.
- JWE or COSE as the envelope. Both have one authentication tag over the whole payload. Large archives would need
a chunking and truncation scheme of our own, which is the risky part to design. COSE encryption also has thin
library support in .NET and Python. age has authenticated 64 KiB chunks with a final-chunk flag, several
recipients, a passphrase recipient, a small frozen specification and a public test kit. - OpenPGP (RFC 9580, SEIPDv2). It has chunked AEAD and mature libraries. Rejected for its size: legacy modes,
key-management baggage and many options a Reader would have to refuse. - A whole-file
.moca.agewith no outline. It is simpler, and a host could decrypt and pass bytes to today's
Readers. Rejected as the only form, because a catalogue or library then cannot show what a file is without the
key. Writing no outline remains possible (part B.2). - A signed outline. Package attestations bind the digest, not the outline, and a separate signature would only
tell the host who wrapped the file. The outline stays unverified until it is checked against the decrypted
manifest. - Encryption as a profile. Not possible. A profile lives inside the package (package spec §9), and an envelope
wraps it. distributionoutside the package (in a catalogue, or in a detached statement). Possible, and a host may do
both. Kept in the manifest so that the publisher's intent is signed and travels with every copy.- A diagnostic when an
encrypted-onlypackage is read plain. Rejected. A Reader cannot tell how a package
arrived, and aservice-onlypackage is always read plain by the service it is meant for. The host compares. - Reusing the
packagerole for issuers. Rejected. A package attestation says "I published exactly this". An
issued-copy attestation lets its signer put another publisher's name on changed bytes, which is a larger power.
It is granted separately, and scoped byids. - A licensee identifier in the statement. Rejected. It would be personal data travelling in every copy, and
linkable across one licensee's copies. The copy's digest already identifies it to the issuer. - Marks outside the digest (only in attestations or hidden files). Rejected. Anything outside the content can be
stripped without touching the content. - Strong client protection (obfuscation, device attestation). Out of scope for a standard. See part B.9.
Delivery
Parts A and B are planned for 0.7.0. Part C is planned for 0.7.0 too, but is built last. If it is not ready, it moves
to the next minor release, and parts A and B do not change. Linked pull requests use release-0.7.0 branches.
Activity
0.7.0 WP2: distribution
petecleary commentedon Nov 14, 2026
The spec text for part B (spec/moca-encrypted-package.md, on
release-0.7.0) settles five points the proposal left open. None changes the design.E001orE002.E001_ENCRYPTED_NO_KEYis for no key provider, a provider that returns nothing or throws, or a kind of key that no stanza in the file uses (for example a passphrase for a file with onlyX25519stanzas).E002_DECRYPTION_FAILEDis for a key of a kind the file uses that fails: identities that unwrap no stanza, a wrong passphrase, or a header MAC that does not verify, including against a file key from the host.opened.envelope.openedistrueonly when the result is the inner package's normal result. Any failure in steps 1–8 of the opening order givesopened: false, includingE004and errors in the inner archive, and nothing inside is exposed.formatandoutlineare in the result only whenmoca-enc.jsonis valid.E005triggers.E005_ENVELOPE_INVALIDalso covers apackage.ageorindex.agethat is deflated instead of stored, and amoca-enc.jsonthat is not UTF-8 JSON or repeats a member name (the same rule asmoca.json).moca.jsonisT002, as today.index.agefailures. A Reader opensindex.agethrough the same key provider when it binds the sidecar. A failure is reported bybindSidecarwith itsEcode and makes the sidecar unusable. It does not change the package's validity.The corpus also gains cases for 1, 3 and the two-chunk payload:
envelope-wrong-key-type,envelope-wrong-file-key,envelope-deflated-package,envelope-large.petecleary commentedon Nov 14, 2026
Two additions to part B: an opt-in plain cover, and translations and tags in the outline.
A catalogue or library that lists encrypted packages can show the outline's title before the envelope is opened, but
no picture. #7 adds
imagesto the manifest, with the rolecover. This addition lets a Producer leavea copy of that cover readable in the envelope, the same way as the structure copy.
Layout (part B.1). One more optional plain entry:
outline/cover.png,outline/cover.jpgoroutline/cover.webp.pngisimage/png,.jpgisimage/jpeg,.webpisimage/webp. Any otheroutline/cover.*entry, or more than one, isE005_ENVELOPE_INVALID.maxImageBytes). Over it isE005.The outline check (part B.2). After decryption, the copy MUST be byte-for-byte equal to the file of the inner
manifest's first
imagesentry with rolecover, and its extension MUST match that entry'stype. Otherwise, orwhen the inner manifest has no valid cover, it is
E004_OUTLINE_MISMATCH.Unverified until opened. Like the rest of the outline, the copy is not signed. A host that shows it before
opening SHOULD mark it as unverified. Once the envelope is opened, the check proves it is the publisher's cover.
What it reveals (part B.9). The cover becomes public, as the outline is. A Producer writes it only when the
publisher chooses to; tools never write it by default.
Translations and tags in the outline (part B.2).
translationsandtags(from the same proposal) become thetenth and eleventh properties an outline may carry, opt-in like the others, so a catalogue can show translated
titles, descriptions and tags without the key.
It is copied as a JSON value and checked against the decrypted manifest with the same rule as the other outline
properties: any difference is
E004_OUTLINE_MISMATCH. Tools never write it by default.Corpus: an envelope with a cover copy that matches; one whose copy differs by a byte (
E004); one with a copywhen the inner package has no cover (
E004); one with anoutline/cover.gif(E005); an outline whose translated title differs from the decrypted manifest's (E004).This depends on the
imagesproposal. If that one does not land in 0.7.0, this addition moves with it.0.7.0 WP3: envelope format, codes and corpus
0.7.0 WP5: run the encryption cases against the reference Reader
0.7.0 WP4: decrypt-only age, as @openmoca/moca-core/age
0.7.0 WP5: open encrypted packages
0.7.0 WP5: E006 and E002 cases the age test kit settles
0.7.0 WP4: OpenMoca.Reader.Age, decrypt-only age
0.7.0 WP5: open encrypted packages
0.7.0 WP4: moca_reader.age, decrypt-only age
0.7.0 WP5: open encrypted packages
petecleary commentedon Nov 14, 2026
Follow-up to the outline additions above: #7 now adds alt text for images, and the opt-in outline
translationscarries its per-imagealtmaps too, checked against the decrypted manifest like the rest (E004).0.7.0 WP6: index.age cases
0.7.0 WP6: encrypt, decrypt and index envelopes
0.7.0 WP6: the conformance adapter binds index.age
0.7.0 WP6: the conformance adapter binds index.age
0.7.0 WP6b: package images, translated titles and tags
petecleary commentedon Nov 14, 2026
Part C.4: the shape of the publisher-consent key.
Part C.4 says the publisher's manifest names the issuers it allows and the paths they may mark, and that the exact
shape would be proposed here first. This is that proposal.
The key
issuerspublicKey) or one Sigstore identity (sigstore), in the same form as a trust root (attestations §6).paths/, undercontent/ormedia/.Rules
issuedCopiesallows none. An issued-copy attestation for it isA002, however it is signed.entry with role
issued-copywhoseidscover the package (part C.4), and its signer must be listed inissuers. The host decides whom it trusts; the publisher decides whom it allows. Neither alone is enough.publicKeyentry when the two decode to the same Ed25519 key. The Reader compares the keybytes, not the PEM text, so line breaks and padding do not matter.
sigstoreentry under the rule in attestations §6:issuerandsubjectequal, exactly and case-sensitively.
keyidvalues are local to a host, so the manifest never uses them.changedFilesmust equal a file entry inpaths, or start with a directory entry. Achange outside them is
A002. Comparison is exact, on NFC paths. The C.1 rules still apply: nevermoca.json,structure.ttl,sources/,attestations/, a hidden entry or a file a profile defines.issuedCopiesis inmoca.json, which an issuer can never change (C.1). So it is covered bythe publisher's signature, and the Reader checks it in pass 2 against the rebuilt original digest.
issuedCopiesfails the manifest schema (M002). Apathsentry outsidecontent/ormedia/fails the schema too.old version keep the old version's consent.
Not a configuration key
issuedCopiesnever makes a Reader contact anything or change a setting (package spec §13.2). A Sigstore identityin it is matched against a certificate already in the package; a key is compared with the signing key. Nothing is
fetched.
Corpus
signed, withissuedCopyin the record;issuers(A002);paths(A002);issuedCopies(A002);issuersbut not in the trust root with roleissued-copy(A003, as for any untrusted key);issuedCopieswith a path undersources/(M002).Alternatives considered
sha256:of the key). Shorter, but a new format to define, andpublishers would copy keys from trust roots anyway.
keyidvalues. Rejected: they are names a host chooses, not something a publisher can know.the same way.
WP7: issued copies (#5 part C): predicate, issuedCopies consent, two-…
petecleary commentedon Nov 14, 2026
Correction to the publisher-consent comment above: an issued-copy attestation signed with a key the host's trust root does not list is
A002, notA003(attestations §7 step 7).A003applies only when there is no trust root at all. The corpus case isissued-copy-untrusted-issuer.