//! Coldstar Privacy — Transaction privacy layer for Coldstar.dev
//!
//! This crate provides the privacy transaction pipeline for the Coldstar
//! cold wallet, ported from devsyrem's Python privacy module.
//!
//! # Components
//!
//! - **Mode Selector** (`mode`): State machine for explicit transaction mode
//!   selection (public/private). Mode must be chosen before signing and is
//!   locked after proof generation.
//!
//! - **Signing Policy Engine** (`policy`): Evaluates transfer envelopes against
//!   configurable rules — mode validity, envelope structure, amount limits,
//!   destination allowlist, replay protection, proof completeness, and proof
//!   binding.
//!
//! - **Privacy Validator** (`validator`): Top-level orchestrator that chains
//!   mode selection, ZK proof generation, envelope construction, and policy
//!   evaluation into a single validation pipeline.
//!
//! - **Confidential Transfer Manager** (`confidential`): CLI wrapper around
//!   the `spl-token` binary for SPL Token-2022 confidential transfers — mint
//!   creation, account configuration, deposit, transfer, and withdrawal.
//!
//! # Security Properties
//!
//! - Mode must be explicitly selected, never defaulted
//! - Mode switching after proof generation is forbidden
//! - Replay protection via nonce tracking
//! - All policy checks must pass for signing approval
//! - Confidential transfer amounts are ElGamal-encrypted on-chain

pub mod confidential;
pub mod mode;
pub mod policy;
pub mod validator;

pub use confidential::ConfidentialTransferManager;
pub use mode::{ModeSelection, ModeSelector, ModeState};
pub use policy::{PolicyCheck, PolicyCheckResult, PolicyEvaluation, SigningPolicyEngine};
pub use validator::{PrivacyValidator, ValidationResult};

/// Library version
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_version() {
        assert!(!VERSION.is_empty());
    }
}
