Updated 165 days ago

Espresso ☕️

Sellings good in crypto should be easier!

  • Crypto / Web3
  • Metamask
  • Defi
  • L2
  • Base
  • Mobile
  • payments
  • Moralis, Wagmi, Viem, Sablier, Request Network

Overview

Espresso is a tablet-first app that helps merchant setting up their shop and start accepting payments in crypto. Within the app merchants can create their shop, add items and sell goods to their customers just by having them scanning a QR Code.

On the customer side, the scanned QR Code redirects to a web page to complete the payment. There are two options:

  • Simple payment with USDC through RequestNetwork
  • Buy Now, Pay Later by collateralizing a Sablier Stream NFT

Once completed the payment, the merchant will be able to see the new transaction on their tablet, while the customer will see a confirmation message and in case of "buy now pay later" they will be able to repay their debt within 4 months.

In this use case and scenario the clear business model is that merchants are willing to pay Espresso a monthly fee or a % fee for each "buy now, pay later" purchase happening within the app. It's in their best interest to do so, as "buy now pay later" can improve their customers conversion rate.

How it's made

Espresso is running on Base and using USDC has the native digital dollar. The tablet app has been built with React Native, allowing merchants to register/login with their email thanks to Privy. The merchant data is stored on a Firebase database as well as their items and checkouts details.

The web app used by customers to pay has been built with React & Next.js, using Wagmi and Rainbowkit to connect the user's wallet. The web app also includes the integrations with Request Network and Sablier for the payment side of things. We also integrated Moralis APIs to fetch NFTs owned by the user (the Sablier NFTs that they can collateralize) and some contract events that we show.

Repositories

How it works

The Simple Payment has been built with Request Network. When the user is paying, they are creating a request setting theirselves as payers and the shop as payee. The transaction happens with USDC. Disclaimer: The Request Network transactions are flying on Base Mainnet as they are not yet supporting Base Sepolia testnet.

The Buy Now Pay Later feature has been built with Sablier NFTs. We created a custom contract owned by Espresso that allows the customer to select and lock one of their Stream NFTs (e.g. the stream representing their payroll). According to the value of the stream that they deposit and lock, Espresso grants them a loan, paying the merchant in advance on behalf of the customer and expecting the customer to pay their debt back within 4 months. If their debt is extinguished before the deadline, they automatically get back their Stream NFT, otherwise their NFT gets liquidated (i.e. Espresso can claim it).

Bounties

  • Base: our application is running entirely on Base, the best layer to build consumer applications, specially when it comes to payments. We put a lot of effort in creating an application and product that is easy to use and consumer friendly.

  • Request Network: we used Request Network for performing the payments, creating and paying requests using the SDK. In addition, we spent some time to experiment with paying requests before persisting them in order to speed-up the payment process and offer users a better experience, however we weren't able to make it as the SDK is not yet ready to support this use case. Implementation details: https://github.com/builders-garden/espresso-web/tree/main/lib/request-network

  • Sablier: we used Sablier NFTs as collaterals to grant customers a loan. Sablier NFTs can represent payrolls for example, and it's one the best permissionless credential that allows Espresso to verify and trust a customer with the loan they are asking. This type of NFTs incentivize the customer to repay their debt in time so that they don't lose it. The custom contract that we built acts as an escrow where the user locks in their Stream NFT and Espresso sends money (from their treasury) to the merchant. Then, the customer has to repay back the debt before a predefined deadline and if they don't they can't claim back anymore their NFT, as they are liquidated. Web implementation details: https://github.com/builders-garden/espresso-web/tree/main/lib/sablier. Smart contracts details: https://github.com/builders-garden/espresso-smart-contracts