TEE Verifier
settlementTeePalletâ
Statement hash componentsâ
- context:
keccak256(b"tee") - vk:
keccak256(vk.encode()) - pubs:
keccak256(pubs)
Verifier implementationâ
This pallet implements a verifier for Trusted Execution Environment (TEE) attestation documents. It supports two backends, selected by the Vk variant submitted with the proof:
- Intel: Intel TDX / SGX DCAP attestation quotes, validated against an Intel TCB info response and a certificate chain.
- Nitro: AWS Nitro Enclaves attestation documents, which are self-contained (no off-chain TCB material is required).
The verification flow works as follows:
- Resolves the CA name to use for the CRL lookup from the
Vkvariant (via theCaNameProvidertrait). - Retrieves the Certificate Revocation List for that CA from
pallet-crl. The CA must be registered, even if its CRL is empty, so that unpermissioned CRL updates remain possible. - Dispatches verification on the
Vkvariant:- Intel: parses the attestation quote from the proof bytes, parses the TCB info response from the verification key, checks TCB validity at the current timestamp, and verifies the quote against the TCB info and CRL.
- Nitro: parses the attestation document from the proof bytes and verifies it against the CRL at the current timestamp.
-
verify_proof()parses and validates the attestation against the data in the verification key (Intel) or against the self-contained attestation document (Nitro), in both cases consulting the CRL for the resolved CA. -
validate_vk()deserializes the TCB response JSON and verifies its signature using the provided certificates against the CRL. Nitro VKs carry no data and cannot be registered:validate_vk()returnsInvalidVerificationKeyforVk::Nitro, so Nitro proofs must be submitted without a pre-registered VK. -
Define the following types:
pub type Proof = Vec<u8>; // TEE attestation, max 65536 bytespub type Pubs = Vec<u8>; // Max 0 bytes, not usedpub enum Vk {Intel {tcb_response: Vec<u8>, // TCB info JSON response, max 65536 bytescertificates: Vec<u8>, // PEM-encoded certificate chain for TCB signature verification, max 65536 bytes},Nitro,} -
hash context data is
b"tee" -
public inputs are not used (
MAX_PUBS_LENGTH = 0)
Encodingâ
- For
Vk::Intel, thetcb_responsefield should contain the JSON response body as returned by the Intel Trusted Services TCB Info API, andcertificatesis a PEM-encoded chain (as provided by theTCB-Info-Issuer-Chainheader of the response). - For
Vk::Nitro, the proof bytes are an AWS Nitro Enclaves attestation document (CBOR/COSE), which embeds its own certificate chain.
CRL Integrationâ
The TEE verifier depends on pallet-crl, which manages Certificate Revocation Lists on-chain. The CRL pallet provides certificate revocation data via the CrlProvider trait, enabling the TEE verifier to check that certificates in the attestation chain have not been revoked.
Each Vk variant resolves to its own CA registered with pallet-crl. In the zkVerify runtime:
Vk::Intel { .. }â CA"Intel_SGX_Processor"Vk::Nitroâ CA"AWS_Nitro"
Both CAs must be registered with pallet-crl for the corresponding proofs to verify (an empty CRL is acceptable). CRL updates can be submitted in either PEM or DER form, via the CrlInput::Pem { crl, cert_chain } and CrlInput::Der { crl, cert_chain } variants respectively.