# Wire formats

Understand frozen artifact encodings and the inputs required for independent verification.

Verification operates on exact bytes under a named format. Lys uses standard primitives and versioned contracts. A decoder returning fields does not prove that the artifact verifies.

## Formats

- `identity`: Ed25519 signatures and keys; trust-layer hashes use SHA-256.
- `attestation`: Tagged COSE_Sign1 covering the payload’s SHA-256 hash and timestamp. Inspecting its fields does not verify its signature.
- `certificate`: An Ed25519-signed X.509 certificate. An extension’s signed bytes need a separately defined interpretation; a signature alone is not an access decision.
- `checkpoint`: A C2SP signed-note envelope over the log origin, tree size and root hash.
- `inclusion proof`: A self-contained artifact for a raw leaf and a checkpoint, checked against a trusted signed-note verifier key.
- `consistency proof`: Evidence that one tree extends an earlier tree, checked against the signed checkpoints.
- `sealed envelope`: X25519, HKDF-SHA256 and AES-256-GCM, with the sender’s attestation verified before opening.


## Raw log leaves

The transparency-log CLI hashes the file bytes directly with the RFC 6962 leaf prefix: a zero byte followed by the raw leaf. The typed library tree's postcard encoding is a separate path. A verifier of CLI log artifacts must use the raw path.

## Attestations and certificates

The attestation's protected COSE headers, deterministic payload encoding and domain separation are part of its versioned contract. The payload binds the hash and timestamp. Certificate verification also checks the issuer and validity window; a certified attestation must bind the same subject key to its signer.

A certificate extension transports signed bytes. Interpret them only under the format that defines their semantics; arbitrary JSON in an extension does not establish a current product permission.

## Checkpoints and proofs

A checkpoint body names its origin, tree size and root, each newline terminated. Its signed-note envelope is checked with a trusted verifier key. Inclusion and consistency artifacts carry the proof material needed without access to the original log directory.

## Read the verifier's contract

**Read the verification contract**

```bash
lys verify --help
lys ca verify --help
lys log verify inclusion --help
lys log verify consistency --help
```


The help describes each verifier's inputs. Supply the original artifact, the exact payload bytes and the trusted key required by that verifier.
