βœ… Master On-Chain Governance

Understand protocol upgrades, voting mechanisms, and attack vectors

Upgrade blockchain protocol through voting

Key Takeaways

You've explored on-chain governance mechanisms, proposal lifecycles, voting systems, and security vulnerabilities. Let's review the essential concepts before testing your knowledge.

πŸ—³οΈ On-chain Governance Fundamentals

Decentralized protocols enable token holders to control protocol evolution through smart contract-enforced voting.

  • β€’Proposals executed automatically once approvedβ€”no trusted intermediaries
  • β€’Used by major DeFi protocols: Compound, Uniswap, Aave, MakerDAO
  • β€’Enables parameter changes, upgrades, treasury management without hard forks

πŸ“‹ Proposal Lifecycle (5 Stages)

Structured process from creation to execution with multiple security checkpoints:

  • β€’Pending: Voting delay period after creation (typically 1 block)
  • β€’Active: 3-7 day voting period, power snapshot at creation block
  • β€’Succeeded: Quorum met, majority voted FOR, ready for queuing
  • β€’Queued: 1-7 day timelock delay before execution (exit window)
  • β€’Executed: Changes applied to protocol contracts automatically

πŸ”’ Voting Mechanisms

Different systems balance plutocracy, sybil resistance, and voter participation:

  • β€’Token-Weighted: 1 token = 1 vote. Simple but vulnerable to whale control (Compound, Uniswap)
  • β€’Quadratic: Vote power = √tokens. Reduces whale influence, lowers sybil resistance (Gitcoin)
  • β€’Conviction: Lock tokens longer for more power. Aligns with long-term health (Polkadot)
  • β€’Delegated: Assign voting power to representatives, combats apathy (ENS, Optimism)

⚑ Governance Attacks & Defenses

Attack vectors and critical defense mechanisms:

  • β€’Flash Loan Attacks: Borrow tokens, vote, repay same transaction β†’ Defense: Snapshot voting power at creation
  • β€’Vote Buying: Accumulate tokens to control decisions β†’ Defense: High quorum, timelocks, delegation
  • β€’Bribery Markets: Pay holders to vote specific way β†’ Defense: Conviction voting, veto power
  • β€’Critical Defenses: Timelocks (exit window), snapshot blocks (prevent flash loans), high quorum (expensive attacks)

πŸ’‘ Best Practices

Lessons from production governance systems:

  • β€’Always use timelocks: Minimum 24-48 hours, ideally 7 days for major changes
  • β€’Snapshot at creation: Record voting power when proposal created, not during vote
  • β€’Balance quorum: 30-40% participation prevents attacks without gridlock
  • β€’Consider delegation: Combats voter apathy, distributes power to active participants
  • β€’Emergency veto: Security multisig as last resort against attacks (centralization tradeoff)