Design On-Chain Voting

Medium45 min
1 / 30
understanding8 min read

Problem Statement: On-Chain Governance Voting at DAO Scale

Problem Statement: On-Chain Governance Voting at DAO Scale — on-chain governance voting interview depth

Problem Statement: On-Chain Governance Voting at DAO Scale

Design a Snapshot / Tally / Compound-class on-chain governance voting platform where token holders propose protocol changes, cast weighted or quadratic ballots, and execute passed actions through a timelock. This section focuses on problem during the understanding phase.

Mechanism

  • Compound-style Governor with checkpointed ERC20Votes weights at snapshot block
  • Snapshot hub ingests EIP-712 ballots; relayer posts results on-chain when strategy demands binding execution
  • Tally-style indexer replays VoteCast and ProposalCreated for sub-second UI tallies
  • Optional quadratic credits cap whale dominance while preserving one-person-one-vote intent

Quantified anchors

  • 42M governance tokens outstanding; 6.5% supply typically delegates
  • 7-day voting period; 400k VoteCast events/day peak during contentious upgrades
  • Quadratic mode: 100 credit budget/voter/season; cost(n votes)=n² on a single proposal

Component focus (TokenHolder, ProposalHub, VoteEngine, Timelock)

  • Trace how TokenHolder hands off to ProposalHub under load
  • VoteEngine projections must be idempotent across reorgs
  • Timelock is the execution or observability boundary

Governance invariants

  • Vote weight at snapshot block is authoritative; off-chain tallies are hints until relayed
  • Relayers cannot exceed on-chain quorum when posting Snapshot results
  • Simulation precedes queue; timelock ETA is user-visible

Failure drills

  • Flash-loan acquisition in creation block blocked by votingDelay
  • IPFS gateway slow: show hash on-chain, degrade rationale UI only
  • Quadratic Sybil: reject duplicate identity wallets

Interview checkpoints

  • Quote concrete numbers (quorum 4%, threshold 100k tokens, 48h timelock)
  • Separate signaling vs binding paths in one sentence
  • Name Snapshot, Tally, Compound parallels when asked

Depth note 1.1: Compound-style Governor with checkpointed ERC20Votes weights at snapshot block — impacts vote latency, relayer budget, and tally correctness for problem.

Depth note 1.2: Snapshot hub ingests EIP-712 ballots; relayer posts results on-chain when strategy demands binding execution — impacts vote latency, relayer budget, and tally correctness for problem.

Depth note 1.3: Tally-style indexer replays VoteCast and ProposalCreated for sub-second UI tallies — impacts vote latency, relayer budget, and tally correctness for problem.

Depth note 1.4: Optional quadratic credits cap whale dominance while preserving one-person-one-vote intent — impacts vote latency, relayer budget, and tally correctness for problem.

Depth note 1.5: Compound-style Governor with checkpointed ERC20Votes weights at snapshot block — impacts vote latency, relayer budget, and tally correctness for problem.

Depth note 1.6: Snapshot hub ingests EIP-712 ballots; relayer posts results on-chain when strategy demands binding execution — impacts vote latency, relayer budget, and tally correctness for problem.

javaOne Dark Pro
1public final class GovVote1 {
2 public static final String TOPIC = "problem";
3 public boolean quorumMet(long forVotes, long against, long supply, int quorumBps) {
4 return (forVotes + against) * 10_000L >= supply * quorumBps;
5 }
6}
pythonOne Dark Pro
1SECTION_1_TOPIC = "problem"
2TOKEN_SUPPLY = 42_000_000
3
4def quadratic_cost(vote_units: int) -> int:
5 return vote_units * vote_units
typescriptOne Dark Pro
1export const SECTION_1 = { topic: 'problem', phase: 'understanding' };
2export function quadraticCost(units: number): number {
3 return units * units;
4}

Why interviewers care

On-Chain Voting interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: On-Chain Governance Voting at DAO Scale that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Compound-style Governor with checkpointed ERC20Votes weights at snapshot block
  • Snapshot hub ingests EIP-712 ballots; relayer posts results on-chain when strategy demands binding execution.
  • Tally-style indexer replays VoteCast and ProposalCreated for sub-second UI tallies
  • Optional quadratic credits cap whale dominance while preserving one-person-one-vote intent
Mention this
Tie sec-01 to **snapshot block weights** and **quadratic credit budgets**—signals production governance literacy.
Pro tip
Never treat Snapshot percentages as executed law without on-chain queue proof.

Section Rescue Kit

Buzzwords to use:

snapshot blockquadratic credits

Safe statements:

  • "For Problem Statement: On-Chain Governance Voting at DAO Scale, I'll separate signaling vs binding before naming cloud SKUs."
  • "I'll walk propose → vote → queue → timelock when stuck."
Design On-Chain Voting - System Design | WinJob | WinJob