Skip to main content
Rehearsed end to end for testnet on the deployed service on 2026-11-17, together with the relay account rotation, with step 10 on 2026-11-18; the measured times are from that rehearsal. Not yet rehearsed on mainnet.
The fee sponsor pays the network fee, through a CAP-15 fee bump, for an account sitting at its minimum balance. It holds a small operational float and spends it only on fees. Only the API knows it: there is no public-key setting and no client change, so a rotation changes one secret, a repository variable and one row of the monitoring plan. The steps follow the relay account rotation, with the differences below. <net> and <NET> mean the same as there, and every step runs in a shell started as that page’s steps describe (set -o pipefail, a throwaway XDG_CONFIG_HOME, the operator identity). The same rule on deploy runs applies: hold merges that deploy the API until the last env-only revision of the rotation serves.

When

  • Compromise: the key may be exposed, or S4b.Information.1.M.1 or S4b.Elevation.1.M.1 fired. Pause sponsorship first.
  • Planned: skip the pause.

Blast radius

  • Only sponsored fees. Every close that pays its own fees is unaffected, and while sponsorship is paused a plan that needed it reports the blocker before anything is built.
  • A fee bump signed by the old sponsor is valid only as long as its inner transaction, at most 330 seconds. Submitted after the drain, the network rejects it because its fee account no longer exists: nothing is applied or charged, and the client asks for a new sponsorship.
  • At most the old account’s float is at risk; draining it ends that. A testnet sponsor funded through friendbot holds far more than a float: the one retired on 2026-11-17 held about 10,000 XLM, which the drain returned to the operator.

Steps

  1. Compromise only: pause sponsorship.
    Expected: Done., and POST $API/v1/<net>/fee-bump/sponsor answers 503 fee_sponsorship_paused.
  2. Generate the new key: stellar keys generate new-sponsor, then stellar keys address new-sponsor. Expected: a G... address, <new>.
  3. Create the account with the float, not more. The balance monitor’s floor is 50 XLM, so fund above it:
    Expected: the float, in XLM.
  4. Check the binding, pin it, then add the secret as a new version. If the sponsor secret is bound to latest, pin its current version number first, as in the relay runbook, step 4, which also shows pinning both secrets in one revision when both rotations run together. It was bound to latest on the production service at the 2026-11-17 rehearsal.
    Expected: Created version [<n>] of the secret [<sponsor-secret>].
  5. Switch the API:
    Expected: Done., the new revision serving 100 percent, and the binding showing version <n>. In a compromise, turn FEE_SPONSORSHIP_ENABLED back to true.
  6. Confirm the new account pays. On testnet, run the sponsored close through the deployed web app:
    It funds two throwaway accounts through friendbot, sends a zero-fee account merge of one into the other, with a 120-second time bound, to fee-bump/sponsor, submits the fee bump it gets back, and reads the transaction from Horizon. Expected: it ends with PASS: fee_account <new>; on any failure it prints one FAIL: line with the reason and exits non-zero. Without the script, the same check by hand: create an account with exactly 1 XLM from the operator, build an accountMerge back to the operator with fee 0 and a 120-second time bound, sign it, send it to POST $API/v1/testnet/fee-bump/sponsor with a testnet test key, submit the returned envelope, and read the transaction from Horizon. Expected either way: <new> as fee_account, and the closed account, never <new>, as source_account. On mainnet there is no scripted check: confirm with the first real sponsored close.
  7. Monitors, before the drain: set FEE_ACCOUNT_ADDRESS_<NET> to <new> and FEE_ACCOUNT_ADDRESS_<NET>_RETIRED to <old>, merge the change to the Fee-bump sponsor (<net>) row of the inventory table in the same hour, and run the workflow. The row’s proof link cites a fee bump paid by the account it names, so replace it with the fee bump from step 6. As in the relay runbook, step 7, the same pull request changes SPONSOR in apps/api/tests/unit/service-account-monitors.test.ts, which makes it deploy the API, and on testnet the playground’s PLAYGROUND_EXPECTED_FEE_ACCOUNT_TESTNET changes too. Expected: the config step lists sponsor (<net>): <new> and sponsor (retired) (<net>): <old>, drained into <operator address>, every job succeeds, and the balances step reports only <new>.
  8. Wait 6 minutes after the new revision took traffic, so no fee bump signed by the old key can still land.
  9. Drain the old account with the operator as the transaction source, exactly as in the relay runbook, step 9, using an old-sponsor identity piped from the previous secret version. Expected: Horizon answers 404 for <old> and the float is back with the operator. The next monitor run stays green: the keys check sees no transaction sourced from <old>, and the forward check reads this merge into the operator as the drain, while fee bumps <old> paid for raise nothing: the keys check does not judge a retired sponsor as fee_account, because the window still holds the ones from before the switch. Until the drain and for the rest of the 24 hours, any transaction the old key sources, and any merge or payment out of <old> to another address, is reported as a suspected key compromise.
  10. After 24 hours: gh variable delete FEE_ACCOUNT_ADDRESS_<NET>_RETIRED, disable the previous secret version, and rm -rf "$XDG_CONFIG_HOME". Then check that /health still answers 200: the service binds version <n>, not the disabled one.

Measured times

From the testnet rehearsal on the production service, run together with the relay account rotation, which lists the shared steps:

Confirm the fix

  • A sponsored transaction shows <new> as its fee_account (step 6).
  • Horizon shows <old> as 404, and the monitors run green with both addresses for 24 hours.
  • To roll back before the drain, bind the previous secret version again. After the drain, rotate forward.