Concepts

Attestation & Capacity

How Tova verifies TEE hardware attestations on-chain and bounds concurrent unsettled provider volume through stake-backed trust capacity.

Two-layer provider security

An open HTTP 402 market faces two risks: endpoints returning unverified outputs, and Sybil providers locking up agent budgets across dozens of unanswered escrows. Tova closes both on-chain in ProviderRegistry:

  1. Hardware attestation verification binds every claim_settlement to an Ed25519 signature from a registered TEE key whose quote has not expired.
  2. Stake-backed trust capacity caps the total value of concurrent Open escrows a provider can hold at once to its locked staked_capacity_lamports.
text
ProviderRegistry PDA: ["provider", provider_signer_pubkey]
Provider Stake PDA:   ["provider_stake", provider_registry_pubkey]

Supported hardware types

ProviderRegistry.hardware_type is stored as a u8 enum validated on register_provider and update_provider_attestation:

Enum valueNameUse case
0IntelTDXIntel Trust Domain Extensions hardware TEE attestation
1AmdSevSnpAMD Secure Encrypted Virtualization (SEV-SNP) hardware TEE attestation
2LocalAttestedDeterministic Ed25519 enclave key for localnet testing and development

Any value greater than 2 rejects with InvalidHardwareType.

Execution receipt signing and on-chain verification

Before calling claim_settlement, the provider signs a domain-separated 99-byte binary message inside its TEE using its registered attestation_pubkey:

text
receipt_message =
  "TOVA_TEE_RECEIPT_V1"  (19 bytes, ASCII)
  || settlement_id       (8 bytes, u64 little-endian)
  || request_hash        (32 bytes)
  || response_hash       (32 bytes)
  || receipt_slot        (8 bytes, u64 little-endian)

The claim transaction places Solana's native Ed25519SigVerify precompile instruction before claim_settlement. Inside claim_settlement, verify_ed25519_precompile reads the Instructions sysvar (Sysvar1nstructions1111111111111111111111111) and confirms that an earlier instruction in the same transaction called Ed25519Program with:

  • public_key == provider_registry.attestation_pubkey
  • signature == tee_signature (64 bytes)
  • message == receipt_message (matching the escrow's settlement_id and request_hash, plus the claimed response_hash and receipt_slot)
  • All offsets inline (instruction_index == u16::MAX)

If no matching precompile instruction is found, claim_settlement fails with InvalidAttestation.

Attestation rotation and expiry

Every provider registration carries an attestation_expiry_slot. Both open_settlement and claim_settlement require clock.slot <= provider.attestation_expiry_slot, returning AttestationExpired once a quote ages out.

Providers rotate keys or extend expiry without unstaking by calling update_provider_attestation, signed by provider_signer.

Stake-backed capacity bound

When a provider registers with stake_lamports, register_provider transfers that SOL into provider_stake and sets staked_capacity_lamports = stake_lamports.

Every open_settlement enforces the capacity invariant:

text
provider.active_unsettled_lamports + amount <= provider.staked_capacity_lamports

If accepting a new escrow would push unsettled volume above the provider's stake, open_settlement fails with ProviderCapacityExceeded (HTTP 422 in the API, retryable: true). Volume is released as soon as the provider claims (claim_settlement) or an expired escrow refunds (refund_settlement).

The API also computes capacityUtilizationBps for display on Providers:

text
capacityUtilizationBps = floor((active_unsettled_lamports * 10_000) / staked_capacity_lamports)

See Register a TEE Provider to register an endpoint and wrap your HTTP handler with gate402().