Creator Economy & Wallets
Relevant source files
The following files were used as context for generating this wiki page:
- src/lib/creator-economy/economy-service.ts
- src/domains/economy/wallet/wallet.ts
- src/lib/creator-economy/routes.ts
- src/lib/creator-economy/persistence/creator-economy-store.ts
- src/domains/economy/revenue/revenue-ledger.ts
- src/domains/economy/types.ts
- server.ts
- src/components/Finance/CattleyaFinanceView.tsx
The Creator Economy and Wallet system provides a programmatic infrastructure for revenue distribution, creator identity management, and financial settlements. It operates as a federated economic engine that handles digital asset sales, gift purchases, and automated revenue splits between creators and the platform ecosystem.
The system uses an append-only ledger architecture to ensure cryptographic auditability of all transactions. It integrates Know Your Customer (KYC) verification and programmatic governance to regulate payouts and marketplace activity, ensuring compliance with territorial fiscal requirements.
Sources: src/lib/creator-economy/economy-service.ts:1-10, server.ts:107-130, src/components/Finance/CattleyaFinanceView.tsx:40-50
Economic Architecture and Revenue Flow
The system processes every financial interaction through a governed pipeline consisting of identity verification, policy evaluation, and ledger recording. Revenue is split programmatically based on predefined percentages to ensure stakeholders receive their shares automatically upon settlement.
Programmatic Revenue Split
Default revenue shares distribute funds across four main categories:
- User/Creator: 50%
- Platform Operations: 35%
- Creator Reward: 10%
- Ecosystem Fund: 5%
Sources: src/domains/economy/types.ts:88-95, src/components/Finance/CattleyaFinanceView.tsx:64-75
Transaction Lifecycle
Economic events transition through specific statuses to maintain financial integrity:
- Pending: The event is recorded but not yet verified.
- Confirmed: The transaction has passed initial policy checks.
- Settled: Funds are moved to the creator's available balance.
- Disputed/Refunded: Governance actions taken against the transaction.
Sources: src/domains/economy/types.ts:106-112, src/domains/economy/revenue/revenue-ledger.ts
The diagram shows the sequence from an economic event trigger to the final audit trail, illustrating how governance gates lead to programmatic splits.
Sources: server.ts:1140-1175, src/lib/creator-economy/economy-service.ts:89-115
Creator Identity and KYC (Know Your Customer)
Creators must maintain a profile that tracks their capabilities, certifications, and reputation. Financial activities like requesting payouts require higher levels of verification.
Verification Levels
| Level | Requirements | Capabilities |
|---|---|---|
| None | Default state | Limited marketplace access |
| Level 1 Basic | Valid RFC submitted | Basic sales and gift reception |
| Level 2 Full | eFirma, CLABE, and Address verified | Full payout and external publishing access |
Sources: src/lib/creator-economy/economy-service.ts:169-188, src/lib/creator-economy/routes.ts:63-88
Reputation Metrics
Reputation is calculated using a 9-factor model that affects the creator's global score and evidence level. Key metrics include:
- Quality Assessment: Based on transaction history and usage.
- Reliability Rate: Successful completion of service/product delivery.
- Security Compliance: Adherence to Zero-Trust protocols.
- Dispute Rate: Frequency of contested transactions.
Sources: src/domains/economy/creators/creator-profile.ts:68-85, src/components/Finance/CattleyaFinanceView.tsx:135-155
Marketplace and Assets
The Marketplace facilitates the exchange of digital assets, including AI agents, cognitive skills, and workflow templates.
Listing Management
Marketplace listings track versioning, provenance, and performance metrics.
- Asset Types: Agents, skills, knowledge packs, datasets, and digital products.
- Listing Statuses: Draft, Active, Paused, Revoked, and Sold Out.
- Provenance: Every asset includes a
contentHashandauditTrailIdto verify its origin.
Sources: src/domains/economy/types.ts:15-30, src/domains/economy/types.ts:65-80, src/lib/creator-economy/economy-service.ts:120-145
Anti-Fraud Gating
The system implements velocity checks to prevent engagement inflation and fraudulent spikes in activity.
- Velocity Spike Factor: A 500% increase (5x) over a baseline triggers a
RISK_HOLD_EVENT. - Daily Purchase Limits: Specific gifts (e.g., "Mina de Plata") have hard daily limits per user.
Sources: src/lib/creator-economy/economy-service.ts:30-50, src/lib/creator-economy/persistence/creator-economy-store.ts:100-115
Wallet and Ledger System
The wallet acts as the interface for creator funds, while the ledger provides the authoritative record of all movements.
Ledger Structure
The ledger is implemented as a double-entry system where debits and credits must balance per transaction.
- Accounts: customer_cash_clearing, creator_payable_pending, creator_payable_available, platform_revenue_gross.
- Invariants: The sum of debits and credits for a specific
transactionIdmust always equal zero.
Sources: src/lib/creator-economy/persistence/creator-economy-store.ts:180-205, src/domains/economy/wallet/wallet.ts
Payout Procedure
- Request: Creator initiates a payout via
/api/v1/economy/wallet/payout. - Gate Check: System verifies balance sufficiency and KYC level 2 status.
- Hold: Funds move from
availabletoclearingstatus. - Completion: Operator marks the payout as paid, updating the ledger with a
disbursementReference.
Sources: src/lib/creator-economy/routes.ts:192-210, server.ts:1115-1135, src/lib/creator-economy/persistence/creator-economy-store.ts:220-240
This diagram illustrates the secure payout request flow involving KYC validation and multi-step ledger updates.
Sources: src/lib/creator-economy/routes.ts:25-50, src/lib/creator-economy/economy-service.ts:160-175, server.ts:1210-1225
Technical Implementation Summary
The implementation relies on a combination of Express routers for API access and SQLite (or in-memory) stores for persistence.
| Feature | Implementation Path | Source File |
|---|---|---|
| Persistence | SQLite with WAL mode | src/lib/creator-economy/persistence/creator-economy-store.ts |
| Fiscal Engine | SAT Deduction & VAT Extraction | src/lib/creator-economy/tax-engine.ts |
| API Endpoints | /api/v1/economy/* | server.ts & src/lib/creator-economy/routes.ts |
| Economic Events | SHA-256 Digest Hashing | src/lib/creator-economy/economy-service.ts |
The CreatorEconomyStore manages 13 primary tables, including ce_profiles, ce_entitlements, and ce_ledger_entries, ensuring that the economy remains persistent and scalable.
Sources: src/lib/creator-economy/persistence/creator-economy-store.ts:60-120, src/lib/creator-economy/index.ts
The Creator Economy & Wallets module establishes a sovereign financial framework within the project, enabling automated monetization while maintaining strict territorial and cryptographic governance.