GitWork integrates MagicBlock Ephemeral Rollups to provide instant bounty claims on Solana. When contributors claim their rewards, they receive payment in <500ms instead of 3-15 seconds, creating a Web2-like instant payment experience on Web3 infrastructure.
Key Achievement: 6-30x faster claim times with automatic fallback to base layer for guaranteed reliability.
MagicBlock is an ephemeral rollup solution for Solana that enables:
- ⚡ Ultra-fast transactions: Sub-second finality
- 💰 Lower costs: Minimal transaction fees
- 🔌 Seamless integration: Works with existing Solana infrastructure
- 🔄 Automatic settlement: Periodic commits to Solana base layer
Traditional blockchain transactions take several seconds to confirm. For bounty claims, this creates friction:
- Contributors wait 3-15 seconds for transaction confirmation
- Poor user experience compared to Web2 payments
- Higher transaction costs on base layer
MagicBlock solves this:
- ✅ Instant claims in <500ms (6-30x faster)
- ✅ Better UX - feels like instant payment
- ✅ Lower costs - reduced transaction fees
- ✅ Automatic fallback - never breaks, just slower if unavailable
- ✅ Magic Router - intelligent transaction routing with single endpoint
GitWork creates ephemeral sessions when bounties become claimable, enabling contributors to receive payments almost instantly when they claim their reward.
-
MagicBlock Service (
src/services/magicblock.js)- Manages connections to MagicBlock ephemeral rollup
- Creates and manages ephemeral sessions for bounties
- Handles delegation/undelegation of accounts
- Provides smart routing between ephemeral rollup and base layer
-
Ephemeral Sessions
- Created automatically when a bounty becomes "ready_to_claim"
- Delegates escrow wallet to the ephemeral rollup
- Enables instant claims with auto-commit functionality
- Closed automatically after claim or cancellation
-
Transaction Execution
- Claims execute on ephemeral rollup for instant confirmation
- Automatic fallback to base layer if ephemeral rollup unavailable
- Smart connection management with health checks
-
MagicBlock Context (
gitwork-front/src/contexts/MagicBlockContext.jsx)- Provides MagicBlock connection state across the app
- Manages wallet adapter with MagicBlock support
- Health monitoring for ephemeral rollup availability
-
UI Components
- MagicBlockStatus: Shows current connection status
- BountyCard: Displays instant claim badge for fast bounties
- Visual indicators for MagicBlock-enabled transactions
1. Bounty Created → PR Merged → Status: ready_to_claim
↓
2. Ephemeral Session Created
- Escrow wallet delegated to MagicBlock
- Session valid for 24 hours
↓
3. Contributor Claims Bounty
↓
4. Magic Router Routes Transaction
├─→ Ephemeral Rollup: <500ms ⚡ (if session active)
└─→ Base Layer: 1-3s 🐢 (fallback)
↓
5. Auto-Commit to Solana Base Layer
- Every 5 transactions OR
- When session closes
# Enable MagicBlock Ephemeral Rollups
MAGICBLOCK_ENABLED=true
# Magic Router - Intelligent transaction routing
MAGICBLOCK_RPC_URL=https://rpc.magicblock.app
# Solana Mainnet
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# USDC Mainnet Address
USDC_MINT_ADDRESS=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v# Enable MagicBlock Ephemeral Rollups
MAGICBLOCK_ENABLED=true
# Magic Router Devnet - Auto-routing for development
MAGICBLOCK_RPC_URL=https://devnet-rpc.magicblock.app
# Solana Devnet
SOLANA_RPC_URL=https://api.devnet.solana.com
# USDC Devnet Address
USDC_MINT_ADDRESS=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU# Enable/disable MagicBlock in frontend
VITE_USE_MAGICBLOCK=true
# MagicBlock RPC endpoint
VITE_MAGICBLOCK_RPC_URL=https://devnet-rpc.magicblock.appMagicBlock's Magic Router is a unified RPC endpoint that:
- ✅ Automatically routes transactions to ephemeral rollup or Solana base layer
- ✅ Intelligent delegation-based routing
- ✅ Seamless fallback handling
- ✅ Single endpoint configuration
Read more: Magic Router Blog
- Sessions are created when bounties become claimable
- 24-hour validity period with auto-commit every 5 transactions
- Automatic cleanup after claims or cancellations
The system intelligently routes transactions:
- Ephemeral Rollup: For instant claims with active sessions
- Base Layer: Fallback for deposits, refunds, or when rollup unavailable
- Continuous health checks for MagicBlock availability
- Automatic fallback to base layer on failures
- No disruption to user experience
- ⚡ Instant Claims: Get your bounty in seconds, not minutes
- 💰 Lower Fees: Reduced transaction costs
- 🎯 Better UX: Seamless claiming experience
- 🚀 Faster Payouts: Contributors receive funds immediately
- 💎 Premium Experience: Stand out with cutting-edge tech
- 📊 Better Metrics: Track ephemeral session usage
MagicBlock Service (src/services/magicblock.js):
createEphemeralSession(bountyId, accounts)- Create ephemeral session for fast claimscloseEphemeralSession(sessionId)- Close session and commit to base layerexecuteOnEphemeralRollup(sessionId, transaction)- Execute instant transactionsgetSmartConnection()- Auto-routes to best available connection
Smart Connection Management:
- Magic Router automatically handles delegation routing
- Transparent fallback to base layer on failures
- Health monitoring for optimal performance
- Ephemeral Rollup Claims: < 500ms (instant)
- Base Layer Fallback: 1-3s (standard)
- Session Lifetime: 24 hours with auto-commit every 5 transactions
# Check MagicBlock connection status
curl http://localhost:3000/api/magicblock/health
# View active ephemeral sessions
curl http://localhost:3000/api/magicblock/sessions- Create a bounty on a GitHub issue
- Fund the escrow wallet
- Merge a PR that fixes the issue
- Claim bounty → Instant confirmation via MagicBlock ⚡
- Check logs for ephemeral session activity
If needed, set:
MAGICBLOCK_ENABLED=falseSystem automatically falls back to standard Solana base layer.
GitWork includes robust fallback mechanisms:
- ✅ MagicBlock Unavailable: Automatically falls back to Solana base layer
- ✅ Session Errors: Transactions proceed normally on base layer
- ✅ No User Disruption: Fallback is transparent and seamless
Connection Failures:
- Verify
MAGICBLOCK_RPC_URLis correct - Check network connectivity
- Test health endpoint
Slow Claims:
- May indicate fallback to base layer (still works, just slower)
- Check MagicBlock service status
- Review logs for fallback warnings
Dependencies:
@magicblock-labs/ephemeral-rollups-sdkv0.3.7+@solana/web3.jsv1.87.6+- Magic Router for intelligent transaction routing
Key Files:
src/services/magicblock.js- Core MagicBlock integrationsrc/services/bounty.js- Bounty lifecycle with ephemeral sessionsgitwork-front/src/contexts/MagicBlockContext.jsx- Frontend integration
- 📚 MagicBlock Website: https://www.magicblock.xyz
- 🧩 Magic Router Blog: https://www.magicblock.xyz/blog/magic-router
- 📖 MagicBlock Docs: https://docs.magicblock.gg
- 🔗 SDK Package: @magicblock-labs/ephemeral-rollups-sdk
- 💻 GitWork Docs: See
/docsdirectory
⚡ Powered by MagicBlock Ephemeral Rollups - Making bounty claims instant!