mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
- pkg/infra: Add abstract KV interface, ConsensusKV (dual-cert BFT with Ed25519 + ML-DSA-65), NatsKV, ConsulKVAdapter, HybridKV, SQLiteMeta with full test coverage - pkg/hsm: Add Provider interface and implementations for AWS KMS, GCP Cloud KMS, Azure Key Vault, Zymbit HSM, Hanzo KMS, and file-based providers with registry and tests. Rename existing FileProvider to FilePasswordProvider to avoid collision with new Provider interface - pkg/policy: Add transaction governance engine with signers, roles, spending limits, whitelist/blacklist, time windows, rate limiting, approval workflow, audit log, and FHE private policy evaluation - contracts: Add ThresholdPolicy.sol for on-chain policy enforcement - cmd: Rename lux-mpc-cli to mpc-cli - Makefile: Update build targets for mpc-cli
23 lines
704 B
Go
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)
|
|
}
|