Files
zeekay b374abe5c4 feat: blockchain-native consensus with dual-certificate PQ finality
Replace Consul with private BFT blockchain (ConsensusKV) as default
state management backend for MPC cluster. MPC nodes are now validators
on their own chain with dual-certificate finality:

- Ed25519 (classical, 64B sig) + ML-DSA-65 (FIPS 204, 3,309B sig)
- Block finalized only when BOTH signature types reach t-of-n threshold
- Abstract KV interface with 3 backends: consensus (default), nats, consul
- Signer interface for KMS/HSM delegation (keys never leave enclave)
- Bootstrap via NATS JetStream KV bucket before consensus genesis
- State sync via snapshot for new node joins
- Same luxfi/crypto/mldsa used by Lux mainnet precompiles

All existing Consul code preserved for 100% parity testing.
2026-03-11 16:03:35 -07:00

23 lines
704 B
Go

package infra
// KV is the abstract key-value store interface for MPC cluster state.
// Replaces Consul KV. Implementations: NatsKV (NATS JetStream KV),
// BadgerKV (local BadgerDB), LuxKV (Lux consensus-backed).
//
// All MPC subsystems (PeerRegistry, KeyInfoStore, APIKeyStore, WalletOwner)
// use this interface through the ConsulKV compatibility adapter.
// KVPair mirrors the consul api.KVPair for drop-in compatibility.
type KVPair struct {
Key string
Value []byte
}
// KV is the native key-value interface for MPC state management.
type KV interface {
Put(key string, value []byte) error
Get(key string) ([]byte, error)
Delete(key string) error
List(prefix string) ([]*KVPair, error)
}