On-chain programs powering the Spiral protocol
Decentralized governance, film registration and long-term audiovisual preservation on Solana.
Spiral is a decentralized protocol focused on the preservation of audiovisual works through cryptographic guarantees, on-chain governance, and incentive-aligned storage.
This repository contains the core Anchor programs that define Spiral’s on-chain logic.
Organization ──┐
├──▶ Film (Token-2022 NFTs)
│
└──▶ Preservation (Storage Deals)
Each program is:
- Independently deployable
- Explicitly permissioned
- Designed for CPI-based interoperability
Purpose
Manages organizations, members, and permissions across the Spiral ecosystem.
Highlights
- Deterministic organization & member PDAs
- Role-based access control (
Admin,Uploader) - Cross-program authorization
- On-chain counters (members, films)
Purpose
Registers audiovisual works as Token-2022 NFTs, optimized for long-term metadata preservation.
Highlights
- Token-2022 NFTs (supply = 1)
- Metadata Pointer + Metadata Interface
- Custom on-chain fields:
organization_keyfile_hashinclusion_date
- Controlled mint authority
- CPI integration with Organization
Why Token-2022?
- Native extensions
- Reduced reliance on external programs
- Future-proof metadata model
Purpose
Implements a decentralized storage marketplace backed by economic incentives.
Highlights
- Storage provider registration with stake
- Stake locking & slashing
- Film-specific storage deals
- Time-based verification
- Reward distribution
- DAO-compatible treasury flows
Pending ──▶ Active ──▶ Completed
│
└────▶ Slashed
- PDA-based authorities everywhere
- No implicit trust between programs
- Explicit CPI authorization
- Stake-backed guarantees for providers
- Deterministic account derivation
- Strict role enforcement at instruction level
The protocol is fully covered by Anchor-based integration tests, validating both happy paths and failure modes.
tests/
├── organization/
├── film/
└── preservation/
- Organization creation
- Admin and member lifecycle
- Role assignment & revocation
- Permission enforcement
- Cross-organization access protection
- Minting restricted to authorized members
- Film count synchronization with Organization
- Metadata updates and validation
- Burn restrictions and ownership checks
- CPI authorization failures
- SpiralCoin mint initialization
- Storage provider registration
- Stake deposit & top-up
- Deal proposal, acceptance and cancellation
- Time-based deal maturation
- Payment release and stake unlock
- Slashing logic on failed deals
- Partial stake withdrawal
✔ All critical state transitions are validated
✔ Failure paths are explicitly tested
✔ CPI boundaries are enforced and verified
Spiral governance is managed via Realms.
🔗 Spiral DAO (Devnet)
https://app.realms.today/dao/WqRqAoSZvoojkbsSbzS3uAPZt8bpooS5PsLSdZfqdkf?cluster=devnet
| Tool | Version |
|---|---|
| Node.js | ≥ 20 (24 recommended) |
| Rust | ≥ 1.75 |
| Solana CLI | ≥ 3.0 (Agave) |
| Anchor CLI | 0.32.1 |
| Yarn | 1.22.x |
| SPL Token | ≥ 5.x |
yarn installanchor buildanchor test --skip-local-validatorDesigned for:
- Devnet — development & testing
- Mainnet-beta — production
Program IDs are defined explicitly per network.
MIT License.
Spiral is building public infrastructure for the preservation of human audiovisual memory.
Made with 🌀 by spiralhq