How a model stays
closed in public

The weights of a sealed model sit on Solana for anyone to fetch. This page follows the one key that opens them, from the owner's device to the receipt an answer leaves.

Where the model key exists

The key is in plaintext in two kinds of place only: the owner's device at sealing, and enclaves holding a grant under an unexpired record. On chain it appears wrapped, never open.

The contour marks every place the model key is in plaintext.

The weights are public bytes

Sealing starts on the owner's device. It draws a random 256-bit model key and encrypts the weights under it with AES-256-GCM, in 1 KiB chunks, so any range of the file verifies on its own.

The ciphertext is written into Solana accounts and sealing fixes its SHA-256. From that slot the bytes cannot change. Anyone can fetch every byte, and every byte reads like a page of the codex: careful, regular, and meaningless without the key.

Sealed models in the docs →

What the chain records about the enclave

An enclave runs the Seraphin runtime and makes two keys at boot: an encryption key for grants and inputs, a signing key for receipts. The record binds them to a measurement, the SHA-256 of the runtime it runs, and to an expiry slot.

The owner of a model lists the measurements allowed to open it, so the record decides whether an enclave can be granted. Your browser just measured the runtime itself:

Enclaves and attestation in the docs →

A grant is the model key, wrapped

A grant is the model key wrapped to one enclave's encryption key with ECDH P-256, HKDF-SHA256 and AES-256-GCM. It sits on chain beside the model, and only the enclave it names can unwrap it, inside its runtime.

The owner makes the first grant. After that a granted enclave can grant the next one: it checks the newcomer's record, wraps the key inside itself and signs the grant. Capacity grows while the owner is offline.

Grants in the docs →

A call holds a price and a deadline

A caller's input is encrypted on their device to the enclave's encryption key, and a fresh key pair is made for the reply. One signature opens a call holding the hash of the encrypted input, the price in escrow and a deadline slot.

The enclave runs the model and encrypts the output to the reply key. A call not settled by its deadline goes back to the caller in full.

Calls and receipts in the docs →

What a receipt proves

When the enclave answers, it signs the model, the call, the slot, the input hash and the output hash with its signing key. Anyone can run the same checks in a browser.

Verify a receipt in the docs →

codex-16 is sealed this way. Draw something, and read the receipt it leaves.

Call codex-16