A decentralized data sharing and verification platform built on Filecoin with AI-powered validation
Dallnk is a revolutionary decentralized platform that connects data requesters with data providers through a transparent bounty system. Built on the Filecoin network for decentralized storage and powered by advanced AI agents for automated verification, Dallnk ensures data integrity, accessibility, and fair compensation.
- ποΈ Decentralized Storage: Built on Filecoin's robust infrastructure using Storacha/IPFS
- π€ AI-Powered Verification: Automated data validation using Gemini 2.0 Flash
- π° Smart Contract Bounties: Transparent, automated payment system
- π Secure Transactions: Blockchain-based trust and transparency
- π Real-time Tracking: Monitor bounty status and submissions in real-time
- π¨ Modern UI: Responsive design with smooth animations
- Architecture
- Filecoin Integration
- AI Agent System
- Smart Contract Layer
- Getting Started
- API Documentation
- Usage Guide
- Deployment
- Contributing
graph TB A[User Interface] --> B[Next.js Frontend] B --> C[Smart Contract Layer] B --> D[AI Verification Service] B --> E[Filecoin Storage] C --> F[Filecoin Testnet] D --> G[Gemini AI API] E --> H[Pinata/IPFS] subgraph "Decentralized Infrastructure" F H end subgraph "AI Services" G end - Frontend Layer: Next.js 15.5.4 with TypeScript and TailwindCSS
- Blockchain Layer: Filecoin testnet smart contracts
- Storage Layer: Pinata with IPFS
- AI Layer: Google Gemini 2.0 Flash for data verification
- Authentication: MetaMask wallet integration
Dallnk leverages Filecoin's decentralized storage network to ensure data permanence, accessibility, and censorship resistance.
// Storage Implementation (app/utils/web3storage.ts) interface StorageResult { success: boolean; cid?: string; error?: string; } // Upload to Filecoin via Pinata export const uploadToFilecoin = async ( file: File, email: string ): Promise<StorageResult> => { // Creates IPFS CID and stores on Filecoin network // Returns permanent content identifier };// Each file gets a unique Content Identifier (CID) const cid = "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"; const ipfsUrl = `https://w3s.link/ipfs/${cid}`;// Files accessible from any IPFS gateway const gateways = [ "https://w3s.link/ipfs/", "https://ipfs.io/ipfs/", "https://gateway.pinata.cloud/ipfs/", ];- Cryptographic Proof: Each file upload generates a unique hash
- Immutability: Content cannot be altered without changing the CID
- Redundancy: Files replicated across multiple Filecoin storage providers
| Traditional Storage | Filecoin Storage |
|---|---|
| Centralized servers | Distributed network |
| Single point of failure | Redundant storage |
| Vendor lock-in | Interoperable |
| Censorship risk | Censorship resistant |
| Limited lifecycle | Permanent storage |
Dallnk employs advanced AI agents powered by Google's Gemini 2.0 Flash model to automatically verify data submissions against bounty requirements.
// AI Verification Flow (app/api/verify/route.ts) interface VerificationRequest { cid: string; // IPFS content identifier requirements: string; // Bounty requirements fileType: string; // MIME type fileSize: number; // File size in bytes } interface VerificationResult { isValid: boolean; // Verification outcome confidence: number; // AI confidence score (0-1) reasoning: string; // Detailed explanation issues?: string[]; // Identified concerns }// AI evaluates file format against requirements const formatAnalysis = { expectedTypes: ["CSV", "JSON", "PDF"], actualType: "text/csv", compatibility: true, score: 0.95, };// Semantic analysis of data relevance const contentAnalysis = { requirements: "Financial quarterly data", dataDescription: "Q3 2024 revenue reports", relevanceScore: 0.87, keywordMatch: true, };// Data quality indicators const qualityMetrics = { fileSize: "appropriate", // Size vs content type structure: "well-formatted", // Data organization completeness: "comprehensive", // Information coverage reliability: 0.91, // Overall quality score };// Secure API endpoint (app/api/verify/route.ts) export async function POST(request: NextRequest) { // API key secured server-side const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); // Comprehensive prompt engineering const prompt = ` Analyze this data submission for a bounty request: - IPFS CID: ${cid} - Requirements: ${requirements} - File Type: ${fileType} - File Size: ${fileSize} bytes Provide structured verification with confidence scoring. `; }// Graceful degradation when AI unavailable const fallbackVerification = { basicFormatCheck: true, sizeValidation: true, defaultApproval: false, // Conservative approach humanReviewRequired: true, };- Automated Processing: Instant verification without human intervention
- Consistent Standards: Uniform evaluation criteria across all submissions
- Scalability: Handle thousands of submissions simultaneously
- Cost Efficiency: Reduce manual review overhead
- 24/7 Availability: Continuous operation without downtime
Smart contracts handle all bounty lifecycle management on the Filecoin testnet.
// Core data structure struct DataRequest { uint256 id; string description; string requirements; uint256 bounty; address requester; address assignedMiner; string ipfsHash; bool isVerified; bool isPaid; uint256 timestamp; }// Bounty creation announceDataRequest(description: string, requirements: string) // Data submission submitDataForRequest(requestId: uint256, ipfsHash: string) // Verification (by bounty creator) verifySubmittedData(requestId: uint256, isValid: bool) // Payment release confirmAndPay(requestId: uint256)- Node.js 18+
- MetaMask wallet
- Filecoin testnet tokens (tFIL)
- Clone the repository
git clone https://github.com/cridiv/Dallnk.git cd Dallnk/dallnk-frontend- Install dependencies
npm install- Environment setup
# Create .env.local file DALLNK_GEMINI_API_KEY=your_gemini_api_key PINATA_JWT=your_pinata_jwt- Run development server
npm run dev- Access the application
http://localhost:3000 Configure MetaMask for Filecoin testnet:
{ "chainId": "0x4CB2F", "chainName": "Filecoin Testnet", "rpcUrls": ["https://api.calibration.node.glif.io/rpc/v1"], "nativeCurrency": { "name": "testnet filecoin", "symbol": "tFIL", "decimals": 18 }, "blockExplorerUrls": ["https://calibration.filscan.io/"] }POST /api/bounty/create { "description": "Financial quarterly data needed", "requirements": "CSV format with revenue data", "bounty": "10" // tFIL amount }POST /api/verify { "cid": "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi", "requirements": "Detailed requirements string", "fileType": "text/csv", "fileSize": 1024000 } Response: { "isValid": true, "confidence": 0.87, "reasoning": "File format and content align with requirements", "issues": [] }// Upload to Filecoin via Pinata const result = await uploadToFilecoin(file, email); // Returns: { success: true, cid: "bafybeig..." }// Download from IPFS const url = `https://w3s.link/ipfs/${cid}`; await downloadFromIPFS(cid, filename);- Connect Wallet: Link your MetaMask wallet
- Create Bounty: Define requirements and set reward amount
- Review Submissions: Use AI-powered verification
- Release Payment: Approve and pay for accepted data
- Browse Bounties: Explore available data requests
- Upload Data: Submit files to Filecoin storage
- Await Verification: AI agent validates your submission
- Receive Payment: Get compensated for approved data
// 1. Data Requester creates bounty const bounty = await createBounty({ description: "E-commerce transaction data", requirements: "JSON format, 2023 data, minimum 10k records", amount: ethers.parseEther("25"), // 25 tFIL }); // 2. Data Provider submits data const submission = await submitData({ bountyId: bounty.id, file: transactionData, description: "Q1-Q4 2023 e-commerce transactions", }); // 3. AI verification runs automatically const verification = await verifyWithAI({ cid: submission.cid, requirements: bounty.requirements, }); // 4. Bounty creator reviews and approves if (verification.isValid && verification.confidence > 0.8) { await acceptSubmission(bounty.id); await releasePayment(bounty.id); }- Connect repository to Vercel
- Set environment variables:
DALLNK_GEMINI_API_KEY=your_key_here NPINATA_JWT=your_jwt - Deploy: Automatic deployment on git push
// package.json { "scripts": { "build": "next build", "start": "next start" } }- API Rate Limits: Implement rate limiting for AI verification
- Storage Quotas: Monitor Pinata usage limits
- Gas Optimization: Optimize smart contract interactions
- Error Handling: Comprehensive error tracking and recovery
// tailwind.config.js module.exports = { content: ["./app/**/*.{js,ts,jsx,tsx,mdx}"], theme: { extend: { colors: { "filecoin-blue": "#0090ff", "ai-purple": "#7c3aed", }, }, }, };// next.config.js /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { serverActions: true, }, images: { domains: ["w3s.link", "ipfs.io"], }, };- End-to-End Encryption: Files encrypted before upload
- Access Control: Smart contract-based permissions
- Immutable Records: Blockchain transaction history
- Server-Side Processing: API keys never exposed to client
- Input Validation: Comprehensive request sanitization
- Rate Limiting: Prevent API abuse
- Audit Ready: Clean, documented contract code
- Access Controls: Role-based permission system
- Reentrancy Protection: Secure payment mechanisms
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- TypeScript: Strict type checking enabled
- ESLint: Consistent code formatting
- Testing: Comprehensive test coverage
- Documentation: Clear code comments
This project is licensed under the MIT License - see the LICENSE file for details.
- Filecoin Foundation: For decentralized storage infrastructure
- Google AI: For Gemini API access
- Next.js Team: For the excellent React framework
- Pinata: For seamless IPFS integration
Aderemi Ademola β (X: @crid_iv) Olaniyi Ezekiel β (X: @) Peters Joshua β (X: @joshpet77)
Empowering decentralized data sharing through AI and blockchain technology