Skip to main content

nklave_core/
lib.rs

1//! Nklave Core - Signing logic and slashing protection rules
2//!
3//! This crate provides the core functionality for the Nklave signing security layer:
4//! - BLS key management and signing
5//! - Ethereum slashing protection policy enforcement
6//! - Validator state management
7//! - State integrity and hash chaining
8//! - Signing service orchestration
9//! - Prometheus metrics
10
11pub mod keys;
12pub mod metrics;
13pub mod policy;
14pub mod replication;
15pub mod service;
16pub mod state;
17
18pub use keys::bls::{BlsKeypair, BlsPublicKey, BlsSecretKey, BlsSignature};
19pub use keys::ed25519::{Ed25519Keypair, Ed25519PublicKey, Ed25519SecretKey, Ed25519Signature};
20pub use keys::keystore::{load_keystores_from_dir, Keystore, KeystoreError};
21pub use policy::cosmos::CosmosPolicy;
22pub use policy::ethereum::EthereumPolicy;
23pub use policy::types::{ChainType, PolicyDecision, RefusalCode, SigningType};
24pub use service::{SharedSigningService, SigningResult, SigningService, SigningServiceError};
25pub use state::integrity::{DecisionRecord, StateIntegrity};
26pub use state::validator::{
27    AttestationHistory, ChainState, CosmosSignedMsgType, CosmosSignedVote, CosmosState,
28    EthereumState, ValidatorState,
29};
30
31// Replication exports
32pub use replication::failover::{
33    FailoverConfig, FailoverCoordinator, FailoverError, FailoverState, NodeRole,
34};
35pub use replication::heartbeat::{HeartbeatCheckHandle, HeartbeatConfig, HeartbeatMonitor};
36pub use replication::passive::{PassiveConfig, PassiveError, PassiveHandle, PassiveReceiver};
37pub use replication::primary::{ReplicationError, ReplicatorConfig, ReplicatorHandle, StateReplicator};
38pub use replication::protocol::{
39    AckMessage, ErrorCode, ErrorMessage, FencingToken, Heartbeat, HelloMessage,
40    ReplicationMessage, SyncRequest, SyncResponse, PROTOCOL_VERSION,
41};