SPL Governance Tutorial: Master It Step by Step.

Here's the deal: SPL Governance is your go to for running DAOs on Solana without the headache. It's this program from Solana Labs that lets you set up voting, proposals, and multisig stuff super easily. Think of it as turning your token holders into a decision making crew. You wanna master it? I'll walk you through it like we're grabbing coffee and I'm showing you my screen.

So, SPL Governance basically powers DAOs by letting people propose actions-like transferring funds from the treasury, minting more tokens, or upgrading smart contracts-and then vote on 'em. It's all on chain, no trust needed. The cool part? It handles two voter groups: community (your big token holders) and council (maybe a small trusted group). Community mint gets locked in at creation, can't change it later unless you hack on plugins like VSR for fancier voting.

In my experience, most folks start with the UI at app.realms.today-just tack on ?cluster=devnet if you're testing. No coding required at first. But yeah, it gets deeper with accounts like Realms (your DAO hub), Governances (voting rules per asset), Proposals (the votes themselves), and that native treasury wallet for SOL funds. Why does this matter? 'Cause one wrong setup and your DAO's stuck.

Get your wallet and tokens ready-don't skip this

Look, before anything, you need a Solana wallet like Phantom or Backpack. Fund it with like 0.5 SOL on mainnet, way less on devnet (grab airdrops there). Now, the big one: your governance token. SPL Governance needs an SPL token for voting power-holders lock 'em up to vote.

I usually just create one quick. Install Solana CLI if you haven't: sh -c "$(curl -sSfL https://release.solana.com/stable/install)". Set to devnet with solana config set --url https://api.devnet.solana.com. Airdrop SOL: solana airdrop 2.

Now mint your token. Run spl token create token-it spits out a mint address like 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU. Mint some to yourself: spl token mint YOURMINT 1000. Boom, you got 1000 tokens. Revoke mint authority later? spl token authorize YOURMINT mint --disable. That's best practice-stops inflation surprises.

Pro tip on tokens

  1. Make decimals match your vibe, like 9 for USDC style.
  2. Test transfers: spl token transfer YOURMINT 10 DESTWALLET.
  3. Potential issue: Wrong cluster? Transactions fail silently. Double check with solana config get.

Sound familiar? Yeah, it's like any SPL token, but this one's your vote fuel.

Create your first Realm-that's your DAO home

  • Hit app.realms.today, connect wallet.
  • Click "Create Realm". Pick your community mint from above.
  • Add council mint? Optional, but do it for trusted votes-create another token quick if needed.
  • Name it, like "MyTestDAO". Authority? Your wallet for now.
  • Vote thresholds: Set community yes vote % to 60%, council to 75%. Min for quorum, say 10% of supply.

And hit create. Gas? Tiny, like 0.001 SOL. Boom, Realm address pops up. That's your DAO's top account. It holds config like who can make new Governances. In my experience, mess up thresholds early and proposals flop-test on devnet.

What's a Realm authority? It's the signer needed for big changes. Don't use the native treasury for everything; it's not best practice. Use it for treasuries yeah, but delegate mints and such carefully.

Now, Governances-where the rules live

Okay, Realms group Governances. Each one governs something-like your token mint, a program, or whatever. Head to your Realm in the UI, "Create Governance".

Pick what to govern: Say, your DAO's SOL treasury. It makes a PDA wallet seeded by the Governance address-holds native SOL. Gas for creation: ~0.002 SOL. Configs here: Proposal cooldown 1 day, voting time 3 days, tipping enabled? Yeah, ends early if obvious win. Veto allowed for community? Handy.

Governance TypeWhat it doesWhen to use
Mint Gov (deprecated but UI uses it)Controls token supplyDAO token upgrades
Program GovUpgrades on chain programsYour DAO's contracts
Token GovManages token accountsTreasury tokens

Deprecated? Yeah, but UI leans on 'em. Create one, note the governance_seed-it's just a pubkey for PDA magic. Problem? If your Realm authority ain't signed right, fails. Fix: Use UI, it handles.

Proposals: The fun part, voting time

Here's where it gets real. In a Governance, "Create Proposal". Give it a name like "Fund dev work", description, pick voters: community or council.

Options? Default yes/no, or add more like "Yes 50k", "No wait". Now instructions- the meat. UI lets you build transactions: Transfer 1 SOL from treasury to a dev wallet? Select "Transfer SOL", input amount 1, dest address. Or mint 10k tokens. Multiple? Group into atomic txns.

Deposits: Needs ~0.05 SOL deposit per proposal, refunded post vote. Scales with active ones to stop spam.

Step by step proposal flow

  1. Draft: Creator adds signatories (you + 2 others?).
  2. Call AddSignatory in UI-each signs off.
  3. SignOff: All signed? Insert transactions now.
  4. Voting: Open votes. Yes/No/Abstain/Deny. Weights from locked tokens.
  5. Finalizing: Hits threshold? Succeeded. Execute after hold up (say 1 day).

Short one: Votes tie? Counts as No. Veto? Community can kill council props if enabled. I usually set hold up to 1-2 days-lets folks react.

Issue: Can't vote? Lock tokens first. In UI, "Deposit & Lock" your governance tokens into a Token Owner Record. That's your voting weight. Unlocks post active votes drop to zero.

Voting deep dive-don't mess this up

So, to vote: Own tokens of the governing mint. UI auto creates Token Owner Record (tracks locks) and Vote Record (per proposal). Lock say 100 tokens for weight. Vote Yes on option 0-boom, VoteRecord made.

Power calc? Straight token amount locked, unless VSR plugin for time weighted. Why lock? Prevents selling post vote. In my experience, newbies forget-votes fail, frustration city.

Voting states: Proposal must be in Voting state. Anyone with weight votes till end or tip. Finalize checks: Yes > Deny by threshold? Pass. ExecuteTransaction runs instructions-governance signs as authority.

Abstain? Counts toward quorum sometimes. Tie? No. Community veto threshold? Set low, like 30% to override council.

Execute and wrap proposals

Proposal Succeeded? Wait hold up time (governance min + proposal's own). Then "Execute". UI does it, or CLI if fancy. Gas ~0.0005 SOL. Treasury transfers? Native SOL from PDA wallet, or SPL tokens if governed.

Canceled? Only in Draft or SigningOff. Refund deposit auto in UI. Active proposals block full unlocks-wait it out.

Troubleshooting the crap that goes wrong

Honestly, half my time fixing these.

  • Proposal stuck in SigningOff: Missing sig? Add more or creator signs to Voting.
  • Low gas errors: Solana's cheap, but priority fees help-UI has toggle, ~0.0001 SOL extra.
  • Can't create Governance: Not enough power? Check Realm config-needs council token or community min.
  • Tokens not unlocking: Active votes? Finalize all proposals first.
  • Mainnet scare: Always devnet test. Switch clusters easy.

One time, I forgot to sign as Realm authority-whole DAO bricked for an hour. Laugh now, cry then.

Advanced: Plugins and custom stuff

Once comfy, VSR plugin. Locks with deposit/withdraw for quadratic voting or time boosts. UI supports. Change community mint post creation? VSR hacks it.

Own deploy? Clone repo, Anchor build, deploy to custom program ID. PR to Realms UI for recognition. SDK? Typescript from Oyster repo-integrate to your dApp.

Your first full DAO in 10 mins

  1. Mint token (2 mins).
  2. Create Realm (1 min).
  3. Governance for treasury (2 mins).
  4. Proposal: Transfer 0.1 SOL to yourself as "test" (3 mins).
  5. Lock tokens, vote Yes (1 min).
  6. Execute (wait, then 1 min).

That's it. Scale to real: Add council, multiple Governances (one per treasury token, one per program). Gas totals? Under 0.01 SOL easy.