Attestation & receipts
Every node runs inside an Intel TDX VM built from a signed mero-tee
release. Before a client or another node sends it anything, it asks the node
for a quote — a hardware-signed statement of what the VM is running — and
checks it. The check lives in one place, calimero_client::attest,
shared by the Rust client, meroctl, calimero-client-py and every node judging
its peers; mero-js’s src/runtime/attestation.ts implements the same check.
The attestation document
Section titled “The attestation document”GET /attestation?nonce=<32 bytes hex>[&app=<app>|&appHash=<hex>][&purpose=receipts|kms|jobs|orchestrator][&form=interval]
answers, unsealed:
| Field | Meaning |
|---|---|
quote |
The TDX quote, base64 (a mock quote on --dev nodes) |
transportKey |
The node’s X25519 transport key, hex |
appHash |
A bundle hash bound into the quote (zeros when none was asked) |
nonce |
The caller’s nonce, echoed |
release |
{ version, profile }: the mero-tee release and image profile the node says it runs |
cluster, node, mock |
The cluster name, node id, and whether the quote is a mock |
receiptKey, governance |
With purpose=receipts only: the node’s receipt key and the cluster’s governance |
kms |
With purpose=kms only, and only when the node has a record: what it verified of the mero-kms replica each key came from (below) |
jobKey |
With purpose=jobs only, on a job node: its Ed25519 job signing key |
clusterIdentity |
With purpose=jobs (the identity a job node takes work from) or purpose=orchestrator (the identity a replica holds): the cluster identity public key, hex |
interval |
With form=interval and no purpose, from a node that has a current interval quote: { key, quoteNonce, issuedAt, signature } (Interval quotes) |
The quote’s 64 bytes of report data bind the request to the key:
transport: report_data = nonce ‖ SHA-256("calimero.tee-attest.transport-key.v1" ‖ app_hash ‖ transport_key)receipts: report_data = nonce ‖ SHA-256("calimero.tee-attest.receipt-key.v3" ‖ receipt_key ‖ SHA-256(governance JSON) ‖ u32_be(len(cluster)) ‖ cluster ‖ u64_be(node))kms: report_data = nonce ‖ SHA-256("calimero.tee-attest.kms-evidence.v1" ‖ transport_binding ‖ SHA-256(JCS(kms)))orchestrator: report_data = nonce ‖ SHA-256("calimero.tee-attest.orchestrator.v1" ‖ transport_key ‖ cluster_identity)governance JSON is Governance::canonical: its fields in declaration
order, deployments and deployers only when not the defaults
(Deployers).
A receipts quote also binds the cluster name and node id, so a verifier checks
it against the node it asked for, never the document’s own cluster and
node: verify_app_cluster against the cluster the entry node names in its
sealed answer and the node id of each replica, a peer against its own cluster
and the node it reached for. A node of a release before 1.0.0-rc.19 quotes the
receipt-key.v2 form, without the cluster and node; a node takes that form
from a peer only while its cluster’s logged version is below 1.0.0-rc.19 (so
while an earlier node may still be in it), and a client never does.
transport_binding is the second half of the transport form, so a kms
quote still attests the transport key; it also commits to the kms record.
The nonce makes the quote fresh: an old quote cannot be replayed. The second half commits the quote to a key that lives only in that VM’s memory. A caller that verifies the quote therefore knows the key belongs to a process running the measured image, and nobody else can open what is sealed to it.
Every request carries a fresh nonce, so every request is a new quote, and a
TDX quote blocks its thread in the kernel for about a second. A node makes one
quote at a time, on its blocking pool rather than the workers that run Raft and
the API, and lets a few more requests wait for it; past that it answers
503 BUSY with Retry-After: 1 at once (MAX_CONCURRENT_QUOTES,
MAX_QUEUED_QUOTES, QUOTE_WAIT; Limits).
A client sends the request again after the delay. The cluster’s own nodes
attesting each other queue apart from anyone else and pass the anonymous
queue, so requests nobody vouches for cannot keep a restarted node from
rejoining (MAX_QUEUED_PEER_QUOTES, PEER_QUOTE_WAIT).
So a node can make about one quote a second for everyone, and a few dozen requests at once would keep new clients from connecting. The clients in this repository therefore ask for the interval form below, which makes no quote per request. The cluster’s nodes do not: each peer channel rests on a quote made for its own nonce, in the peer lane.
Interval quotes
Section titled “Interval quotes”GET /attestation?form=interval answers from a quote the node made earlier,
not one over the caller’s nonce. Once a minute (INTERVAL_QUOTE_EVERY) the
node makes a fresh Ed25519 key, the interval key, which never leaves its
memory, and one quote that binds it:
interval: report_data = quote_nonce ‖ SHA-256("calimero.tee-attest.interval-key.v1" ‖ transport_key ‖ interval_key ‖ u64_be(issued_at))signature = Ed25519(interval_key, "calimero.tee-attest.interval-sig.v1\0" ‖ nonce ‖ app_hash ‖ transport_key)quote_nonce is 32 random bytes the node chose, and issued_at the Unix
second it made the quote, by its clock. Each request is answered with that
quote and interval: { key, quoteNonce, issuedAt, signature }, where
signature is the interval key’s over the caller’s nonce and the app hash
and transport key the per-request form would bind. Signing takes microseconds,
so no request waits for a quote and none is refused 503 BUSY.
A verifier (attest::verify, mero-js, mero-kotlin and mero-swift alike)
checks, in this order:
issuedAtis at mostINTERVAL_QUOTE_MAX_AGE_SECS(300) before its own clock and at mostINTERVAL_QUOTE_MAX_SKEW_SECS(60) after it.signatureis the interval key’s over its own nonce, the app hash it asked for (or the node’s, withapp) and the transport key.- The quote passes every check above (What the verifier checks),
with
quoteNonceas its nonce and the interval binding as its second half.
The nonce still makes the answer fresh: only a process that holds the interval
key can sign it, and the quote proves that the key was made inside a measured
TD, bound to the same transport key. Since the key lives only for the
interval, a quote older than the maximum age vouches for no key anyone can
still sign with. The node serves an interval quote while it is at most
INTERVAL_QUOTE_SERVED_FOR (120 s) old, leaving three minutes for the clocks
to differ; it makes its interval quotes in Lane::Peer, so anonymous requests
never delay them, and tries again within seconds when one fails.
The form is asked for, never assumed, so nothing changes for a client that does
not ask: form absent is the per-request quote, byte for byte. A node that
has no current interval quote (it just started, or its last quote failed), or
that is asked with a purpose, answers the per-request quote as before, and so
does a node of a release before the form: it ignores the parameter. A verifier
takes either answer, deciding by whether interval is present. form takes
only interval; any other value is 400 BAD_FORM.
Nodes attesting each other never use the form. A node’s peer policy
(Policy::require_fresh_quote) makes HttpAttestor and PeerAttestor ask
without form, on every peer path: opening a channel, identifying a caller,
checking a registered node, delivering the cluster key, and again after a
restart. verify under that policy refuses a document that carries
interval, so a peer that answers with an interval proof anyway is not
attested. The per-request queue’s peer lane keeps their quotes ahead of
anonymous requests. A node still answers form=interval from its peers, so
a node of the release that brought the form, which asks its peers for it,
still attests the others through a rolling upgrade.
What the verifier checks
Section titled “What the verifier checks”attest::verify (transport) and verify_receipt_key (receipts) run the same
steps (verify_report):
- Mock quotes are accepted only when the policy says
allowMock(a development cluster), and then only their report data is checked. - A measurement policy is required for a real quote.
Measurements::None, the default, refuses every real quote.Pinnedchecks fixed MRTD/RTMR allowlists.Releasereads the release the node names, refuses it if it is older than the floor (min_version, elseDEFAULT_MIN_RELEASE=2.3.109), fetches that release’spublished-mrtds.jsonand verifies its Sigstore signature (calimero-tee-release), and requires the quote’s MRTD and RTMRs to match one of the allowed profiles. Debug profiles are dropped from the allowed list unless the caller asked for them: a debug TD lets the host read its memory. - The quote is genuine: DCAP verification against Intel’s collateral
(
calimero-tee-attestation), the TD is not a debug TD, and the report data is exactly the expected 64 bytes. - Policy: the TCB status is allowed (
UpToDateunless the caller allows more), and the measurements match the profile found in step 2.
Only then does the client open a sealed session to the transport key.
What a node trusts its KMS on
Section titled “What a node trusts its KMS on”A TDX node takes its storage key, and its data disk’s key, only from a mero-kms
replica whose quote matches the KMS allowlists of a signed mero-tee release:
the release’s kms-attestation-policy[.<profile>].json, fetched and verified
against its Sigstore signature and the release workflow’s identity
(calimero-kms-client’s policy.rs). Nothing else pins a KMS. With no release
named there is no policy and no key; there are no allowlists in config.toml
and no variable that skips the release (USE_ENV_POLICY is gone: a node that
finds it set warns and ignores it).
The release and the KMS URL come from outside the TD, so the rest of the chain is what keeps the host from choosing what the node trusts:
- The image’s root filesystem, merod and its init script included, is behind dm-verity. Its root hash is on the kernel command line, which RTMR2 measures, so the node’s quote names the code that runs.
- The host supplies only values: the init script reads a whitelist of instance
metadata and passes those values to
merod initandmerod.env, never a file or a setting of its own choosing. config.tomllives on the data disk, which the TD encrypts with a key from the KMS, so the host cannot edit it.- A release older than the image’s own (
MERO_TEE_MIN_VERSION) is refused, and a URL that reaches any other KMS reaches one the signed policy refuses.
Which KMS a node took its keys from
Section titled “Which KMS a node took its keys from”A node’s quote proves it runs code that refuses a KMS outside the signed
mero-kms release policy. It does not say, by itself, which KMS that code
accepted. So the node keeps what it verified each time it took a key: the KMS
quote’s MRTD and RTMR0–3, its TCB status, the release and profile of the
signed policy it matched, the KMS URL’s host, the quote’s SHA-256 and the time
(calimero_tee_attestation::KmsEvidence, recorded by
calimero-kms-client). There is one record per key:
storage: the storage key merod fetches itself at start (--kms-url).disk: the data disk’s key, which the image’s boot script fetches withmerod kms disk-key --evidence-outbefore merod starts; merod reads that record from a tmpfs/ramfs file (--kms-disk-evidence), where only the TD can have written it.
Asked with purpose=kms, a node that has a record returns it as kms and
binds SHA-256(JCS(kms)) into its quote (kms_report_data). attest::verify
checks that binding whenever a document carries kms, so a relay or the host
that swaps, adds or strips the record fails the check that attests the
transport key, and a record that passes is as trustworthy as the node’s own
code. The public attestation verifier (mero-tee attestation-verifier) shows
it as “Keys from a verified KMS” and checks the KMS’s registers against the
kms_allowed_* lists of the release it names, as it does on /kms.
The record does not carry the rollback
epoch yet: a node reports it in /health (rollbackEpoch) and in
/ops/status, outside any quote.
The binding is opt in, so nothing changes for a client that does not ask: its
report data is the transport form above, byte for byte. A node with no record
(--dev, a key from a file, or a merod before this) answers purpose=kms with the transport form and no kms, which
a verifier shows as “not reported”, not as a failure.
Peers are judged the same way
Section titled “Peers are judged the same way”A node opening a channel to a peer uses the same check with its own policy:
Release with --peer-profiles (default: its own MERO_TEE_PROFILE) and
--peer-min-release (never below the built-in floor, 2.3.109; a lower one
stops the node). A node trusts debug-profile peers only when it runs a
debug image itself, and that profile is measured, not taken on trust: at start
a TDX node reads its own registers and refuses to run unless they match
MERO_TEE_PROFILE in the signed release MERO_TEE_VERSION names. What the peer’s verified attestation named as its release
is remembered and decides whether the peer may receive an app’s data
(release approvals).
The check runs the other way too. A node calling a peer proves its own
attested transport key in the handshake (Noise IK), and the receiving node
attests the caller’s registered address with a fresh nonce, under its own
peer policy: the caller is the node whose quote names that key, on the release
that quote names. So a node knows which node calls an internal route and on
which release, and judges it as it judges where to send
(Networking). The same goes for
sessions: a node takes a session token only under the receipt key it attested
(purpose=receipts) for the node that signed it, ahead of time for every
registered peer (Failover).
Receipts
Section titled “Receipts”Every successful /intents and /views answer carries a receipt: the
answering node’s signed statement that entry index of app app produced this
result.
Receipt { app, index, resultHash, node, key, signature }resultHash = hex(SHA-256(JCS(result))) // RFC 8785 canonical JSONsignature = Ed25519(receipt_key, "calimero.receipt.v1\0" ‖ app ‖ 0 ‖ index (u64 BE) ‖ resultHash ‖ 0 ‖ node (u64 BE))The receipt key is an Ed25519 key each node makes on its first start and keeps
in its data directory wrapped under its K_r (signing_key.rs), so a restart
keeps it and only the release whose mero-kms gives that K_r opens it. It also
signs the node’s sessions (Sessions). It is attested on its own (purpose=receipts), together with the
cluster’s governance. So a receipt is checkable later, offline, by anyone who
holds that node’s receipt-key attestation: it shows that a genuine node of a
cluster deployed under those rules returned that answer.
Account proofs
Section titled “Account proofs”A third party (Calimero Cloud’s console, which records which account on a cluster is a developer’s) can learn which account a person controls without taking their word for it. It hands the person a fresh nonce; their browser, signed in with a passkey, asks the node to sign it:
POST /auth/account-proof { nonce, audience } // a passkey session; not an API keyAccountProof { statement, key, signature }statement = { cluster, node, account, nonce, audience, issuedAt, expiresAt } // expiresAt = issuedAt + 300signature = Ed25519(receipt_key, "calimero.account-proof.v1\0" ‖ JCS(statement))account is the session’s own; the body names only the nonce (16 to 128
characters) and the audience (1 to 128), each in letters, digits and -_.:/.
A session opened on an app’s frontend or a registered origin is refused, so an
app cannot vouch for its user to someone else. The third party checks the
signature under that node’s attested receipt key: from its own
purpose=receipts attestation, or, as the cluster’s operator, from
GET /ops/nodes/{node}/receipt-key ({ node, key, release, attestedAt }: the
key the answering node attested for that peer, or its own), read over its
attested channel. Then it checks the statement: its cluster, its own nonce
(once), its own audience, and expiresAt.
calimero_client::attest::AccountProof::verify checks the signature.
Job nodes
Section titled “Job nodes”A job node (merod run --job-node) runs compute for a cluster’s apps and holds no replica, vote or cluster key.
GET /attestation?purpose=jobs on it binds its transport key and its job signing key in one quote.
The report data is nonce ‖ SHA-256("calimero.tee-attest.job-key.v1" ‖ transportKey ‖ jobKey ‖ release.version ‖ cluster ‖ node), so a quote for one key pair cannot vouch for another, nobody on the path can rewrite the release the leader judges the node by, and a quote cannot be replayed as another node or cluster.
A job node attests nothing else: GET /attestation without purpose=jobs, or with any other purpose, is 404.
So the channels a cluster node opens after attesting a transport key (the cluster key’s delivery, peer requests carrying the cluster secret, Raft, blob pushes) cannot open to a job node.
calimero_client::attest::verify_job_key checks it with the same quote and measurement policy as every other attestation.
A cluster node answers purpose=jobs with 404.
The cluster’s leader attests a job node this way, under its --peer-profiles and --peer-min-release, and uses it only if the release it names is one the app’s owner approved.
Clients never need it.
The orchestrator
Section titled “The orchestrator”GET /attestation?purpose=orchestrator&nonce= on a replica binds its transport key and the cluster identity key it holds (the key GET /ops/cluster answers as identity) in one quote, so a caller learns in one verification that the node runs an approved release, is a member of the cluster with that identity, and owns the transport key it is about to seal requests to.
The 32 bytes after the nonce are SHA-256("calimero.tee-attest.orchestrator.v1" ‖ transportKey ‖ clusterIdentity), both keys as their raw 32 bytes.
A job node holds no cluster key and answers 404 NOT_FOUND, as it does for every purpose but jobs.
calimero_client::attest::verify_orchestrator(doc, nonce, cluster_identity, policy) checks it with the same quote and measurement policy as every other attestation, refuses a document that names another identity, and answers the transport key.
Verifying the whole app cluster
Section titled “Verifying the whole app cluster”GET /apps/{app}/attestation?nonce= asks every replica of the app for its
receipt-key attestation over the caller’s nonce and returns them together,
with the cluster’s name. Client::verify_app_cluster checks each one with the
client’s policy, checks each quote binds the cluster that answer names and the
node id it is listed under (the entry node fetches the documents in the clear,
so their own cluster and node fields are not trusted), and requires every replica to
attest the same governance. It answers the attested receipt key per node
and that governance. A replica that does not answer, or does not pass, fails
the whole check.
What a user learns from it:
- every node that holds the app’s data is a genuine TD on an image they trust;
- which keys sign the app’s receipts (a receipt from any other key is not one to trust);
- who may move the app to new code, approve images, and approve outbound destinations (Deployment governance).
The entry node gathers the documents but cannot forge them: each quote binds the caller’s fresh nonce and is verified against Intel’s collateral.
meroctl attest node # this node's transport attestation, verifiedmeroctl attest app my-kv # every replica of the app, verified, and the governance they attestA person who does not run a client can check a node on an independent site:
with merod --attestation-verifier-url URL, every consent
page links to {URL}/mero-tee?node_url=…&release_tag=mero-tee-v…,
a verifier the node does not control, and runs no check of its own (a
tampered node could fake any in-page verdict).
Recovery files carry an attestation
Section titled “Recovery files carry an attestation”Each file a node writes to the recovery disk
is signed by its receipt key and carries that key’s purpose=receipts quote,
over the nonce SHA-256("calimero.recovery-backup.attest.v1\0" ‖ u32 length ‖ cluster ‖ u64 node). A holder’s client checks the signature and the quote
before it opens a key, and a node takes no recovery file whose attestation its
peer policy refuses (400 UNATTESTED_RECOVERY_FILE)
(Storage schema).
Release attestations
Section titled “Release attestations”A node fetches its key from mero-kms when it starts, before it serves
anything, and mero-kms releases a key to any TD whose quote matches the
signed release policy. So by the time a node answers /attestation, the
key is already out. A manager that wants to decide first (is this the image
and merod it meant to start?) asks for a release attestation, which
merod attest makes with no key, no store and no running node:
report_data = nonce(32) || SHA-256("calimero.tee-attest.release.v1" || for each of merodVersion, merodSha256, teeRelease, teeProfile, identity: u32 BE length || UTF-8 bytes (length 0 when null))The claim is what the node says it is: its merod release and executable digest, the mero-tee release and profile the image names, and, when it has one before the KMS, the peer id of the identity it will ask the KMS a key for. The claim proves nothing by itself; the quote’s registers do, and the claim is bound so it cannot be swapped under them. The domain tag keeps it from ever equalling a transport, receipt-key or admission quote’s second half.
calimero_client::attest::release::verify_release runs the same quote check
as every client (mock only with allowMock, DCAP, the measurement policy, a
Release policy reading the release the claim names, the TCB status), checks
the nonce and the report data, and refuses an envelope whose copy of the
registers, or whose claimed profile, is not what the verified quote shows.
meroctl attest release prints its verdict. A verifier that is not Rust
gives calimero-tee-verify the quote, its nonce and the second half above as
app_hash_hex, and checks the reported registers against the release’s
signed published-mrtds.json itself.
A booting TD that has no key yet serves it with merod attest --serve ADDR
(GET /attestation/release?nonce=), so the manager attests it over its own
fresh nonce; the boot script stops it before merod run takes the address.
Generating quotes
Section titled “Generating quotes”A TDX node produces quotes through the kernel’s TSM configfs interface
(calimero_tee_attestation::generate_attestation). A --dev node (and
merod local) produces mock quotes with the same report-data layout, which a client
accepts only with allowMock; meroctl node add … --allow-mock keeps that
permission for one saved node only. A node without --dev always produces
real quotes and refuses mock quotes from its peers.
In calimero-node
Section titled “In calimero-node”Where the node implements this chapter, by the names in its code: paths are under crates/node/src
unless another crate is named. The design and its reasons are above; a module’s own detail is in its
//! doc, and the node’s mental model is crates/node/AGENTS.md.
Receipts
Section titled “Receipts”Every /intents and /views answer carries a Receipt signed by the answering node’s receipt key
(Ed25519, made on the node’s first start and kept in <data_dir>/signing-key wrapped under K_r,
signing_key.rs: a restart keeps it, only the release whose mero-kms gives that K_r opens it), over
(app, index, SHA-256(JCS(result)), node).
The key is attested on its own (GET /attestation?purpose=receipts, report data nonce || receipt_key_binding), and GET /apps/{app}/attestation gathers every replica’s
(Client::verify_app_cluster).
KMS evidence
Section titled “KMS evidence”GET /attestation?purpose=kms adds kms (config.kms_keys: the KMS quote merod accepted for its
storage key, and the boot script’s record for the data disk’s, --kms-disk-evidence) and binds it
(kms_report_data).
Without a record, or without purpose=kms, the answer is the plain transport form.
Orchestrator attestation
Section titled “Orchestrator attestation”GET /attestation?purpose=orchestrator on a replica binds the transport key and
Node::cluster_identity (orchestrator_report_data) and carries clusterIdentity; a job node
answers 404 NOT_FOUND.
Release attestations
Section titled “Release attestations”Code: attest.rs, release_attestation, serve_release.
A quote over a manager’s nonce and ReleaseClaim, for merod attest before the node has any key.
Not a route of a running node: serve_release is its own tiny server (that one route, through its
own Quoter), run only by merod attest --serve.
Quotes
Section titled “Quotes”Code: attest::Quoter.
Every quote a serving process makes goes through its one Quoter (Node::quoter for /attestation
and the recovery disk’s attestation, a job node’s, a waiting node’s, serve_release’s).
A TDX quote blocks its thread in the kernel for about a second and anyone may ask for one, so it
runs on the blocking pool (spawn_blocking), MAX_CONCURRENT_QUOTES (1) at a time;
MAX_QUEUED_QUOTES (8) more wait, each at most QUOTE_WAIT (3 s), and anything past that answers
503 BUSY with Retry-After: 1 at once (ApiError::busy).
The slot is released only when the quote returns, even if its caller went away.
A node attesting a peer of its cluster (PeerAttestor: opening a sealed channel, identifying a
caller, checking a registered node) sends x-calimero-peer-attest, an HMAC over the request’s
nonce under a key derived from K_c (peer_attest_tag, label calimero.attest-peer.v1|<cluster>).
A request whose header the node computes alike takes Lane::Peer: MAX_QUEUED_PEER_QUOTES (8)
places of its own, at most PEER_QUOTE_WAIT (10 s), and the slot before every anonymous request
but the one already waiting for it (only one anonymous request waits for the slot at a time), so a
full anonymous queue delays a peer by about two quotes. Any other request, or one from a node of an
older release that sends no header, takes Lane::Anyone as before; the response is the same.
The recovery disk’s own attestation also takes Lane::Peer.
/attestation takes it after ?app=’s lookup, which, in the clear and without a credential, is
judged as an anonymous GET /apps/{app} (fresh system state; an app anyone may not reach answers
404 as an unknown id).
Mock quotes take the same path.
Interval quotes
Section titled “Interval quotes”Code: attest::IntervalQuotes, attest::refresh_interval_quotes.
refresh_interval_quotes, started with the node, makes a new interval key and its quote
(interval_report_data) through Node::quoter in Lane::Peer every INTERVAL_QUOTE_EVERY, and
after INTERVAL_QUOTE_RETRY when one fails. /attestation with form=interval and no purpose
signs interval_message with the current key (IntervalQuotes::answer) while its quote is at most
INTERVAL_QUOTE_SERVED_FOR old and binds the node’s transport key, and falls back to the
per-request quote otherwise. The verifier is calimero_client::attest::verify’s verify_interval;
Config::peer_policy sets require_fresh_quote, so a node asks its peers without form and refuses
their interval proofs (attest::tests::a_peer_is_attested_with_a_quote_over_its_own_nonce).
Peers’ quotes
Section titled “Peers’ quotes”Are judged like a client’s (calimero_client::Measurements): in TDX mode the signed mero-tee
release the peer names, profiles from --peer-profiles (default: this node’s MERO_TEE_PROFILE),
floor --peer-min-release (merod refuses one below DEFAULT_MIN_RELEASE,
attest::configured_min_release).
Debug peers are trusted only by a debug node, and run measures that first: on TDX it reads its own
registers and refuses to start unless they match MERO_TEE_PROFILE in the signed MERO_TEE_VERSION
release (attest::check_own_profile).