Key custody: tiers, HSMs, multi-sig, ceremonies, and losing a key without losing the business

Tier keys by what losing them costs, keep the hot tier narrow and low-value behind a signer or HSM, put value behind quorum and hardware, and write the compromise playbook before you need it.

Read the briefing
About 4 min to read 6 drills

What to remember

  1. Mixing custody tiers on one host is the classic fatal design. Withdrawal credentials 'temporarily' on a signing box turns any host compromise into a permanent loss.
  2. An HSM converts key theft into key use. The key is non-extractable, so an attacker must ask — which is rate-limited, policy-checked and logged.
  3. Multi-sig is an organisational control wearing cryptography. m-of-n only works if the signers are separate people, on separate devices, in separate places, with a tested recovery path.
  4. A ceremony is scripted, witnessed and rehearsed. Generation and recovery done live for the first time is how shares get lost and how nobody can prove what happened.
  5. Bound the loss before it happens: value caps and narrow policy. The hot key should control the minimum working balance, so the worst case is a bad day rather than the end of the business.

The big picture

Key custody is the discipline of deciding, in advance, what each key can do, who can make it do that, and what happens when one is compromised. The technology — HSMs, signers, multi-sig, ceremonies — exists to make those decisions enforceable rather than aspirational.

The mental model

For every key ask three questions: what does losing it cost, what is the smallest thing it needs to be able to do, and how would I find out it had been used without permission? The answers give you the tier, the policy and the detection.

In depth

Tiers

Hot — signs continuously and unattended (validator signing keys, relayer and fee-payer keys, market-data or order-entry credentials). Behind a remote signer or HSM, with policy limits on message types and rates, holding the minimum value that lets the system work, and topped up automatically from a warmer tier.

Warm — occasional operational authority (deploying a contract, rotating an operator address, moving working capital). Behind an approval workflow with named humans and an audit record.

Cold — value and control (treasury, upgrade authority, withdrawal credentials). Multi-sig with hardware wallets, geographically separated signers, documented quorum, offline. Never on an internet-connected host, and never "temporarily" beside a hot key.

HSMs, KMS and remote signers

The common property is non-extractability: you send an operation, you get a signature, and the private key never exists outside the boundary. That changes the attacker's problem from stealing a secret to using an API — which you can rate-limit, scope by message type, require authentication for, and log. A remote signer (Web3Signer, Horcrux, a custom service in front of a KMS or HSM) adds domain policy: slashing protection for validators, allowed transaction shapes for a relayer, per-key rate limits.

The trade-offs to say out loud: latency per signature, availability (the signer becomes a dependency and needs its own redundancy — carefully, if exclusivity matters), and cost. A cloud KMS is the pragmatic starting point; a dedicated HSM raises the extraction bar and is often a counterparty requirement.

Multi-signature and ceremonies

Multi-sig splits authority so no single person or machine can move value: an m-of-n policy where signers are distinct people using distinct devices in distinct locations, with a written quorum, named alternates, and a tested recovery path for a lost device or an unavailable signer. Choose m and n for both safety and liveness: 2-of-3 is fragile against one loss plus one holiday; 3-of-5 is the common compromise.

A key ceremony makes generation, backup and recovery auditable: a script written and reviewed in advance, rehearsed with dummy material, executed by multiple people who verify each other, in a controlled location, with the artefacts — shares, attestations, a recording, signed attendance — retained as evidence. The recovery half is the part people skip and the part that matters: a backup nobody has restored is a rumour.

The compromise playbook

Written before it is needed, because you may be racing an attacker on-chain: what is rotated and in what order; how value is moved and to where; how signers are exited or migrated without ever running two; who is notified internally, and which counterparties and regulators have a clock attached; what evidence is preserved before hosts are rebuilt; and who has pre-agreed authority to act at 3 a.m. without convening a committee. Rehearse it on testnet or with dummy keys. And bound the blast radius in advance — tiering, value caps, narrow policy — because the difference between an incident and an extinction event is decided long before the alert fires.

Myths and facts

Myth: An HSM means we cannot be compromised.

Fact: It means the key cannot be extracted. An attacker with access to the signing API can still ask for signatures, which is why policy, rate limits and detection matter.

Myth: Multi-sig is a cryptographic control.

Fact: It is an organisational one: separate people, devices and locations, plus a tested recovery path. Three keys in one safe is not multi-sig.

Myth: Rotation every 90 days is the main defence.

Fact: Short lifetimes and narrow scope matter more; a 90-day rotation still leaves 90 days of exposure and is usually untested.

Myth: Cold storage means encrypted on a server.

Fact: Cold means offline and quorum-controlled. Encrypted-at-rest on a reachable host is warm at best.

Myth: We will write the compromise plan if it happens.

Fact: You will be racing someone. The ordering of rotation, value movement and notification has to be decided when nobody is panicking.

How pros do it

  • Tier every key explicitly and never mix tiers on a host; keep hot keys at the minimum working value.
  • Make keys non-extractable (HSM/KMS/remote signer) and enforce message-type and rate policy at the signer.
  • Use m-of-n with genuinely separated signers, a written quorum, and a recovery path you have tested.
  • Script, rehearse, witness and record key ceremonies — including recovery, not just generation.
  • Write and rehearse the compromise playbook, with pre-agreed authority and evidence preservation.

Questions people ask

KMS or a dedicated HSM?

Cloud KMS by default; a dedicated HSM when a counterparty or regulator requires it or the value justifies it. Both make the key non-extractable and log every use, and the HSM adds single-tenant hardware under your own custody with a higher extraction bar. The caveat: neither is a control until the signing grant is scoped by message type, rate and identity — an HSM with an open grant is a slower file.

How much should a hot wallet hold?

The minimum that keeps the system working for a defined window — hours, not weeks. Automated top-up from a warm tier under approval keeps it there, and an alert on unexpected outflow catches abuse. State the number and defend it: it is your declared worst case for a hot-key compromise.

What m-of-n should we choose?

3-of-5 for most treasuries. m is your safety margin against a compromised signer and n minus m is your liveness margin against a lost device or an absent signer — 2-of-3 leaves you one loss plus one holiday from being unable to move funds. Name alternates and test recovery, or the threshold is theoretical.

First move on a suspected leak?

Assume it is real and follow the written order — contain the funding path, rotate or exit, move value, notify — then investigate. You may be racing an attacker on-chain, so every minute spent reading logs first is a minute the window stays open. The caveat is pre-agreed authority: someone must be allowed to act at 3 a.m. without convening a committee.

Do we need a ceremony for every key?

For cold and control keys, yes, every time. For hot keys generated inside an enclave or HSM, the attestation and the audit log are the equivalent evidence of provenance. Either way the recovery rehearsal is the part that matters, not the generation — a backup nobody has restored is a rumour.

Further reading

Drills · 6

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Pick the strongest answer

You are building a platform that signs transactions all day and also holds a treasury. How do you tier the keys — which of these is right?

  1. Hot signing key in an HSM-backed signer with message-type and rate policy, holding only a working balance topped up automatically; treasury in a 3-of-5 multi-sig on hardware wallets held offline by separate people. Value and continuous authority are separated, and the hot tier's worst case is bounded.
  2. Treasury key encrypted on the signing host, decrypted only when needed. It is present on a reachable host at the moment of use, so any host compromise reaches it.
  3. One hardware wallet holding both, plugged into the signing server for availability. A permanently connected hardware wallet on an internet-facing host loses most of its benefit and mixes tiers.
  4. Both keys in the same KMS with different IAM policies. IAM misconfiguration or a compromised role reaches both; value belongs behind quorum and hardware, not policy alone.
In short

Hot key in an HSM signer with a small capped balance; treasury in an offline 3-of-5 multi-sig held by separate people.

Why

The test to apply: if this host is fully compromised, what is the worst outcome? Correct tiering makes the answer "a bounded working balance and some policy-limited signatures", never "the treasury".

The common mistake

Treating "same KMS, different IAM policies" as tiering. One misconfigured or compromised role reaches both; value belongs behind quorum and hardware, not policy alone.

Read the docs

2 Pick the strongest answer

How do you keep a signing key safe? Specifically — what does putting it in an HSM actually change for an attacker?

  1. It removes the need for audit logging. The audit trail is one of the main benefits; you would not remove it.
  2. It makes signing faster. It usually adds latency; the benefit is custody, not speed.
  3. It prevents unauthorised signatures entirely. An attacker with API access still gets signatures unless policy stops them.
  4. Theft becomes use: the key cannot be extracted, so an attacker must call the signing API — which can be scoped by message type, rate-limited, authenticated and logged, making the abuse detectable and bounded. Non-extractability converts a silent copy into an observable, limitable action.
In short

The attacker can no longer copy the key; they must ask the HSM to sign, and every request can be limited and logged.

Why

This distinction drives the rest of the design: because abuse is now a sequence of API calls, the controls that matter are policy at the signer, rate limits, and alerting on unusual patterns — not just protecting a file.

The common mistake

Stopping at "the key can't leave the HSM" as if that ended the story. An attacker with API access still gets signatures unless message-type policy, rate limits and alerting stop them.

Read the docs

3 Answer out loud

We are about to put assets behind your platform. How do you protect the keys? Tell me the tiers, what a compromised host actually gets an attacker, how the keys were generated, how you would know something was wrong, and what happens if one leaks. Five to seven sentences.

In short

A strong answer starts with the bounded worst case: a compromised host gets a capped balance and limited signatures, never the treasury.

What a strong answer does
  • model: Explicit tiers with what each controls, non-extractable hot keys with policy, cold value behind separated quorum, and the compromise question answered directly with a bounded worst case.
  • evidence: Ceremony artefacts, immutable off-host audit of key use, tested recovery, access reviews — the things an auditor samples.
  • response: Ordered playbook with funding-path containment, value movement, exit/migration without double signing, notification commitments and evidence preservation — rehearsed.
  • candour: States residual risk plainly and what would reduce it, which is what makes the rest credible.
Why

Counterparty answers must lead with the bounded worst case, show evidence rather than assert diligence, and state residual risk.

The common mistake

Reassurance instead of specifics. "Keys are encrypted and access is restricted" loses the room; "if you own this host you get at most the capped hot balance and rate-limited signatures" wins it.

4 Find what's broken

You are on a counterparty's diligence call and they have this excerpt of your custody design in front of them. Six entries end the conversation. Find all six.

# custody design doc (excerpt)
hot_signing_key = "file on the signer host, mode 0600, owner app"
hot_wallet_balance = "unbounded; funded from treasury on demand"
treasury = "2-of-3 multisig"
treasury_signers = "three hardware wallets in the office safe"
warm_key_approval = "any engineer with production access"
ceremony = "generated by the founding engineer on a laptop, backup in 1Password"
recovery_test = "never"
In short

The fatal entries are the key file on the host, the unbounded hot balance, the three signers in one safe, any engineer approving warm-key moves, the laptop key generation, and the untested recovery.

What's broken
  • Line 5: All three treasury signers sit in one safe, so the multi-sig provides no separation — one break-in or one insider reaches quorum.
  • Line 3: The hot wallet balance is unbounded and funded from treasury on demand, so a hot-key compromise can drain far more than a working balance.
  • Line 7: The key was generated on a laptop with a password-manager backup — no ceremony, no witnesses, no evidence of provenance.
  • Line 8: Recovery has never been tested, so nobody knows whether the backup can actually restore the key — a backup nobody has restored is a rumour.
  • Line 2: The hot signing key is a file on the host, so a host compromise is a key compromise.
  • Line 6: Any engineer with production access can approve warm-key operations — no named approvers, no separation between requester and approver, and nothing that records the approval.
Why

2-of-3 (line 4) is a defensible quorum — fragile against one loss plus one holiday, which is why 3-of-5 is more common, but not a design failure; it is the co-location on line 5 that ruins it. The six flagged entries are each sufficient to fail diligence on their own.

Read the docs

5 Scenario: what do you do next?

02:10. Alerting fires: an unexpected process on a signing host read the hot key's material file, and 4 ETH has left the hot wallet to an unknown address. The hot wallet holds 20 ETH and is topped up automatically from a 400 ETH warm wallet. The treasury is in a separate multi-sig.

Step 1. This is your pager. What do you do first, and in what order?

  1. Stop the automated top-up, sweep the remaining hot balance to a safe address, isolate the host from the network while preserving its state, and start the written playbook including notifications. Cut the funding path before anything else — it is actively feeding the attacker — then save what is left, then preserve evidence.
  2. Rotate the treasury multi-sig first, as it holds the most value. The treasury is not implicated and rotating a quorum takes time you should spend stopping the bleed.
  3. Investigate how the process got there before touching balances. The top-up keeps sending funds to a compromised key while you read logs.
  4. Power off the host immediately. Destroys volatile evidence; isolate the network instead unless the host is actively signing.

Step 2. Bleeding stopped, 16 ETH saved. What next?

  1. Generate the replacement key on the same host to save time. Generating a new key on an untrusted host reproduces the compromise.
  2. Rebuild the signer from known-good, verified artefacts with a new key, review which other credentials that host could reach and rotate anything it touched, and notify internally plus any counterparty whose operations ran through it with the facts and the amount lost. Clean foundations, exposure analysis by credential path, honest and specific communication.
  3. Restore the host from last week's snapshot and resume. The snapshot may contain the compromise, and the key is burned regardless.
  4. Say nothing externally since the loss is small. Counterparties whose flows touched that host need to know, and discovery later costs far more than disclosure now.

Step 3. Postmortem mechanisms?

  1. Require two engineers to approve every signature. Impractical for an automated signer; bound value and constrain policy instead.
  2. Cap hot-wallet balance and top-up rate so the loss is bounded by design, move signing behind a signer with message and rate policy, add alerts on key-file reads and unexpected outflows, pin and verify binaries, and rehearse the playbook with pre-agreed authority. Bounds the blast radius, removes the key from the host, and makes detection and response fast by construction.
  3. Add a firewall rule for the attacker's address. Addresses one indicator, not the class.
In short

First stop the automatic top-up, then move the remaining funds to a safe address, then isolate the host and keep its state.

Why

The ordering — funding path, then sweep, then evidence, then rebuild, then disclosure — is what interviewers listen for, along with "the worst case should have been bounded before this happened".

The common mistake

Investigating before containing. While you read logs, the automatic top-up keeps sending funds to a key the attacker already holds.

Read the docs

6 Quick recall

When you review someone else's custody design, what is the one mistake you look for first — the one that turns a single compromise into a permanent loss?

In short

Mixing hot and cold keys on one host.

Accepted

mixing custody tiers on one host · mixing tiers · keeping cold keys on a hot host

Why

Mixing tiers — cold or withdrawal keys present on a host that also does continuous signing — turns any single compromise into a permanent loss.

Next lesson Trusted execution: enclaves, the threat model they actually change, and what they cost
Drill · Key custody
0:00

Loading…