FlavorSnap integrates the Stellar network and Soroban smart contracts to decentralize AI food classification governance and incentive systems. This document provides a deep dive into the blockchain layer, its components, and its role within the larger application ecosystem.
- 🚀 Why Blockchain?
- 🏗️ Technical Stack
- ⛓️ Smart Contract Ecosystem
- 🔗 System Integration
- 🧩 Governance Model
- 💰 Tokenomics & Incentivization
- 🔒 Security & Trust Model
Conventional AI classification services suffer from three primary issues:
- Centralization of Accuracy: The service provider alone determines if a classification is correct.
- Incentive Misalignment: Users provide data for training but don't share in the value created.
- Lack of Transparency: Model updates happen "behind closed doors," with no record of validation.
FlavorSnap solves these by decentralizing the verification and governance layers on the Stellar network.
- Network: Stellar (Low-cost, high-speed, environmentally friendly).
- Smart Contract Platform: Soroban (Rust-based, WASM-ready, efficient).
- SDKs: Soroban Rust SDK for contracts, Stellar JS SDK for the frontend.
- Storage: On-chain persistent storage for metadata, balances, and governance state.
A decentralized, verifiable database of food categories and their associated metadata. This acts as the "Source of Truth" for the classification labels used by the ML model.
Ensures that every update to the ResNet18 model used in production is transparently proposed and community-voted.
- Proposal Lifecycle: Submission → Voting Period → Quorum Check → Evaluation → (Optional) Execution.
- Weighting: Voting power is derived from the user's token balance (reputation-weighted).
Provides a programmable reward layer for users who contribute high-quality data or validate classifications.
- Vested Rewards: Long-term contributors receive tokens through vesting schedules.
- Multi-sig Security: Minting and burning tokens require multiple admin signatures.
The "decentralized oracle" of FlavorSnap. Users stake tokens to vouch for classification accuracy (e.g., "Is this really a Pizza?").
- Incentive Loop: Correct evaluators earn tokens; incorrect ones lose their stake.
- Feedback: Results are fed back into the training dataset for future RLHF (Reinforcement Learning from Human Feedback) cycles.
graph TD
subgraph "Frontend (Next.js)"
UI[User UI]
Wallet[Stellar/Freighter Wallet]
end
subgraph "ML API (Flask)"
Inf[Inference Engine]
XAI[Explainable AI]
end
subgraph "Blockchain (Soroban)"
Gov[Model Governance]
Inc[Tokenized Incentive]
Reg[Food Registry]
Sen[Sensory Evaluation]
end
UI -- "Upload Image" --> Inf
Inf -- "Prediction Result" --> UI
UI -- "Sign Verification" --> Wallet
Wallet -- "Submit Evaluation" --> Sen
Sen -- "Reward/Stake" --> Inc
Gov -- "Approve Model Hash" --> Inf
Reg -- "Labels" --> UI
FlavorSnap implements a Liquid Democracy approach (pre-alpha) where:
- Quorum: Proposals require a minimum percentage of total token supply to participate (e.g., 50%).
- Proposer Stake: A minimum amount of tokens must be staked to submit a new model proposal, preventing spam.
- Active Monitoring: Admins can cancel malicious proposals before they are executed.
Tokens are the fuel for the FlavorSnap ecosystem:
| Action | Reward (%) | Unlock Schedule |
|---|---|---|
| Dataset Contribution | 40% | Immediately |
| Verification Staking | 30% | Post-Verification (7 days) |
| Model Improvement | 20% | 6-month Vesting |
| Governance Participation | 10% | Immediately |
- Admin Multisig: No single admin can mint tokens unilaterally. All
MintandBurnactions inTokenizedIncentiveare stored in anAdminApprovalsstate until the threshold is met. - Identity: Users are identified by their Stellar account addresses.
- Transparency: Every state change (token transfer, vote cast, model update) is recorded on the Stellar ledger, auditable via any block explorer.
Last updated: March 2026 For setup instructions, see docs/installation.md.