A decentralized media distribution and royalty management platform for the music industry. Features peer-to-peer music distribution with zero-knowledge royalty verification built on the BTTC (BitTorrent Chain) blockchain.
- Frontend: React + TypeScript + Vite + Tailwind CSS + Shadcn UI (in
apps/web-client/) - Backend: Rust/Axum API server (in
apps/api-server/) — not currently running as a workflow - WASM Frontend: Rust/Yew alternative frontend (in
apps/wasm-frontend/) - Smart Contracts: Solidity via Foundry (in
libs/contracts/) - Shared Libs: Rust shared code, ZK circuits (in
libs/)
- Workflow: "Start application" runs
npm run dev→ Vite serves the React frontend on port 5000 - Host:
0.0.0.0withallowedHosts: truefor Replit proxy compatibility
- React 18, TypeScript, Vite 8, Tailwind CSS, Shadcn UI
- React Router v6, TanStack Query, Framer Motion, Recharts
- Rust workspace (Cargo), Axum, Tokio
- BTTC/BTFS blockchain integration
- Zero-knowledge proofs (arkworks Groth16/BN254)
- DDEX ERN 4.1, CWR compliance protocols
- Frontend: npm with
--legacy-peer-depsflag (due to Vite 8 peer dependency constraints) - Backend/Rust: Cargo workspace
- Rate limiting: Per-IP sliding-window middleware — 120/min general, 10/min auth, 5/min upload; IP from X-Real-IP / X-Forwarded-For
- Wallet auth: Challenge-response authentication (
GET /api/auth/challenge/:addr,POST /api/auth/verify) — EIP-191 ECDSA, 24h JWT, single-use nonces - LMDB persistence: All five stores (KYC, moderation, privacy, takedown, ZK cache) backed by heed 0.20 LMDB — survive restarts
- Per-user auth guards: KYC and privacy endpoints enforce
JWT sub == uid— 403 on mismatch - BTFS API key:
X-API-Keyheader on all BTFS requests whenBTFS_API_KEYenv var is set - BTFS TLS: HTTP blocked in production (
RETROSYNC_ENV=production) — requires HTTPS reverse proxy - NCMEC CyberTipline: CSAM reports auto-submit to NCMEC API (18 U.S.C. §2258A); gated on
NCMEC_API_KEY - JWT extractor:
auth::extract_callerdecodes Bearer JWT, checks expiry, returns wallet address - CORS: Locked to
ALLOWED_ORIGINSenv var - Upload cap: 100MB hard limit (
MAX_AUDIO_BYTESenv var) - DDEX: XML escaping on all user inputs
- Moderation IDs: Cryptographically random (OS entropy)
SoulboundNFT.sol— ERC-5192 soulbound token (non-transferable). One token per track, stores ISRC, BTFS CID, band, and all contributor wallet addresses, IPI numbers, roles, and basis-point splits. Deterministic token ID =keccak256(bytes(isrc)). Minted only by PublishingAgreement. Burned by admin on DMCA takedown.PublishingAgreement.sol— Multi-party on-chain publishing contract. Admin proposes an agreement; each songwriter/publisher signs from their own wallet. Once all parties have signed, the soulbound NFT is minted automatically. EmitsAgreementFullySigned+SoulboundMintedevents for the backend to trigger DDEX.RoyaltyDistributor.sol— Distributes BTT royalties with ZK split proof verification.ZKVerifier.sol— On-chain Groth16 verifier for the royalty split circuit (3 public inputs: band, bps_sum, split_commitment).MockBTT.sol— ERC-20 test token (owner-restricted mint).
persist.rs— generic LMDB store (put/get/append/update/delete)rate_limit.rs— per-IP sliding-window rate limiter middlewarewallet_auth.rs— challenge issuance, ECDSA verify, JWT issuanceauth.rs— Zero Trust middleware +extract_callerhelperkyc.rs— KYC/AML with LMDB + per-user guardmoderation.rs— DSA content queue with LMDB + NCMEC CyberTipline reportingprivacy.rs— GDPR/CCPA with LMDB + per-user guardtakedown.rs— DMCA §512 with LMDBzk_cache.rs— ZK proof cache with LMDBbtfs.rs— BTFS upload/pin with API key auth + TLS enforcementpublishing.rs—POST /api/register: validates all contributors' KYC, stores publishing agreement, delivers to DDEX ERN 4.1 with full IPI + wallet attribution; soulbound NFT minted on-chain once all parties sign
- User fills MetadataUpload form: title, ISRC, audio file, contributors (wallet, IPI, role, bps splits summing to 10,000)
- Frontend POSTs audio as multipart to
POST /api/upload→ BTFS upload, BTTC distribution, DDEX registration, mirrors push. Returnscid,band. - Frontend POSTs JSON to
POST /api/register→ KYC-checks all contributors, logs publishing agreement, delivers full ERN 4.1 XML with contributor IPI/wallet attribution to DDEX sandbox. - On-chain: Backend (or deployer) calls
PublishingAgreement.propose(isrc, cid, band, wallets[], ipis[], roles[], bps[]). - Each party calls
PublishingAgreement.sign(agreementId)from their wallet (via frontend or direct tx). When the last party signs,SoulboundNFT.mint()fires automatically. - Soulbound NFT permanently records creative attribution on-chain (ISRC, BTFS CID, all IPI numbers, wallet addresses, royalty splits).
- Target: Static site
- Build:
npm run build - Public dir:
dist