Automated, verifiable payments for open-source contributions
Grainzy is a comprehensive grant execution layer that converts ecosystem funding into automated, verifiable payments for open-source contributions. Built on Stellar Soroban, it ensures transparent, escrow-backed payouts based on real GitHub activity.
Open-source ecosystems face critical challenges:
- β Grant money managed off-chain with no transparency
- β Manual distribution of rewards by maintainers
- β Delayed or subjective contributor payments
- β No verifiable proof of how grants convert to real work
- β Contributors must trust platforms or maintainers for fair payouts
Grainzy bridges ecosystems and contributors with an automated, on-chain execution layer:
- β Escrow-first: Funds locked in smart contracts before work begins
- β Automated payouts: Triggered by verified GitHub activity
- β Transparent impact: Every payment is verifiable on-chain
- β GitHub-native: Works with existing workflows
- β Privacy-safe: KYC handled off-chain
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Ecosystem ββββββΆβ Program Escrow ββββββΆβ Project β
β (Stellar) β β (Contract) β β Maintainer β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β Fund (XLM/tokens) β Allocate funds β Create issues
ββββββββββββββββββββββββΆββββββββββββββββββββββββΆβββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Grainzy Backend β
β β’ GitHub webhook integration β’ Scoring engine β
β β’ Off-chain verification β’ KYC management β
β β’ Payout orchestration β’ Auditing β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Auto-trigger
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bounty Escrow (Contract) β
β β’ Hold individual bounty funds β
β β’ Enforce max claimants β
β β’ Platform fee collection β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Release
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Contributor Wallet β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
grainzy/
βββ packages/
β βββ contracts/ # Soroban smart contracts (Rust)
β β βββ src/
β β β βββ lib.rs # Main exports
β β β βββ grainzy_core.rs # Upgradeable contract
β β β βββ program_escrow.rs # Program-level escrow
β β β βββ bounty_escrow.rs # Individual bounty escrow
β β βββ manifests/ # Machine-readable manifests
β β β βββ grainlify-core-manifest.json
β β β βββ program-escrow-manifest.json
β β β βββ bounty-escrow-manifest.json
β β βββ Cargo.toml
β β βββ scripts/validate-manifests.sh
β βββ ui/ # Shared UI components
βββ apps/
β βββ backend/ # Express.js + TypeScript API
β β βββ src/
β β β βββ models/ # Database models (Prisma)
β β β βββ routes/ # API endpoints
β β β βββ services/ # Business logic
β β β β βββ github.ts # GitHub webhook handler
β β β β βββ scoring.ts # Points calculation
β β β β βββ kyc.ts # KYC orchestration
β β β β βββ payout.ts # Payout execution
β β β βββ middleware/
β β β βββ utils/
β β βββ package.json
β βββ webapp/ # Next.js frontend
β βββ src/
β β βββ app/ # App Router pages
β β βββ components/ # React components
β β β βββ HeroSection.tsx
β β β βββ ProgramList.tsx
β β β βββ HowItWorks.tsx
β β β βββ Navbar.tsx
β β βββ lib/ # Utilities
β β βββ types/ # TypeScript definitions
β βββ package.json
βββ package.json
βββ turbo.json # Turborepo configuration
βββ tsconfig.json
- Node.js 18+
- Rust 1.75+ (for contracts)
- PostgreSQL 14+
- Stellar CLI (for deployment)
# Install all workspaces
npm install
# Or install individually
npm --workspace=@grainzy/backend install
npm --workspace=@grainzy/webapp install# Backend
cd apps/backend
cp .env.example .env
# Fill in your values# Start all services (requires Turborepo)
npm run dev
# Or individually:
npm --workspace=@grainzy/backend run dev # Backend on :3001
npm --workspace=@grainzy/webapp run dev # Frontend on :3000cd packages/contracts
cargo build --target wasm32-unknown-unknown --releasecd packages/contracts
./scripts/validate-manifests.sh- Time-delayed upgrades (default 24h)
- Multisig governance (configurable threshold)
- Immutable upgrade history
- WASM hash verification
- Locks program funds in escrow
- Allocates to projects
- Processes contributor payouts
- Emergency pause functionality
- Per-bounty escrow
- Multi-token support
- Platform fee collection
- Claim approval workflow
- No on-chain identities: Only wallet addresses stored
- Off-chain KYC: Compliance handled separately
- Circuit breakers: Pause contracts during incidents
- Reentrancy protection: All state changes before external calls
- Time-locked upgrades: Prevent rapid malicious updates
Points awarded based on:
- Base points (assigned by maintainer)
- Complexity multiplier (PR size)
- Reputation bonus (contributor history)
- Capped maximum per PR
Formula: FinalPoints = min(Base Γ Complexity Γ Reputation, MAX_PER_PR)
Webhooks received for:
- Issues β Sync bounty point assignments
- Pull Requests β Link to issues, track status
- Reviews β Auto-approval logic
- Pushes β Trigger merge detection
# Deploy upgrade contract first
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/grainzy_contracts.wasm \
--source <admin-keypair> \
--network testnet
# Then deploy Program Escrow
# Then deploy Bounty Escrowcd apps/backend
npm run build
npm startcd apps/webapp
npm run build
# Deploy output folder# Run backend tests
npm --workspace=@grainzy/backend run test
# Run contract tests
npm run contracts:test
# End-to-end simulation (TODO)
npm run test:e2e- Architecture Guide - System design
- API Reference - Backend endpoints
- Contract Interface - Smart contract API
- Deployment Guide - Go-live checklist
- Contributing - Development workflow
We welcome contributions! Please see our Contributing Guide.
- Fork the repository
- Create feature branch:
git checkout -b feat/my-feature - Commit changes:
git commit -am 'Add feature' - Push branch:
git push origin feat/my-feature - Open a Pull Request
MIT License - see LICENSE for details.
- Stellar Development Foundation - Soroban platform
- OnlyDust - Grant coordination inspiration
- Open Source Community - The reason we do this
- Twitter: @grainzy
- Discord: Join our community
- Email: hello@grainzy.org
Built with β€οΈ for open source maintainers and contributors worldwide.