Inspiration

Subscriptions and recurring payments play a crucial role in the financial ecosystem. However, the blockchain sector has yet to fully tap into this market, leaving a significant gap. Currently, not many product enables service providers and users to easily manage subscriptions and recurring payments on blockchain.

This is where the idea for SuperSub was born. Recognising that creating such a system using existing Externally Owned Accounts (EOAs) would pose security risks—since we would have to manage users' private keys—we turned to account abstraction. With account abstraction gaining traction in the Ethereum Virtual Machine (EVM) ecosystem, we decided to build a subscription system that leverages smart contract accounts and plugins for secure and efficient recurring payments.

What it does

  1. Creating products and subscription plans
  2. Subscription and subscription management
  3. Cross-chain asset transfer using ChainLink CCIP

How we built it

The Supersub project consists of three main components: The smart contracts, the backend server, and the frontend application.

Smart Contracts

The smart contracts are divided into three components:

  1. Smart Accounts: These are powered by Alchemy's Account Abstraction Infrastructure, enabling the creation of smart contract accounts and the submission of user operations to their entry point contract.

  2. Subscription Plugin Contract: Implementing the ERC-6900 standard, this contract, when installed by the Alchemy smart accounts, provides users with the ability to create subscription products and plans, make recurring payments, subscribe to services, and manage their products and subscriptions.

  3. CCIP Bridge: Leveraging Chainlink's CCIP (Cross-Chain Interoperability Protocol), this component allows subscription charges to be delivered across different chains and enables users to send tokens to other chains.

Backend Server

The backend server is developed using TypeScript and Prisma. It acts as an indexer for the events occurring on the smart accounts, CCIP bridge, and subscription plugin contracts. Additionally, the backend server provides REST APIs to facilitate integration with front-end applications and third-party applications. The comprehensive API documentation is available here.

Frontend Application

The frontend application is a robust and user-friendly interface developed using React and TypeScript. It offers a comprehensive set of features, including:

  1. Smart Contract Account Creation: Users can seamlessly create smart contract accounts through the intuitive interface.
  2. Product and Plan Management: The application allows for the creation and management of subscription products and plans, providing a streamlined experience.
  3. Asset Transfer: Users can effortlessly transfer assets within the application, ensuring a smooth and secure transaction process.
  4. Cross-Chain Asset Transfer: Leveraging the CCIP bridge, the frontend application enables users to transfer assets across different blockchain networks, facilitating cross-chain interoperability.
  5. Subscription and Recurring Payment Management: Users can conveniently view and manage their subscriptions and recurring payments, ensuring complete control over their recurring transactions.
  6. Third-Party Integration SDK: The frontend application provides a Software Development Kit (SDK) that enables third-party developers to integrate their applications seamlessly. The frontend application is available here and the SDK is available on npm

Challenges we ran into

Account abstraction and the ERC-6900 plugin standard are relatively new, and resources are scarce. Initially, we used session key plugins to allow periodic removal of a certain amount of assets from a smart contract. However, this approach had limitations: we couldn't grant unlimited permissions for asset removal, and there were time constraints for the session keys.

We then discovered that we could develop a plugin enabling modular smart accounts to create subscription plans, subscribe to those plans, and charge the smart contract account at specific intervals using the ERC-6900 standard.

Accomplishments that we're proud of

Building a blockchain subscription infrastructure is a challenging task. The major accomplishment that we're proud of is being able to successfully build smart contracts, frontend application, and backend server in a month for the hackathon.

What we learned

  1. Technicalities of account abstraction, smart contract accounts, and ERC-6900 plugins.
  2. How to send assets and messages to other chains using ChainLink's CCIP.

What's next for SuperSub?

We have some changes to make on the smart contract level, including gas optimisations and recurring payment changes. We also plan on developing a fee structure for subscriptions. Ultimately, our goal is to deploy the smart contracts on the Polygon POS network and onboard service providers and users.

Built With

Share this project:

Updates