Skip to content

Smainer/smainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

214 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Smainer

Decentralized Compute-Sharing Protocol on Starknet

Share your GPU. Earn STRK. Power the future of permissionless compute.

License: MIT Built on Starknet Cairo Next.js Python PRs Welcome


A Web3 compute marketplace built on Starknet where Providers share hardware resources and Demanders pay for compute tasks using ERC-20 tokens — transparently, on-chain, and without intermediaries.

Pull Requests are welcomed. Please see the Contributing Guide before opening a Pull Request.


Index


Architecture

┌─────────────────┐      ┌──────────────────┐      ┌─────────────────┐
│   Frontend      │◄────►│    Relayer       │◄────►│  Provider Node  │
│   (Next.js)     │ REST │  (FastAPI + WS)  │  WS  │  (Python Daemon)│
└────────┬────────┘      └────────┬─────────┘      └─────────────────┘
         │                        │
         │  starknet-react        │  starknet.py
         │                        │
         ▼                        ▼
    ┌─────────────────────────────────────┐
    │         Starknet L2 Network         │
    │  ┌───────────────────────────────┐  │
    │  │  Cairo Smart Contracts        │  │
    │  │  - Provider Registry          │  │
    │  │  - Escrow System              │  │
    │  │  - Proof Verification         │  │
    │  └───────────────────────────────┘  │
    └─────────────────────────────────────┘

Protocol Economics

Fee Structure (15% Total)

On task completion, the smart contract automatically splits payment:

Recipient Share BPS Description
Provider 85% 8500 Base compute payout
Provider (gas subsidy) 3% 300 Rebated to cover Starknet gas costs
Smainer Treasury 12% 1200 Platform maintenance & infrastructure
  • Provider total: 88% of task amount (85% payout + 3% gas subsidy)
  • Treasury total: 12% of task amount
  • All math uses basis points (BPS_DENOMINATOR = 10000) for precision
  • Fee split is enforced on-chain in submit_proof_and_claim — no off-chain calculation

Gas Subsidies

The 3% gas subsidy is automatically added to the provider's payout so providers don't have to pay out-of-pocket to submit proofs. This lowers the barrier to onboarding new compute nodes.

Transparent Pricing (Frontend)

When users submit tasks, the cost estimator shows a full breakdown:

  Compute Cost:                       X STRK
  Smainer Network Fee (15%):          Y STRK
    |-- Treasury (12%):               ...
    |-- Gas Subsidy to Provider (3%): ...
  ──────────────────────────────────────────
  Total:                              Z STRK

Monorepo Structure

Directory Description Stack
contracts/ Starknet smart contracts Cairo, Scarb, OpenZeppelin
backend/ Coordination middleware & provider daemon Python, FastAPI, Redis
frontend/ Web3 dashboard Next.js, starknet-react, shadcn/ui
telegram/ Telegram bot integration Python, aiogram
desktop/ Windows node onboarding app Tauri v2, Rust, React

Desktop app repository: Smainer/smainer-desktop


Quick Start

# Smart Contracts
cd contracts && scarb build && scarb test

# Backend (Relayer + Provider Node)
cd backend && pip install -e ".[dev]" && pytest

# Frontend
cd frontend && npm install && npm run dev

# Telegram Bot
cd telegram && pip install -e ".[dev]"

Note: The relayer service runs on port 8000 by default, with automatic fallback to 8001 if occupied. The relayer endpoint is fully configurable via RELAYER_API_URL environment variable for both security and operational flexibility.


Documentation

Document Description
DEEP_DIVE.md Detailed architecture and implementation status
REPO_VISION_PUBLIC_RELAYER.md Public relayer and open-source boundary vision
docs/PAYMENT_SYSTEM.md Payment, escrow, settlement, and fee model
docs/architecture/00-overview.md Architecture overview and component map
docs/architecture/05-settlement-system.md Starknet settlement flow and accounting model
docs/architecture/10-trust-assumption.md Public trust assumptions and verification roadmap

Community & Security

Document Description
CONTRIBUTING.md How to contribute changes
SECURITY.md How to report vulnerabilities
CODE_OF_CONDUCT.md Community behavior expectations

License

Released under the MIT License.

About

Decentralized compute on Starknet. No central servers — your prompts run on rented nodes and are never stored. Mine STRK passively, or access privacy-first AI via Telegram

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors