Chapter 10
Security for Builders
Building in Web3 means your CI pipeline, npm dependencies, and deployer keys are part of the attack surface — not just the Solidity you ship. Supply-chain compromises and leaked private keys have caused as much damage as on-chain logic bugs.
Treat production keys like production databases: few people touch them, access is logged, and rotation happens after team changes. Never commit secrets to git, Slack, or ticket attachments. Use hardware-backed signers or multisig for deployments that control user funds.
Separate staging and production environments completely. A testnet deploy key should not live beside mainnet credentials. Document who can upgrade proxies and under what conditions.
Dependency hygiene is ongoing. Web3 npm packages are high-value targets. Review changelogs on upgrades, prefer reproducible builds, and monitor security advisories for frameworks your team depends on.