← Back to Technical Specs

NET LIBRARY SYSTEM TOPOLOGY

Architecture Overview & Data Flow

πŸ’° x402 Relay Funding Flow

πŸ‘€
Farcaster User
Your Wallet
β†’ USDC
πŸ’΅
EIP-3009
USDC Transfer
$0.10 / $0.25 / $5.00
β†’ swap
πŸ”„
x402 Facilitator
Swap Service
0x6462...1D0
β†’ ETH
⟠
Converted
ETH Balance
β†’ gas funds
πŸ”
Derived Wallet
Backend Wallet
pays gas automatically
β†’ auto-sign
πŸ“¦
Permanent Storage
Net Protocol
storedon.net CDN

πŸ” Upload Session Flow (v3)

1️⃣
Balance Check
/api/relay/balance
β†’ ETH in backend wallet
2️⃣
EIP-712 Signature
wagmi signTypedData
domain: "Net Relay Service"
3️⃣
Session Token
/api/relay/session
β†’ 1 hour validity
4️⃣
Submit Txs
/api/relay/submit
β†’ batched storage calls
Session signs: { operatorAddress, secretKeyHash: keccak256(secretKey), expiresAt }
All API calls proxied locally to avoid CORS in Farcaster Mini Apps

πŸ“Š Data & Live Pricing

🦎
CoinGecko API
Live ETH prices power ALL USD conversions: Upload Wallet balance, upload cost estimates, and funding calculations. Refreshes every 30 seconds.
api.coingecko.com/api/v3/simple/price
πŸ”
Blockscout API
Wallet balances, transaction history, USDC transfer verification.
base.blockscout.com/api

⛓️ Blockchain Protocols

πŸ“š
Net Protocol
Permanent onchain storage. Documents chunked and stored on Base L2.
netprotocol.app/api
⭐
Score Protocol
Onchain upvotes via UpvoteStorageApp contract. Permanent tips to creators.
0x00...5B62
🏷️
ENS Subnames
Member IDs minted as X.netlibrary.eth subnames on Base.
netlibrary.eth

πŸ’¬ Social Layer

🟣
Farcaster SDK
Authentication, user context, cast composer, frame actions.
@farcaster/frame-sdk
◼️
Neynar API
User profiles, channel posts, social graph queries.
api.neynar.com/v2

πŸ—οΈ App Infrastructure

πŸ’Ύ
KV Storage
Fast indexed storage for discovery index, leaderboards, achievements, collections.
Vercel KV (Redis)
🌐
storedon.net CDN
Global content delivery for stored documents. Instant URL generation.
storedon.net/{key}

⛓️ Onchain Storage (Permanent)

Documents (PDFs) netlib-{name}-{ts}
Comments netlib-comment-{key}-{ts}
Reading Queue net-library-reading-queue-{addr}
Upvotes Score Protocol Contract
Grid Upvotes keccak256("netlib-grid-{id}")
ENS Subnames X.netlibrary.eth

⚑ App Storage (KV - Fast)

Discovery Index Book catalog & search
Member Registry Membership records
Leaderboard Rankings & stats
Collections User book collections
Achievements Gamification data
Grids grid:{id}, grid-cells:{id}
Grid Archives grid-archive:{id}
Social Receipt Index social-receipts:{fid}

🐦 Social Receipt Archival (v1.42.4)

πŸ“₯
Content Fetch
/api/social/fetch
Twitter: syndication API
Farcaster: Neynar API
πŸ–ΌοΈ
Receipt Generation
/api/social/receipt
Satori PNG with embedded media
⚠️ Images need explicit dimensions
⛓️
Permanent Storage
Uploaded via relay system
PNG stored on Net Protocol
Self-contained archive
Flow: Paste URL β†’ Fetch content + media β†’ Generate receipt image β†’ Upload to Net Protocol
Images embedded as base64 data URLs for permanent preservation

♾️ Unlimited Storage Pass

πŸ’°
One-Time Purchase
$100 USDC β€” permanent unlock
Never pay per-grid fees again
πŸ”²
Unlimited Unlocked Grids
Create any size grid (6Γ—6 to 100Γ—100)
No $2 per-grid fee with pass
πŸ“š
Unlimited Stack Items
Add unlimited items to any stack
Without pass: 25-item limit
Location: Profile β†’ Member Resources β†’ Unlimited Storage Pass
API: /api/membership/stack-pass | Storage: hasStackPass in member registry

πŸ”— CDN Link Access

πŸ“–
Item Detail CDN Button
Every item detail page has a "πŸ”— CDN Link" button.
Opens centered modal with copyable link.
storedon.net/content/{contentKey}
πŸ“‹
Profile CDN Links Tab
Profile β†’ My Uploads β†’ "CDN Links" subtab.
Lists all uploads with copyable CDN links.
Subtabs: Recent | Most Upvoted | CDN Links
πŸ“₯
Bulk Download
"Download All Links (.txt)" button exports
all CDN URLs to a text file, one per line.
Uses safeOpenUrl(blobUrl) for mini app compatibility

πŸ“œ Smart Contracts (Base L2)

USDC Token
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
x402 Facilitator
0x6462F8f301Bd08c206ee611aA00015bA41acc1D0
Net Protocol Storage
0x000...Bbf5
Net Protocol Chunked
0x000...E6C6
Score Protocol (Upvotes)
0x000000060CEB69D023227DF64CfB75eC37c75B62
Score Contract
0x0000000FA09B022E5616E5a173b4b67FA2FBcF28
User Wallet
USDC Payment
ETH Conversion
Net Protocol
Data Services