WAI Extension: Marking Layers
Mirrored from the canonical text at commit 498e6b88 ().
Status: Draft. Registers no capability and no record; defines one document kind,
wai-marking-delivery. A party that marks media as made, or not made, by a model writes the marking from its origin claims into every layer a delivery carries, and this extension says what each layer carries for each claim and how a verifier holds every layer to the claim it rests on. The layers are the C2PA statement of a manifest (synthesis §6); the container’s own text metadata, in three fields WAI defines for the places FLAC, Ogg Opus and MP3 files have for them, with where C2PA embeds a manifest store in each of those containers and in WAV and MP4; the AI-disclosure values of a release message in the Electronic Release Notification standard, version 4.3.2, read from the message itself where a delivery gives it (release-message); a live track’s claims for each of its groups; and the watermark, read from the audio of each FLAC, WAV, Ogg Opus and MP3 file by the audio scheme synthesis registers (§3.7, §4.7), Ogg Opus through one pinned decoder whose samples are the same integers on every machine (§4.8) and MP3 through an exact decoder that is WAI’s own definition (§4.9). Each layer’s value is a function of the claim, and where the claims leave a value open (how much of a mix a model made, when an input’s own claim is not held) every value they leave open is admitted, so a verifier never refuses a value the claims cannot exclude. The marking verifier is given a delivery: the claims, the files, the statements, the release’s values and a recorded session’s groups. It refuses the first layer that disagrees with its claim, each defect with its own reason, and states for each claim and each layeragreesorabsent, neveragreesfor a layer the delivery does not carry, and for the watermarknot-checkedwhere no file resting on the claim was read. No new transport and no new container. The reference implementation is themarking_layersmodule ofwai-rs(featuremarking_layers); the corpus islive-conformance/marking-layers/, and its second implementation islive-conformance/marking_layers_verify.py. Keywords MUST, MUST NOT, SHOULD, MAY are RFC 2119/8174.Texts read for this revision, each pinned to the version named: the Code of Practice on Transparency of AI-Generated Content, final text of 10 June 2026, Section 1, Commitment 1, Measure 1.1 with Sub-measures 1.1.1 to 1.1.3, as the Commission’s document 129555, whose SHA-256 as fetched on 14 November 2026 was
7bd22c5a3c56eaefda27a5bf7a6118198ef2a9c9255241bd97abf7cdedf9bc28(the bytes synthesis read); Regulation (EU) 2024/1689, Article 50(2), as that Code reproduces it (the Official Journal text, and the amending Regulation (EU) 2026/1744, could not be fetched for this revision: the publications office refused an unattended fetch on 14 November 2026, with a script challenge for the one and an empty answer for the other, and this text relies on no date or rule of either beyond the paragraph the Code reproduces); the IPTC Digital Source Type vocabulary, released 2024-10-23 (its JSON form’s SHA-256 as fetched,1caaa5bb729d5b40fdfef599bc650bf1288e7cca4fe52b9bb4d65701da4fb1d6); the C2PA Technical Specification, version 2.5 (October 2026), §11.8, §16.3.3.3.7, §16.4.1.4.5, §16.8.2 and Appendix A §A.1, §A.3.5, §A.3.7, §A.3.9 and §A.5.1, and C2PA’s informative Applying Content Credentials to Music Assets (2.4), §2.1, §2.3, §4.1 and §4.3; the Electronic Release Notification standard’s schema for version 4.3.2,release-notification.xsd(SHA-25636110e2149336d35e90ea4822daca72961c121dcc6b5cf5b794048b50f6c1e8a) and the allowed-value sets it imports, version 12 (SHA-25603f290c5a6715e45dcdde5f4fa2b44821c3372331f5bec0b17c802d6fa0e8385), with the licence terms its schema names (§3.5, decisions D110, D115 and D117); RFC 9639 §8, §8.1, §8.2, §8.6, §9 with its subsections; RFC 6716 §3.1, §3.2, §3.4, §6 and Appendix A with A.1 and A.3 (its reference implementation, under the licence the RFC states for its code components); RFC 8251 §1, §3 to §11; RFC 7845 §3, §4 with its subsections, §5.1 with §5.1.1.1, and §5.2; RFC 3533 §6; and ID3 tag version 2.4.0, its Main structure §3.1, §3.3, §4 and §4.1 and its Native frames §4.2.6 and §4.15. A section number of one of those texts in this extension is that version’s. The MPEG audio standards, ISO/IEC 11172-3 and 13818-3, are sold and were not read; the exact MP3 decoder (§4.9) is written from a decoder dedicated to the public domain, its source read at the revision decision D137 names.
1. Scope
In scope: what each layer of a delivery carries for an origin claim (§3): the table (§3.1), the generative share a release states (§3.2), the C2PA statement (§3.3), the container fields and where a manifest store sits in each container (§3.4), the release message’s values (§3.5), a live track’s groups (§3.6), the watermark (§3.7) and a live track’s (§3.8); how each container is read (§4), the audio of FLAC, WAV, Ogg Opus and MP3 files (§4.7), the Opus decoder pinned to read Ogg Opus’s (§4.8) and the exact decoder that reads MP3’s (§4.9); the delivery a verifier is given (§5); and the verification (§6).
Out of scope: what an origin claim is and when one is true, which is synthesis’s; the integrity of each carrier: a manifest’s signature and its binding to the content (c2pa-binding §6, live-provenance), a claim’s signature (synthesis §2), a group receipt (jwp-receipts §3); a watermark’s scheme, its embedding and its detector, which are synthesis’s (§7.3 to §7.10): this extension decodes a file’s audio and runs the detector of the audio scheme synthesis registers (§3.7, §4.7); a label shown to a person (synthesis §10); and any rule of law. WAI says what a marking party can carry in each layer and how a verifier checks that the layers agree. It sets no legal or consent rule and states nothing about any regime: Regulation (EU) 2024/1689, Article 50(2), which has providers of systems that generate synthetic audio, image, video or text mark their outputs in a machine-readable format, and the Code of Practice’s Measure 1.1, which describes signed metadata and an imperceptible watermark as two layers, are reasons a party may need several layers. Whether a delivery meets either is for that party to confirm against their texts.
Relationship to synthesis: every value of every layer here is a function of an origin claim read and checked as synthesis §3 and §5 have it. Synthesis already gives a claim its IPTC digital source type (§5 there) and its C2PA statement (§6 there); this extension carries those into the formats outside WAI that a release and a stream travel in, and adds the check across them. Synthesis §7’s two layers, the claim and the watermark, are two of the layers here.
Relationship to ai-usage: a release message’s training permissions are mapped to ai-usage’s terms (§3.5) and not compared with them.
Relationship to music-rights and release-message: music-rights §6 maps a works document onto the release message’s identifier fields, and release-message writes and reads the message (decision D117); this extension holds the message’s AI-disclosure fields to the claims, read from the message where a delivery gives it.
2. Terms
- Layer: a place in a delivery that says whether, and how far, a model made a piece of media.
This revision names five:
c2pa,container,release,liveandwatermark. - Carried: a layer is carried for a claim when the delivery holds a value of that layer that rests on the claim. It agrees when every such value is the one §3 gives the claim; it is absent when the delivery holds none. The watermark is carried where a file resting on the claim was read, its audio decoded and the detector run on it (§3.7); a claim no such file rests on has its watermark not-checked.
- Marking party: the party that writes a layer from a claim: a generator’s provider, an editor, a packager, a distributor, a room’s publisher. It need not be the claim’s signer.
- Delivery: what a verifier is given (§5): the claims and, for each layer it carries, its values.
- Span: a run of a live track’s groups, consecutive in group number, that give their audio and share one claim for the watermark (§3.8).
3. The layers
3.1 The table
For a claim of each class, each layer carries:
| class | IPTC digital source type (synthesis §5) | C2PA statement (synthesis §6) | release ContainsAI (§3.2) | container fields (§3.4) | live (§3.6) |
|---|---|---|---|---|---|
captured | the capture’s own: digitalCapture, computationalCapture, screenCapture or digitalCreation | c2pa.created with that type | None | WAI_ORIGIN_CLASS=captured and that type | a track or group claim of class captured |
reconstructed | its input’s; a composite of several, compositeCapture or composite | c2pa.opened, c2pa.converted, with no type of its own; several inputs: c2pa.created with the composite’s type | None | reconstructed and that type | as for the class |
assistive | algorithmicallyEnhanced | c2pa.opened, c2pa.edited with algorithmicallyEnhanced; one c2pa.ai-disclosure for each trained model | None | assistive and algorithmicallyEnhanced | as for the class |
synthesized | the generated source: trainedAlgorithmicMedia, compositeWithTrainedAlgorithmicMedia or algorithmicMedia; a composite holding a synthesized input compositeSynthetic; a conversion or assist of a synthesized input, its input’s | c2pa.created (or c2pa.opened, c2pa.edited) with that type; one c2pa.ai-disclosure for each trained model, with its humanOversightLevel | All, Partly or None, by the share (§3.2) | synthesized and that type | as for the class |
So a class alone does not decide every layer: a synthesized claim whose models are all
algorithmic (a synthesizer playing a score, algorithmicMedia) states None in a release,
because the release message’s ContainsAI is about content created using generative AI, which
its allowed-value sets define (as a contributor type) as artificial intelligence that generates
media with models learning the patterns of their training data, and C2PA attaches its AI
disclosure only where a trained model was invoked (C2PA 2.5 §16.8.2.3). An assistive claim over a trained model (a
denoise by a model) states None too: the edit did not alter the content substantially
(synthesis §3.2), and created none.
3.2 The generative share
A release states how much of a resource generative AI made, as one of None, Partly and All
(the allowed-value set ContainsAI of ERN 4.3.2: none of the content was created using
generative AI, part of it was, all of it was). Of a claim c the share S(c) is the set of
those values that agree with it, computed from the claim and the claims of its inputs a verifier
holds:
capture: {None}.convertorassistof one input i: S(i).convertof several inputs: J(S(i) for each input i).generate: J(G, then S(i) for each input i), where G is {All} when a model of the claim istrainedand {None} when every model isalgorithmic.
S of an input is S of the claim its origin names, where the verifier holds that claim;
otherwise it is read from the input’s restated class and source: {None} for a class other than
synthesized; for synthesized, {All} with source trainedAlgorithmicMedia (a trained model
generated all of it from synthesized inputs, or a conversion of such), {Partly, All} with
compositeWithTrainedAlgorithmicMedia, and all three values with any other source
(algorithmicMedia and compositeSynthetic can each hold, or not hold, the output of a trained
model further back). A claim names an input only by a link hash that depends on the input’s
claim, so the inputs of held claims never lead back to the claim itself; a verifier computes each
claim’s share once.
J of a list of sets is the set of outcomes over every choice of one value from each set: None
where every choice is None, All where every choice is All, and Partly otherwise. So J of
one set is that set, a model’s whole generation is {All}, a model’s edit of a recording
(generate over a captured input) is J({All}, {None}) = {Partly}, a mix of a recorded
voice with a generated accompaniment is {Partly}, and a mix of two generated stems is {All}.
3.3 The C2PA layer
A manifest carries a claim’s C2PA statement, {"actions": A, "assertions": D} (synthesis §6),
as the actions of its first actions assertion and its c2pa.ai-disclosure assertions. This
revision reads the statement as a C2PA reader gives it after validating the manifest, a JSON
object of exactly two members: actions, an array of objects each with a string member action
and, optionally, a string member digitalSourceType; and assertions, an array of objects each
with a string label and an object data. Other members of an action, other members of data
(modelName, scientificDomain, metadata) and assertions whose label is not c2pa.ai-disclosure
or c2pa.ai-disclosure__n are not read. A disclosure’s data has a string modelType, and,
where present, a string modelIdentifier and an object contentProfile whose
humanOversightLevel, where present, is a string. Otherwise the statement is c2pa_malformed.
Against the statement the claim gives, in this order:
- the actions’ names, in order (
c2pa_action_mismatch); - each action’s
digitalSourceType, present or absent, and its value: the IPTC term of synthesis §5’s code, or none for a conversion (c2pa_source_mismatch); - the disclosure assertions, taken in the order of their labels (
c2pa.ai-disclosure, then__1,__2, …): their number, and each one’smodelTypeandmodelIdentifier(c2pa_disclosure_mismatch), so a trained model with no disclosure, a disclosure with no trained model and a model named by another identifier are each refused; - each disclosure’s
humanOversightLevel, present or absent, and its value (c2pa_oversight_mismatch).
A statement that states digitalCapture for a synthesized claim is refused at step 2; one that
omits a trained model’s disclosure, at step 3. A manifest is carried in a file (§3.4) or beside it
as a sidecar (c2pa-binding §5). Where the delivery says it is carried in a file, the file holds a
store at the place C2PA gives its container (c2pa_store_missing); the store’s own bytes, its
signature and its binding are checked as C2PA and c2pa-binding have them, not here.
3.4 Container fields and the place of a store
Three fields carry a claim in a container’s own text metadata:
| field | value |
|---|---|
WAI_ORIGIN | the claim’s link hash (synthesis §2), 64 lowercase hexadecimal digits |
WAI_ORIGIN_CLASS | the claim’s class: captured, reconstructed, assistive or synthesized |
WAI_DIGITAL_SOURCE_TYPE | the IPTC term of the claim’s source: http://cv.iptc.org/newscodes/digitalsourcetype/ and the code (synthesis §5) |
A file that carries one carries all three, each once (container_field_invalid). They are not
signed: they restate the signed claim for a reader that reads only the container, and the claim
they name is what signs it. The Code of Practice’s Sub-measure 1.1.1 describes recorded
information that is digitally signed and time-stamped; these fields are not that, and the claim
and the manifest are. A marking party that writes them writes them from the claim; a verifier
holds them to it (§6.1 step 3).
Where each container holds them, and where C2PA 2.5 places a manifest store in it:
| container | the fields | a manifest store (C2PA 2.5) |
|---|---|---|
| FLAC (RFC 9639) | Vorbis comment fields of its Vorbis comment block (RFC 9639 §8.6), names compared without regard to case | in an ID3v2 tag before the fLaC marker, as a GEOB frame (§A.3.5, which names FLAC beside MP3); RFC 9639 defines no such tag, and C2PA lists the native container as being considered (§A.1) |
| Ogg Opus (RFC 7845) | user comments of the comment header (RFC 7845 §5.2), names compared without regard to case | its own logical bitstream, whose first packet begins with the five bytes \x00c2pa (§A.3.7, written for Ogg Vorbis; the stream sits beside the Opus stream in the same physical stream, RFC 3533, and C2PA’s box hash takes each logical bitstream as a box, §16.3.3.3.7) |
| MP3 | TXXX frames of an ID3v2 tag (ID3v2.4.0 frames §4.2.6), the field’s name as the frame’s description | a GEOB frame of that tag (§A.3.5) |
| WAV (RIFF) | none in this revision | a chunk of identifier C2PA, the last sub-chunk of the RIFF chunk (§A.3.9) |
| MP4 (ISO base media) | none in this revision | a top-level uuid box of extended type D8FEC3D6-1B0E-483C-9297-5828877EC481 whose purpose is manifest (§A.5.1) |
A store’s GEOB frame has the MIME type application/c2pa, the media type C2PA 2.5 §11.8 gives a
manifest store (the earlier application/x-c2pa-manifest-store is deprecated there and is not
read). A WAV or an MP4 file carries no fields here: the container layer of such a file is
no-place (§6.2), never agrees. Placing the IPTC property in a file’s XMP packet is left to a
later revision.
3.5 The release message
ERN 4.3.2 carries AI disclosure in three places: ContainsAI on a Release and on each resource
of type SoundRecording, Image, Video or Text; and, on a resource’s Contributor,
AiContribution (None, Partly or All) and a SpecialContributor of GenerativeAI, whose
AiContribution is All where it states none. For a resource resting on a claim c:
- the resource’s
ContainsAI, where stated, is in S(c) (release_resource_mismatch); - where S(c) is {
None}, no contributor states an AI contribution,PartlyorAll, whether stated or by default (release_contributor_mismatch); - the release’s
ContainsAI, where stated, is in J(S of each of its resources), a resource resting on no claim taking all three values (release_mismatch).
A release states no AI use over a generated track, ContainsAI None over a claim whose share is
{All}, and it is refused. The message’s own rules (a resource of All names only generative
contributors, and one of None none whose contribution is AI) are the message standard’s and not
checked here.
Its training permissions, the deal use types UseForTrainingGenerativeAI and
UseForTrainingNonGenerativeAI, map to ai-usage’s terms: both to train-ai of the aipref
vocabulary, the first to cawg.ai_generative_training and the second to cawg.ai_training of
the CAWG assertion (ai-usage §3.2, §3.4). A deal is a licence to its recipient, as a grant’s
terms are (ai-usage §5.2), and so never disagrees with a published preference; the verifier does
not compare them.
Where a delivery gives the release message itself (§5), the verifier reads these values from it
by release-message §7, which holds the message to the ERN 4.3.2 schema within its profile: the
release’s ContainsAI, and for each sound recording its ContainsAI and its contributors’
SpecialContributor and AiContribution. A delivery that carries no message restates the values,
as the marking party gives them, and the same rules hold them (decisions D115, D117).
3.6 A live track’s groups
A track is claimed from a group on by a track claim, and a group by a group claim (synthesis §3.1;
a live track is named by its digest, live-rooms §6.2, and a group by its group receipt’s link
hash, jwp-receipts §3 step 3). In a recorded session, the track claim in force at group g of
track t is the track claim for t with the greatest from_group at most g. Where a group has
both a group claim and a track claim in force, they state the same class and the same source
(live_group_mismatch): a track claimed as captured with a group claimed as synthesized, or the
reverse, has one statement false about that group. A group with neither is a gap: its layer is
absent. Each track an AI participant publishes is claimed synthesized (synthesis §8.2), which a
synthesis verifier given the room checks; a group claim of a lower class in such a track is then
refused here.
3.7 The watermark
The watermark is the second of synthesis §7.1’s layers: a payload that is a function of the claim
(synthesis §7.2), embedded in the content. A file rests on a claim where its origin (§5) or
its WAI_ORIGIN field names the claim; §6.1 step 3 holds the two to one claim where both are
given. For each file the verifier decodes its audio (§4.7) and, where the samples are ones
wai-mark:band64 admits (synthesis §7.10.1), runs that scheme’s detector on them (synthesis
§7.10.5), which reads a payload or no mark; the file is then read. With the payload p read
from a file resting on claim c, in this order:
- p is c’s payload: the file’s watermark agrees;
- p is the payload of a claim given that c reaches through inputs along steps
convertandassist, each input’s claim given: it agrees by inheritance, inherited, as synthesis §7.3 step 4 has it, since a conversion that does not mark its output again carries its input’s mark; - p’s first byte is not the code of c’s class (synthesis §7.2):
watermark_class_mismatch, the content carrying the mark of a claim of another class than the claim its metadata names, a generated track’s mark in a file whose claim says captured among them; - otherwise
watermark_origin_mismatch: the mark of another claim of the same class, one c does not reach.
A read file in which the detector finds no mark is absent. A read file that rests on no claim and carries a mark is carried, its payload stated: the delivery states no claim for it to disagree with, and its payload’s seven bytes name the claim it points at (synthesis §7.2). A file whose audio this revision does not decode is not-decoded, and one decoded to samples the scheme does not admit (another rate, more than eight channels, less than a second) is not-admitted; neither is read.
A claim’s watermark layer agrees where a file resting on it agrees or is inherited; it is absent where at least one file resting on it was read and none agrees; and it is not-checked where no file resting on it was read. It never agrees for a claim from which nothing was read. A payload is a pointer of seven bytes to a claim, not a proof of one: a mark that agrees says that the content carries the claim’s mark, and the claim’s signature says the rest.
The scheme read is wai-mark:band64, the one audio scheme synthesis registers; its picture schemes
(synthesis §7.5, §7.9) mark no container this extension reads. What a mark survives is synthesis
§7.10.7’s and §7.10.8’s measurement: a file this revision reads is one whose audio arrives as FLAC,
WAV, Ogg Opus or MP3 of MPEG-1 or MPEG-2 Layer III, after whatever codec it passed through on the
way. A detection on a file is the same reading on every machine, since the samples are the same
integers (§4.7; for Ogg Opus, those of the pinned decoder, §4.8; for MP3, the exact decoder’s,
§4.9) and the detector is an integer function of them.
3.8 A live track’s watermark
A recorded session may give, for a track’s groups, the Opus packets of each group’s objects, in
order, and the channels the track is decoded to, the same for every group of the track that gives
them (§5). The verifier decodes each such track by the pinned decoder (§4.8) at 48 kHz in those
channels: its groups in ascending group number, each group’s packets in order, one decoder for the
whole track. A live track has no pre-skip and no end trimming: a group’s samples are the
decoder’s output for its packets. A packet of no bytes, or whose framing breaks RFC 6716 §3.4’s
rules R1 to R7, or that the decoder refuses, is audio_malformed, raised at its group. A track
whose packets hold more than 2^26 samples, every channel counted, is not decoded.
A group’s claim for the watermark is the track claim in force at it (§3.6), or, where none is,
its group claim, or none. A span is a run of a track’s groups that give audio, consecutive in
group number, whose claim is one claim (or none throughout), as long as it runs; its samples are
its groups’ samples in order. Each span is read as a file is (§3.7): where its samples are ones
the scheme admits, the detector runs on them and the payload is held to the span’s claim in §3.7’s
order, agrees, inherited, watermark_class_mismatch or watermark_origin_mismatch (raised at
the span’s first group), a span with no mark being absent and a marked span resting on no claim
carried; otherwise the span is not-admitted. A claim’s watermark layer counts the spans resting
on it as it counts the files (§3.7). So the mark is read where it lives, across the groups that
share a claim: a mark of one claim heard in groups that another claim is in force at is refused,
as a file’s would be. A group of 20 ms reads no mark on its own; a span of the scheme’s period,
about 5 s, does (synthesis §7.10.3).
4. Reading the containers
A file is read by its container’s rules below. One that breaks them is container_malformed. A
reader reads the structure and the metadata named here; the audio is decoded for the watermark
alone, by §4.7. Text is read as UTF-8
(RFC 3629) where this section says so; bytes that are not UTF-8 there are container_malformed.
4.1 ID3v2 tags
An ID3v2 tag at offset 0: the bytes ID3; a major version of 3 or 4 and a revision byte other
than 0xFF; a flags byte of 0 (no unsynchronisation, no extended header, no footer: a tag with any
flag set is not read by this revision and is container_malformed); and a size of four bytes each
below 0x80, seven bits each, most significant first (ID3v2.4.0 structure §3.1). The tag is 10
bytes and that size, within the file. Frames follow from offset 10: a 10-byte header of four
characters A–Z and 0–9, a size (for major version 4, four bytes each below 0x80, seven
bits each; for 3, a 32-bit big-endian number), and two flag bytes of 0 (a frame with a flag set is
container_malformed here); then a body of that size, at least 1 byte, within the tag. A header
whose first byte is 0 begins the padding, which runs to the tag’s end with every byte 0. A tag of
padding alone is read: ID3v2.4.0 structure §4 asks a tag for at least one frame, and muxers write
such tags all the same.
A TXXX frame whose encoding byte is 0 (ISO-8859-1) or 3 (UTF-8) is read: its description runs to
the first 0 byte, and its value is the rest, less one final 0 byte where present. Its description
names a field of §3.4 exactly, or it is not a field here; a frame in another encoding is not read.
A GEOB frame (frames §4.15): its encoding byte, 0 to 3; a MIME type to the first 0 byte; a filename and a
description, each terminated by one 0 byte in encodings 0 and 3 and by two at an even offset from
its start in 1 and 2; then the object. Its MIME type application/c2pa is a manifest store (§3.4).
A TXXX frame of encoding 0 or 3, or a GEOB frame, that does not hold those parts is
container_malformed.
4.2 FLAC
An ID3v2 tag at 0 (§4.1) may come first, as media-identify §5 reads FLAC; then fLaC; then
metadata blocks (RFC 9639 §8.1): a byte whose high bit marks the last block and whose low seven
bits are its type, not 127, and a 24-bit big-endian length; the block within the file. The first
block is of type 0 and length 34; there is at most one of type 4 (RFC 9639 §8.6). After the last
block, the bytes 0xFF and 0xF8 or 0xF9 begin the first frame.
A block of type 4 is read whole: a 32-bit little-endian length and that many bytes of vendor
string, UTF-8; a 32-bit little-endian count; that many fields, each a 32-bit little-endian length
and that many bytes, UTF-8, holding = after a name of characters U+0020 to U+007E other than
=; and no byte after the last field. A field whose name is one of §3.4’s, compared without
regard to case, is that field, its value what follows the first =.
4.3 Ogg Opus
Pages from offset 0 to the file’s end (RFC 3533 §6): a 27-byte header beginning OggS and the
version 0; a header-type byte of no bit but 0x01 (continued), 0x02 (first page of a stream) and
0x04 (last page); the granule position; the stream serial number (32-bit little-endian, at 14);
the page sequence number (at 18); the checksum (at 22); the segment count (at 26); its table; and
a body of as many bytes as the table sums to. The checksum holds as media-identify §5 states it
for Ogg (polynomial 0x04C11DB7 from zero over the page with its checksum bytes zero, not
reflected). Each stream’s first page, and only that page, has the 0x02 bit, and each later page of
a stream has the sequence number one above the stream’s page before it. Packets are its segments
joined, a segment below 255 bytes ending one: a page that continues a packet has the 0x01 bit, and
a page with it continues one; no packet is left unfinished at the file’s end.
The file holds exactly one stream whose first packet begins OpusHead, at least 19 bytes long,
its version byte’s high four bits 0, and the only packet of its page (RFC 7845 §3); its second
packet begins OpusTags, the comment header, ending its page. It holds at most one other stream,
whose first packet begins \x00c2pa: a manifest store (§3.4). A file with any other stream is not
read by this revision.
The comment header (RFC 7845 §5.2) after OpusTags: a vendor string and a count of user comments
as in §4.2, each comment UTF-8 holding = after a name of characters U+0020 to U+007D other than
= (the Vorbis comment rule RFC 7845 refers to); bytes after the last comment are kept, as RFC
7845 §5.2 allows, and not read. A comment named as a field of §3.4, compared without regard to
case, is that field.
4.4 MP3
An ID3v2 tag at 0 (§4.1), where there is one; then an MPEG audio frame header, at 0 or after the
tag, as media-identify §5 reads one for MPEG audio (its version, layer, bitrate index and rate
index each a value that names a frame), and its frame within the file. The fields are the tag’s
TXXX frames; a store is the tag’s GEOB frame (§4.1).
4.5 WAV
RIFF, a 32-bit little-endian size, and WAVE; the size plus 8 is the file’s length. Chunks
follow to the end: four bytes of identifier, a 32-bit little-endian length, and that many bytes,
padded to an even count. One chunk is fmt and one is data. A chunk C2PA that is the last is
a manifest store (§3.4); one elsewhere is not at C2PA’s place and is not a store here.
4.6 MP4
Boxes from offset 0 to the end: a 32-bit big-endian size and four bytes of type, each 0x20 to 0x7E
or 0xA9; size 1, a 64-bit size after the type, at least 16; size 0, to the file’s end; any other
size at least 8; each box within the file, as media-identify §5 walks ISO base media. The first is
ftyp. A top-level uuid box whose 16-byte extended type is C2PA’s, followed by a version and
flags of 0, the purpose manifest ending in a 0 byte, and eight bytes of offset, is a manifest
store (§3.4).
4.7 The audio
The verifier decodes a file’s audio for the watermark (§3.7), and only where the samples it decodes are the same integers on every machine:
- FLAC. Where STREAMINFO’s bits per sample is 16 (RFC 9639 §8.2), the frames after the last
metadata block, to the end of the file, each by RFC 9639 §9: its header and the header’s CRC-8
(§9.1, §9.1.8), naming as many channels as STREAMINFO and a bit depth of 16 or STREAMINFO’s; its
subframes, constant, verbatim, fixed and linear-predictive, with their wasted bits and coded
residuals (§9.2), a linear predictor’s shift not negative; its channels decorrelated as its
channel bits state (§9.1.3); each sample within 16 bits; and the frame’s CRC-16 (§9.3). Where
STREAMINFO states a total of samples, the frames hold exactly that many in each channel. A file
that breaks any of these is
audio_malformed. A FLAC file of another sample size is not decoded. - WAV. The
fmtchunk is at least 16 bytes: a format, a channel count, a rate, a byte rate, a block alignment and the bits per sample, of 16, 16, 32, 32, 16 and 16 bits, little-endian; otherwiseaudio_malformed. Where the format is 1 (PCM), the bits per sample 16, the channels at least 1 and the block alignment two bytes a channel, thedatachunk is a whole number of blocks (otherwiseaudio_malformed), its samples little-endian and the channels interleaved: the scheme’s canonical buffer (synthesis §7.10.1) as it stands. A WAV file of another format is not decoded. - Ogg Opus. The Opus stream of §4.3. Its identification header (RFC 7845 §5.1) gives the
output channel count C (its byte at offset 9), the pre-skip (the 16-bit little-endian number at
offset 10) and the mapping family (its byte at offset 18). A family other than 0 is not decoded;
family 0 with C other than 1 or 2 is
audio_malformed(RFC 7845 §5.1.1.1). Its audio packets are its packets after the first two, each one Opus packet (family 0 codes one stream, RFC 7845 §3). An audio packet of no bytes, or one whose framing breaks RFC 6716 §3.4’s rules R1 to R7, isaudio_malformed; the samples a packet holds are its frame duration at 48 kHz times its frame count, as its TOC byte and, for code 3, its second byte state them (RFC 6716 §3.1, §3.2). Its pages’ granule positions are held to RFC 7845 §4: the identification header’s page and the page on which the comment header completes have 0; a page on which no packet completes has −1, all 64 bits set; the first page on which an audio packet completes has at least the samples of the audio packets that complete on it, unless it is the stream’s last page and ends the stream (§4.5); each later such page has the one before’s plus the samples of its packets, except that the stream’s last page, where it ends the stream, may have less, down to the one before’s (end trimming, §4.4). Any other value isaudio_malformed. The start is the first such page’s granule position less its packets’ samples, or 0 where that is less than 0; the end is the last such page’s granule position less the start (0 where there is no such page); an end below the pre-skip isaudio_malformed(§4.5). The audio packets are decoded in order by the pinned decoder (§4.8) into C channels at 48 kHz, a packet it refuses beingaudio_malformed; the samples are its output from the sample numbered by the pre-skip up to the end, the channels interleaved (RFC 7845 §4.2, §4.4). The header’s output gain is not applied: it is a gain for playback (RFC 7845 §5.1), and the samples are the ones the packets code. - MP3. The frames after the ID3v2 tag (§4.4), decoded by the exact MP3 decoder of §4.9, which
says which streams it does not decode (MPEG-2.5, Layers I and II, free-format bitrate) and which
frames are
audio_malformed; the samples are its output, every frame’s, nothing trimmed. - MP4 is not decoded in this revision: its standard holds an AAC decoder’s output to a
tolerance, not to its integers, and the decoder of exact output that will read its AAC-LC, a port
of a fixed-point decoder in a crate of its own (decision D136), is not yet built. Its watermark is
not-decoded.
A file is decoded to at most 2^26 samples, every channel counted: one whose STREAMINFO total, whose
frames, whose data chunk, whose Opus packets or whose MP3 frames hold more is not decoded.
4.8 The pinned Opus decoder
RFC 6716 defines Opus through the reference implementation in its Appendix A, and holds a decoder to
that implementation’s output within the thresholds of a comparison tool, not to its integers (§6).
Appendix A states that the normative output is that of the code’s floating-point configuration,
and that the code computes in fixed-point arithmetic alone where FIXED_POINT is defined. Two
conforming decoders can give a detector different samples, so this extension reads Ogg Opus through
one decoder, pinned:
- The source: the archive RFC 6716 Appendix A.1 extracts from the RFC’s text,
opus-rfc6716.tar.gz, whose SHA-1 is86a927223e73d2476646a1b933fcd3fffb6ecc8cas A.1 states it (SHA-2562282d2aa4677562fce0602849e9be3df760edc14a08b39fa0cb7c861f8c7fd39), with the update of RFC 8251 applied: the patch its §1 names, whose SHA-1 is029e3aa88fc342c91e67a21e7bfbc9458661cd5fas RFC 8251 states it (SHA-2562b06d9a981b1feeb98348d981c1e326658f842fff9abc0cf6afbd62a916b1f02), its decoder changes those of RFC 8251 §3 to §9. The code is published under the licence RFC 6716 and RFC 8251 state for their code components (decision D128). - The configuration: the sources the archive’s makefiles list, with the fixed-point SILK files
in place of the floating-point ones, compiled as its
Makefilecompiles them withFIXED_POINTset, which definesFIXED_POINTandDISABLE_FLOAT_API; no other definition that changes the code. The decoder is the oneopus_decoder_createmakes at 48000 Hz and C channels; each packet is given toopus_decodewith a frame size of 5760 anddecode_fec0, and its 16-bit output is the samples. It applies CELT’s 180-degree phase shift, which RFC 8251 §10 lets a decoder omit (its §11’s outputs without the suffixm). - Why its samples are exact. In that configuration the decoder computes with integers alone. Appendix A states that the code relies on no undefined behaviour, and on four implementation- defined behaviours common to two’s-complement machines: right shifts of negative values that round down, conversion to a narrower signed type modulo its range, division that truncates toward zero, and a 64-bit integer type. Every machine and C compiler that meets them computes the same integers, so the samples are a function of the packets, a property of the code rather than of a build. Decision D128 records the measurement: the build decodes RFC 8251’s twelve test vectors at 48 kHz, in two channels and in one, to the same samples with two C compilers in four versions, on x86-64 and AArch64 under two operating systems, at every optimisation level tried, and under an undefined-behaviour sanitiser that reported nothing.
- Its identity: decoded as above, the 24 outputs of RFC 8251’s test vectors (the archive its §11
names, SHA-256
6b26a22f9ba87b2b836906a9bb7afec5f8e54d49553b1200382520ee6fedfa55), in two channels and then in one, each in the vectors’ order, concatenated, have SHA-256a39a8af766ba28326be20dc1f5e84ddab05b5c506431b807430a153ba8ff667a.opus/reference.jsonstates each output’s digest, and each under a stated pattern of lost packets, which reaches the decoder’s concealment. Every packet received leaves the range decoder in the final state the vector stores for it (RFC 6716 §6). - What it is not: the normative output. It passes RFC 6716 §6’s comparison on every vector (quality 72.4 to 100 at 48 kHz in two channels, where the floating-point configuration’s is 99.2 to 100) and the range decoder’s test, so it is a conforming decoder; another conforming decoder gives samples within those thresholds of its own, not these. A mark read through another decoder is that decoder’s reading; this extension states the pinned decoder’s.
A verifier MAY decode with any implementation that gives the pinned decoder’s samples for every
stream. The reference implementation’s, wai-rs’s opus_exact module, is an integer
reimplementation of that decoder in safe Rust, held to the 48 digests and to every packet’s final
range on the vectors, and to the pinned build’s own decoding of the corpus’s streams (§8).
4.9 The exact MP3 decoder
ISO/IEC 11172-3 and 13818-3 define how Layer III is decoded and hold a decoder to a reference’s output within a tolerance, not to its integers; they are sold, were not read for this revision, and publish no code to pin (decision D129). So this extension defines MP3’s samples itself. The exact MP3 decoder is a decoder conforming in intent: it decodes Layer III by the structure the standards give it, and a measurement holds it close to a floating-point decoder (decision D137); but its output is WAI’s own definition, the integers its arithmetic below gives, and not any other decoder’s samples. It was written from a decoder whose authors dedicated it to the public domain (the basis, decision D137), whose stream syntax, Huffman code tables, scalefactor band tables and synthesis window it takes; the basis computes in floating point, and every operation here is on integers.
- The stream. The bytes after the file’s ID3v2 tag (§4.4). The first frame header names the
stream’s version, layer, sampling rate and whether it is one channel; every later frame begins
where the one before ends and states the same; an ID3v1 tag, 128 bytes beginning
TAG, may end the file. A frame header is 11 bits of sync, a version other than 01, a layer other than 00, a bitrate index other than 15 and a rate index other than 3; a frame’s length is 144 (MPEG-1) or 72 (MPEG-2) times the bitrate over the rate, rounded down, plus its padding byte. In file order, the first of these decides: a first frame of MPEG-2.5 (version bits 00), or of Layer I or Layer II, or any frame of free-format bitrate (bitrate index 0, whose length its header does not state), is not decoded; bytes that are not a frame header where one is due, a header of another version, layer, rate or channel count, and a frame that runs past the end areaudio_malformed. A free-format first frame is refused by §4.4 already. Decoded are MPEG-1 at 32, 44.1 and 48 kHz and MPEG-2 at 16, 22.05 and 24 kHz, in one channel or two (stereo, joint stereo, dual channel), long, start, short, stop and mixed blocks, middle-and-side and intensity stereo. - Each frame, in order. Where the header asks for a CRC, the CRC-16 (polynomial 0x8005, from
0xFFFF, most significant bit first) of the header’s last two bytes and the side information
equals the two bytes after the header; each granule’s big_values is at most 288; window switching
is never with block type 0; main_data_begin is no more than the bytes of main data the earlier
frames hold (of which the last 511 are kept); the granules’ part2_3_length add to no more bits
than main_data_begin and the frame’s own main data hold; each granule’s scalefactors and big
values end within its part2_3_length; and under intensity stereo the two channels’ granules are
of one block type, mixed or not alike. A frame that breaks one is
audio_malformed, the first broken in this order deciding. A count1 quadruple that ends past its granule’s part2_3_length is not taken, and the granule’s decoding stops there; Huffman tables 4 and 14, which code nothing, read no bits and give zeros. Scalefactors are read as MPEG-1 has them (scalefac_compress’s two lengths, and in the second granule of a long block the groups scfsi marks copied from the first) or as MPEG-2 has them (scalefac_compress’s four lengths and partitions, halved for a right channel under intensity stereo, whose largest value in its length is no intensity position). - The arithmetic. A quantised value q is requantised to |q|^(4/3)·2^(e/4) in units of 2^−28 of full scale: e = 4m + r with 0 ≤ r < 4, and the magnitude is n·k / 2^(26 − m) rounded once, n the nearest integer to |q|^(4/3)·2^24 (an exact integer cube root of q^4·2^72, rounded) and k the nearest integer to 2^(r/4)·2^30, held to 2^16 units; e is global_gain − 210 less, for a long band, (scalefactor + preflag·pretab)·2^(1 + scalefac_scale), and for a short band in window w, 8·subblock_gain[w] + scalefactor·2^(1 + scalefac_scale). Joint stereo: middle and side to left and right as (M ± S)·cos(π/4); intensity stereo in each band above the highest the right channel has a non-zero quantised value in (per window in a short block), whose position is a position, the left channel scaled by k_L and k_R (MPEG-1: t/(1 + t) and 1/(1 + t), t = tan(πp/12); MPEG-2: 1 and 2^(−e/4) for e from the position and intensity_scale, in the order the position’s parity gives); the top band of each window takes the band below’s position where that band is intensity-coded, else 3 (MPEG-1) or 0 (MPEG-2). Then a short block’s lines are reordered by window, the alias butterflies run across the subband boundaries of long blocks and of a mixed block’s long part (c the eight values −0.6 … −0.0037 of the structure, as c/√(1 + c²) and 1/√(1 + c²)), each subband’s inverse MDCT of 36 (Σₖ X[k]·cos(π(2i + 19)(2k + 1)/72), under the normal, start or stop window) or three of 12 (Σₖ X[3k + w]·cos(π(2i + 7)(2k + 1)/24) times sin(π(2i + 1)/24), at 6 + 6w) is added to the last granule’s overlap, the odd samples of the odd subbands are negated, and the polyphase synthesis gives 32 samples a time slot: V[i] = Σₖ cos(π(16 + i)(2k + 1)/64)·S[k] for i = 0 … 63, then sample j = Σ over i = 0 … 7 of D[64i + j]·V₂ᵢ[j] + D[64i + 32 + j]·V₂ᵢ₊₁[32 + j], Vₗ the block of time slot l back, D the basis’s window (its 512 values times 65536, integers). Every constant is the basis’s integer or the nearest integer to the real value stated, times 2^30. Every sum of products is computed exactly and rounded once, halves away from zero: each requantised value, each stereo and alias output, each windowed IMDCT output, each V, and each sample, which is the synthesis at 2^44 a unit times 32768, held to −32768 … 32767. No stage’s value can leave 64 bits.
- The samples. Every frame’s samples in order, the channels interleaved, at the frames’ rate: nothing is trimmed. An encoder’s header frame, a frame with no main data, decodes to silence; an encoder’s delay, the filterbank’s 529 samples and an encoder’s padding at the end are in the samples. A statement of an encoder’s delay, which the standards do not define, is not read.
- Its identity. The
mp3_exactmodule ofwai-rs, the reference implementation, whose arithmetic this section states.mp3/reference.jsonstates the SHA-256 of its samples for every MP3 stream of the corpus, for the real muxer’s inidentify-conformance/ext/, for twelve streams of a mode set and for the 128 streams of synthesis §7.10.8’s MP3 deliveries, each the same on x86-64 and AArch64 (decision D137). - What it is not. The standards’ decoding, which their texts hold to a tolerance; another decoder’s samples, which differ from these by a little: decision D137 records ±1 in about one sample of 600 against a floating-point decoder, at the offset the trimmed delays give, and the same on synthetic streams of intensity stereo and mixed blocks, which the encoder measured never writes; on those, a band whose intensity position is the largest its length codes reads as no position here and as a position in that decoder. A mark read through another decoder is that decoder’s reading; this extension states the exact decoder’s.
A verifier MAY decode with any implementation that gives the exact decoder’s samples for every stream.
5. The delivery
A delivery is a JSON object read as synthesis §2 reads a record (RFC 8259, no member named twice
in one object, at most 32 levels of nesting, the integers and byte strings of jwp-receipts
§2.4.3), with exactly these members and none other, at every level; otherwise
delivery_malformed:
| member | value |
|---|---|
kind | "wai-marking-delivery" |
claims | an array of at most 256 strings, each an origin claim’s text (synthesis §3.1) |
files | an array of at most 64 objects: name (1 to 64 characters of a–z, 0–9, ., - and _, no two alike), container (flac, ogg-opus, mp3, wav or mp4), origin (the link hash of the claim the party says the file rests on, or null) and bytes (the file, hex, at most 2^24 bytes) |
c2pa | an array of at most 64 objects: origin (a link hash), carriage ("sidecar", or {"file": name}, a file of files) and statement (§3.3, read by §3.3’s rules) |
release | null; or an object restating the release: message ("ern-4.3.2"), contains_ai (None, Partly, All or null) and resources, an array of 1 to 64 objects: reference (2 to 32 characters, A and then a–z, A–Z, 0–9, _ and -, no two alike), type (SoundRecording, Image, Video or Text), origin (a link hash or null), contains_ai (a value or null) and contributors, an array of at most 32 objects: special ("GenerativeAI" or null) and ai_contribution (a value or null); or an object giving the message: message ("ern-4.3.2"), xml (the message’s text, at most 16 MiB, release-message §5.1’s bound) and origins, an array of at most 64 objects: reference (a sound recording’s ResourceReference, of reference’s form, no two alike) and origin (a link hash or null) |
session | null, or an object: groups, an array of at most 4096 objects: track (32 bytes, the track’s digest), group (an integer), receipt (32 bytes, the group receipt’s link hash) and audio (null, or an object: channels, 1 or 2, the same for every group of the track whose audio is not null, and packets, an array of at most 3000 byte strings of at most 2^16 bytes each, the Opus packets of the group’s objects in order, §3.8), no track and group twice and no receipt twice |
The release’s members restate the message’s elements: contains_ai the Release’s ContainsAI;
each resource its ResourceReference, its composite’s name, its ContainsAI and its
contributors’ SpecialContributor and AiContribution. Its origin is the claim the party says
the resource rests on. A release given as its message is read by release-message §7, and each entry of
origins names the claim the party says a sound recording rests on; a sound recording no entry
names rests on no claim.
6. Verification
6.1 Steps
The verifier runs these steps and stops at the first refusal, which it reports with the reason
and where: ["delivery"]; a claim, a file or a statement by its list and index; ["release"],
or a resource by ["release", "resources", i] and a contributor by
["release", "resources", i, "contributors", j]; for a release given as its message,
["release", "xml"], an entry of origins by ["release", "origins", i], and the message’s
sound recordings, in its order, by ["release", "recordings", i] and their contributors by
["release", "recordings", i, "contributors", j]; or a group by ["session", "groups", i].
- Reading. The delivery reads (§5):
delivery_malformed. - Claims: each, in order, reads and its signature verifies (synthesis §2, §3.1, §3.2:
record_malformed,bad_key,bad_signature); then each, in order: its subject is not one an earlier claim names (claim_conflict); its class is synthesis §3.2’s (class_mismatch) and its source synthesis §5’s (source_mismatch); and each input whoseoriginnames a claim given restates that claim’s class and source, that claim being about the input’s object (synthesis §3.3,input_mismatch). A claim is named by its link hash. - Files, in order: the file reads by its container’s rules (§4:
container_malformed); its fields are each once and of their form, all three or none (§3.4:container_field_invalid); itsorigin, where notnull, and itsWAI_ORIGIN, where carried, each name a claim given (claim_unknown), and the same one (container_origin_mismatch); and the claim’s class is itsWAI_ORIGIN_CLASS(container_class_mismatch) and the claim’s source itsWAI_DIGITAL_SOURCE_TYPE(container_source_mismatch). - Statements, in order: each names a claim given (
claim_unknown); its statement reads (§3.3:c2pa_malformed); a carriage in a file names a file whose container holds a store (§3.4, §4:c2pa_store_missing); then §3.3’s steps 1 to 4 (c2pa_action_mismatch,c2pa_source_mismatch,c2pa_disclosure_mismatch,c2pa_oversight_mismatch). - The release, where given. Given as its message: the message reads (release-message §7:
release_message_invalid); then each entry oforiginsin order names a sound recording of the message (release_reference_unknown) and, where itsoriginis notnull, a claim given (claim_unknown); the resources are then the message’s sound recordings, in its order, and the release’sContainsAIitsRelease’s. Then each resource in order: a restated one’sorigin, where notnull, naming a claim given (claim_unknown), then §3.5’s first two rules (release_resource_mismatch, and for each contributor in orderrelease_contributor_mismatch); then the release’sContainsAI(release_mismatch). - The session, where given: each group in order, §3.6 (
live_group_mismatch). - The watermark: each file in order, its audio decoded (§4.7:
audio_malformed), then, where it is read and rests on a claim, its payload held to the claim (§3.7:watermark_class_mismatch,watermark_origin_mismatch); then each track of the session that gives audio, in the order of its first such group in the list: its groups’ packets read and decoded (§3.8:audio_malformedat the group), then each of its spans in group order, held to its claim (§3.8, §3.7:watermark_class_mismatch,watermark_origin_mismatchat the span’s first group).
6.2 What an accepted delivery states
- for each claim, in order: its link hash, its class, its source as the IPTC term, its share
(§3.2) as the values in the order
None,Partly,All, and for each layeragreesorabsent:c2pawhere a statement names it;containerwhere a file’sWAI_ORIGINnames it;releasewhere a resource resting on it states aContainsAI, or has a contributor that states anAiContributionor is aGenerativeAIcontributor;livewhere it is a track claim in force at a group of the session or a group claim of one of its groups; andwatermarkagrees,absentornot-checked(§3.7); - for each file, in order: its name, its container, its fields,
agrees,absentorno-place(WAV and MP4, §3.4), and whether it holds a store at C2PA’s place; its watermark,agrees,inherited,absent,carried,not-admittedornot-decoded(§3.7), the payload read (nullwhere none was), and the samples decoded (§4.7) as their rate, channels, length and SHA-256 of their canonical buffer (synthesis §7.10.1), ornullwhere it is not decoded; - for each span (§3.8), the tracks in the order step 7 takes them and each track’s spans in group
order: its track, its first and last group, the link hash of its claim (
nullwhere none), its watermark,agrees,inherited,absent,carried,not-admittedornot-decoded, the payload read and its decoded samples, as for a file (an empty list where no group gives audio); - the release’s own
ContainsAI:agreeswhere stated,absentwhere it isnullor no release is given.
7. Reasons
The codes the marking verifier gives, each with where it is raised:
| reason | raised at |
|---|---|
delivery_malformed | §5, §6.1 step 1 |
record_malformed | §6.1 step 2 (synthesis §2) |
bad_key | §6.1 step 2 (synthesis §2) |
bad_signature | §6.1 step 2 (synthesis §2) |
claim_conflict | §6.1 step 2 (synthesis §3.1) |
class_mismatch | §6.1 step 2 (synthesis §3.2) |
source_mismatch | §6.1 step 2 (synthesis §5) |
input_mismatch | §6.1 step 2 (synthesis §3.3) |
claim_unknown | §6.1 steps 3, 4 and 5 |
container_malformed | §4 |
container_field_invalid | §3.4 |
container_origin_mismatch | §6.1 step 3 |
container_class_mismatch | §6.1 step 3 |
container_source_mismatch | §6.1 step 3 |
c2pa_malformed | §3.3 |
c2pa_store_missing | §3.3, §3.4 |
c2pa_action_mismatch | §3.3 step 1 |
c2pa_source_mismatch | §3.3 step 2 |
c2pa_disclosure_mismatch | §3.3 step 3 |
c2pa_oversight_mismatch | §3.3 step 4 |
release_resource_mismatch | §3.5 |
release_contributor_mismatch | §3.5 |
release_mismatch | §3.5 |
release_message_invalid | §6.1 step 5 (release-message §7) |
release_reference_unknown | §6.1 step 5 |
live_group_mismatch | §3.6 |
audio_malformed | §4.7, §6.1 step 7 |
watermark_class_mismatch | §3.7, §6.1 step 7 |
watermark_origin_mismatch | §3.7, §6.1 step 7 |
A verifier that implements pq-signatures also gives that text’s codes for a hybrid claim, as synthesis §2 has it.
8. Conformance
live-conformance/marking-layers/ holds the corpus, in one
file, vectors.json, written from fixed seeds by wai_marking_layers_vectors gen: every key, every
sample and every file is derived from a label by SHA-256, and every container file is written by
the generator itself, so the file is the same bytes on every machine. Each delivery states the
outcome it was written to have: accepted deliveries with every layer agreeing, deliveries with
gaps (layers absent, files with no fields, WAV and MP4 files with no place, groups no claim
covers), deliveries whose FLAC and WAV files carry marks (a claim’s own, one it inherits, one
resting on no claim, none, and files this revision does not decode), and refused deliveries,
each a control of one defect, so every reason of §7 refuses at least one. The marked files are a
tune generated from a fixed seed, marked by synthesis’s audio scheme under the claim’s payload and
written by the reference’s FLAC encoder (fixed predictors, Rice-coded residuals) or as 16-bit WAV;
a short stereo FLAC holds a frame in each of the three decorrelations; and the corpus states the
samples the reference decodes from the real muxers’ FLAC (linear prediction) and WAV files of
identify-conformance/ext/. Deliveries that give the release as
its message carry messages release-message’s writer wrote; among them a message stating no AI use
over a generated track, refused through the message as the restated form is.
tests/marking_layers.rs holds that the file regenerates byte for byte, that wai-rs
gives each delivery its outcome, that §7 lists exactly the reference’s codes, and that the
container readers read the files real muxers wrote in
identify-conformance/ext/.
The corpus’s Ogg Opus files hold the packets the pinned decoder’s own encoder (the archive’s, in the
same configuration) wrote at 96 kbit/s in two channels and at 48 kbit/s in one, in its audio
application, from tunes generated from fixed seeds at 48 kHz, the two-channel one marked under a
claim’s payload: opus/marked.bit and
opus/plain.bit, in the framing of RFC 6716 §6.1’s tool. The generator wraps them in Ogg pages
itself, so the files are the same bytes on every machine; a short stream of ten packets is the
control the refused streams each change in one place (a packet framed against RFC 6716 §3.4, a
packet of no bytes, a granule position counted wrong on a first page and on a later one, a stream
ended inside its pre-skip, three channels in family 0, a header page’s granule position). The corpus
publishes, as opus_decodes, the samples the pinned decoder gives each stream the verifier decodes:
the stream’s audio (the SHA-256 of its audio packets, each a 4-byte big-endian length and its bytes;
its channels, pre-skip and end), the samples’ SHA-256, and the samples as FLAC; and, for each live
track the verifier decodes (§3.8), the samples of all its packets in group order, its pre-skip and
end null. A recorded session’s groups carry the packets of a third input, opus/live.bit (a tune
of 6 s at 48 kHz in one channel, marked under the AI participant’s track claim and coded at
64 kbit/s), fifty packets a group: its spans read their claim’s mark and a performer’s unmarked
track reads none; a captured track carrying the AI participant’s mark, a packet of no bytes and a
track whose groups state different channels are refused.
tests/opus_exact.rs holds the reference implementation’s decoder to
opus/reference.json on RFC 8251’s
vectors, which opus/fetch.sh fetches and checks
by digest, and opus/check.py builds nothing of
wai-rs: it runs the pinned build, which fetch.sh makes, on the vectors, on the encoder’s inputs
(requiring opus/*.bit byte for byte), and on every stream of the corpus (requiring the samples the
corpus states and publishes).
live-conformance/marking_layers_verify.py is the second implementation, written from this text
and sharing no code with wai-rs. It reads claims with synthesis’s second implementation
(synthesis_verify.py), reads every container itself, decodes FLAC and WAV audio itself (§4.7)
and runs the audio scheme’s detector from synthesis’s second implementation of it
(_wai_audio_mark.py), gives each delivery its stated outcome, decodes the real muxers’ files to
the samples the corpus states,
requires every mutated copy of the corpus to fail, drops each of its named checks in turn and
requires the corpus to catch each weakened verifier, and reads the same files of
identify-conformance/ext/. It does not decode Opus: it reads each Ogg Opus stream’s header,
framing and granule positions itself (§4.7), refusing what they refuse, and holds the stream’s audio
to the samples the corpus publishes for it, which it decodes from their FLAC and holds to their
SHA-256 before it runs the detector on them. That those samples are the pinned decoder’s is the
pinned build’s to show (opus/check.py), not the second implementation’s.
The corpus’s MP3 files hold the frames an open-source encoder wrote from tunes generated from fixed
seeds (the commands are mp3/encode.sh’s): a
tune of 6 s marked under the generated instrumental’s payload, one channel at 16 kHz and 32 kbit/s
(MPEG-2), after the encoder’s header frame,
mp3/marked.mp3; an unmarked tune of 1.5 s,
mp3/plain.mp3; and ten frames of MPEG-1 at 48 kHz in one channel with no header frame,
mp3/short.mp3, and the same protected by CRCs, mp3/crc.mp3. The generator writes their ID3v2
tags itself. The short stream is the control the refused streams each change in one place (a CRC
that does not hold, main data before the stream, a granule longer than its frame’s main data, big
values past 288, window switching with block type 0, a later frame of another rate and one of
another channel count, a broken sync, a frame past the end), and the streams not decoded are an
MPEG-2.5 stream, a Layer II stream and a stream whose fifth frame is of free-format bitrate. The
corpus publishes, as mp3_decodes, the samples the exact decoder gives each stream the verifier
decodes and the real muxer’s: the SHA-256 of the file’s bytes after its ID3v2 tag, the samples’
rate, channels and length, their SHA-256, and the samples as FLAC. tests/mp3_exact.rs holds the
reference implementation’s decoder to
mp3/reference.json on the corpus’s
streams, and on the mode set’s and the streaming deliveries’ where they are given (they are not in
the repository).
The second implementation does not decode MP3 either: it walks each stream’s frames, reads each frame’s header, CRC and side information itself, and refuses or does not decode what §4.9’s rules for the stream and for each frame’s side information say; the rules inside a granule’s Huffman data are the exact decoder’s alone. It holds each stream it reads as decodable to the samples the corpus publishes for it, decoded from their FLAC and held to their SHA-256, and runs the detector on them. That those samples are the exact decoder’s is shown by the reference implementation, on x86-64 and AArch64, not by the second implementation.
9. Security and privacy considerations
- Agreement is not truth. A delivery whose layers agree with its claims says that every layer says what the claims say; the claims carry their signers’ authority and no more (synthesis §14). A party that signs a false claim and writes every layer from it passes here, and is caught, if at all, by a watermark its generator embedded or by a detector’s verdict (detection).
- The container fields and the release values are not signed. Anyone who rewrites a file can rewrite its fields; the verifier refuses fields that disagree with the claim they name, and a file whose fields name a claim not given is refused, but fields stripped from a file leave its layer absent, which is not a refusal. A file’s claim is bound to it here by the delivery’s statement and the file’s own field, not by recomputing the claim’s subject from the file.
- A release’s values are read from its message where the delivery gives it (§3.5), and the message is its writer’s, not signed here. Where a delivery restates them instead, that they are the values the message holds is the party’s statement. Either way the verifier checks them against the claims.
- The fields carry a link hash, a class and a source type: no person, account, device or session. A link hash finds a claim, whose signer’s key it then names.
- A watermark read from a file says what that file’s samples carry (§3.7). A file not read (MP4,
an Ogg Opus stream of another mapping family, an MP3 stream of MPEG-2.5, of Layer I or II or of
free-format bitrate, another sample format, or samples the scheme does not admit) leaves its
claim’s watermark
not-checked, and an accepted outcome then says nothing of a mark. An Ogg Opus stream is read through the pinned decoder (§4.8), and an MP3 stream through the exact decoder (§4.9): a listener’s player that decodes it otherwise, within its standard’s tolerance, plays samples that are not these, and a mark near the detector’s margin can read differently from them; the reading this extension states is that decoder’s. The exact MP3 decoder trims no delay, so its samples lead a player’s by the encoder’s header frame and delays, which the detector’s alignment absorbs at some cost to its margin (synthesis §7.10.8). A read file with no mark is not a refusal: a party may deliver an unmarked rendition, and a mark stripped, or lost to a transform the scheme does not survive (synthesis §7.10.7, §7.10.8), leaves the layer absent. The scheme is key-free (synthesis §7.10.6): anyone can read the mark, and anyone who can write samples can write one; a mark that agrees with a claim points at that claim and proves nothing the claim’s signature does not.