← Back to home

SubsCrypt

SubsCrypt: Private, anonymous on-chain subscription payments via ZK-proofs and EIP-7702 automation.

Problem Statement

SubsCrypt is an innovative platform that leverages EIP-7702 and Vlayer ZK-proofs to create an on-chain private subscription payment marketplace.Leveraging advanced blockchain technologies, SubsCrypt combines Ethereum's EIP-7702 standard and Vlayer zero-knowledge (ZK) email proofs to achieve user privacy without sacrificing usability.Name morphological analysis: * Subs: Short for “Subscription”, highlighting recurring payments. * Crypt: From the Greek “kryptós”, meaning “hidden” or “secret”, emphasizing user privacy.In most Web2 SaaS applications, users' emails are used as the service consumer profiles, allowing users to authenticate themselves in web apps and consume the specific service. In the case of paid services, payments should be routed through a conventional payment gateway (PayPal, Stripe...) to which the identity of the user must be disclosed (email, payment information, service consumed, price paid) to a third-party payment gateway. The advantage is that for subscription payments, the user should only set up the payment method once, and the service provider will periodically pull the funds throw the payment gateway from the user's payment methods automatically without requiring any user interaction. We can now mimic that flow efficiently by implementing delegate logic to EOAs thanks to the EIP-7702 introduced in the Ethereum Pectra upgrade.Once a user generates their dedicated "payment" EOA, it can be anonymously funded through privacy-preserving methods. Service providers utilize EIP-7702's delegation capabilities, enabling semi-automated, non-interactive recurring payments after a one-time authorization.SubsCrypt thus ensures complete privacy, streamlined recurring payments, and enhanced interoperability for subscription services on the blockchain.

Solution

How it's MadeSubsCrypt is built specifically to tackle the privacy challenges in decentralized subscription payments.Core Technology StackFrontend ArchitectureBuilt onNext.jswithTypeScriptandTailwind CSS v4.The Web3 integration utilizes:RainbowKit 2.2.5for beautiful wallet connection UXWagmi 2.15.4for React hooks and wallet managementViem 2.30.5for type-safe Ethereum interactionsTanStack Queryfor efficient data fetching and cachingSmart Contract InfrastructureDeveloped usingSolidity 0.8.28withHardhatas our development framework andOpenZeppelin contractsfor security-audited base implementations. We deployed onSepolia testnetwithAnvilfor local development and testing.Our contract architecture consists of:SubsCryptMarketplace.sol- Main marketplace and service registrySubsCryptSmartAccountDelegate.sol- EIP-7702 delegation logicInterface contracts for modularity and upgradabilityBackend ServicesBun.js-based wallet services handling:Email-to-blockchain bridge operationsAutomated payment processingVlayer proof verificationAuthorization tuple parsing from emailsApp FlowService ProviderService providers can announce their services by submitting a transaction to SubsCryptMarketplace.registerService specifying all the properties of the service through ServiceOffer struct. This can be easily done through the service provider admin dashboard.struct ServiceOffer { address serviceProvider; address paymentRecipient; address paymentAsset; uint256 assetChainId; uint256 servicePrice; // in wei/seconds uint256 paymentInterval; // seconds }UserUsers can visualize all offered services from different services providers in the same aggregated frontend.If an user is interested in a specific service, he can start the subscription initialization through cling a simple button in the frontend.Transparently to the user a "payment" EOA private key is randomly generated and is used to sign a delegation to the SubsCryptSmartAccountDelegate implementation.At the end of the button click handler action, an email window opens, indicating to the user that they need to send an email to the service provider with the delegation payload. The email is automatically generated following a template; the user only has to send it.Email Reception AutomationThe email is received in the service provider inbox and is automatically processed by an email automation build with n8n.From the email content following data is parsed:The service id that the user wants to subscribe to.The email sender.The email receiver.The EIP-7702 authorization tuple.The service provider backend submits an Ethereum v4 transaction to the blockchain with the given authorization tuple, effectively setting up the SubsCryptSmartAccountDelegate to the "payment" EOA.Vlayer Email ProofsThe email's .eml file content is submitted to our custom prover and all private inputs constrains are checked. As output we obtain the address of the "payment" EOA and a hidden commitment of the user email.The proof is then passed on-chain to the verifier contract along with the public outputs.On-Chain logicIf the verification succeeds the verifier contract itself will call the access controlled SubsCryptMarketplace.initializeAccount to initialize the state of the EOA. The wallet is now ready to be funded.Wallet Funding and BotsThe users knows the address of the wallet and is its his duty to add funds to it in order to trigger the first payment of the subscription. Privacy preserving funding methods can be used to completely anonymize the payments of the subscription.After each period of paymentInterval the bots will be incentivized to trigger the payment transactions mimicking an automatic execution of the payments. The payments can be triggered selectively in batches through calling the SubsCryptMarketplace.batchExecutePayments.Privacy-First Design PatternsEphemeral Payment EOAsUsers generate temporary private keys solely for subscription purposesOnce EIP-7702 delegation is active, the private key becomes unnecessaryEmail authentication can recover funds, eliminating key management burdenComplete separation between user identity and payment addressesAnonymous FundingPayment EOAs are funded through privacy-preserving protocolsFunding source cannot be traced back to the user's main identityIntegration points designed for mixers and privacy poolsZero-Knowledge Email BindingConnection between email and payment address exists only as cryptographic proofsEmail addresses never exposed on-chainVlayer proofs provide authentication without revealing sensitive dataDevelopment Challenges & SolutionsEmail Integration ComplexityThe biggest challenge has been parsing the email and passing its properties to the Vlayer prover. We innovated in email parsing and authorization tuple extraction.Multi-Currency Payments via Atomic 1 Inch Unoswap SwapsWe leverage 1 Inch Unoswap swaps so users can pay in their preferred currency and the services providers got payed with their specified currency. The swap executes atomically in a same pulling transaction, converting the funds.Privacy vs. Functionality BalanceBalancing complete privacy with necessary functionality required creative solutions:Using email hashes as identifiers while maintaining anonymityDesigning recovery mechanisms that don't compromise privacyCreating audit trails without exposing user informationFuture EnhancementsMulti-Party Computation (MPC)We've laid groundwork forfamily subscription featuresusing MPC:Shared payment accounts across multiple usersThreshold signatures for subscription managementPrivacy-preserving family plan implementations casesSubsCrypt represents a convergence of emerging blockchain standards (EIP-7702), zero-knowledge privacy (Vlayer), creating something that's never existed before: truly anonymous, automated, Web2-UX subscription payments on Web3 infrastructure.

Hackathon

ETHGlobal Prague

2025

Prizes

  • 🏆

    Big Blockscout Explorer Pool Prize

    Blockscout

Contributors