NFT-based access control protocol on Solana
Buy access once as an NFT. Use it. Resell it when you're done.
0KTOPUS transforms API subscriptions and digital access into tradeable NFTs on Solana. Instead of recurring subscriptions, users purchase access NFTs that:
- Track usage - Metered (100 uses), unlimited, or single-use
- Are transferable - Sell unused access on secondary markets
- Split revenue - Automatic payments to multiple recipients
- Work anywhere - Integrate with any API or service
0ktopus2/
├── capability-protocol/ COMPLETE - Solana smart contract
├── capability-frontend/ COMPLETE - MVP web interface
├── access-backend/ PLANNED - Access verification API
├── integration-sdk/ PLANNED - NPM SDK for developers
├── demo-app/ PLANNED - AI image generation demo
└── docs/ COMPLETE - Architecture & specs
Legend:
- COMPLETE - Fully implemented and working
- PLANNED - Specification complete, implementation pending
- IN PROGRESS - Currently being developed
Status: COMPLETE
The core Solana program written in Rust/Anchor.
Features:
- Product registration with customizable access types
- NFT minting with automatic revenue splitting
- Usage tracking (metered/unlimited/single-use)
- Transfer functionality
- Replay attack protection
- TypeScript SDK for blockchain interactions
Tech Stack: Rust, Anchor Framework, Solana
Quick Start:
cd capability-protocol
anchor build
anchor testDocs: See capability-protocol/README.md
Status: COMPLETE
Next.js 14 web application for creating products, minting NFTs, and transferring access.
Features:
- 3-tab interface: Create Products, Mint NFTs, Transfer NFTs
- Wallet integration (Phantom, Solflare, etc.)
- Real-time balance tracking
- Product cards with pricing and access info
- NFT cards with usage bars and status
- 0KTOPUS branding and logo component
- Responsive grid layouts
Tech Stack: Next.js 14, TypeScript, Tailwind CSS, Solana Wallet Adapter
Quick Start:
cd capability-frontend
npm install
npm run devLive at: http://localhost:3000
Docs: See capability-frontend/README.md
Status: PLANNED (Specs complete, implementation pending)
REST/WebSocket API server that allows external applications to verify NFT ownership and consume access uses without directly interacting with the blockchain.
Planned Features:
- POST /api/v1/verify-access - Verify NFT and consume use
- GET /api/v1/check-access/:nftMint - Check access without consuming
- Group management for organizing NFT holders
- Analytics for usage tracking and revenue metrics
- WebSocket support for real-time events
- NFT freezing/unfreezing for moderation
- Rate limiting and caching (Redis)
- PostgreSQL for persistent analytics
Tech Stack: Fastify, PostgreSQL, Redis, Prisma, WebSocket
Current State:
- Complete API specification in
access-backend/docs/BACKEND_SPEC.md - Folder structure created
- package.json with dependencies defined
- Placeholder code with TODO comments
- Implementation pending (Phase 1 - Week 1)
Quick Start (when implemented):
cd access-backend
npm install
cp .env.example .env
npm run devDocs: See access-backend/docs/BACKEND_SPEC.md
Status: PLANNED (Specs complete, implementation pending)
NPM package (@0ktopus/sdk) that allows developers to easily integrate NFT-based access control into their applications.
Planned Features:
- OktopusClient class for REST API calls
- React hooks: useAccess, useGroup, useAnalytics
- Express middleware for protecting API routes
- WebSocket client for real-time events
- TypeScript types and full documentation
- Browser CDN distribution
- Example integrations (Express, Next.js, vanilla JS)
Tech Stack: TypeScript, React, Axios, Rollup
Current State:
- Complete SDK specification in
integration-sdk/docs/INTEGRATION_SPEC.md - NPM package structure created
- Placeholder code with TODO comments
- Examples folder structure
- Implementation pending (Phase 3 - Week 3)
Usage (when published):
npm install @0ktopus/sdkimport { OktopusClient } from '@0ktopus/sdk';
const client = new OktopusClient({
apiKey: 'your-api-key',
endpoint: 'https://api.0ktopus.dev'
});
const result = await client.verifyAccess({
nftMint: 'ABC123...',
requestData: { action: 'api-call' }
});Docs: See integration-sdk/docs/INTEGRATION_SPEC.md
Status: PLANNED (Specs complete, implementation pending)
Live demonstration of 0KTOPUS integration showing an AI image generation API protected by NFT-based access.
Planned Features:
- Next.js frontend for buying NFTs and generating images
- Express backend with NFT-protected endpoints
- Real-time usage tracking
- Integration with @0ktopus/sdk middleware
- Docker Compose setup for full stack
- Example of NFT transfer and resale flow
Tech Stack: Next.js 14, Express, @0ktopus/sdk, Docker
Current State:
- Complete demo specification in
demo-app/docs/DEMO_APP_SPEC.md - Backend folder structure with middleware placeholders
- package.json files defined
- Environment templates created
- Implementation pending (Phase 4 - Week 4)
Quick Start (when implemented):
cd demo-app
docker-compose upLive at (planned): https://demo.0ktopus.dev
Docs: See demo-app/docs/DEMO_APP_SPEC.md
Status: COMPLETE
Files:
ARCHITECTURE_PLAN.md- Overall system architecture and roadmap- Individual component specs in their respective folders:
access-backend/docs/BACKEND_SPEC.mdintegration-sdk/docs/INTEGRATION_SPEC.mddemo-app/docs/DEMO_APP_SPEC.md
For complete deployment instructions (localnet/devnet), see DEPLOYMENT_GUIDE.md
- Node.js 20+
- Rust 1.70+
- Solana CLI 1.18+
- Anchor CLI 0.31+
- A Solana wallet with test SOL
- Deploy Smart Contract - See DEPLOYMENT_GUIDE.md for detailed steps
- Run Frontend -
cd capability-frontend && npm install && npm run dev - Visit
http://localhost:3000
- Create a Product → "Create Products" tab → Fill form → Create
- Mint NFT → "Mint NFTs" tab → Select product → Mint
- Transfer NFT → "Transfer NFTs" tab → Enter recipient → Transfer
Note: Make sure you have SOL in your wallet. Use solana airdrop 2 for test networks.
- Set up Fastify server
- Implement /verify-access endpoint
- Implement /check-access endpoint
- Connect to Solana RPC
- Basic error handling
- Rate limiting
- Database setup (PostgreSQL/Redis)
- Group CRUD operations
- Assign NFTs to groups
- Role-based permissions
- Admin dashboard
- Create npm package structure
- REST client
- React hooks
- TypeScript types
- Documentation
- Publish to npm
- Build AI API service example
- Integrate with access backend
- Show usage tracking
- Show NFT transfer flow
- Deploy live demo
- Add freeze authority to smart contract
- Frontend freeze/unfreeze UI
- Backend freeze state checking
- Emergency freeze functionality
Smart Contract
- Create products with customizable access
- Mint NFTs with revenue splitting
- Track usage on-chain
- Transfer NFTs between wallets
Frontend
- Create products via UI
- Purchase access NFTs
- View NFT details and remaining uses
- Transfer NFTs to other wallets
- Real-time SOL balance updates
Access Backend (API for external apps)
- Verify NFT ownership without blockchain calls
- Consume uses via REST API
- Real-time WebSocket events
- Group management and analytics
Integration SDK (Easy developer integration)
npm install @0ktopus/sdk- React hooks for access verification
- Express middleware for API protection
- Complete TypeScript support
Demo App (Reference implementation)
- AI image generation API
- NFT-gated access
- Usage tracking dashboard
- Live demo deployment
- Smart Contract: Rust, Anchor Framework
- Network: Solana (localhost/devnet/mainnet-beta)
- Framework: Next.js 14
- Language: TypeScript
- Styling: Tailwind CSS
- Wallet: Solana Wallet Adapter
- API: Fastify
- Database: PostgreSQL (Prisma ORM)
- Cache: Redis
- WebSocket: ws / Socket.io
- Language: TypeScript
- Build: tsup
- Testing: Vitest
- Docs: TypeDoc
- Deployment Guide:
DEPLOYMENT_GUIDE.md- Complete deployment instructions for localnet and devnet - Architecture:
ARCHITECTURE_PLAN.md- System overview and roadmap - Smart Contract:
capability-protocol/README.md - Frontend:
capability-frontend/README.md - Access Backend:
access-backend/docs/BACKEND_SPEC.md - Integration SDK:
integration-sdk/docs/INTEGRATION_SPEC.md - Demo App:
demo-app/docs/DEMO_APP_SPEC.md
cd capability-protocol
anchor testcd capability-frontend
npm run buildcd access-backend
npm testFor complete installation instructions and deployment steps, see DEPLOYMENT_GUIDE.md
Required Software:
- Node.js 20+
- Rust 1.70+
- Solana CLI 1.18+
- Anchor CLI 0.31+
- PostgreSQL 15+ (for access backend)
- Redis 7+ (for access backend)
Each component has its own .env.example file:
capability-protocol/.env- Solana RPC endpointsaccess-backend/.env- Database URLs, API keysdemo-app/backend/.env- 0KTOPUS integration keys
This is currently a private project. Contribution guidelines will be added when open-sourced.
MIT (to be determined)
- Website: (Coming soon)
- Documentation: See
docs/folder - Demo: (Coming soon)
- NPM Package:
@0ktopus/sdk(Coming soon)
For issues or questions:
- Check the relevant component's README
- See documentation in
docs/ - Review the architecture plan:
ARCHITECTURE_PLAN.md
Built with ❤️ by the 0KTOPUS Team
Transforming subscriptions into tradeable assets on Solana