# Wire Format — Payload JSON, Encryption, and HMAC Integrity > The REP payload wire format. JSON structure, AES-256-GCM encrypted blob, HKDF key derivation, HMAC-SHA256 integrity tokens, and SRI verification. Source: https://rep-protocol.dev/concepts/wire-format/ ## Payload structure The gateway injects a ` ``` ### Fields | Field | Type | Required | Description | |---|---|---|---| | `public` | `object` | Yes | Key-value map of PUBLIC tier variables (strings only) | | `sensitive` | `string` | No | Base64-encoded AES-256-GCM encrypted blob | | `_meta` | `object` | Yes | Payload metadata | ### `_meta` fields | Field | Type | Required | Description | |---|---|---|---| | `version` | `string` | Yes | Protocol version (semver) | | `injected_at` | `string` | Yes | RFC 3339 timestamp of injection | | `integrity` | `string` | Yes | `hmac-sha256:{base64_signature}` | | `key_endpoint` | `string` | No | Path to session key endpoint (`/rep/session-key`) | | `hot_reload` | `string` | No | Path to SSE endpoint (`/rep/changes`) | | `ttl` | `integer` | No | Cache TTL in seconds (0 = no cache) | ### SRI attribute The `data-rep-integrity` attribute contains a SHA-256 hash of the raw JSON content: ``` data-rep-integrity="sha256-{base64_of_sha256_digest}" ``` The SDK verifies this using the Web Crypto API, comparing the hash against the actual `textContent` of the `