
{"id":166200,"date":"2026-05-15T14:34:55","date_gmt":"2026-05-15T14:34:55","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=166200"},"modified":"2026-05-15T14:34:55","modified_gmt":"2026-05-15T14:34:55","slug":"quadratic-funding-the-mathematics-behind-fair-public-goods-financing","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=166200","title":{"rendered":"Quadratic Funding: The Mathematics Behind Fair Public Goods Financing"},"content":{"rendered":"<p>If you\u2019ve ever donated on Gitcoin, you\u2019ve participated in a Quadratic Funding (QF) round, perhaps without fully understanding why your $1 donation sometimes unlocked ten times that amount in matching funds, while a whale\u2019s $10,000 donation barely moved the needle. That asymmetry isn\u2019t a bug. It\u2019s the entire\u00a0point.<\/p>\n<p>This article unpacks QF from first principles: the economic philosophy behind it, the mathematics that make it work, the real-world constraints that complicate it, and a full Solidity implementation that brings it on-chain using Foundry. By the end, you\u2019ll understand not just <em>what<\/em> QF is, but <em>why<\/em> it is the way it is, and what it takes to actually build\u00a0it.<\/p>\n<h3>The Problem QF Is Trying to\u00a0Solve<\/h3>\n<p>Before we look at the solution, we need to understand the failure modes it addresses. Two dominant models of resource allocation exist, and both are broken in predictable ways.<\/p>\n<h3>The Failure of Pure Markets (Capitalism\u2019s Blind\u00a0Spot)<\/h3>\n<p>In a free market, funding follows private interest. A project receives exactly the sum of what individuals choose to contribute:<\/p>\n<p>F = \u03a3 c\u1d62<\/p>\n<p>The problem is that markets are optimised for <em>private<\/em> goods, excludable goods (if you don\u2019t pay, you don\u2019t get access), and rival goods (your consumption reduces what\u2019s available to others). Public goods are the opposite: they\u2019re non-excludable and non-rival. Clean air, open-source software, free documentation, public research, everyone benefits regardless of whether they contributed.<\/p>\n<p>This creates the <strong>free-rider problem<\/strong>. Because you can enjoy a public good without paying for it, rational agents choose not to contribute, expecting others to fund it. The result is chronic underfunding of the things communities actually need most. In a linear funding model, only the single contributor with the highest marginal valuation has a meaningful influence. Everyone else free-rides.<\/p>\n<p><strong>For instance,<\/strong> imagine an open-source developer building a critical cryptographic library that secures $50 billion worth of DeFi protocols. The library is free to use. Every protocol benefits, but none feels individually responsible for funding it. The developer ends up making $3,000 from crowdfunding despite enabling billions in value. This is the market failure QF is designed to\u00a0correct.<\/p>\n<h3>The Failure of One-Person-One-Vote Democracy<\/h3>\n<p>Democratic systems solve the free-rider problem by forcing collective decisions, but they introduce a different distortion: they are blind to the <em>intensity<\/em> of preferences.<\/p>\n<p>Under majority rule, a project mildly preferred by 51% of voters will be funded. A project <em>desperately<\/em> needed by 49% will receive nothing. This systematically disadvantages minority communities, niche but critical infrastructure, and \u201centrepreneurial\u201d public goods innovations that most people don\u2019t yet understand but a passionate few see as transformative.<\/p>\n<p><strong>For instance,<\/strong> A proposal to fund a new park that 60% of citizens vaguely support defeats a proposal to fund wheelchair ramp retrofits that only 15% of citizens care about, even though 15% having an intense, life-affecting stake in the\u00a0outcome.<\/p>\n<h3>The Middle Ground: What QF Aims\u00a0For<\/h3>\n<p>Quadratic Funding, introduced by Vitalik Buterin, Zo\u00eb Hitzig, and Glen Weyl in their 2018 paper <em>Liberal Radicalism<\/em>, is designed to sit between these two failure modes. It\u00a0is:<\/p>\n<p><strong>As responsive as a market<\/strong>: anyone can signal support for any project at any time, and preferences are expressed through voluntary financial contributions.<strong>Resistant to wealth dominance<\/strong>: a dollar from a millionaire does <em>not<\/em> carry the same weight as a dollar from an ordinary contributor, because what matters most is the <em>number<\/em> of contributors, not the\u00a0amount.<strong>Sensitive to preference intensity<\/strong>: contributors signal how much they care through the size of their donation, but in a way that rewards breadth over\u00a0depth.<\/p>\n<p>The mechanism that achieves this balance is a surprisingly elegant\u00a0formula.<\/p>\n<h3>The Formula\u200a\u2014\u200aWhat It Is and Why It Works This\u00a0Way<\/h3>\n<h3>The Core\u00a0Equation<\/h3>\n<p>The total funding a project receives under Quadratic Funding\u00a0is:<\/p>\n<p>F\u209a = ( \u03a3\u1d62 \u221ac\u1d62\u209a )\u00b2<\/p>\n<p>Where:<\/p>\n<p>F\u209a Is the total funding allocated to the project\u00a0pc\u1d62\u209a is the contribution of the individual i to project\u00a0p\u03a3\u1d62 \u221ac\u1d62\u209a is the sum of the square roots of all individual contributions<\/p>\n<p>The <em>matching amount<\/em> from the shared pool is\u00a0then:<\/p>\n<p>Matching = F\u209a \u2212 \u03a3 c\u1d62\u209a  =  ( \u03a3\u1d62 \u221ac\u1d62\u209a )\u00b2 \u2212 total direct donations<\/p>\n<p>That is, QF calculates what the project <em>should<\/em> receive, then fills in the gap with matching\u00a0funds.<\/p>\n<h3>Breaking It Down Step-by-Step<\/h3>\n<p>Let\u2019s use a concrete example. Suppose a project receives three donations:<\/p>\n<p>Contributor Amount Alice $10 Bob $3 Carol\u00a0$20<\/p>\n<p><strong>Step 1\u200a\u2014\u200aTake the square root of each contribution:<\/strong><\/p>\n<p>Contributor Amount \u221aAmount Alice $10 \u2248 3.162 Bob $3 \u2248 1.732 Carol $20 \u2248\u00a04.472<\/p>\n<p><strong>Step 2\u200a\u2014\u200aSum the square\u00a0roots:<\/strong><\/p>\n<p>3.162 + 1.732 + 4.472 = 9.366<\/p>\n<p><strong>Step 3\u200a\u2014\u200aSquare the\u00a0sum:<\/strong><\/p>\n<p>9.366\u00b2 \u2248 $87.72<\/p>\n<p><strong>Step 4\u200a\u2014\u200aSubtract direct donations:<\/strong><\/p>\n<p>Direct donations: $10 + $3 + $20 = $33<br \/>Matching amount:  $87.72 \u2212 $33 = $54.72<\/p>\n<p>So three contributors donating a combined $33 unlock $54.72 in matching funds, a 165%\u00a0boost.<\/p>\n<p>Now compare what happens if a single donor gives the same $33\u00a0total:<\/p>\n<p>\u221a33 \u2248 5.745<br \/>5.745\u00b2 = 33.00<br \/>Matching = $33 \u2212 $33 = $0<\/p>\n<p>A single $33 donation generates <em>zero<\/em> matching. The mechanism is explicitly designed to reward <em>community breadth<\/em>, not individual wealth.<\/p>\n<h3>Why the Square Root? The Mathematical Intuition<\/h3>\n<p>The choice of the square root is not arbitrary. It\u2019s the precise function that embodies a key democratic principle: <strong>diminishing marginal returns on influence.<\/strong><\/p>\n<p>Consider what different functions would\u00a0produce:<\/p>\n<p><strong>Linear (pure capitalism):<\/strong> F = \u03a3 c\u1d62; A $100 donation contributes exactly 100\u00d7 more than a $1 donation. Wealth =\u00a0power.<\/p>\n<p><strong>Pure democracy (1p1v):<\/strong> Every address counts equally regardless of donation size. A $0.01 donation has the same weight as a $10,000 one. Easy to game with fake identities, and ignores preference intensity.<\/p>\n<p><strong>Square root (QF):<\/strong> A $100 donation contributes \u221a100 = 10 units of weight. A $1 donation contributes \u221a1 = 1 unit of weight. So the $100 donor is only 10\u00d7 as influential as the $1 donor, despite contributing 100\u00d7 as much money. This compresses the power of wealth while still rewarding greater financial commitment, a genuine middle\u00a0ground.<\/p>\n<p>The \u201cquadratic\u201d in Quadratic Funding refers to the squaring operation in the final step. The cost to achieve a given <em>influence<\/em> is quadratic: to double your weight, you must contribute four times as\u00a0much.<\/p>\n<h3>The Power of Collective Action: A Vivid Illustration<\/h3>\n<p>To see QF\u2019s most important property, consider two scenarios for a project with a $1,000 matching\u00a0pool:<\/p>\n<p><strong>Scenario A: One wealthy\u00a0backer<\/strong><\/p>\n<p>1 donor gives\u00a0$1,000\u221a1000 \u2248\u00a031.6231.62\u00b2 =\u00a01,000Matching =\u00a0$0<\/p>\n<p><strong>Scenario B: A community rallies<\/strong><\/p>\n<p>100 donors each give\u00a0$1100 \u00d7 \u221a1 =\u00a0100100\u00b2 =\u00a0$10,000Matching = $10,000 \u2212 $100 =\u00a0$9,900<\/p>\n<p>One hundred people each contributing $1 generate nearly $10,000 in matching. A single donor giving $1,000 generates nothing. This is not a flaw; it is the mechanism working exactly as intended. Community consensus unlocks shared resources. Individual wealth does\u00a0not.<\/p>\n<h3>Real-World Constraints\u200a\u2014\u200aFrom Theory to Capital-Constrained QF<\/h3>\n<p>The pure QF formula has one fatal flaw for real-world deployment: it can claim arbitrarily more matches than exist in the\u00a0pool.<\/p>\n<p>In the example above, the $100 community round would need $9,900 in matching, but what if only $5,000 is available? The formula, taken literally, would be insolvent.<\/p>\n<h3>Introducing Alpha: Capital-Constrained QF\u00a0(CQF)<\/h3>\n<p>The solution is to introduce a weighting parameter \u03b1 (alpha) that scales QF results to fit within the actual budget. The CQF formula for a project\u2019s payout\u00a0becomes:<\/p>\n<p>Payout = \u03b1 \u00d7 QF_score + (1 \u2212 \u03b1) \u00d7 direct_contributions<\/p>\n<p>Where:<\/p>\n<p>When \u03b1 = 1: pure QF (full matching amplification)When \u03b1 = 0: pure direct funding (no matching amplification)When 0 &lt; \u03b1 &lt; 1: a blend that exactly clears the available budget<\/p>\n<p>The optimal alpha is calculated as:<\/p>\n<p>\u03b1 = (matching_pool \u2212 total_direct_contributions) \/ (total_QF_score \u2212 total_direct_contributions)<\/p>\n<p>This ensures the total payouts across all projects precisely equal the available matching pool, no overspend, no underspend.<\/p>\n<p>In my Solidity implementation, this is handled in calculateOptimalAlpha():<\/p>\n<p>function calculateOptimalAlpha() public returns (uint256 alpha) {<br \/>    uint256 totalQFScore = calculateTotalQFScore();<br \/>    uint256 totalDirectContributions = totalContribution;    uint256 numerator = totalMatchingFund;<br \/>    uint256 denominator = totalQFScore;    if (numerator &gt;= denominator) {<br \/>        alpha = 1e18; \/\/ Full QF: pool covers everything<br \/>    } else if (numerator &lt;= totalDirectContributions) {<br \/>        alpha = 0;    \/\/ Pool too small: pure direct<br \/>    } else {<br \/>        alpha = ((numerator &#8211; totalDirectContributions) * 1e18)<br \/>                \/ (denominator &#8211; totalDirectContributions);<br \/>    }<br \/>    \/\/ Clamped to [0, 1e18]<br \/>}<\/p>\n<p>Alpha is then used in finalizeRound() to calculate the matching payout for every project, ensuring total distributions never exceed totalMatchingFund.<\/p>\n<h3>The Sybil Attack\u200a\u2014\u200aQF\u2019s Achilles\u00a0Heel<\/h3>\n<p>QF\u2019s greatest strength, rewarding the <em>number<\/em> of contributors, is also its greatest vulnerability. If you can fake an identity, you can fake community support.<\/p>\n<h3>How Sybil Attacks Exploit the\u00a0Formula<\/h3>\n<p>A Sybil attack occurs when a single entity creates multiple fake identities to appear as multiple contributors. In QF, the impact is\u00a0severe.<\/p>\n<p><strong>The $1-to-$1,000 amplifier:<\/strong> Suppose an attacker controls 100 fake wallets, each contributing $0.01:<\/p>\n<p>Total donated: 100 \u00d7 $0.01 = $1<br \/>\u221a of each:     100 \u00d7 \u221a0.01 = 100 \u00d7 0.1 = 10<br \/>Squared sum:   10\u00b2 = $100<br \/>Matching:      $100 \u2212 $1 = $99<\/p>\n<p>A $1 \u201cinvestment\u201d across 100 fake identities generates $99 in matching, a 9,900% return. The attacker is draining the matching pool from legitimate projects.<\/p>\n<p><strong>The Reciprocal Backing Ring:<\/strong> A group of 20 project creators coordinate to each donate to each other\u2019s projects using fresh wallets. Each cross-donation looks like independent community support. The QF formula amplifies all of it, and every participant takes a larger slice of the matching pool at the expense of genuinely community-backed projects.<\/p>\n<p><strong>The botnet approach:<\/strong> An attacker deploys a bot to generate thousands of wallets, each sending negligible ETH (or even zero, if the contract is misconfigured). If identity isn\u2019t verified, the formula treats every wallet as a unique human\u00a0signal.<\/p>\n<h3>How My Contract Defends Against Sybil\u00a0Attacks<\/h3>\n<p>The contract implements a dual-mode Sybil resistance system through the ISybilResistance interface:<\/p>\n<p>interface ISybilResistance {<br \/>    function isVerified(address _address) external view returns (bool);<br \/>}<\/p>\n<p>This interface is intentionally abstract. It can be wired\u00a0to:<\/p>\n<p><strong>Gitcoin Passport<\/strong>\u200a\u2014\u200aan identity aggregation service that scores wallet \u201chumanity\u201d based on connected accounts (GitHub, Twitter, ENS,\u00a0etc.)<strong>WorldID<\/strong>\u200a\u2014\u200abiometric proof of personhood via iris\u00a0scanning<strong>Internal whitelist<\/strong>\u200a\u2014\u200aa curated list of KYC\u2019d addresses managed by the round\u00a0operator<\/p>\n<p>The onlyVerified modifier gates every contribution:<\/p>\n<p>modifier onlyVerified() {<br \/>    if (sybilResistanceEnabled) {<br \/>        require(sybilResistance.isVerified(msg.sender), &#8220;Not verified&#8221;);<br \/>    } else if (whitelistMode) {<br \/>        require(verifiedAddresses[msg.sender], &#8220;Not whitelisted&#8221;);<br \/>    }<br \/>    _;<br \/>}<\/p>\n<p>And round operators can seamlessly switch between\u00a0modes:<\/p>\n<p>function setSybilResistance(address _sybilResistanceAddress) public onlyOwner {<br \/>    sybilResistance = ISybilResistance(_sybilResistanceAddress);<br \/>    sybilResistanceEnabled = (_sybilResistanceAddress != address(0));<br \/>    whitelistMode = false; \/\/ Disable whitelist when using external provider<br \/>}function enableWhitelistMode() public onlyOwner {<br \/>    whitelistMode = true;<br \/>    sybilResistanceEnabled = false;<br \/>}<\/p>\n<p>No identity verification is perfect, but the combination of on-chain modifiers and off-chain verification providers raises the cost of Sybil attacks significantly, especially when economic barriers (gas costs, minimum donations) are factored\u00a0in.<\/p>\n<h3>The Engineering\u200a\u2014\u200aBuilding QF in\u00a0Solidity<\/h3>\n<h3>The 24KB\u00a0Problem<\/h3>\n<p>Every Ethereum smart contract has a hard deployment size limit of 24 kilobytes (the Spurious Dragon EIP-170 limit). Implementing the full CQF formula, with square root calculations, precision scaling, alpha computation, round management, Sybil resistance, and withdrawal logic, pushes dangerously close to this\u00a0ceiling.<\/p>\n<p>The contract addresses this with three optimisation strategies:<\/p>\n<p><strong>1. Library extraction<\/strong><\/p>\n<p>The most computation-heavy math, the square root summation, is isolated into a clean internal function (sqrtFixed) that the Solidity compiler can efficiently inline:<\/p>\n<p>function sqrtFixed(uint256 x) public pure returns (uint256 y) {<br \/>    if (x == 0) return 0;<br \/>    uint256 scaledInput = x * PRECISION_FACTOR; \/\/ Scale by 1e9<br \/>    uint256 z = (scaledInput + 1) \/ 2;<br \/>    y = scaledInput;<br \/>    while (z &lt; y) {<br \/>        y = z;<br \/>        z = (scaledInput \/ z + z) \/ 2;<br \/>    }<br \/>    return y;<br \/>}<\/p>\n<p><strong>2. Function internalization<\/strong><\/p>\n<p>Helper functions that are only called from within the contract are declared internal rather than public. This allows the compiler to optimise call jumps and significantly reduce bytecode\u00a0size.<\/p>\n<p><strong>3. Three-phase alpha calculation<\/strong><\/p>\n<p>Rather than computing the entire CQF match in a single monolithic function, the logic is broken into three discrete phases: summing square roots across contributions, calculating total QF scores, and then applying alpha to scale the final distribution. This modular approach keeps each function lean enough to stay within stack depth limits and keeps the overall bytecode well under the 24KB\u00a0ceiling.<\/p>\n<h3>Precision Math: Handling\u00a0Square<\/h3>\n<h3>Roots Without Floating\u00a0Points<\/h3>\n<p>Solidity has no native floating-point support. All arithmetic is integer-based. This creates a problem: \u221a(2 ether) should return approximately 1.414, but integer math would simply return 1, losing half the precision.<\/p>\n<p>The solution is <strong>fixed-point arithmetic<\/strong> with a precision scaling factor of 1e9 (stored as PRECISION_FACTOR):<\/p>\n<p>uint256 public constant PRECISION_FACTOR = 1e9;<\/p>\n<p>When computing a square root, the input is first multiplied by PRECISION_FACTOR, and the integer square root is taken on the scaled value. The result is then &#8220;unscaled&#8221; later by dividing by PRECISION_FACTOR\u00b2 =\u00a01e18:<\/p>\n<p>uint256 projectQFScore = (sumOfSqrts * sumOfSqrts) \/ (PRECISION_FACTOR * PRECISION_FACTOR);<\/p>\n<p>This gives us 9 decimal places of precision, more than sufficient for ETH-denominated donations measured in wei (where 1 ETH = 1e18\u00a0wei).<\/p>\n<p><strong>Concrete example:<\/strong><\/p>\n<p>Contribution: 1e18 wei (1\u00a0ETH)scaledInput = 1e18 \u00d7 1e9 =\u00a01e27sqrtFixed(1e18) \u2248 \u221a(1e27) \u2248 1e13.5 \u2248 3.162 \u00d7\u00a010\u00b9\u00b3This integer represents 3.162 with 13 digits of precision<\/p>\n<h3>Round Lifecycle<\/h3>\n<p>The contract models a complete funding round lifecycle:<\/p>\n<p>[Deploy] \u2192 startRound() \u2192 [Contributions] \u2192 endRound() \u2192 finalizeRound() \u2192 withdrawProjectFunds()<\/p>\n<p>Each state transition has access control and validity\u00a0checks:<\/p>\n<p>modifier roundIsActive() {<br \/>    require(roundActive, &#8220;No round&#8221;);<br \/>    require(block.timestamp &gt;= roundStartTime, &#8220;Not started&#8221;);<br \/>    require(block.timestamp &lt;= roundEndTime, &#8220;Ended&#8221;);<br \/>    _;<br \/>}<\/p>\n<p>finalizeRound() can only be called after the round has ended, preventing mid-round manipulation of matching calculations. Once finalized, project recipients can call withdrawProjectFunds() to pull their direct donations plus matching, with protection against double-withdrawal:<\/p>\n<p>uint256 alreadyWithdrawn = projectWithdrawnAmount[_projectId];<br \/>require(totalPayout &gt; alreadyWithdrawn, &#8220;No funds left&#8221;);<br \/>uint256 availableToWithdraw = totalPayout &#8211; alreadyWithdrawn;<br \/>projectWithdrawnAmount[_projectId] = totalPayout;<br \/>(bool success,) = payable(msg.sender).call{value: availableToWithdraw}(&#8220;&#8221;);<\/p>\n<p><strong>Note<\/strong>: the use of\u00a0.call{value:\u00a0&#8230;} instead of\u00a0.transfer() This is the modern Solidity best practice, as transfer() hardcodes a 2,300 gas stipend that can fail on smart contract recipients.<\/p>\n<h3>The Full Calculation Flow\u200a\u2014\u200aPutting It All\u00a0Together<\/h3>\n<p>Let\u2019s trace a complete round from start to finish with a realistic example.<\/p>\n<p><strong>Setup:<\/strong><\/p>\n<p>Matching pool: 10\u00a0ETHThree projects: LibraryX, ProtocolY, ToolZ<\/p>\n<p><strong>Contributions received:<\/strong><\/p>\n<p>Project Contributors Amounts (ETH) LibraryX 50 people 0.01 each \u2192 0.5 total ProtocolY 3 people 2, 1, 0.5 \u2192 3.5 total ToolZ 10 people 0.1 each \u2192 1.0\u00a0total<\/p>\n<p><strong>Step 1\u200a\u2014\u200aCalculate QF\u00a0scores:<\/strong><\/p>\n<p><em>LibraryX:<\/em> (50 \u00d7 \u221a0.01)\u00b2 = (50 \u00d7 0.1)\u00b2 = 5\u00b2 =\u00a025<\/p>\n<p><em>ProtocolY:<\/em> (\u221a2 + \u221a1 + \u221a0.5)\u00b2 \u2248 (1.414 + 1 + 0.707)\u00b2 \u2248 3.121\u00b2 \u2248\u00a09.74<\/p>\n<p><em>ToolZ:<\/em> (10 \u00d7 \u221a0.1)\u00b2 = (10 \u00d7 0.316)\u00b2 \u2248 3.16\u00b2 \u2248\u00a09.99<\/p>\n<p><strong>Step 2\u200a\u2014\u200aCalculate alpha (total QF score \u2248 44.73, total direct = 5 ETH, pool = 10\u00a0ETH):<\/strong><\/p>\n<p>\u03b1 = (10 \u2212 5) \/ (44.73 \u2212 5) \u2248 5 \/ 39.73 \u2248 0.1259<\/p>\n<p><strong>Step 3\u200a\u2014\u200aApply CQF\u00a0formula:<\/strong><\/p>\n<p><em>LibraryX:<\/em> 0.1259 \u00d7 25 + (1 \u2212 0.1259) \u00d7 0.5 \u2248 3.15 + 0.44 \u2248 3.59\u00a0ETH<\/p>\n<p><em>ProtocolY:<\/em> 0.1259 \u00d7 9.74 + 0.8741 \u00d7 3.5 \u2248 1.23 + 3.06 \u2248 4.29\u00a0ETH<\/p>\n<p><em>ToolZ:<\/em> 0.1259 \u00d7 9.99 + 0.8741 \u00d7 1.0 \u2248 1.26 + 0.87 \u2248 2.13\u00a0ETH<\/p>\n<p><strong>Total distributed: 3.59 + 4.29 + 2.13 \u2248 10.01 ETH<\/strong> (rounding accounts for tiny discrepancy)<\/p>\n<p><strong>The key takeaway: LibraryX<\/strong>, despite having only 0.5 ETH in direct donations, the least of the three, receives the <em>most<\/em> matching because 50 people showed up for it. ProtocolY raised 7\u00d7 more in direct donations, yet LibraryX wins the community signal contest. This is QF functioning as designed.<\/p>\n<h3>Bonus Mechanism\u200a\u2014\u200aAssurance Contracts<\/h3>\n<p>One extension worth noting, especially relevant for high-fixed-cost public goods like infrastructure, is the <em>assurance contract<\/em> model (sometimes called \u201cdominant assurance contracts\u201d).<\/p>\n<p><strong>The problem<\/strong>: a project with a $100K fixed cost must raise the full amount to launch. Under standard QF, contributions might trickle in, but if only $40K is raised, the project can\u2019t launch, and all contributors want their money back. This coordination failure discourages early contributions.<\/p>\n<p><strong>The solution:<\/strong> all-or-nothing thresholds. Contributions are held in escrow until a funding target is met. If the target is hit within the round, contributions are released and matching flows. If not, everyone is refunded.<\/p>\n<p>This could be implemented in the contract by adding a minimumFundingThreshold to the Project struct and modifying withdrawProjectFunds() to check whether the threshold was reached before releasing funds.<\/p>\n<h3>Why This Matters Beyond\u00a0Web3<\/h3>\n<p>Quadratic Funding is not merely a DeFi mechanism. It\u2019s a proposal for a fundamentally different relationship between communities, resources, and public goods. one\u00a0where:<\/p>\n<p>A developer in <strong>Lagos<\/strong> building open infrastructure for Nigeria can receive meaningful funding if their community shows up, regardless of whether Silicon Valley VCs understand the\u00a0problem.Minority communities with intense needs can outcompete majority interests with mild preferences.The system is mathematically neutral and non-authoritarian: the algorithm allocates based on revealed community preference, not committee decisions or donor politics.<\/p>\n<p>Gitcoin Grants has run over 20 rounds using QF, distributing over $60M to open-source developers. The experiments have been messy, Sybil resistance remains imperfect, round design is an art as much as a science, but the fundamental insight holds: <strong>a community of small contributors can and should unlock more than a single large\u00a0patron.<\/strong><\/p>\n<h3>Conclusion<\/h3>\n<p>Quadratic Funding takes a beautiful mathematical insight, that the square root compresses the influence of wealth while preserving signals of preference intensity, and constructs from it a complete system for democratically allocating shared resources to public\u00a0goods.<\/p>\n<p>The formula F\u209a = (\u03a3\u221ac\u1d62)\u00b2 is simple to write but rich in implications. It rewards breadth over depth. It amplifies community consensus. It punishes concentrated wealth. And, when constrained to a real budget via the CQF alpha parameter, it remains mathematically solvent while preserving its democratic character.<\/p>\n<p>Building it in Solidity requires confronting concrete engineering challenges: integer-only arithmetic demands fixed-point precision scaling; Sybil resistance requires external identity infrastructure wired through a clean interface; capital constraints require a careful alpha calculation; and the 24KB bytecode limit demands architectural discipline.<\/p>\n<p>The full implementation is available at <a href=\"http:\/\/github.com\/damboy0\/Quadratic-Fund\">github.com\/damboy0\/Quadratic-Fund<\/a>. Explore the src\/QF.sol file alongside this article to see theory become\u00a0code.<\/p>\n<p>Public goods are chronically underfunded, not because people don\u2019t care about them, but because the systems we use to fund them don\u2019t capture how much people care. Quadratic Funding is a genuine attempt to fix that, one square root at a\u00a0time.<\/p>\n<h3>References<\/h3>\n<p>Buterin, V., Hitzig, Z., &amp; Weyl, E. G. (2018). <em>Liberal Radicalism: A Flexible Design for Philanthropic Matching Funds.<\/em> Available at SSRN: <a href=\"https:\/\/ssrn.com\/abstract=3243656\">https:\/\/ssrn.com\/abstract=3243656<\/a>Newbery, E. (2024). <em>Quadratic Funding &amp; Project Choice.<\/em> Master\u2019s Thesis: <a href=\"https:\/\/thesis.dial.uclouvain.be\/bitstreams\/5d51729c-e350-4fc2-a3f5-12c70fa80d13\/download\">https:\/\/thesis.dial.uclouvain.be\/bitstreams\/5d51729c-e350-4fc2-a3f5-12c70fa80d13\/download<\/a>Gitcoin Grants: <a href=\"http:\/\/gitcoin.co\/grants\">gitcoin.co\/grants<\/a>\u200a\u2014\u200athe primary real-world application of QF for open-source software.WTF is QF?: <a href=\"http:\/\/wtfisqf.com\/\">wtfisqf.com<\/a>\u200a\u2014\u200aan interactive simulator for visualising matching\u00a0impacts.EIP-170: Contract code size limit\u200a\u2014\u200aEthereum Improvement Proposal that established the 24KB deployment ceiling: <a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-170\">https:\/\/eips.ethereum.org\/EIPS\/eip-170<\/a><\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/quadratic-funding-the-mathematics-behind-fair-public-goods-financing-ae3ac085ceb3\">Quadratic Funding: The Mathematics Behind Fair Public Goods Financing<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve ever donated on Gitcoin, you\u2019ve participated in a Quadratic Funding (QF) round, perhaps without fully understanding why your $1 donation sometimes unlocked ten times that amount in matching funds, while a whale\u2019s $10,000 donation barely moved the needle. That asymmetry isn\u2019t a bug. It\u2019s the entire\u00a0point. This article unpacks QF from first principles: [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":166201,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-166200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/166200"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166200"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/166200\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/media\/166201"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}