BTC Deposit Attestor

A Turnkey Verifiable Cloud (TVC) enclave watches the Bitcoin testnet4 custody wallets of the staging BTCcx Testnet4 – Base Sepolia asset cx merchant and writes every confirmed deposit (txid, amount and destination address) to a contract on Base Sepolia. The contract only accepts writes from an enclave whose AWS Nitro attestation it verified itself. That lets the merchant check a deposit on-chain before minting.

loading live status…

Live status

Enclave key
–
Deposits found
–
Attested on-chain
–
Bitcoin tip
–

Deposits

Payments into watched custody addresses with at least 6 confirmations. "Attested" means the registry stores the record, so isAttested(txid, sats × 1e10) returns true.

Bitcoin txOutAmount (BTC)ToBlockStatus
loading…

How the trust chain works

1

Approved release

The app is built reproducibly (StageX) into a QOS manifest. The manifest pins the binary hash, all its arguments (registry, watched addresses, confirmations, data sources), the quorum key and the approver sets. Its hash is the app's identity.

manifest hash
2

Nitro enclave boots

QOS starts inside an AWS Nitro Enclave and creates a fresh ephemeral key. AWS signs an attestation that binds the enclave image (PCRs), the manifest hash and that key.

boot proof
3

Enclave scans & signs

Every 2 minutes it reads testnet4, collects new deposits and signs the batch with the ephemeral key, including the chain id and registry address so it can't be replayed elsewhere.

app proof
4

Registry verifies on-chain

registerEnclaveKey checks the AWS certificate chain and signature, the trusted PCRs and the trusted manifest hash, then stores the key. postDeposits verifies each batch's P-256 signature against it.

on-chain verifier
5

Merchant checks

Before mintAndDeposit / finalizeYieldAccrual, the merchant (or anyone) can require isAttested(txHash, amount), using the same txid and 18-decimal amount it already passes.

enforcement

What counts as a deposit

  • Any output paying one of the 35 watched addresses: the merchant's 32 BitGo custody addresses plus 3 yield-accrual addresses.
  • Only after 6 confirmations.
  • A transaction that spends from a watched address (withdrawal change, consolidation) is never a deposit, so change can't be minted against.
  • Full address history is scanned, so older deposits were backfilled on the first run.

Merchant integration (not deployed yet)

// in ConcreteMerchant.mintAndDeposit(userId, amount, txHash)
require(
  depositRegistry.isAttested(txHash, amount),
  "BTC deposit not attested"
);

The merchant is unchanged in this POC. The same check works for finalizeYieldAccrual(vault, nonce, amountInAsset, txHash).

Security model

Who can write deposits?

Only an enclave running a release the registry owner trusts. Anyone may submit a registration, but it reverts unless the attested manifest hash and PCRs are on the trusted lists. A different TVC app has a different manifest hash, so it can't register. The test suite checks this with a real boot proof from another app. Resubmitting our own boot proof only re-registers our key, whose private half never leaves the enclave.

What has to be trusted

  • Registry owner: decides which manifests are trusted. It's a hot key in this POC; production should use a Safe multisig with a timelock.
  • AWS Nitro hardware and QOS, the enclave OS whose image the PCRs pin.
  • The data source: one Esplora instance (mempool.space). There's no SPV proof check yet.
  • TVC operators: they approve manifests and hold the quorum key shares.

Reboots and the 3-hour window

Each boot creates a new ephemeral key with a new attestation. The attestation's leaf certificate is valid for only about 3 hours, and the on-chain certificate manager rejects expired certificates. So after every reboot the new key must be registered within 3 hours. The script scripts/register-enclave.sh does it and anyone can run it, but someone has to. A registered key stays valid until the owner revokes it, however long the enclave runs.

Planned improvement: attest once per release and bind the enclave's quorum-derived address, which stays the same across reboots. Restarts then need no registration.

Gas on Base Sepolia

StepGasHow often
Cache each AWS CA certificate (3)~5.5–7M eachwhen they expire (1–20 days)
Cache the enclave's leaf certificate~6.9Mevery boot
registerEnclaveKey (Nitro verification)~15.9Mevery boot (Base's per-tx cap is 16.78M)
postDeposits, 15 deposits~0.8Mper batch

Contracts (source-verified)

Key transactions: first deployment (27 Nov 2026)

The trust chain as it happened on-chain, in order. Later releases repeat steps 2–6 (the CA certificates usually stay cached). The current enclave's registration is in the registry's event log.

Limits of this POC