# QuantumPassport V1 protocol
Status: Experimental. Network: Dytallix Testnet.
Testnet records are not production mainnet records.

## Architecture
Dytallix stores generic signed data transactions. QuantumPassport assigns asset, issuer, controller, attestation, and provenance meaning outside the chain. No Dytallix core file changes are required.

The signed envelope contains `body` and `signature`. The stored bundle contains `record`, `metadata`, `anchor`, and `events`. An anchor contains `transaction_reference` and `block_height`. Receipt fields stay outside the signed body because the chain assigns them after signing. Never insert those fields into the signed body. A complete passport view combines the signed body and its anchor.

Each signature contains `algorithm`, `public_key`, and `value`. Algorithm is `ML-DSA-87`. Public keys and signatures use padded standard Base64. The public key has 2592 bytes. The signature has 4627 bytes. The browser and CLI hold private keys. The API receives public signed records only. The application sponsor key signs a different transaction and pays its fee. Sponsor identity does not replace issuer identity.

## Canonical bytes
Serialize null, Boolean, string, safe integer, array, and plain object values as compact UTF-8 JSON. Reject floating point values, negative zero, unsupported types, sparse arrays, invalid Unicode surrogates, and integers outside [-9007199254740991,9007199254740991]. Sort object keys by JavaScript UTF-16 order. Preserve array order. Preserve string code points. Do not normalize general metadata strings. Normalize manifest paths to NFC. No spaces or final newline contribute to a hash. This is a restricted canonical format, not an unrestricted RFC 8785 implementation.

Hash exact canonical bytes with SHA-256. Encode digests as `sha256:` plus 64 lowercase hexadecimal characters. Sign SHA-256 of UTF-8 `QuantumPassportV1\n` followed by canonical body bytes. Use deterministic ML-DSA signing (`extraEntropy: false`). Verification uses the same message. The network and chain ID occur inside every signed body.

## Identifiers and time
The passport identifier is `qp1_` plus SHA-256 of the canonical passport body without `passport_id`. The attestation identifier is `qpa1_` plus the hash of its body without `attestation_id`. The event identifier is `qpe1_` plus the hash of its body without `event_id`. The hexadecimal digest has no `sha256:` prefix in identifiers.

Timestamps use UTC with exactly three fractional digits: `2026-09-11T00:00:00.000Z`. Validate the calendar date. Event sequence, not wall time alone, establishes order. Allow at most 60 seconds of future clock skew for submitted records. Sequence starts at zero. Event zero must be PASSPORT_CREATED. Its previous hash is the genesis signed-envelope hash. Each later previous hash commits to the prior signed envelope. Include payload hash, actor, network, and chain in the signed event.

## Status and authorization
A genesis passport has ACTIVE status. Historical records remain immutable. Current state is the result of applying valid ordered events. Controller changes require the current controller signature and the new controller public key. The new key derives the new address. The current issuer must sign each attestation. An issuer can revoke or replace only its own attestation. Expiration uses `expires_at`; null means no expiration. Resolved attestation states are ISSUED, EXPIRED, REVOKED, or REPLACED. ISSUED describes a signed claim, not independent certification.

A provenance event can be PASSPORT_CREATED, ASSET_UPDATED, ASSESSMENT_COMPLETED, ATTESTATION_ISSUED, ATTESTATION_REVOKED, ATTESTATION_REPLACED, METADATA_UPDATED, CONTROLLER_CHANGED, CERTIFICATION_RENEWED, or SOFTWARE_RELEASED. Schema validation fixes the public payload fields for each event. A new signature never changes a historical record.

## Verification
Evaluate genesis signature, identifier, network, chain, metadata hash, asset fingerprint, event sequence, previous hashes, event signatures, actor authorization, attestation signatures, expiration, revocation, replacement, transaction receipt, and block membership. The result is INVALID if a required check fails. The result is PROOF_VALID_ASSET_NOT_CHECKED when the proof is valid but no asset was supplied. Return VERIFIED only after asset and metadata checks pass. Revoked or expired attestations retain those states; they do not invalidate the asset itself.

The configured Dytallix node supplies receipts and blocks. This release does not implement an independent consensus light client. It verifies membership reported by that node. History completeness is relative to the application store and available signed records. A valid prefix alone cannot prove that an operator did not omit a later event. Preserve backups and compare exported receipts when auditing history.

## Scope
V1 has no transferable asset tokens, fractional ownership, asset trading, or marketplace. A future token application can reference `{passport_id, network, chain_id}`. Token ownership must not silently replace the passport controller policy.
