Validator Key Management and Chain Bootstrap
Three independent key pairs per validator — TLS identity, BLS consensus, and staking — generated locally, never derived from a shared seed, held in hardware or KMS, bound into genesis by NodeID, and rotated without downtime
Abstract
Every validator node carries three cryptographic identities: TLS (node identity and peer-to-peer), BLS (consensus voting), and staking (P-Chain registration). Keys MUST be unique per node, non-deterministic, and held in hardware-backed or KMS-backed storage. This LP covers generation, persistence, rotation, genesis binding, and the chain bootstrap process.
Motivation
Validator keys are the highest-value targets on any proof-of-stake network. A compromised validator key allows double-signing (equivocation), unauthorized withdrawal of staked funds, network partition through key collusion, and permanent loss of stake through slashing.
The network therefore requires a key management standard that:
- prevents key reuse across nodes, which would undermine fault tolerance;
- prevents key derivation from a shared secret, where one compromise compromises all;
- supports rotation without downtime;
- enables post-quantum key migration;
- works across bare metal, cloud, and Kubernetes.
Specification
Key types
| Key | Algorithm | Purpose | Rotation |
|---|---|---|---|
| Staker TLS | ECDSA P-256 (X.509 cert) | Node identity, p2p encryption, NodeID derivation | Annual, or on compromise |
| BLS signer | BLS12-381 | Consensus voting, L1 / L2 attestation | Per epoch (planned) |
| Staking key | secp256k1 (derived from TLS) | P-Chain validator registration, reward address | Tied to the TLS certificate lifecycle |
Post-quantum path:
| Key | Classical | Post-quantum |
|---|---|---|
| TLS | ECDSA P-256 | ML-DSA-65 plus Pulsar hybrid |
| BLS | BLS12-381 | Pulsar lattice (threshold-friendly) |
| Staking | secp256k1 | Pulsar lattice |
ML-DSA-65 on TLS adds about 7 KB to the initial handshake — once per connection — and buys NIST FIPS 204 conformance, which matters for regulated institutional clients. Pulsar on consensus voting keeps per-block overhead minimal because its signatures are threshold-aggregatable.
In hybrid mode, every message carries both a classical and a post-quantum signature, so the channel is secure if either algorithm holds.
Key generation
MUST: keys are generated locally on the node using a CSPRNG
(crypto/rand).
MUST NOT:
- derive from a shared mnemonic — one mnemonic means all validators fall together;
- derive from deterministic seeds — predictable is attackable;
- copy keys between nodes — that undermines N-of-M fault tolerance;
- generate keys on a developer machine and transfer them.
Generation process:
1. Node boots for the first time
2. Init container checks for existing keys in persistent storage
3. If no keys exist:
a. Generate an ECDSA P-256 key pair → staker.key
b. Self-sign an X.509 cert (10-year expiry) → staker.crt
c. Generate a BLS12-381 key pair → signer.key
d. Compute NodeID = CB58(RIPEMD160(SHA256(staker.crt.DER)))
e. Store all three files in persistent storage
4. If keys exist: load and verify integrity
Key storage
Production (Kubernetes):
Tier 1 (recommended): Hardware Security Module
- PKCS#11 interface via --staking-kms-endpoint
- Keys never leave the HSM boundary
- Supported: AWS CloudHSM, GCP Cloud HSM, Zymbit Zymkey
Tier 2 (acceptable): KMS-backed Kubernetes Secrets
- Keys stored in etcd, encrypted at rest via the KMS provider
- Per-node Secret: staker-keys-{node-index}
- RBAC: only the specific pod can read its own Secret
Tier 3 (development only): Persistent Volume
- Keys on a PVC with ReadWriteOnce access
- Acceptable for devnet and testnet, NOT for mainnet
NEVER: emptyDir — keys are lost on restart, which breaks genesis binding
Tier 2 manifest pattern:
apiVersion: v1
kind: Secret
metadata:
name: staker-keys-node-0
namespace: chain
type: Opaque
data:
staker.crt: <base64>
staker.key: <base64>
signer.key: <base64>
node.id: <base64> # cached NodeID for quick reference
The StatefulSet mounts per node:
volumes:
- name: staking
secret:
secretName: staker-keys-node-{{ .podIndex }}
Genesis binding
The genesis file MUST reference the actual validator NodeIDs and BLS public keys. That creates a cryptographic binding between genesis state and the physical validators.
1. Generate keys for all N validators
2. Extract NodeIDs and BLS public keys from each
3. Run: genesis -network <name> -keys-dir <path-to-all-keys>
4. The genesis tool:
a. Reads staker.crt → derives NodeID
b. Reads signer.key → extracts the BLS public key
c. Generates initialStakers[] with real NodeIDs + BLS keys
d. Generates allocations[] with the correct HRP for the network ID
e. Generates the C-Chain alloc (a separate concern)
5. Deploy genesis as a ConfigMap
6. Boot nodes with matching keys
The canonical shape of that genesis tree is LP-1030.
Network ID to HRP mapping:
| Network ID | HRP | Example |
|---|---|---|
| 1 | lux | P-lux1abc… |
| 2 | test | P-test1abc… |
| 3 | dev | P-dev1abc… |
| 1337 | local | P-local1abc… |
| other | custom | P-custom1abc… |
Chain bootstrap
Complete bootstrap for a new network:
Phase 0: Key generation
- For each validator (0..N-1):
- Generate TLS + BLS keys
- Store in KMS / Secrets
- Record NodeID + BLS pubkey
Phase 1: Genesis generation
- Run: ~/work/lux/genesis/cmd/genesis/
- Inputs: validator keys, network ID, C-Chain alloc source
- Output: genesis.json with initialStakers, allocations, cChainGenesis
- Store in ~/work/lux/genesis/configs/{network}/
Phase 2: Primary network boot
- Deploy genesis as a ConfigMap
- Mount validator keys into pods
- Boot nodes with --network-id and --genesis-file
- Wait for P/X/C chains to bootstrap
- Verify: all validators connected, BLS keys match
Phase 3: L1 / L2 creation
- CreateNetworkTx materializes the network with its validators,
chains, and cert profile in one commit-or-revert step (LP-1020)
- CreateChainTx deploys the chain's VM
- AddL1ValidatorTx registers validators to the network
- Wait for the network to bootstrap
Phase 4: Contract deployment
- Deploy the CREATE2 factory (deterministic address)
- Deploy the chain's contract set through that factory
- Same CREATE2 salt → same addresses on every network
Phase 5: Verification
- Check all accounts funded (P/X/C)
- Check all contracts deployed
- Run end-to-end tests
- Confirm the explorer is indexing every block
Key rotation
Planned rotation, no downtime:
1. Generate a new key set for the node
2. Register the new NodeID as a validator on P-Chain (addValidator tx)
3. Wait for the new validator to sync
4. Remove the old NodeID from the validator set (removeValidator tx)
5. Securely destroy the old keys
Emergency rotation, on compromise:
1. Immediately remove the compromised NodeID from the validator set
2. Generate new keys on a clean machine
3. Re-register with the new NodeID
4. Investigate and remediate the compromise
5. Update genesis for the next network reset, if one is needed
Relaunch with new NodeIDs
When validators need new addresses or keys — migration, compromise, hardware refresh:
1. Snapshot current chain state (native backup)
2. Export state to ~/work/lux/state/backups/<label>/
3. Generate new validator keys
4. Regenerate genesis with the new NodeIDs:
~/work/lux/genesis/cmd/genesis/ -keys-dir <new-keys>
5. Update K8s Secrets with the new keys
6. Update the genesis ConfigMap
7. Delete old PVCs to force a clean boot
8. Boot nodes — they bootstrap from genesis
9. Restore state from the snapshot, if history is being preserved
10. Redeploy contracts through CREATE2 (same addresses)
Preserved: C-Chain contract addresses (CREATE2 is deterministic), account balances (genesis allocation), chain configuration.
Changed: NodeIDs, BLS keys, P-Chain staker records, network addresses.
Security Considerations
- Key isolation. Each validator's keys are readable only by that validator's pod.
- No shared secrets. Validator keys are never derived from a shared seed.
- Defense in depth. Even if one validator is compromised, the network continues under the BFT threshold.
- Post-quantum ready. Hybrid classical-plus-PQ signatures on every validator message.
- Audit trail. Every key operation is logged to the KMS audit log (LP-7330).
- Secure destruction. Old keys are cryptographically erased, not merely unlinked.
Reference Implementation
- Key generation:
~/work/lux/node/staking/(TLS and BLS) - Genesis tool:
~/work/lux/genesis/cmd/genesis/ - Genesis regeneration:
~/work/lux/genesis/cmd/regenerate-genesis/ - KMS staking endpoint:
~/work/lux/node/config/config.go(--staking-kms-endpoint)
Copyright
Copyright and related rights waived via CC0.