All milestones have been met! We are on mainnet.
But development continues on more features and optimizations.
Project Name: DebitLLama
Project Track: DeFi
Team Name: ZKP Solutions (Research and Development)
Team Member(s): [Barfollomew (aka StrawberryChocolateFudge on Github)]
HackerEarth Project Link: hopeter_c520 - HackaTRON Season 5 - Debitllama-subscription-payments | HackerEarth Hackathons
debitLlama_pitchDeck_v3.pdf (1.6 MB)
Video Demo: https://youtu.be/zg5mNxqA_s8
Project Goal: Provide subscription payments with fixed or dynamic priced billing. A subscription payment gateway.
Project Value: It unlocks new payment channel for businesses using crypto and provide a safe way to pay for subscriptions for users. The payment process works in any browser, it’s not required to have a wallet after the accounts have been set up. The checkout process is very fast. Subsciption payments are set it and forget it
Project Website: debitllama.com
Project Test Instructions: The first version is available at debitllama.com
You can sign up or use these credentials to login: email@example.com password is testtesttest
Feel free to look around and use the sidebar to navigate.
To make payments you can create a virtual account that holds deposits or connect a wallet (EOA) and the payments will be pulled from the account directly.
To debit accounts you need to create a debit item that defines the parameters of the subscription and will generate a checkout page. You can add the wallet that will receive the payments, the subscription name, how much is the price per payment, how many times that will be pulled and how often. You can select dynamic or fixed pricing.
A fixed priced subscription is automatically processed while a dynamic one needs to be requested because the actual price can vary! It’s useful when billing per usage.
The Item page contains an embedded button that links to the checkout.
On the checkout page, customers can create new accounts or use existing ones and approve pull payment (subscriptions) by supplying a password. After they have created an account or connected a wallet they don’t need to use crypto wallet to make payments from it anymore.
It’s not only account but full wallet abstraction.
To sum it up, users need to use crypto wallet when:
- Creating a new account
- Updating balance (via approvals or deposit)
- Closing the accounts
Merchants need to use the crypto wallet when:
- Topping up the relayer with GAS
But there is a possibility to cover the gas entirely from other fees
The subscription payments are pulled from the accounts automatically by a relayer.
The smart contracts and circuits published here : GitHub - StrawberryChocolateFudge/DebitAccounts: Crypto note based Debit accounts
DebitLlama allows Merchants to create custom checkout pages where users can pay for subscriptions using account abstraction.
Once the accounts are created all wallet interaction is abstracted using a relayer.
To directly debit accounts, the users create payment intents (zkp) which parameterize the details of the subscription payment. The intents are invariants and transactions created with them can be submitted by any relayer.
DebitLlama provides a centralized service to store data, render the checkout pages and store the payment intents, provides a relayer service, a Front End and a Rest Api.
An example use-case is a SaaS company offering subscription for a service like a VPN, they prompt the user to subscribe and then they can debit the customers wallet for a fixed period.
Subscriptions can be cancelled any time and provide a spending limit when we pay per usage.
DebitLLama is a centralized SaaS business that provides payments for other SaaS businesses who can add a new checkout button to their website.
This image was the original sketch of how the service should work with the cryptography and it was implemented like this.
Smart Contract links:
Check one of my posts here
Smart contracts and circom circuits
Backend and frontend of the application (built with Deno Fresh)
Database using Supabase
Relayer service (built with Deno)
MVP ready for Demo and hackathon submission
Website landing page.
Mainnet deployment :Between October 15-22
Zapier integration - Developed, docs coming soon
How it works and Inspirations.
Direct Debit with Account abstractions
The tech is inspired by “Vitalik EthCC Speech Summary: Account Abstraction Makes Crypto Wallets as Simple as Email” and Tornado Cash Note Accounts.
“Vitalik described account abstraction as allowing Ethereum accounts to be controlled by smart contract code instead of private keys”
I went ahead and implemented it with zero knowledge abstractions.
Creating an account:
- Alice computes a secret off-chain, which will be used to control the account and encrypts the secret with a password
- A second encryption takes place with a public masterkey belonging to the service provider who will verify the identity of alice.
- Alice creates the account by triggering a smart contract function and saves the encrypted secret.
To spend, the Alice must be first identified by the service provider that will do the first layer of decryption to recover the secret and will serve it on a secure page.
Alice then uses the account password to access the plaintext secret. Final decryption takes place in the browser.
Alice computes a zkSnark, from now on referred to as payment intent, using the secret.
The payment intent allows directly debiting the account. The parameters of the payment intent enforce strict spending patterns. Due to the unalterable nature of the payment intent, transactions with it can be trustlessly relayed.
Payment intents can be revoked and accounts can be closed using the wallet that created them, any time.
A payment intent contains:
- The address of the payee
- The maximum debitable amount from the account
- The amount of times the payment intent can be used
- The interval it can be used, in days.
and other variables used for the cryptography.
To recap, using this payment method, the accounts created can be directly debited multiple times, while approving these payments require only a password from the end user.
After this alice sends the Payment Intent to the service provider that will submit the transactions to process the payments.