Decentralized Open Source Contribution Rewards System
Built on Mantle Network | Powered by zkTLS & AVS EigenLayer
- Overview
- Problem Statement
- Solution
- Technology Stack
- System Architecture
- Application Flow
- Key Features
- Project Structure
- Smart Contract Integration
- Setup Instructions
- Build and Deployment
- Testing
zkPull is a decentralized platform that revolutionizes open source contribution rewards through blockchain technology. The platform enables repository owners to create bounties for GitHub issues and allows contributors to claim rewards automatically upon PR merge verification using zkTLS (Zero-Knowledge Transport Layer Security) and AVS (Actively Validated Services) from EigenLayer.
Traditional bounty systems require manual verification and trust between parties. zkPull eliminates this through:
- zkTLS Technology: Provides cryptographic proof of PR merge status without exposing sensitive data
- AVS EigenLayer: Decentralized validation layer ensuring tamper-proof verification
- Smart Contract Automation: Instant reward distribution upon successful validation
- Mantle Network: Fast, low-cost transactions on L2 blockchain
Open source contributors face several challenges:
- Payment Delays: Waiting for repository owners to manually release funds
- Trust Issues: Uncertainty whether bounties will be paid after contribution
- Manual Verification: Time-consuming PR merge verification process
- Lack of Transparency: No clear audit trail of contributions and payments
- Centralized Control: Dependency on platform operators for dispute resolution
zkPull addresses these challenges through:
- zkTLS automatically verifies PR merge status directly from GitHub
- No manual intervention required from repository owners
- Cryptographic proofs ensure authenticity
- Smart contracts hold bounty funds in escrow
- Automatic distribution upon successful validation
- No waiting periods or manual approvals
- AVS EigenLayer provides additional validation layer
- Multiple validators ensure accuracy
- Byzantine fault tolerance
- All transactions recorded on Mantle blockchain
- Complete history of bounties, claims, and validations
- Immutable proof of contributions
- Support for multiple contributors per issue
- Fair reward distribution
- Flexible bounty splitting
- Next.js 15.6.0 (Turbopack): React framework with server-side rendering and optimal performance
- TypeScript 5.5.2: Type-safe development
- Tailwind CSS: Utility-first styling framework
- Wagmi 2.14.5: React hooks for Ethereum
- Viem 2.22.17: TypeScript Ethereum library
- RainbowKit 2.2.4: Wallet connection interface
- React Hooks: Built-in state handling
- Radix UI: Accessible component primitives
- Framer Motion 12.0.0: Animation library
- Lucide React: Icon system
- Sonner: Toast notifications
- Mantle Sepolia Testnet: L2 blockchain for testing
- Alchemy RPC: Private RPC endpoint for reliability
- pnpm: Fast, disk space efficient package manager
- ESLint: Code quality and consistency
- Git Hooks: Pre-commit validation
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend Layer β
β Next.js App Router β React Components β Tailwind CSS β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Blockchain Integration β
β Wagmi β Viem β RainbowKit β Wallet Connectors β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mantle Network β
β Smart Contracts β ERC20 Token β Transaction Processing β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββ΄βββββββββββββββ
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β zkTLS Protocol β β AVS EigenLayer β
β PR Verification β β Validation β
ββββββββββββββββββββ ββββββββββββββββββββ
src/
βββ app/ # Next.js App Router
β βββ (landing)/ # Landing page route group
β βββ (main)/ # Main application routes
β β βββ issues/ # Browse bounty issues
β β βββ issues/[id]/ # Issue detail page
β β βββ create-bounty/ # Create new bounty
β β βββ profile/ # User profile
β β βββ faucet/ # Test token faucet
β βββ globals.css # Global styles
β
βββ components/ # React components
β βββ pages/ # Page-specific components
β β βββ (landing)/ # Landing page components
β β β βββ Hero.tsx # Hero section
β β β βββ Work.tsx # How it works section
β β β βββ PartnerMarquee.tsx # Partner logos
β β β βββ CTA.tsx # Call to action
β β βββ (app)/ # Application components
β β βββ issues/ # Issue listing components
β β βββ issue-detail/ # Issue detail components
β β βββ create-bounty/ # Bounty creation form
β β βββ profile/ # Profile components
β β βββ faucet/ # Faucet components
β βββ ui/ # Reusable UI components
β βββ button.tsx # Button component
β βββ input.tsx # Input component
β βββ WalletConnect.tsx # Wallet connection
β βββ ... # Other UI components
β
βββ lib/ # Utilities and hooks
β βββ hooks/ # Custom React hooks
β β βββ use-create-issue.tsx # Issue creation logic
β β βββ use-claim-rewards.tsx # Reward claiming logic
β β βββ use-get-all-issue.tsx # Fetch all issues
β β βββ use-mint-tokens.tsx # Token minting
β β βββ use-balance.tsx # Balance checking
β β βββ use-wallet.tsx # Wallet management
β βββ utils.ts # Utility functions
β
βββ config/ # Configuration files
β βββ const.ts # Smart contract addresses & ABIs
β βββ wagmi.config.ts # Wagmi configuration
β
βββ utils/ # Type definitions
βββ types.ts # TypeScript interfaces
User Journey:
ββββββββββββββββ
β Connect β
β Wallet β
ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β Fill Bounty Form: β
β - GitHub Project ID β
β - Bounty Amount (mUSD) β
β - Project Name β
β - Description β
β - Repository Link β
β - Deadline β
β - Maximum Claims (number of developers) β
ββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Approve mUSD Token Spending β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Submit Transaction β
β (createIssue function) β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Bounty Created & Visible β
β on /issues page β
ββββββββββββββββββββββββββββββββ
Smart Contract Flow:
1. User approves MANTLE_USD_ADDRESS to spend bountyAmount
2. Contract transfers tokens from user to escrow
3. Issue stored with id, metadata, and maxClaims
4. IssueCreated event emitted
User Journey:
ββββββββββββββββ
β Browse β
β Issues β
ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Select Issue β
β View Details β
ββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Create & Merge PR on GitHub β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Connect with GitHub OAuth β
β (Access Token stored) β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Enter PR Link & Submit Claim β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β zkTLS Verifies Merge Status β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β AVS Validates Claim β
ββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β Reward Distributed β
β (Bounty Γ· maxClaims) β
ββββββββββββββββββββββββββββββββ
Smart Contract Flow:
1. User submits claimReward with:
- issueId
- prLink
- isMerged (verified by zkTLS)
- accessToken (from sessionStorage)
2. Contract validates:
- Issue is open
- PR not already used
- Maximum claims not reached
- Merge status is true
3. If AVS enabled: Creates validation task
4. Upon validation: Transfer reward to developer
5. RewardClaimed event emitted
zkTLS Validation:
ββββββββββββββββββββββββββββββ
β Contributor submits PR URL β
βββββββββββ¬βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββ
β zkTLS creates secure proof of: β
β - PR exists on GitHub β
β - PR is merged β
β - No sensitive data exposed β
βββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β Proof sent to smart β
β contract for verification β
ββββββββββββββββββββββββββββββ
AVS Validation:
ββββββββββββββββββββββββββββββ
β Smart contract creates β
β validation task β
βββββββββββ¬βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββ
β Multiple AVS operators validate: β
β - zkTLS proof authenticity β
β - PR merge correctness β
β - Issue-PR relationship β
βββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β Consensus reached β
β (Byzantine fault tolerant) β
βββββββββββ¬βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β Validation result returned β
β to smart contract β
ββββββββββββββββββββββββββββββ
-
Easy Bounty Creation
- Simple form-based interface
- Support for multiple claim limits
- Deadline enforcement
- Automatic fund escrow
-
Cost Control
- Set bounty amount per issue
- Define maximum number of claimants
- Withdraw unused funds after deadline
-
Transparency
- View all claims on issue
- Track validation status
- Blockchain audit trail
-
Fair Rewards
- Automatic distribution upon validation
- Pro-rata sharing for multiple claimants
- No manual approval needed
-
Security
- Funds guaranteed in smart contract escrow
- Cryptographic proof of contribution
- No risk of non-payment
-
User Experience
- GitHub OAuth integration
- Real-time claim status
- Wallet balance tracking
- Test token faucet
-
Maximum Claims System
- Support multiple developers per bounty
- Automatic reward calculation:
Bounty Amount Γ· Max Claims - Current claims tracking
- Prevents over-claiming
-
Dual Validation
- zkTLS: Cryptographic PR verification
- AVS: Decentralized consensus validation
- Byzantine fault tolerance
- High security guarantee
-
Token Management
- ERC20 mUSD token on Mantle
- Approval flow for security
- Balance display in wallet
- Faucet for testing
-
Responsive Design
- Mobile-first approach
- Desktop optimization
- Consistent UI across devices
/ (landing)
βββ Hero section with zkTLS highlight
βββ How it works (3-step process)
βββ Partner marquee (Mantle, EigenLayer, etc.)
βββ Call to action
/issues
βββ Browse all open bounties
βββ Filter and search
βββ Highest reward badge
βββ Issue cards with metadata
/issues/[id]
βββ Issue details
βββ Bounty information
βββ Maximum claims display
βββ Reward per claim calculation
βββ Claim form
βββ Validation status
/create-bounty
βββ Bounty creation form
βββ Token approval
βββ Transaction confirmation
βββ Success feedback
/profile
βββ Wallet connection status
βββ User statistics
βββ Contribution history
βββ Achievement display
/faucet
βββ Test token minting
βββ Amount input
βββ Network information
βββ Balance display
All blockchain interactions are abstracted into custom hooks:
use-create-issue: Handle bounty creationuse-claim-rewards: Manage reward claiming processuse-get-all-issue: Fetch and cache issuesuse-mint-tokens: Test token mintinguse-balance: Real-time balance updatesuse-wallet: Wallet connection management
Address: Configured via environment variable NEXT_PUBLIC_ISSUE_ADDRESS
Key Functions:
-
createIssue
function createIssue( string _githubProjectId, uint256 _bountyAmount, string _projectName, string _description, string _repoLink, uint256 _deadline, uint256 _maxClaims )
Creates a new bounty with escrow.
-
claimReward
function claimReward( uint256 _issueId, string _prLink, bool _isMerged, string _accessToken )
Claims reward after PR merge.
-
getAllIssues
function getAllIssues() returns (Issue[])
Returns all bounty issues.
-
getIssueDetails
function getIssueDetails(uint256 _issueId) returns (Issue)
Fetches specific issue details.
-
validateClaim
function validateClaim( uint256 _issueId, uint256 _claimIndex, bool _isValid )
Validator function for AVS.
Address: Configured via environment variable NEXT_PUBLIC_MANTLEUSD_ADDRESS
Key Functions:
-
mint
function mint(address to, uint256 amount)
Mints test tokens (faucet).
-
approve
function approve(address spender, uint256 value)
Approves contract to spend tokens.
-
balanceOf
function balanceOf(address account) returns (uint256)
Returns token balance.
The frontend listens to these events:
IssueCreated: New bounty createdRewardClaimed: Claim submittedClaimValidated: Validation completedAVSTaskCreated: AVS validation initiatedFundsWithdrawn: Owner withdrew funds
- Node.js: v18.0.0 or higher
- pnpm: v8.0.0 or higher
- Git: Latest version
- Wallet: MetaMask or compatible Web3 wallet
-
Clone the repository:
git clone <repository-url> cd web
-
Install dependencies:
pnpm install
-
Create
.env.localfile:# Smart Contract Addresses (Mantle Sepolia) NEXT_PUBLIC_ISSUE_ADDRESS=0x... NEXT_PUBLIC_MANTLEUSD_ADDRESS=0x... # RPC Configuration NEXT_PUBLIC_ALCHEMY_RPC=https://mantle-sepolia.g.alchemy.com/v2/YOUR_KEY # Application Configuration NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Configure wallet:
- Add Mantle Sepolia network to MetaMask
- Network Name: Mantle Sepolia Testnet
- RPC URL: https://rpc.sepolia.mantle.xyz
- Chain ID: 5003
- Currency Symbol: MNT
- Block Explorer: https://sepolia.mantlescan.xyz
Start the development server:
pnpm devOpen http://localhost:3000 to view the application.
# Install dependencies
pnpm install
# Run development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Run linter
pnpm lint
# Type checking
pnpm type-check-
Build the application:
pnpm run build
-
Verify build output:
- Check for zero errors
- Check for zero warnings
- Review bundle size
- Test critical paths
-
Test production build locally:
pnpm start
- Connect repository to Vercel
- Configure environment variables
- Deploy automatically on push
- Build application:
pnpm build - Copy
.next,public,package.jsonto server - Install production dependencies:
pnpm install --prod - Start server:
pnpm start
Ensure all environment variables are set in production:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
NEXT_PUBLIC_ISSUE_ADDRESS=
NEXT_PUBLIC_MANTLEUSD_ADDRESS=
NEXT_PUBLIC_GITHUB_CLIENT_ID=
NEXT_PUBLIC_ZK_BACKEND_GENERATE_PROOF=
NEXT_PUBLIC_ZK_BACKEND_GET_ACCESS_TOKEN=Wallet Connection:
- Connect wallet successfully
- Display correct address
- Show MNT balance
- Show mUSD balance
- Handle network switching
Create Bounty Flow:
- Fill form with valid data
- Approve token spending
- Submit transaction
- Receive confirmation
- Bounty appears on /issues
Claim Reward Flow:
- Select issue from list
- View issue details
- GitHub OAuth connection
- Submit claim with PR link
- Receive validation feedback
- Receive reward tokens
Faucet:
- Request test tokens
- Receive tokens in wallet
- Balance updates correctly
UI/UX:
- Responsive on mobile
- Responsive on tablet
- Responsive on desktop
- Proper error messages
- Loading states visible
- Toast notifications work
Test scenarios on Mantle Sepolia:
- Create bounty with different maxClaims values
- Multiple users claim same bounty
- Verify reward splitting works correctly
- Test deadline enforcement
- Test maximum claims enforcement
- Verify zkTLS validation
- Verify AVS validation
- Server-side rendering for SEO
- File-based routing
- Built-in API routes
- Optimal code splitting
- Fast refresh during development
- Modern React hooks for Ethereum
- Type-safe contract interactions
- Built-in caching and request deduplication
- Extensive wallet support through RainbowKit
- Better developer experience than ethers.js
- Low transaction costs (L2 scaling)
- EVM compatibility (easy smart contract deployment)
- Fast finality (quick confirmations)
- Growing ecosystem
- Good documentation
- Utility-first approach (rapid development)
- Consistent design system
- Minimal CSS bundle (unused styles purged)
- Responsive design utilities
- Easy customization
This project follows strict code quality standards defined in CLAUDE.md:
- SOLID principles for all code
- Type safety required
- Zero build warnings policy
- Component structure must follow project conventions
- Import discipline through index files only
- Performance optimizations required
This project is part of a hackathon submission and is provided as-is for evaluation purposes.
For technical support or questions:
- Open an issue in the repository
- Contact the development team
- Review documentation in
/docsdirectory
Built with:
- Mantle Network
- EigenLayer AVS
- zkTLS Protocol
- Reclaim Protocol
- Next.js
- Wagmi
- RainbowKit
Built for open source, by open source.
zkPull - Empowering Contributors with Trustless Rewards