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
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 tx | Out | Amount (BTC) | To | Block | Status |
|---|---|---|---|---|---|
| loading… | |||||
How the trust chain works
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 hashNitro 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 proofEnclave 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 proofRegistry 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.
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.
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
| Step | Gas | How often |
|---|---|---|
| Cache each AWS CA certificate (3) | ~5.5–7M each | when they expire (1–20 days) |
| Cache the enclave's leaf certificate | ~6.9M | every boot |
registerEnclaveKey (Nitro verification) | ~15.9M | every boot (Base's per-tx cap is 16.78M) |
postDeposits, 15 deposits | ~0.8M | per batch |
Contracts (source-verified)
| BtcDepositRegistry | 0x3c93c495e71517541e7b898a4B694BDfAaeF90E1 · events · read |
| NitroValidator | 0xE38f50Db9134246666cE7526dD6bBe3a13924494 |
| CertManager | 0x1F24F4613ecFe183F1665195b7629801e9b6016e |
| P384Verifier | 0x9b5B0774789A59521B48DBCb74aa4aD91b852833 |
| Merchant (unchanged) | 0xCC70a72B78266aeA091B11B5E0c5c223Bb9b5748 |
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.
| 1. Deploy registry | 0xed0483f0…02fe4d |
| 2. Owner trusts the release's manifest hash | 0x51f5d13a…687db8 |
| 3. Owner trusts the QOS image (PCR0–2) | 0xb9d6cdd8…372a1e |
| 4. Cache AWS regional CA | 0xbebfad78…cb32b4 |
| Cache AWS zonal CA | 0xcc42b084…10138cb |
| Cache AWS instance CA | 0xf13346c8…b587a8e |
| 5. Cache the enclave's leaf certificate | 0xabc719be…934f57 |
| 6. Verify the Nitro attestation and register the enclave key | 0xa8f72ac7…f10ab7 |
| 7. Enclave posts 15 deposits | 0x743ef778…713af1 |
Limits of this POC
- One data source (mempool.space). The enclave doesn't check SPV or merkle proofs and doesn't cross-check a second provider.
- A testnet4 reorg deeper than 6 blocks isn't rolled back. The owner can revoke an enclave key, but not individual records.
- New custody addresses need a new release, because the watched list is part of the attested manifest.
- Every reboot needs a registration within 3 hours (see above).