AnafiRegistry, with the attestation evidence. The engine signs a heartbeat on chain. Each adapter and the DSL registry accept a signature only from the published signer key.
What the registry publishes
Both keys, the compose hash and the evidence change together in one call,
setEngineIdentity. Each call replaces all of them and adds 1 to version().
The attestation evidence
The evidence is not in storage. It is in the data of the event that each identity change emits:engineEvidenceHash means that the registry owner posted no evidence with the current identity. Treat such an identity as unattested. The registry does not check the quote on chain. A verifier checks it off chain.
Check the evidence
1
Read the current identity
Read
version(), engineSigKey(), engineEncKey(), composeHash() and engineEvidenceHash() from the registry.2
Fetch the event of that version
Get the
EngineIdentitySet log with the indexed topic newVersion equal to version(). The first identity has version 0 and comes from initialize, which emits no EngineIdentitySet.3
Compare the event with storage
newSigKey, newEncKey and newCompose must equal the storage values. keccak256(abi.encode(tlsCertDer, quote, eventLog)) must equal engineEvidenceHash().4
Check the quote
Verify the Intel TDX quote with the quote verification tool of your choice. Check that the quote binds
tlsCertDer, newSigKey and newEncKey.getContractEvents. Split a long range into parts.
The heartbeat
The engine signs a heartbeat, and any address submits it withattestHeartbeat(attestedBlock, attestedTick, engineSignature). The registry accepts it only when:
attestedBlockis more thanlastHeartbeatBlock()and not more thanblock.number,- the signature recovers to
engineSigKey()over this digest:
HeartbeatAttested(uint64 indexed attestedBlock, uint64 attestedTick).
Use the heartbeat as a liveness signal:
- Compare
lastHeartbeatTick()with the current time. A large gap means that no new heartbeat landed. - Compare
lastHeartbeatBlock()with the chain head. This tells a stopped engine from a stopped chain.
attestHeartbeat transaction of a HeartbeatAttested log, decode its input, compute the digest, and recover the signer:
The live adapter list
delegationAdapters() returns the adapters that the registry lists, in list order. Each Anafi adapter calls isDelegationAdapter(address(this)) first on each redeem. An adapter that the list does not hold refuses every redeem with AdapterNotAllowed().
Check an adapter before you grant it a permission:
- The registry lists it:
isDelegationAdapter(adapter)istrue. - It reads this registry:
adapter.anafiRegistry()equals the registry address. The registry checked this when it listed the adapter. - It has the expected tag:
ROUTE_TAG()returns0x31747694805ea00e26185495e79555aa0fd8bc5ed92dee2440234ea76be46373.
delegationAdapters() and serves an account kind only while the list holds the configured adapter of that kind. See Client.
Watch the list with DelegationAdapterAdded(address indexed adapter) and DelegationAdapterRemoved(address indexed adapter).
Admin and code changes
The registry owner can change the engine identity, the adapter list and the code of each proxy. See Contracts overview. Each change is visible on chain:
To read the current implementation of a proxy, read the ERC-1967 implementation slot
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc:
AnafiSwapExecutor and AnafiOffRampFallbackHandler have no proxy, so their code never changes.