A BCH-native covenant operating layer for treasuries, streams, payments, distributions, and governance.
FlowGuard combines CashScript covenants, wallet-driven signing, backend transaction builders, and indexed activity views. Teams can run treasury logic on chain without giving custody to an application server.
- Multi-member treasury vaults with policy controls, proposal workflows, and activity tracking.
- Contract-backed stream families: linear, cliffed linear, hybrid, recurring, refillable recurring, milestone, and tranche schedules.
- One-time payments and recurring payout flows.
- Airdrops, rewards, bounties, and grants backed by on-chain contract logic.
- Governance proposals and vote-lock infrastructure tied to treasury operations.
- Personal and organization workspace surfaces in the frontend.
FlowGuard does not treat every schedule as the same thing under the hood. The current covenant set covers:
- Linear vesting
- Linear vesting with a cliff
- Hybrid schedules with an upfront unlock and linear tail
- Fixed-cadence recurring schedules
- Refillable recurring schedules
- Milestone-based step schedules
- Bounded custom tranche schedules
The frontend includes a shape gallery, schedule previews, row-level batch charts, batch history, treasury-linked activity feeds, and personal or organization launch flows for the same shared stream builders.
frontend/: React + Vite application for the public site, personal workspace, and organization workspace.backend/: Express + TypeScript API for transaction building, app state, indexing hooks, and execution services.contracts/: CashScript covenant source and compiled artifacts for treasury, streaming, distribution, and governance modules.sdk/:@flowguardlabs/sdk, the TypeScript client for building on FlowGuard from your own frontend or backend.docs/: Mintlify documentation (concepts, guides, API reference, app guide).deploy/: production topology for the VPS — Docker Compose, Caddy, and whatbackend/.envmust contain.
Users keep control of signing throughout:
- The frontend collects configuration and requests a transaction build.
- The backend assembles a contract-aware unsigned transaction descriptor.
- The user signs in a BCH wallet.
- The signed transaction broadcasts to the Bitcoin Cash network.
- The app observes the resulting contract state and updates activity views.
pnpm installcd contracts
pnpm run buildcd backend
cp .env.example .env
pnpm devcd frontend
pnpm devOpen http://localhost:5173.
Key values in backend/.env:
PORTBCH_NETWORK=chipnet|mainnetDATABASE_URL: Postgres connection string (Supabase or self-hosted).CHAINGRAPH_URL: optional, enables richer chain indexing.CORS_ALLOWED_ORIGINS: comma-separated list of allowed frontend origins.REDIS_URL: optional, enables Redis-backed nonce store for multi-replica auth. Falls back to in-memory if unset.ADMIN_EXPORT_TOKEN: optional, enables/api/admin/export(redacts private-key columns).- Authority and fee-payer values used by specific product flows when enabled.
VITE_BCH_NETWORK=chipnet|mainnet: baked in at build time. Must match the backend'sBCH_NETWORK— neither side reads the network at runtime, so a mismatch is silent and the first symptom is a wallet prompt for a transaction that cannot confirm. Check withnode scripts/check-network-agreement.mjs.VITE_WALLETCONNECT_PROJECT_ID: required for the WalletConnect and Cashonize connectors. Without it those wallets fail at connect time.VITE_ENABLE_WIZARDCONNECT,VITE_ENABLE_OPTN: opt-in wallet connectors, default off.
There is no API base URL variable. The frontend calls the relative path /api, proxied
by Vite in development and by a Cloudflare Worker in production, which keeps browser
requests same-origin and avoids CORS.
The repo also includes an indexer service under backend/indexer/ that reconstructs covenant state from the BCH chain into queryable views.
pnpm buildOr per workspace:
cd contracts && pnpm run build
cd backend && pnpm build
cd frontend && pnpm buildLocal verification paths:
cd contracts && pnpm run check
cd contracts && pnpm run test:unit
cd contracts && pnpm run test:streaming- Frontend:
frontend/distserved by a Cloudflare Worker, which also proxies/apito the backend.cd frontend && pnpm deploy. - Backend API and indexer: Docker Compose on a VPS behind Caddy, with Postgres on
Supabase. Topology and the full
backend/.envkey list are indeploy/. - Contracts: compiled locally, artifacts committed, consumed by the backend and tests.
- Docs: Mintlify under
docs/.
FlowGuard is live on BCH Mainnet. Contracts were reviewed internally before launch. A third-party audit is on the roadmap.
- Product docs:
docs/ - Public docs site: docs.flowguard.cash
FlowGuard is on BCH Mainnet. The core contract-backed flows — treasury, streaming, distributions, and governance — are live. FT (CashToken) mode is implemented and written end to end; testing on mainnet with a real token category is the next step before treating it as stable.
MIT. See LICENSE.