← Back to home

PDFi

When did your PDF last send a payment? PDeFi makes invoices pay on-chain, instantly, securely.

Problem Statement

PDFi: The First Interactive PDF Blockchain PlatformPDFs have been static documents for 30+ years. We've cracked the code to make them interactive with blockchain networks. A PDF that can actually send cryptocurrency transactions is revolutionary.📄Why PDFs Are PerfectUniversal FamiliarityEveryone knows PDFs- from your grandma to corporate executivesNo learning curve- people already understand how to open, view, and interact with PDFsTrusted format- PDFs are the gold standard for official documentsWorks everywhere- every device, every operating system, every browserTraditional Finance Still Runs on PDFsInvoicesare sent as PDFsContractsare signed as PDFsReceiptsare generated as PDFsBank statementscome as PDFsTax documentsare PDFsThe entire financial world already operates on PDFs. We're just making them functional.💰Real-World Impact: Hackathon ExampleThe Problem:Hackathon organizers spend weeks chasing winners for payment details, bank accounts, wire transfers, international fees, currency conversions.The PDFi Solution:Winner gets a PDF invoiceClicks "Pay Now"Money is sent instantlyNo back-and-forth emailsNo bank account sharingNo international wire feesThe PDF pays for itself🔗Multi-Chain, Multi-Token SupportUsers can withdraw from:Ethereum(ETH, USDC, USDT, DAI)Base(ETH, USDC, USDT)And more chains coming...One PDF wallet, access to the entire crypto ecosystem.The Core Innovation: PDF + Blockchain ConnectionWe've connected the world's most trusted document format to the world's most innovative financial technology.📋Endless Use CasesBusiness & FinanceInvoicesthat pay themselvesCredit memoswith instant settlementPurchase orderswith automatic paymentExpense reportswith direct reimbursementDigital AssetsGift cardsthat work globallyVoucherswith blockchain verificationBurner walletsfor temporary usePrepaid cardswithout physical cardsEvents & ServicesEvent ticketswith built-in paymentService contractswith automatic billingSubscription renewalsvia PDFMembership cardswith crypto benefits��Why This Changes Everything1. No More App DownloadsUsers don't need MetaMask, Coinbase Wallet, or any crypto appJust open the PDF and start using itWorks on any device with a PDF reader2. Instant Global PaymentsSend money to anyone, anywhere, instantlyNo bank accounts neededNo international wire feesNo currency conversion delays3. Self-Executing DocumentsPDFs that actually do what they sayInvoices that pay themselvesContracts that execute automaticallyReceipts that verify on blockchain4. Trust Through TransparencyEvery transaction is recorded on blockchainNo chargebacks or fraudPermanent audit trailPublic verification

Solution

How PDFi Was Built: The Technical Deep DiveThe Core ArchitecturePDFi is built on a three-tier architecture that bridges the gap between static PDF documents and dynamic blockchain networks. The frontend creates interactive PDFs, the backend handles blockchain operations, and the PDFs themselves contain embedded JavaScript that communicates with our infrastructure.CDP (Coinbase Developer Platform) IntegrationThe backbone of our blockchain operations is CDP, which provides enterprise-grade account management and transaction capabilities. CDP handles the complex aspects of blockchain interaction that would be impossible to implement securely in a PDF environment.Key CDP Features We Leverage:Account Management: Each PDF wallet gets a dedicated CDP account with its own addressTransaction Signing: CDP handles the cryptographic signing of transactionsMulti-Chain Support: Seamless switching between Ethereum, Base, and other networksBalance Management: Real-time balance checking across multiple tokensGas Optimization: Automatic gas estimation and fee managementTechnical Implementation:The CDP service handles all blockchain operations through their REST API, creating accounts for PDF wallets with unique identifiers and managing the entire lifecycle of each wallet. When a user creates a PDF wallet, we instantiate a new CDP account that becomes the underlying blockchain address for that specific PDF.FERN API IntegrationFERN provides the swap functionality that enables PDF wallets to exchange between different cryptocurrencies. This is particularly crucial for the "send-eth-with-swap" PDF variant.FERN's Role:Quote Generation: Real-time exchange rates for crypto pairsSwap Execution: Atomic swaps between different tokensSlippage Protection: Ensures users get fair exchange ratesMulti-DEX Aggregation: Routes through multiple decentralized exchangesTechnical Challenges with FERN:Quote Expiration: FERN quotes expire quickly, requiring careful timingSlippage Management: Need to handle price movements during transaction confirmationDynamic Wallet IntegrationDynamic provides the wallet connection layer that allows users to interact with PDFs using their existing crypto wallets. This eliminates the need for users to manage private keys within PDFs.Dynamic's Benefits:Multi-Wallet Support: Works with MetaMask, Coinbase Wallet, WalletConnect, etc.Cross-Platform: Functions on web, mobile, and desktopSecurity: Private keys never leave the user's walletUser Experience: Familiar wallet connection flowImplementation Details:The Dynamic context provides wallet connection capabilities, allowing users to connect their existing wallets to the PDF creation process. Contract interactions use the connected wallet through Wagmi hooks, ensuring that all blockchain transactions are signed by the user's own wallet rather than our backend.The FDF (Forms Data Format) ChallengeFDF is Adobe's standard for PDF form data exchange, but it has significant limitations that made our implementation particularly challenging.FDF Limitations We Overcame:No Direct JavaScript Support: FDF can't execute JavaScript functionsLimited Data Types: Only supports basic string/number valuesNo Callback Mechanisms: Can't receive responses from external APIsBrowser Security Restrictions: PDFs can't make direct HTTP requestsOur FDF Workaround:We created a custom handler system that processes FDF data through our backend. FDF data comes in as form submissions containing action types and JSON-encoded data. The backend processes these requests and returns results in a format the PDF can display.The Hacky Part:Since FDF can't directly call APIs, we implemented a polling mechanism where the PDF continuously submits form data to our backend, which processes the request and returns the result in a format the PDF can display. This creates the illusion of real-time interaction despite the fundamental limitations of the PDF format.PDF JavaScript IntegrationThe most technically complex part is embedding JavaScript within PDFs that can communicate with our backend infrastructure.PDF JavaScript Limitations:No Fetch API: Can't make HTTP requests directlyLimited DOM Access: Can't manipulate web page elementsSecurity Restrictions: Sandboxed execution environmentVersion Dependencies: Different PDF readers support different JavaScript featuresOur Solution:We use Adobe's Forms JavaScript API to create interactive elements within PDFs. The JavaScript handles user interactions like button clicks, form submissions, and status updates. All communication with external services happens through FDF form submissions to our backend.Backend ArchitectureThe backend serves as the bridge between PDFs and blockchain networks, handling all the complex operations that can't be performed within the PDF environment.Key Components:Handler Registry: Routes FDF actions to appropriate servicesBlockchain Service: Direct blockchain interactions using ethers.js and viemCDP Service: Coinbase Developer Platform integrationFERN Service: Swap functionality integrationPDF Account Service: MongoDB storage for PDF wallet metadataTechnical Challenges:Concurrent Processing: Multiple PDFs making simultaneous requestsError Handling: Graceful degradation when blockchain operations failRate Limiting: Preventing abuse while maintaining responsivenessData Consistency: Ensuring PDF state matches blockchain stateDecentralization Through TEE (Trusted Execution Environment)To maintain true decentralization, our backend will be implemented as a TEE (Trusted Execution Environment). This ensures that even our own infrastructure cannot access or manipulate user data or transactions.TEE Benefits:Data Privacy: User data is encrypted and only accessible within the secure enclaveCode Integrity: Backend logic cannot be modified without detectionAudit Transparency: All operations are cryptographically verifiableDecentralized Trust: Users don't need to trust our infrastructureTEE Implementation:The backend will run within Intel SGX or AMD SEV secure enclaves, ensuring that even if our servers are compromised, user data and transaction signing remain secure. This creates a truly decentralized system where the backend acts as a trusted intermediary without having access to sensitive information.The Smart Contract LayerWe deployed custom smart contracts on Ethereum Sepolia and Ethereum Mainnet to handle PDF account creation and management.Contract Features:Account Creation: Creates new CDP accounts for PDF walletsOwnership Management: Links PDF wallets to creator addressesMetadata Storage: Stores PDF wallet information on-chainAccess Control: Ensures only authorized users can create accountsTechnical Implementation:The smart contract manages the creation and ownership of PDF accounts, storing metadata on-chain while the actual CDP accounts are managed through Coinbase's infrastructure. This hybrid approach provides the security of blockchain with the scalability of enterprise infrastructure.Security ConsiderationsPDF Security:No Private Keys in PDFs: All cryptographic operations happen on backendInput Validation: Sanitize all user inputs before processingRate Limiting: Prevent abuse of backend servicesAudit Logging: Track all PDF interactions for security analysisBlockchain Security:Multi-Signature Support: CDP accounts can use multi-sig for additional securityTransaction Monitoring: Real-time monitoring of all blockchain operationsError Recovery: Graceful handling of failed transactionsGas Optimization: Automatic gas estimation to prevent transaction failuresPerformance OptimizationsBackend Optimizations:Connection Pooling: Reuse database and blockchain connectionsCaching: Cache frequently accessed data like account balancesAsync Processing: Non-blocking operations for better responsivenessLoad Balancing: Distribute requests across multiple backend instancesPDF Optimizations:Minimal JavaScript: Keep PDF file sizes small for faster loadingEfficient Polling: Smart polling intervals based on transaction statusProgressive Enhancement: Basic functionality works even with limited JavaScript supportThe Integration ChallengeThe biggest technical challenge was creating seamless integration between three fundamentally different systems: static PDF documents, dynamic blockchain networks, and traditional web infrastructure.Integration Points:PDF → Backend: FDF form submissions with embedded dataBackend → Blockchain: CDP API calls and smart contract interactionsBlockchain → PDF: Status updates and transaction confirmationsUser → System: Dynamic wallet connections and transaction signingThis required careful orchestration of multiple APIs, real-time data synchronization, and robust error handling across all layers of the system.The result is a platform where users can create a PDF wallet in seconds, send cryptocurrency transactions with a single click, and have all the complexity of blockchain technology abstracted away behind a familiar document interface, all while maintaining true decentralization through TEE technology.

Hackathon

ETHGlobal New York 2025

2025

Prizes

  • 🏆

    Build a Great Onchain App Using CDP

    Coinbase Developer Platform

  • 🏆

    Best Finance App on Fern

    Fern

Contributors