Security considerations
Clementine’s security model leverages Bitcoin’s security guarantees, cryptographic proofs, and economic incentives to create a trust-minimized bridge. This page covers the security mechanisms, threat model, and operational best practices.Security model overview
Clementine achieves trust minimization through multiple layers of security:1. Cryptographic security
Key deletion covenants: Bridge funds are held in an N-of-N arrangement where participants delete their keys after pre-signing all possible transactions, making unauthorized fund movement cryptographically impossible. Zero-knowledge proofs: RISC Zero circuits and Groth16 proofs ensure operators can only complete withdrawals if they can prove correctness of their operations. Signature aggregation: MuSig2 provides N-of-N threshold signatures without revealing individual keys or requiring interactive coordination beyond the signing ceremony.2. Economic security
Operator collateral: Operators must post collateral that can be slashed if malicious behavior is proven on-chain. Watchtower incentives: Watchtowers earn rewards for detecting and proving operator misbehavior, creating economic incentive for active monitoring. Challenge costs: The cost to challenge must be lower than the reward for successful challenges, ensuring rational actors will monitor and challenge.3. Bitcoin security
Immutable commitments: WOTS signatures commit operator claims to Bitcoin’s blockchain, making manipulation impossible. Proof-of-work validation: The bridge inherits Bitcoin’s security by requiring operators to follow the canonical chain with the most cumulative work. Time-locked governance: Updates to the verifier set are time-locked, giving users an exit window if they don’t trust changes.Threat model
Trust assumptions
Clementine’s security relies on the following assumptions: 1-of-N honest verifier assumption- At least one verifier must maintain key security
- At least one verifier must refuse to sign invalid operations
- If all N verifiers are compromised, deposited funds are at risk
Funds deposited under a previous verifier set remain secure even if the new set is fully compromised, due to the key deletion covenant design.
- At least one watchtower must monitor operator behavior
- At least one watchtower must submit challenges for invalid operations
- Watchtowers must have access to the canonical Bitcoin blockchain
- At least one operator must continue processing deposits and withdrawals
- If all operators stop, new operations halt but existing funds remain secure
- The M-of-N governance can activate new operators through verifier set updates
- Bitcoin’s proof-of-work consensus remains secure
- 51% attacks on Bitcoin could affect Clementine
- Deep reorganizations could invalidate proofs
Attack vectors and mitigations
1. Malicious operator attacks
Attack: Operator creates invalid payout transaction or follows wrong Bitcoin chain Mitigation:- Watchtowers monitor all operator actions
- Operator must prove correctness using Bridge Circuit
- Operator work must exceed all watchtower Work-Only Proofs
- Incorrect proofs can be disproven on-chain, slashing operator
2. Censorship attacks
Attack: Operator ignores watchtower challenges or valid withdrawal requests Mitigation:- Pre-signed ChallengeNACK transactions allow anyone to slash operators who ignore challenges
- Watchtower challenge transaction spending is verified in Bridge Circuit
- Multiple operators can process withdrawals
- Bridge Circuit verifies
watchtower_sent_challengeboolean array - Operator must acknowledge ALL challenges via ChallengeACK
- Failure to acknowledge results in automatic slashing
3. Signer collusion
Attack: All N verifiers collude to steal deposited funds Mitigation:- Key deletion covenant makes pre-signed transactions the only way to spend
- Cannot create new unauthorized transactions
- Verifier set updates are time-locked with user exit windows
- Different entities should operate verifiers
- Geographic distribution of verifiers
- Independent organizational control
- Hardware security modules (HSMs) for key storage
- Regular verifier rotation
4. Bridge circuit vulnerabilities
Attack: Bugs in circuit logic allow invalid proofs to pass verification Mitigation:- Formal verification of critical circuit paths
- Extensive fuzzing and property-based testing
- Multiple independent watchtowers verify proofs
- On-chain disprove mechanism catches invalid proofs
- Open-source code review
5. RISC Zero proof forgery
Attack: Attacker generates fake Groth16 proofs Mitigation:- Method IDs are hardcoded and network-specific
- Groth16 verification is cryptographically sound
- On-chain verification in disprove scripts
- Trusted setup for Groth16 (using RISC Zero’s setup)
6. Database compromise
Attack: Attacker gains access to PostgreSQL database Mitigation:- Database stores state, not private keys
- Nonces are one-time use (MuSig2 security)
- Private keys stored separately in secure key management
- Database access controls and encryption
- Partial signature exposure (not exploitable)
- State manipulation (detectable, not fund-threatening)
- Nonce reuse (preventable with key management)
7. gRPC man-in-the-middle
Attack: Attacker intercepts gRPC communication between actors Mitigation:- Mutual TLS (mTLS) for all connections
- Client certificate authentication
- Certificate pinning for known entities
- Encrypted transport (TLS 1.3)
8. Denial of service
Attack: Attacker floods services with requests or spams Bitcoin blockchain Mitigation:- Rate limiting on gRPC endpoints
- Transaction fee requirements on Bitcoin
- Operator collateral creates spam cost
- Database connection pooling
- Resource limits on circuit proving
Operational security
Key management
Private key storage: Best practices:- Hardware Security Modules (HSMs) for verifier private keys
- Separate key storage from application servers
- Key rotation procedures for long-term keys
- Multi-party computation (MPC) for key generation
- Secure backup of key material with encryption
TLS certificate management
Certificate lifecycle:- Generation: Use strong entropy and appropriate key sizes (RSA 4096 or ECDSA P-256)
- Distribution: Secure channels for certificate sharing
- Rotation: Rotate certificates every 90 days
- Revocation: Maintain CRL or OCSP for compromised certificates
Database security
Access controls:- Enable PostgreSQL encryption at rest (pgcrypto)
- Encrypt sensitive columns (if storing any secrets)
- Use encrypted volumes for database storage
- Regular encrypted backups
Network security
Firewall rules:Monitoring and alerting
Critical metrics:- Watchtower challenge received - Immediate investigation
- Operator slashing event - Critical incident response
- Proof verification failure - Circuit bug or attack
- Database connection loss - Service degradation
- Bitcoin node out of sync - Chain following failure
- Certificate expiration approaching - Renewal needed
Incident response
Compromise indicators:- Unexpected watchtower challenges
- Failed proof verifications
- Unusual gRPC authentication failures
- Abnormal database access patterns
- Unexpected transaction broadcasts
- Operator slashing events
- Detect: Automated monitoring triggers alert
- Isolate: Disconnect compromised services from network
- Investigate: Analyze logs, database state, and blockchain data
- Remediate: Patch vulnerabilities, rotate keys, update configuration
- Recover: Restore service with validated state
- Post-mortem: Document incident and improve defenses
Security best practices
Deployment checklist
Key management
- Private keys stored in HSMs or secure key management
- Key backup procedures documented and tested
- Key rotation schedule established
- Emergency key recovery process defined
Certificate management
- Production certificates from trusted CA
- Certificate rotation automated (90-day cycle)
- Certificate revocation list (CRL) configured
- Certificate permissions restricted (600 for keys)
Network security
- Firewall rules configured for minimal exposure
- Network segmentation implemented
- DDoS protection enabled
- VPN or private network for inter-service communication
Database security
- Database user permissions minimized
- SSL/TLS required for connections
- Encryption at rest enabled
- Regular encrypted backups automated
Application security
- Latest stable version deployed
- Dependencies audited (
cargo audit) - Security patches applied promptly
- Rate limiting configured
Monitoring
- Metrics exported to monitoring system
- Alerts configured for critical events
- Log aggregation and analysis
- On-call rotation established
Running in production
Environment isolation:Testing security
Security testing:Vulnerability disclosure
If you discover a security vulnerability in Clementine: Responsible disclosure:- Email: [email protected]
- Encryption: Use the provided GPG key (see SECURITY.md)
- Include: Detailed description, reproduction steps, impact assessment
- Response: Expect acknowledgment within 48 hours
Security resources
SECURITY.md
Security policy and contact information
Audit reports
Third-party security audit reports
BitVM security
BitVM bridge security model
RISC Zero security
RISC Zero zkVM security properties
Next steps
Quick start
Deploy Clementine with security best practices
Configuration
Configure secure deployments
Monitoring
Set up security monitoring and alerts
Operations
Operational security procedures