Git Product home page Git Product logo

webapp's Introduction

Beaver Wallet - subscriptions in erc-4337

A erc-4337 based wallet that allows users to make periodic payments while keeping funds in full self custody.

Sign up for early access waitlist at https://ethbeaver.xyz

Usage guide

To use the wallet, go to the wallet's web app, log in with google / github and create a password. That's it.

Select the chain in the top left corner (currently Base Mainnet and base Goerli are supported). You can find your address in the top right corner.

Send ETH / ERC20 tokens to that address to top up the wallet. If a token is not shown, click "Import token" button an enter the token's address.

To transfer a token, click "Send" near a token. To see history of your token transfers and other actions, go to "Activity" page.

image

Subscriptions

The key feature of Beaver Wallet is subscriptions. The goal is to establish an industry stnadard for wallets, dapps and centralized apps to talk to each other about subscriptions and provide such functionality to the end users.

It's not possible to interact with dapps yet, but what you can already do - is you can manually set up a periodic transfer of money. Go to "Subscriptions" page, click "Setup new subscription".

image

Now fill out Subscription name, token to send, size of payments, frequency of payments and the recepient addres. Now click "Done" end enjoy seeing a user operation automatically produced every billing cycle (even if you don't open your wallet).

image

Subscriptions under the hood

You might be wondering: how is it possible to send a user operation (user operation is a erc-4337 version of transaction) while the wallet is closed? This means that my private key is transfered yo your server, right??? No! Your funds are always at your full custody.

What actually happens is that when you sign up for a subscription, a bunch of user operations (like 1000 operations) are generated and fully pre-signed locally in the browser. Then these user operations are transfered to our server and the server sends them to the blockchain at the right time. Since they are already signed, no other action from you, as a user, is needed to execute them.

But then it means you can execute all my 1000 pre-signed operations immediately after receiving them and drain all the funds from my wallet?? And again no! Beaver Wallet is a ERC-4337 wallet. ERC-4337 wallets are smart contracts. Being a smart contract allows to implement almost any security checks when executing a user operation. And this is exactly what we do. In every pre-signed user operation, a timestamp is included. The smart contract always checks this timestamp and if it's too early, doesn't allow execution. Which means that your funds remain in your wallet until it is the exact time to make a periodic payment.

Technical side

Beaver Wallet is build on top of Zerodev's Kernel smart contract. Kernel is an audited an secure smart contract that is responsible for keeping your tokens under your and only your control. Subscriptions are implemented as a plugin for Kernel. You can find the code for the plugin validator and executor in the contracts repo.

webapp's People

Contributors

nebolax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.