2026-11-299 min readFrostBit Architecture Deep Dive · 2/3中文

Six-Chain FROST+ROAST Threshold Vaults and Zero-Disk FD 3/4 Key Injection

Multi-hundred-million-dollar bridge hacks almost always trace back to small multisigs, stalled rotations, or plaintext keys sitting on VPS disks. Here is how FrostBit runs native FROST/ROAST custody across BTC, ETH, BNB, Base, Arbitrum, and TRON—combining tiered committees, dual-signed V3 handover proofs, and one-shot Linux FD 3/4 memory-only secret injection.

FROSTROASTCryptographyCross-ChainLinux Security
Table of Contents

Strip away the marketing from most major cross-chain bridge exploits over the past five years and the root causes are remarkably mundane:

  1. Small multisigs sharing one operational failure domain: Four signers hosted on the same cloud provider, or one phished operator laptop draining every chain at once.
  2. Synchronous threshold signing stalling on a single offline node: Classic FROST expects responsive signers across rounds; one dropped peer can freeze the withdrawal queue.
  3. Key rotation tightly coupled to external-chain transactions: If a chain sees no withdrawals or gas spikes, old committees never rotate off, leaving stale shares on departed validators.
  4. Cryptographically sound, operationally plaintext: Private keys or DKG wrapping keys left in .env files, JSON configs, or systemd ExecStart flags on rented VPS disks—one provider snapshot away from compromise.

FrostBit natively custodies vaults across BTC, ETH, BNB, Base, Arbitrum, and TRON (frost/, solidity/contracts/). Below is how we engineered around all four failure modes—and where the real trade-offs remain.


1. FROST + ROAST, Tiered Committees, and Why the Snapshot Limit Is Exactly 175

1. Single-Signature External Footprint, Asynchronous Fault Tolerance

Using Distributed Key Generation (DKG), a vault's full signing key never exists on any single machine. Each committee member holds only its share; at withdrawal time, a coordinator collects threshold t partial signatures and aggregates them into one standard Schnorr signature:

  • Bitcoin: BIP340 Schnorr over Taproot script paths.
  • Five account chains (ETH, BNB, Base, Arbitrum, TRON): BN128 Schnorr verified inside deterministic vault contracts (TRON vault authorization also uses BN128; only the outer energy/bandwidth transaction envelope uses secp256k1).

To survive dropped or slow signers without halting withdrawals, the signing runtime wraps FROST in ROAST (frost/runtime/roast/). The coordinator maintains concurrent active sessions and continuously folds responsive signers into fresh subsets, guaranteeing liveness over asynchronous networks as long as at least t honest committee members are online.

2. Being Honest About Committee Size

Threshold cryptography cannot include thousands of validators in a single interactive signing round. Instead of pretending otherwise, config/frost_committee_policy.go hard-codes a monotonically expanding ladder of committee tiers:

go
// config/frost_committee_policy.go
// Every tier is divisible by 4 so the 3/4 threshold is an exact integer with zero float rounding.
var VaultCommitteeTiers = [...]int{4, 8, 20, 32, 64, 100}

// Largest committee is K=100, t=75, allowing up to 3 DKG restarts per epoch:
// 100 + (100 - 75) * 3 = 175 ranked candidates guarantee deterministic fault replacement
// on every permitted restart without mutating K or t.
const VaultCandidateSnapshotLimit = 175

Committee tenure is fixed in consensus (protocol/custody_timing.go) at 120,960 blocks (~7 days at 5 s/block):

  • Fixed roster during tenure: Neither committee scaling nor ad-hoc "emergency rotations" can bypass an active term.
  • Deterministic term review: At review height, if the ranked mature-stake candidate set matches the active committee, the term simply renews without re-keying; if eligible candidates are insufficient, it fails closed and retains the current vault; only an actual membership change triggers DKG and handover.
  • Custody-bound stake lock: Calling StopMining cannot unlock a validator's stake until both the exit freeze expires (100 blocks voluntary, 120,960 blocks if kicked for liveness) and the validator has zero remaining active-vault or pending-handover custody obligations (vm/miner_custody_lock.go).

2. Cold-Start Anti-Collusion: Operator Threshold + Zero-Inbound Guardian Dual-Signing

During early network bootstrap when a vault runs at the K=4, t=3 tier, pure operator-group signing still concentrates risk if 3 validators share a vulnerability or collude.

Under Vault V3 (authorityProtocol = 3), every withdrawal batch and every authority handover requires two independent signatures: the operational FROST threshold signature and an independent Guardian signature.

1. Enforced on Every External Chain (No Admin Backdoors, Returnbomb-Hardened)

  • Bitcoin: Vault deposit and change outputs use a NUMS (Nothing-Up-My-Sleeve, provably unspendable) internal key and a single Taproot script leaf:

``text <operator_group_pubkey> CHECKSIGVERIFY <guardian_btc_pubkey> CHECKSIG `` There is no spendable key-path and no timeout escape hatch. User deposit receiver tweaks apply strictly to the operator group key; spending any UTXO requires both signatures.

  • Five account chains: SchnorrExampleV3 / SchnorrExampleTronV3 (solidity/contracts/):
  • The Guardian public key G is immutable from constructor time—no setter, no proxy upgrade slot, no owner sweep function, and constructor validation enforces operator != guardian.
  • Native coin transfers use a private _transferNative inline-assembly call (call(NATIVE_CALL_GAS, to, amount, 0, 0, 0, 0)) with return-data copy length pinned to 0, preventing malicious recipient contracts from triggering RETURNDATACOPY returnbomb OOG failures.

2. Zero-Inbound-Port Guardian Architecture

The standalone Guardian daemon (cmd/frost-guardian) obeys two strict rules:

  1. Zero blind signing: The Guardian connects only to its own independently synced latejoin full node. It never signs opaque hashes sent over the network—it reconstructs the finalized withdrawal batch or handover intent directly from local finalized StateDB before signing.
  2. Zero open inbound ports: In hidden polling mode (--listen=), the Guardian server exposes no public ports at all, and validators hold no Guardian IP in config. Its local verifying node listens only on 127.0.0.1 for outbound block sync; frost-guardian polls local finalized pending jobs and submits FrostGuardianSignatureTx directly to the chain.

The security property is simple: neither the operator committee nor the Guardian can move a single satoshi alone, and the Guardian host has zero public inbound attack surface.


3. Continuous Key Rotation Without Withdrawals: 192-Byte Multi-Generation Handover Proofs

A classic failure mode in threshold bridges is tying rotation to external-chain transactions: if a chain goes quiet for weeks, committees freeze in place.

FrostBit V3 decouples on-chain authority succession from external-chain settlement:

text
Epoch 1 (old operator group + Guardian)
   │ Signs a 192-byte dual-signed certificate (domain: DEX_VAULT_AUTHORITY_HANDOVER_V3)
   │ Binds: dexChainId | extChainId | vaultAddr | epoch 1→2 | newOpPubKey | frozenCutoffBatchSeq
   ▼
Stored permanently in FrostBit StateDB (Epoch 2 activates immediately—zero external gas spent)
   │
   │ ... even if 5 consecutive epochs pass with zero withdrawals and old validators retire ...
   ▼
Epoch 6 receives a real withdrawal:
   Any user/broadcaster submits [Epoch 1→2, ..., 5→6] proofs inside withdrawBatchWithHandovers
   (up to 8 hops per call; longer gaps paginate via catchUpAuthority—zero historical signers needed)

The critical invariant is frozenCutoffBatchSeq:

  • Before retiring, the outgoing epoch finishes signing every in-flight withdrawal batch and freezes the contiguous batch sequence cutoff inside its handover certificate.
  • On the external chain, the vault contract verifies contract.nextBatchSeq == cert.cutoff on every hop. If an older signed batch has not yet executed externally, the contract refuses to skip past it—eliminating dropped batches and cross-epoch replay.
  • Once dual-signed withdrawals finalize on FrostBit, full payloads are persisted permanently in StateDB (KeyFrostPermanent* keys committed in the state root). Anyone on Earth can broadcast a finalized batch externally and claim the built-in broadcaster reward from the vault contract—no privileged relayer bottleneck.

4. Operational Key Hygiene: Offline Zero-Plaintext Packaging and Linux FD 3/4 Launch

Cryptographic custody is worthless if validator keys, DKG wrap.key files, or Guardian keys sit on VPS disks.

For mainnet (ChainID = 51025), we locked three OS-level hardening boundaries into the codebase itself:

  1. Plaintext genesis shares permanently disabled in code for 51025: --plaintext-genesis-shares is restricted strictly to dev chain 51520. Mainnet nodes fail closed on plaintext shares and accept only encrypted bundles sealed under per-node 32-byte wrap.key secrets.
  2. Mandatory memory hardening before any key read (utils/secret_memory_linux.go):
  • dex-node, frost-guardian, and dex-fd-launch unconditionally set RLIMIT_CORE = 0 and prctl(PR_SET_DUMPABLE, 0) before touching secret bytes, blocking core dumps and non-root ptrace//proc/<pid>/mem inspection.
  • Production systemd units enforce LimitCORE=0, MemorySwapMax=0, and Restart=no (no swap leakage; after an unexpected VPS reboot the node intentionally stays down until re-launched from the operator's offline machine).
  1. One-shot UNIX socket + anonymous pipe2(O_CLOEXEC) FD 3/4 same-PID exec (cmd/dex-fd-launch/main_linux.go):
text
Trusted offline operator machine (holds private.key / wrap.key / guardian.json)
   │
   │  SSH (pinned known_hosts) streams binary frame over stdin
   ▼
Remote VPS: dex-fd-launch push ──▶ 0600 one-shot UNIX socket (/run/dex-node/launch.sock)
                                      │ verifies SO_PEERCRED UID, 60s timeout
                                      ▼
                                 dex-fd-launch serve
                                      ├─ immediately unlink(launch.sock)
                                      ├─ writes secrets into kernel anonymous pipe2(O_CLOEXEC) → FD 3 / FD 4
                                      ├─ clear() zeros user-space buffers
                                      └─ syscall.Exec replaces itself in-place with dex-node (--private-key-fd=3 --frost-wrap-key-fd=4)

Secrets never touch the VPS filesystem, argv, environment variables, or systemd unit files. A cold disk image of the VPS yields zero usable keys.


5. Honest Trade-Offs and Threat Boundaries

Every defense has a cost. Here are the three boundaries we intentionally accepted:

  1. Liveness vs. theft: Because V3 contracts deliberately omit timeout fallbacks and admin escape hatches, permanent key loss by either the Guardian or the active threshold group freezes vault funds. Multi-copy offline Guardian backups and cross-provider validator dispersion (never more than 2 genesis validators in any single cloud/ASN for K=4, t=3) are mandatory operational invariants.
  2. Shared-bug correlation: The Guardian provides a strong veto against compromised operators, provided it runs an independently synced node. If both operators and the Guardian run binaries containing the same consensus-level bug, both could still co-sign a bad payload—which is why per-block conservation panics and differential verification remain our primary line of defense.
  3. Bitcoin UTXO chaining: Unlike account chains, BTC withdrawals spend real change UTXOs (we deliver complete signed raw transactions plus topologically ordered parent packages). Unbroadcast user parent transactions can delay dependent child change outputs—a physical property of Bitcoin's UTXO model that the protocol surfaces explicitly rather than hiding behind centralized custodial hot wallets.

Source entry points (GPL-3.0-only):

Read the Source & Poke Holes: Every consensus rule, conservation check, liquidation engine, FROST vault, and witness arbitration module discussed above is open-source (GPL-3.0-only) at github.com/commonstate-labs/frostbit. Issues and adversarial edge cases are welcome.