Skip to content

About

Snowmoon's Graph Funding on Ethereum: money climbs a tree of public goods, and at every fork a committee drawn at random decides the split.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Graph Funding: nobody votes on the whole budget

Site X Status
Ethereum Solidity Foundry License


"For each node on the graph, the cryptographic network randomly selects a committee, that makes the decision of what weights the edges right below that node get."
Snowmoon, chapter 17

Graph Funding is the public-goods funding system from Snowmoon, the novel by Vitalik Buterin, built for real on Ethereum. Trading fees from the $GRAPHFUND token flow into a tree of Ethereum public goods. At every fork of the tree, a small committee drawn at random decides how the money splits. Nobody ever votes on the whole budget.

Note

Not affiliated with Vitalik Buterin. Lore from Snowmoon (GPL v3). Unaudited code, volatile token, no promises.


In one minute

๐Ÿ’ธ Money in ๐ŸŒณ The tree ๐ŸŽฒ The committees
Every $GRAPHFUND trade pays a 2% fee. Half of it is claimed straight into the contract. Four branches, fourteen Ethereum public goods. The money climbs down from the trunk to the leaves. At every fork, five Keepers drawn at random set the split. Every six hours the money moves.

How a decision is made

1 Enlist, 2 Drawn, 3 Vote, 4 Flow

  1. Enlist. Lock at least 100,000 $GRAPHFUND. Your chance of being drawn is your share of everything locked.
  2. Drawn. The hash of a future block picks five Keepers for every fork. Nobody knows who in advance.
  3. Vote. Each Keeper proposes how the money below their fork should split. The median wins, so one bad vote moves nothing, and no share moves more than 5 points per epoch, so no single committee can hijack a fork. Voting mints a soulbound Keeper badge.
  4. Flow. Every six hours the epoch closes and the money climbs down the tree. Keepers who voted on a fork share 2% of what flowed through it.
One epoch, as the contracts see it
flowchart LR
    D["draw()<br/>five Keepers per fork,<br/>weighted by stake"] --> V["vote()<br/>each Keeper sends a split<br/>and gets a soulbound badge"]
    V --> A["advance()<br/>median per fork (max 5 pts a move),<br/>money moves down, 2% to the voters,<br/>next draw requested"]
    A -- "6 hours later" --> D

    classDef step fill:#f3ebdd,stroke:#2b59c3,stroke-width:2px,color:#2b59c3
    classDef hot fill:#ff6b1a,stroke:#ff6b1a,color:#ffffff
    class D,V step
    class A hot
Loading

draw() and advance() can be called by anyone; a small bot calls them on time. Recipients pull their money with payout(address).


Where the money comes from

The market pays 2%, the creator wallet's escrow holds 1%, it is claimed into the tree

$GRAPHFUND trades on Stockereum with a 2% fee: 1% goes to the platform, 1% waits in the creator wallet's escrow. The creator wallet claims it with FeeEscrow.claim(WETH, GraphFund), so it goes from the escrow straight into this contract. Every claim is public on Etherscan. Anyone can also send ETH to the contract.


The graph, at genesis

The genesis tree: four branches and fourteen recipients

The starting weights, before any committee has voted. From the first epoch on, the committees decide, 5 points per epoch at most.

BranchRecipientInside the branchOf every ETHยน
๐Ÿ› ๏ธ Core protocol
40% of the tree
Protocol Guild55%22%
Lighthouse15%6%
Nimbus15%6%
Lodestar15%6%
๐Ÿ•ถ๏ธ Privacy
20% of the tree
Tor Project34%6.8%
Web3Privacy Now33%6.6%
Whonix33%6.6%
๐Ÿ›ก๏ธ Security
20% of the tree
Revoke.cash34%6.8%
SEAL 91133%6.6%
DeFiHackLabs33%6.6%
๐Ÿ“Š Open tooling & data
20% of the tree
L2BEAT25%5%
growthepie25%5%
Otterscan25%5%
rotki25%5%

ยน At genesis. Once Keepers vote, each fork they voted on keeps 2% for them. Each name links to its address on Etherscan.

Important

Recipients, not partners. None of these projects has endorsed Graph Funding. Each address was read from the project's own donation page and checked on-chain: see docs/recipients.md. The tree itself lives in contracts/script/genesis.json.

New projects can join. Anyone can propose a project under a branch with a deposit of 1,000,000 $GRAPHFUND. It enters at 0%, gains at most 5 points per epoch, and only gets money if a committee gives it weight; the deposit comes back the first time it does.


Who can do what

Can Cannot
Keepers Lock $GRAPHFUND, vote on the fork they were drawn for, leave the draw and unlock Unlock while sitting on a committee
Anyone Call draw() and advance(), send ETH, propose a project, trigger payout for a recipient Choose who gets drawn
Owner (until renounced) Edit the tree and the starting weights, change parameters within fixed bounds, reject spam proposals Touch anyone's stake, touch money owed to a project, choose who gets drawn

The owner renounces after 28 epochs (7 days) with committees drawn and no emergency changes.


Contracts

Contract What it does
GraphFund The tree, the epochs (draw โ†’ vote โ†’ advance), the payouts (ETH, or WETH to contracts that refuse ETH) and the proposals
KeeperStaking Lock $GRAPHFUND (minimum 100,000) to enter the draw. Stakes can't change while a draw is pending (minutes; if nobody draws, anyone can end it with draw()), and stay locked while you sit on a committee. To exit: leave() takes you out of every future draw, then unstake as soon as your seat ends
KeeperBadge One soulbound token per epoch you voted in
$GRAPHFUND 1,000,000,000 fixed supply, launched on Stockereum

Addresses go here, and on the site, the moment they are deployed.


Honest limits

  • โš–๏ธ Stake buys seats. Seats are drawn in proportion to what is locked: whoever locks most of the supply wins most seats. The median protects a fork's split only while no one holds three of its five seats, and even a captured committee moves each share at most 5 points per epoch. Every seat and every vote is public.
  • ๐ŸŽฒ Randomness is a future blockhash. Whoever builds that block (a role that can be bought for a single slot) can grind its hash and pick a committee. The 5-point cap is the answer: capturing one committee pays little, and honest committees undo it at the same speed. Verifiable randomness (e.g. a VRF) would close it for good.
  • ๐Ÿ”‘ The fee claim depends on the creator wallet. Claims into the contract are public, but someone has to make them.
  • โ›ฝ One transaction draws every committee. Parameters are bounded (committeeSize ร— maxNodes/2 โ‰ค 120) so the worst case stays well under Ethereum's per-transaction gas cap.
  • ๐Ÿงช Not audited yet. The code is open source and tested.

Roadmap

  • Contracts: staking, the tree, epochs, payouts, proposals, badges
  • Unit and fuzz tests, plus a worst-case gas test
  • Site live at graphfunding.app
  • Mainnet-fork test against the real Stockereum (launch โ†’ trades โ†’ fees โ†’ leaves)
  • Deploy and genesis scripts, the keeper bot and CI
  • Deploy the contracts and launch $GRAPHFUND
  • First epoch, then one every six hours
  • Owner renounces after 28 clean epochs

Inside the repo

contracts/src/        GraphFund, KeeperStaking, KeeperBadge
contracts/test/       unit, fuzz, worst-case gas and mainnet-fork tests
contracts/script/     Deploy, Genesis and genesis.json: the starting tree
ops/keeper/           the keeper bot: calls draw() and advance() on time
.github/workflows/    contract tests on every push + the keeper, every 15 minutes
web/                  graphfunding.app (Vite + TypeScript + viem)
brand/                the X kit, the README header and the image pipeline
docs/recipients.md    where every recipient address comes from

Run it yourself

cd contracts
forge test                                                              # unit + fuzz
FOUNDRY_PROFILE=gas forge test --match-contract GraphFundFixesTest -vv  # worst-case gas, isolated
MAINNET_RPC_URL=<rpc> forge test --match-contract StockereumForkTest -vv # the real Stockereum, on a fork

cd ../web
npm install && npm run dev                                              # the site

Keep the epochs moving

Nobody has to be trusted to move the money: draw() and advance() are open to anyone. This repo runs a small bot on GitHub Actions every 15 minutes (ops/keeper); its wallet only pays gas. Anyone can run another one:

cd ops/keeper && npm install
RPC_URL=<rpc> GRAPHFUND_ADDRESS=<GraphFund> DRY_RUN=1 node keeper.mjs   # prints what it would do; drop DRY_RUN and
                                                                        # set KEEPER_PRIVATE_KEY to send it

Images

The illustrations are risograph prints generated from the book's world; every letter on top of them is HTML with real fonts. Snowmoon's license asks derivative works to publish their pipeline, so the prompts and curation scripts are in brand/pipeline.

License

GPL-3.0, like the book.



Public goods of Veridia

About

Snowmoon's Graph Funding on Ethereum: money climbs a tree of public goods, and at every fork a committee drawn at random decides the split.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages