DEV Community

Cover image for TMKMS vs Horcrux: when to upgrade your validator key management
Sonia
Sonia

Posted on

TMKMS vs Horcrux: when to upgrade your validator key management

Every Cosmos validator team we work with eventually hits the same question: when do we move from TMKMS to Horcrux?

Most teams ask it too late. They have been running TMKMS file-based for 8 months on mainnet, the stake has grown past the threshold where a double-sign event would be catastrophic, and one of the operators just left. Now the decision is urgent and the migration is being planned under stress.

This post is the decision framework we use with clients before that moment arrives. It is not a "Horcrux is always better" post. TMKMS is the correct answer for more teams than the Cosmos Twitter discourse would suggest. The point is to understand which signal moves you from one tier to the next, not to apologize for staying on the simpler stack.

TMKMS vs Horcrux: the technical differences that matter

Both tools solve the same fundamental problem: the validator node should not hold its signing key directly. If it does, anyone who compromises the validator host gets the key, signs a conflicting block on another machine, and the protocol slashes 5% of your stake plus permanent tombstoning.

What changes between them is how they remove the key from the validator host.

TMKMS (Tendermint Key Management System) runs a separate process on a separate host. The validator connects to TMKMS over an authenticated TCP socket and requests a signature each time a vote is needed. TMKMS holds the key (as a file, or via a YubiHSM2 or Ledger Nano backend). The validator never sees the raw key.

Single-host architecture. Single signing service. Failure of the TMKMS host means the validator cannot sign, which means missed blocks, which after enough missed blocks means jailing.

Horcrux (built by Strangelove Ventures) splits the key across N hosts using threshold MPC. To produce a signature, K of N hosts (typically 2 of 3) must agree. No single host has the complete key.

Multi-host architecture. Distributed signing service. Failure of one host out of three is recoverable. Compromise of one host out of three does not expose the key.

The operational profile is fundamentally different:

Dimension TMKMS Horcrux
Hosts to operate 1 signing host 3 signing hosts
Key theft risk Compromise of TMKMS host = key exposed Compromise of 1 host = nothing
Availability risk TMKMS host down = validator down 1 of 3 hosts down = signing continues
Signing latency ~10ms ~50-100ms (network coordination)
Operational complexity One service to monitor Three services + coordination layer
Failure modes you debug Connection failures, HSM glitches Network partitions, leader election

Neither one is "better" in the abstract. Each removes a different risk at a different operational cost.

When TMKMS is enough

TMKMS file-based (without an HSM) is sufficient and correct for most teams in these conditions:

  • Total stake under ~50,000 ATOM (the dollar value of a double-sign event is bounded enough that the additional operational burden of Horcrux is not justified).
  • Single chain only (key compromise affects only one chain's stake, not a portfolio).
  • 1-2 operators on the team (you do not have headcount to maintain three signing hosts and the coordination layer).
  • First 6-12 months of operation (you are still building operational muscle, adding distributed signing complexity is premature optimization).
  • Your threat model is "external attacker scanning open ports" not "insider with infrastructure access".

For these teams, TMKMS file-based plus standard host hardening (SSH key-only, no public RPC exposure, firewall) closes 95% of the realistic attack surface. The remaining 5% (full host compromise) is a real risk, but the probability times cost calculation does not warrant the Horcrux operational overhead.

If you want to harden the remaining 5% without going to Horcrux, there is an intermediate move (see below).

When Horcrux earns its complexity

Move to Horcrux when one or more of these crosses the threshold:

Stake above ~100,000 ATOM. The asymmetric downside of a double-sign event (5% slash, permanent tombstoning, total reputation loss) starts to dominate the math. The cost of running three hosts and the coordination layer becomes proportional, not disproportionate, to what you are protecting.

Multi-chain operations. If you are running validators on Cosmos Hub plus 3 consumer chains plus a few other Cosmos SDK chains, a single TMKMS host that holds keys for all of them is a concentrated risk that does not match the distributed nature of your operation.

Team of 3+ operators. Horcrux's coordination model fits a team that is already operating in shifts. With 1-2 people, the cognitive load of debugging three signing hosts plus their network coordination outweighs the security benefit.

Institutional SLA or compliance. If a contract or regulation requires distributed key ownership (no single individual or host can produce a signature), Horcrux is the architecture that satisfies that requirement. TMKMS does not.

You have had a near-miss. If your team has already had an incident where TMKMS was the single point of failure (host crashed during an upgrade, network partition isolated the signing host), Horcrux's distributed design directly addresses that failure mode.

The mistake we see most often: teams move to Horcrux because Cosmos Twitter said it is the "right" architecture, not because the actual conditions above match their setup. Horcrux without the operational maturity to handle three coordinated hosts is less secure than well-monitored TMKMS, not more, because debugging time during incidents is longer.

The intermediate move most teams skip: TMKMS plus YubiHSM2

This is the move we recommend more than any other and the one most teams have never seriously considered.

TMKMS with a YubiHSM2 hardware backend keeps the entire operational profile of file-based TMKMS (one host, one service, simple monitoring) but removes the key from anywhere it can be extracted. Even if the TMKMS host is fully compromised, the attacker has the key handle, not the key itself. Signing only happens inside the HSM.

The threat model this addresses:

  • Insider access to the TMKMS host: cannot extract key.
  • Disk image theft: key not on disk, on HSM.
  • Remote root compromise: can sign, but cannot exfiltrate the key for offline misuse.

What it does NOT address:

  • Single point of failure for availability. If the host or HSM dies, signing stops. Identical to file-based TMKMS.

Cost: a YubiHSM2 is approximately $650 per unit, plus 1-2 hours of integration time to configure TMKMS to use it as the signing backend. For a team running production validator stake above $100k USD equivalent, this is the highest-leverage security upgrade available without taking on Horcrux's operational complexity.

This is the move for teams that have decided Horcrux is too much, but want a meaningful security improvement over file-based keys. It is a real intermediate tier, not a half-step.

The decision tree, in one paragraph

Start with TMKMS file-based if your stake is under 50k ATOM, you operate one chain, and the team is two people or fewer. Upgrade to TMKMS plus YubiHSM2 when you cross 50k ATOM in stake or when you want to harden against insider access (most teams should be here within 6 months of mainnet launch). Move to Horcrux when you cross 100k ATOM total stake, when you start operating multiple chains, when the team grows past 3 operators with on-call rotations, or when an institutional requirement forces distributed key ownership. If you are operating below 50k ATOM and considering Horcrux because you saw a thread about it, save the operational complexity for later and put the YubiHSM2 in your shopping cart instead.

If your team is sizing this decision right now and wants a second pair of eyes on your specific operational maturity, stake level and threat model, we have walked through this with dozens of Cosmos validator teams. Our [Cosmos validator slashing guide] covers the full set of failure modes that key management is one piece of, and our 7-day infrastructure audit walks the same review with a fixed price and concrete recommendations.

The key management decision is the one with the most asymmetric downside in validator operations. Get it right at the right tier for your stage, not over-engineered for a tier you are not yet at.

Top comments (0)