X/Twitter's native creator payouts are:
- Opaque: No visibility into how payments are calculated
- Slow: Weekly/monthly settlements with arbitrary thresholds
- Restrictive: Only available to verified creators in select countries
- Centralized: X controls everything—rates, eligibility, timing
CraftPay is a trustless payment protocol that:
- Tracks X engagement in real-time via X API v2
- Calculates payouts using transparent, on-chain rates
- Enables instant settlement via shareable Payment Links
- Uses MNEE stablecoin (USD-pegged, 18 decimals) on Ethereum mainnet
No intermediaries. No custody. No waiting.
sequenceDiagram
participant Brand
participant CraftPay
participant X API
participant Smart Contract
participant Creator
Brand->>CraftPay: Create Campaign
Brand->>Smart Contract: Deposit MNEE to Escrow
Creator->>CraftPay: Link Tweet URLs
CraftPay->>X API: Fetch Engagement Metrics
X API-->>CraftPay: Likes, Retweets, Replies, Quotes
CraftPay->>CraftPay: Calculate MNEE Owed
CraftPay->>Brand: Generate Payment QR Code
Brand->>Smart Contract: Scan QR → Sign sponsorRelease()
Smart Contract->>Creator: Transfer MNEE from Escrow
| Feature | Description |
|---|---|
| Real-time Metrics | Live X API v2 integration for likes, retweets, replies, quotes |
| Payment Links | Shareable URLs for instant sponsor-to-creator payments |
| Escrow Deposits | Brands lock MNEE in smart contract before campaigns |
| Direct MNEE Transfer | One-click payment with preset amounts ($1, $5, $25, $100) |
| Transparent Rates | Fixed per-engagement rates, fully auditable |
| On-chain Verification | Every transaction on Etherscan |
| Engagement Type | MNEE per Action | USD Equivalent |
|---|---|---|
| Like ❤️ | 0.001 MNEE | $0.001 |
| Retweet 🔁 | 0.005 MNEE | $0.005 |
| Reply 💬 | 0.003 MNEE | $0.003 |
| Quote Tweet 📝 | 0.010 MNEE | $0.010 |
Example: A tweet with 1,000 likes + 100 retweets = 1.50 MNEE ($1.50)
Deployed on Ethereum Mainnet:
| Contract | Address | Etherscan |
|---|---|---|
| MNEE Token | 0x8ccedbAe4916b79da7F3F612EfB2EB93A2bFD6cF |
View |
| CreatorPayoutPool | 0x59E386DD3C1A369e5189DC928D679Fa036845209 |
View |
// Brand deposits MNEE into campaign escrow
function depositForCampaign(bytes32 campaignId, uint256 amount, string metadata)
// Brand releases funds to creator via QR code (trustless)
function sponsorRelease(bytes32 campaignId, address creator, uint256 amount)
// Check campaign balance
function campaignBalance(bytes32 campaignId) view returns (uint256)| Layer | Technology |
|---|---|
| Smart Contracts | Solidity 0.8.20, Foundry, OpenZeppelin |
| Backend | Node.js, Express, TypeScript, Prisma, PostgreSQL |
| Frontend | Next.js 14, React, TailwindCSS, shadcn/ui |
| Blockchain | Ethereum Mainnet, wagmi, viem |
| APIs | X API v2, WalletConnect |
- Node.js 18+
- PostgreSQL (or Neon serverless)
- X API Bearer Token (developer.x.com)
- Ethereum wallet with ETH for gas
# Clone
git clone https://github.com/N-45div/Craftpay.git
cd Craftpay
# Backend
cd backend
npm install
cp .env.example .env
# Edit .env: DATABASE_URL, X_BEARER_TOKEN
npx prisma db push
npm run dev
# Frontend (new terminal)
cd frontend
npm install
npm run devBackend (.env):
DATABASE_URL=postgresql://...
X_BEARER_TOKEN=AAAA...
MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/...
PAYOUT_POOL_ADDRESS=0x59E386DD3C1A369e5189DC928D679Fa036845209
MNEE_TOKEN_ADDRESS=0x8ccedbAe4916b79da7F3F612EfB2EB93A2bFD6cFFrontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:8080
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=...
NEXT_PUBLIC_PAYOUT_POOL_ADDRESS=0x59E386DD3C1A369e5189DC928D679Fa036845209- Go to X Campaigns → Click Create Campaign
- Enter brand/sponsor name
- Click Add Tweet → Paste any X/Twitter URL
- Example:
https://x.com/elonmusk/status/1234567890
- Click Refresh Metrics or Load Demo Data for testing
- Real-time engagement data from X API
- Click Get Payment Link → Copies shareable URL
- Share with sponsor via Twitter DM, email, etc.
- Sponsor opens payment link
- Connects wallet → Picks amount ($1, $5, $25, $100 or custom)
- Clicks Pay → Signs transaction
- Creator receives MNEE instantly! 🎉
- Click View on Etherscan
- Transaction is publicly verifiable
| vs X Creator Payouts | CraftPay |
|---|---|
| Opaque rates | Transparent, on-chain rates |
| Weekly/monthly settlement | Instant |
| Country restrictions | Global |
| Centralized control | Trustless smart contracts |
| Arbitrary eligibility | Anyone can participate |
craftpay/
├── contracts/ # Foundry smart contracts
│ ├── contracts/ # Solidity source
│ ├── script/ # Deployment scripts
│ └── test/ # Contract tests
├── backend/ # Express API server
│ ├── src/routes/ # API endpoints
│ └── prisma/ # Database schema
├── frontend/ # Next.js 14 app
│ ├── src/app/ # App router pages
│ └── src/components/ # React components
└── ARCHITECTURE.md # System design docs
MIT License - see LICENSE for details.
Built for: MNEE Hackathon - Programmable Money for Agents, Commerce, and Automated Finance
Category: Creator Payments / Social Commerce
Key Innovations:
- First X engagement → crypto payment protocol
- Shareable Payment Links for frictionless sponsor payments
- Direct MNEE transfers with preset amounts ($1, $5, $25, $100)
- Real MNEE (18 decimals) on Ethereum mainnet (not testnet)
CraftPay - Turn X engagement into MNEE
Made with ❤️ for the MNEE Hackathon