Skip to content

rmrt1n/lepak-scaling-eth-3

 
 

Repository files navigation

(🔄) RecurriPay - F**k private keys.

Intro 👋

This project aims to tackle 2 key problems with crypto wallets.

Currently, there is no easy way of making recurring payments because you cannot have event-based executions on smart contracts. As an externally owned account you are required to initiate the transaction every time. Some use cases which would have benefitted from this are automated loan repayment, subscription payment and payroll.

On the other hand, current crypto wallets are still susceptible to loss of private keys. The risk of losing all your funds without an avenue for recovery makes it hard to onboard more users.

What is RecurriPay?

Home page RecurriPay stands for "Recurring Payments". To put it simply, it is a wallet which enables recurring payments and social recovery. Under the hood, it uses Gelato Network to automate the recurring payment and Optimism’s Attestation Station to provide social recovery function.

With account abstraction it has made wallet creation easier and more seamless. Social recovery function also enhances the user experience as now users can recover their wallet in the event of them losing their private key. Last but not least, being able to automate payments opens up a new capability for on-chain interactions such as paying for subscriptions or dollar-cost-averaging.

Try it yourself

RecurriPay

Key features 🎲

Account abstraction 👤

createWallet The frontend of this project is built using Nextjs. Under the hood, this project builds on top of the @account-abstraction-sdk by Eth-infinitism to enable first class citizen contract accounts. We wrote smart contracts inheriting from SimpleAccount and SimpleAccountFactory with additional features - recurring payment and social recovery.

Recurring payment 🔂

Add recurring payment form For the former, when a user sets up a recurring payment order, we write it to the account smart contract (setUpRecurringPayment), create a task in Gelato Network and store the payment details in Polybase. It will then call the specified function to execute the transaction (makeRecurringPayment) every interval defined by the user.

Social recovery 🤝

addRecoveryAddress As for social recovery, we have integrated with Optimism’s Attestation Station to achieve this feature. To set up social recovery, the account owner would specify 3 addresses as their social recovery addresses. In the event of losing the key to the ReccuriPay account, the account owner would create a new wallet and ask the owners of the registered social recovery accounts to make attestations that the account is lost, and specify the new wallet address. When all 3 addresses have attested. A function can be called in the account contract to move any tokens or ETH to the attested new wallet address. Optimism’s Attestation Station is easy to integrate and provides a simple and secure mechanism to build our social recovery feature.

Putting it all together

Diagram dashboard

The stack 🛠️

  • Frontend: Next.js
    • Styling: tailwind lottie
  • Account abstraction: eth-infinitism account-abstraction-sdk
  • Transaction automation: Gelato Network
  • Smart Contract Development: hardhat solidity
    • Deploy and address export: hardhat-deploy
    • SDK: openzeppelin ethers
  • Attestation: Optimism's Attestation Station
  • Bundler infrastructure: Stackup
  • Database: Polybase

Getting started 🏁

To deploy hardhat

// install dependencies
npm install 



To run frontend

//if you are from root, head to web directory
cd web

//install dependencies
npm install 

//run in local
npm run dev

Deployments ⛓️

Optimism Mainnet

AttestationProxy

Optimistic Goerli

AttestationStation AttestationStationProxy AttestationProxy

Scroll Alpha

AttestationStation AttestationStationProxy AttestationProxy

Polygon Mumbai

AttestationStation AttestationStationProxy AttestationProxy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 46.0%
  • TypeScript 41.6%
  • JavaScript 12.2%
  • Other 0.2%