Overview
Building a secure crypto treasury requires balancing accessibility with security. This guide covers the practical engineering decisions for production-grade treasury infrastructure.
Architecture Principles
- Multisig Everything — No single point of failure
- Defense in Depth — Multiple security layers
- Observability First — Know what's happening in real-time
- Incident Response — Plan for compromise
Hot vs Cold Wallet Strategy
Hot Wallet (Operational)
- Holds 5-10% of total treasury
- 2-of-3 multisig minimum
- Automated monitoring & alerts
- Rate limiting on withdrawals
interface HotWalletConfig {
signers: Address[];
threshold: number;
dailyLimit: BigNumber;
cooldownPeriod: number; // seconds
}
const operationalWallet: HotWalletConfig = {
signers: [DevOps, Finance, CTO],
threshold: 2,
dailyLimit: parseEther("50"),
cooldownPeriod: 3600, // 1 hour
};
Cold Wallet (Long-term Storage)
- 90-95% of treasury
- 3-of-5 or 4-of-7 multisig
- Hardware wallet signers
- Quarterly access reviews
Monitoring & Alerts
Set up real-time monitoring for:
- Unexpected transactions — Any tx not initiated through your system
- Balance changes — Track inflows/outflows
- Gas price anomalies — Detect potential attacks
- Signer changes — Alert on ownership modifications
async function monitorTreasury(address: Address) {
const balance = await provider.getBalance(address);
const threshold = parseEther("1000");
if (balance.lt(threshold)) {
await alert("Treasury balance below threshold", {
current: formatEther(balance),
threshold: formatEther(threshold),
});
}
}
Incident Response Plan
When compromise is suspected:
- Freeze operations — Pause all automated systems
- Secure remaining funds — Emergency transfer to backup wallet
- Investigate — Analyze transaction history, check signer security
- Communicate — Internal team + stakeholders
- Post-mortem — Document and improve
Key Takeaways
- Never compromise on multisig for production treasuries
- Monitoring is not optional — you need real-time visibility
- Test your incident response before you need it
- Separate hot/cold wallets based on operational needs