project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

ZeroLink

ZeroLink is a CrossChain Subscription Payments platform (dApp) designed to streamline recurring payments across multiple blockchains using CCIP & LayerZero

ZeroLink

Created At

ETHOnline 2024

Project Description

ZeroLink is a CrossChain Subscription Payments platform (dApp) designed to streamline recurring payments across multiple blockchains. Traditional subscription models often require users to operate within a single blockchain ecosystem, limiting flexibility and potentially incurring high transaction fees. Our platform overcomes these limitations by allowing users to select their preferred blockchain for payments, optimizing for various factors such as lower gas fees, better token liquidity, or personal preference. This flexibility is achieved by leveraging ERC-20 tokens, enabling seamless cross-chain transactions for subscriptions and payments across different blockchain networks.

Example Use Case: Consider a scenario where a content creator offers a premium subscription service on the Ethereum blockchain. A user interested in subscribing to this service prefers to make payments from the Binance Smart Chain (BSC) because of lower transaction costs or a larger holding of BUSD tokens on BSC. The CrossChain Subscription Payments platform facilitates this by enabling the user to set up a recurring monthly payment on BSC while allowing the content creator to continue receiving payments on Ethereum. This cross-chain functionality not only enhances user convenience but also optimizes costs, benefiting both the subscriber and the service provider.

How it's Made

Building the CrossChain Subscription Payments platform required integrating multiple technologies to ensure secure, decentralized subscription management across various blockchains. For the frontend, we used Next.js 14 and TypeScript, coupled with Ethers.js, to create a clean and efficient interface that interacts with our deployed smart contracts. This setup allowed us to build custom hooks that seamlessly facilitated interactions between the frontend and smart contracts, simplifying how users manage their subscriptions. For styling, we implemented TailwindCSS and Shadcn UI, ensuring a modern, responsive, and visually appealing user experience.

A critical component of the project was allowing users to interact with the platform through Web3Auth, which enabled them to sign up using their existing Web2 accounts (e.g., Google, GitHub) while generating a Web3 wallet. This integration was pivotal in enhancing user experience, as it bridged the gap between Web2 familiarity and Web3 functionality, allowing users to interact with decentralized technologies without the complexities of traditional wallet management. We also implemented switching networks with the help of Web3Auth PNP SDK.

On the backend, the core of the system's functionality was built around smart contracts that managed subscriptions and payments. LayerZero was used for cross-chain messaging, enabling seamless communication between different blockchains. This allowed us to create a subscription on one blockchain and facilitate payments from another. For instance, a user on Binance Smart Chain could subscribe to a service on Ethereum, with all interactions securely transmitted through LayerZero's omnichain protocol.

For payment processing, we integrated Chainlink CCIP to manage cross-chain ERC-20 token transfers. The smart contracts were designed to handle user payments, with functions like subscribeSubscription, makePayment, and unsubscribeSubscription. Payments were processed via Chainlink CCIP, ensuring secure transfer of tokens like USDC between subscribers and providers across different blockchains. Additionally, the performUpkeep function within the PaymentProcessor contract handled the actual transfer of tokens by checking log data, which was essential for ensuring that payments were made only when due.

LayerZero's lightweight messaging framework was utilized to optimize gas fees while maintaining secure cross-chain communications. Unlike some automated solutions, we did not use Chainlink Automation for scheduling payments but rather triggered payments manually using LayerZero messages. Each payment was initiated when a subscription became due, with the smart contracts securely transferring funds across blockchains.

background image mobile

Join the mailing list

Get the latest news and updates