CAPPZ.AI News

A stolen signing key should not empty the vault: what the Chainflip drain teaches, and how CAPPZ stops it

By CAPPZ.AI ·

An attacker drained $4.86 million from Chainflip with a valid signature from its own signing key. CAPPZ deal escrows can't be redirected that way, and the new Vault Guard limits what any stolen key can take from a pooled account. The XRP Ledger enforces the limit. Tested on testnet.

On Saturday, 21 November 2026, an attacker emptied the Ethereum vault of the cross-chain exchange Chainflip: 520.2 ETH, 3.25 million USDC and 758,000 USDT, about $4.86 million. The stablecoins reached Tornado Cash before Circle or Tether could freeze them. The whole attack took less than ten minutes, The Block reported.

According to the security firms quoted, no smart contract bug was involved. The withdrawal carried a valid signature from the protocol's own signing key. That key is shared by Chainflip's 150 validators: each holds a piece, 100 pieces are needed to sign, and the key is rotated every three days. Bitquery noticed one more detail. Every Chainflip withdrawal carries a nonce, a counter that goes up by one, and at the time the counter stood near 315,000. The attacker's nonce was a 39-digit number, the only one of 299,677 signatures since 2023 that broke the count. Whoever signed it did so outside the normal signing system.

Chainflip has not said how the key was compromised, and this article doesn't guess. The lesson holds whatever the cause: the vault paid whatever that one key signed, so its only limit was its balance. Splitting a key among 150 validators protects the key. It doesn't limit what a signature from that key can do.

This article covers which parts of CAPPZ already prevent this kind of loss, the gap we found, and the new Vault Guard that closes it. The guard is now in the open-source CAPPZ SDK 15.48 and was tested against the same attack on the XRP Ledger testnet.

What CAPPZ already prevents

CAPPZ holds no pooled vault for deals. On the CAPPZ Marketplace, every participant brings their own funded XRP Ledger wallet, and CAPPZ holds no keys and no customer money. When a buyer funds a milestone, the money goes into a native XRP Ledger escrow. The escrow's destination, the seller's address, is fixed when it is created. Releasing it needs a cryptographic condition that only the deal's flow reveals, and an unreleased escrow returns to the buyer when its time runs out. No key can send an escrow anywhere else. A thief holding every CAPPZ key could at most release a milestone early to the seller who was owed it.

Exposure is staged. Holds never run longer than a 30-day billing cycle. Longer work is split into stages, each funded only after the previous one completes. So at any moment, a deal has at most one stage at risk, not the whole contract.

Every escrow transaction is approved before it is signed. An independent check service replays the marketplace's public log and approves the exact unsigned transaction a deal allows right now: the right destination, amount, condition, hold and fee, a short expiry, and the agent's mandate where an agent is buying. The wallet signs nothing else.

Keys are trusted through declarations, and checks are reconciled. CAPPZ trusts a signing key only as far as a wallet declared it, for a purpose, until an expiry, with revocations replayed. Our Constraint Guard for equipment already works the way Bitquery's analysis did: every change must match an authorised command, and a change made outside the normal channel is reported, even when its signature is valid.

The gap

One kind of account still had nothing but its key standing guard: a pooled account. Examples are the marketplace's optional fee collector, an operator's treasury, or a bridge or exchange vault that someone builds on CAPPZ. The marketplace can collect every fee in one account and distribute it later, because that saves buyers an escrow per fee recipient. That account was protected the way Chainflip's vault was. Steal the key and you can move the balance.

Signing approvals don't help here. An approval is checked by the honest signer before signing, so a thief who holds the key simply skips it. The limit has to be one the ledger enforces, so that a perfect signature still can't move more than the policy allows.

The Vault Guard, step by step

The XRP Ledger has native multi-signing: an account can name up to 32 signers, each with a weight, and set a quorum. A transaction counts only if its signers' weights reach the quorum. The ledger checks this itself, before the transaction can enter a ledger. The Vault Guard uses it to make one independent co-signer, the guard, necessary for every transaction, and the guard signs only inside a policy.

Step 1: decide who holds keys. There are three groups:

  • Operator keys: the people or systems who run the account day to day.
  • The guard: a separate service, on a separate machine and cloud account, run by different people, that holds one key and a written policy.
  • Recovery keys (optional, at least two): kept offline by different people, for when the guard itself is lost.

Step 2: write the outflow policy. The owner declares:

  • where money may go (addresses, and exact destination tags where needed)
  • the most one payment may move and the most that may leave in any 24-hour window, per asset (XRP, RLUSD and other tokens, with exact decimals)
  • the highest fee
  • how far ahead a signed transaction may expire (about a minute)

Step 3: set up the account. The SDK builds two transactions, signed by the account's master key as its last act.

The first is a signer list with weights chosen for this job. With n operators, of whom k must sign with the guard:

Who signsWeightCan they move money?
Every operator key togethernNo (the quorum is 2n + 2)
The guard alone2n + 2 − kNo
The guard and k operators2n + 2Yes, inside the policy
Two recovery keys2n + 2Yes, break-glass, always reported
One recovery key and every operator2n + 1No

The second transaction disables the master key. From then on, only the signer list can act. Changing the signer list also needs the quorum, so a thief can't remove the guard either.

Step 4: check the setup from the ledger. checkSignerSetup reads the account and reports either guard-load-bearing or every way a key could still bypass the guard: master key still on, a regular key set, the online keys reaching quorum on their own, and so on. A plain threshold list like Chainflip's, 100 of 150 validator keys with no guard, reports guard-bypassable: stealing the online keys is enough.

Step 5: run payments through the guard. An operator prepares a payment and asks the guard to co-sign. The guard refuses, with every reason at once, unless all of these hold:

  • the destination is on the list
  • the payment is within the per-payment cap and within the 24-hour window
  • the fee is capped and the transaction expires soon
  • it carries the account's next sequence number, with no tickets and no jumps
  • it has no partial-payment flag, paths or extra fields
  • it is not a key, signer or account-setting change

The sequence rule is the XRP Ledger's version of Chainflip's nonce counter. A signature made outside the normal flow, like the 39-digit nonce, is refused before it exists. The guard records each approval, adds its signature, and an operator adds theirs.

Step 6: reconcile. On a schedule, reconcileOutflows reads every validated transaction the account sent and matches each one to an approval the guard recorded. Anything else is reported as unapproved: the setup isn't load-bearing, or a guard key leaked. That includes a failed transaction, because even a failed transaction needed a quorum signature. The report is hashed so an incident record can cite it.

The Chainflip attack, run against a guarded vault

We ran it on the XRP Ledger testnet with the SDK's tools/vault-guard-testnet.ts. Every result below is the ledger's own answer. The vault rhPUaYNVCRLrMamk3wywZDxJrGCtQqPAra was funded with 100 test XRP and given two operators (one signs per payment), a guard and two recovery keys. The policy allowed one settlement address, 20 XRP per payment and 30 XRP per 24 hours.

  1. Setup. Signer list with quorum 6: guard weight 5, operators 1 each, recovery keys 3 each. Master key disabled. The check read back guard-load-bearing.
  2. The master key tries to drain the vault: refused, tefMASTER_DISABLED.
  3. Both operator keys drain the vault. This is the Chainflip case: every key the attacker could reach without the guard. Refused, tefBAD_QUORUM ("Signatures provided do not meet the quorum").
  4. Both operators try to remove the guard from the signer list: refused, tefBAD_QUORUM.
  5. Both operators try to install a regular key of their own: refused, tefBAD_QUORUM.
  6. The guard is asked to co-sign the drain with an out-of-band sequence number. It refused for four reasons: sequence-gap, destination-not-allowed, over-tx-cap, over-window-cap.
  7. A routine 15 XRP payment to the settlement address, signed by the guard and one operator: succeeded.
  8. Another 20 XRP within the same 24 hours: the guard refused (over-window-cap, 15 + 20 > 30).
  9. Break-glass: the two recovery keys moved 5 XRP without the guard. Reconciliation listed it as unapproved, as it should: recovery is allowed, and it is never silent.

The refused transactions never entered a ledger, and the attacker's address was never created. The vault ended with 79.999904 XRP: 100, minus the 20 that moved under control, minus fees.

What it would have meant for a vault like Chainflip's

With the guard in place, stealing the operators' combined key gets an attacker nothing. Stealing the guard and enough operator keys gets them at most one window's cap, sent only to addresses on the list. On a list of the protocol's own addresses and confirmed counterparties, that is an operational incident, not a mixer deposit. The operators have the rest of the window to notice the reconciliation alarm, rotate keys through the quorum, and tighten the policy.

Chainflip's vault is an Ethereum contract, where the same principle would be a contract-level rate limit and an independent co-signer. CAPPZ implements it on the XRP Ledger, where native multi-signing makes it a setup task rather than new contract code.

What it does not do

We'd rather say this plainly than have it found later:

  • It bounds the loss; it doesn't make keys safe to leak. The honest worst case is one window's cap to an allowed destination, and the SDK reports it (worstCaseLoss). Set the cap to what you could afford to lose in a day.
  • The guard is only as independent as you make it. If one breach reaches the guard and the operators, the guard adds nothing. Put it on separate infrastructure, under separate people.
  • The destination list is part of the trust. Add only addresses you control or have confirmed. For a counterparty, use CAPPZ payee confirmation, which checks that the payee declared that address from their own wallet. Don't take an email's word for it.
  • Recovery keys bypass the policy by design. Keep them offline, with different people. Every use shows up in reconciliation.
  • Deal escrows don't need it. Their destination is already fixed by the ledger. The guard is for accounts that pool money.

What it costs

These are XRP Ledger figures at the time of writing; check xrpl.org for current values.

  • Signer list: one owner-reserve item, 0.2 XRP held (not spent) while the list exists.
  • Each guarded transaction: a multi-signed transaction pays the base fee once per signature plus once more. With the guard and one operator that's 3 × 10 drops = 0.00003 XRP, against 0.00001 XRP for a single signature.
  • The guard service: a small always-on machine. The CAPPZ edge node that already runs our paid agents on a home box is enough. Assumption: around $5 to $15 a month for a small VPS or a home device's electricity.
  • Testnet: free.

Against those costs, the most a stolen key can take from a pooled account becomes one window's cap instead of the whole balance.

Try it

  • Guide: docs/VAULT_GUARD.md. Quick start, refusal reasons, setup findings.
  • Code: guardSetupTransactions, checkSignerSetup, guardCosign and reconcileOutflows from @cappz/sdk/marketplace (src/lib/treasury/vaultGuard.ts, Apache-2.0).
  • Run the attack yourself on testnet: npx vite-node tools/vault-guard-testnet.ts -- --out run.json in the CAPPZ SDK. It funds a vault from the faucet and prints the ledger's answer to every step.

Spreading a key across many people protects the key. A vault also needs a limit on what any single signature can do, and the guard puts that limit in the ledger.

Topics: security, key compromise, multisig, xrp ledger, treasury, vault guard, chainflip, cappz sdk

Version 1 · recorded on the CAPPZ admin chain · content sha256 0581bef2f5851ab4

Add CAPPZ.AI as a preferred source on Google · RSS feed