Architecture

Overview

At it's core, Loop is a relay network (backend, bots, and smart contract) that executes transfer requests on-chain using a trust preserving model.

Loop allows wallets to provide "authorizations" via our hosted checkout page or checkout modal for inbound payments (e.g. subscriptions) and our authorization modal for outbound payments. After getting the request authorization, users can collect and schedule payments (called transfer requests) via API calls to process an on-chain transaction.

Loop enables the web3 equivalent of collecting payment information. In web2, users provide companies with their debit/credit/banking information and authorization to spend. With Loop, companies can collect the web3 equivalent of such authorization to spend on-chain and then process payments in line with their terms of service. The result is companies can focus on building superior product experiences with minimal friction from on-chain interactions.

Loop was built to be completely flexible and fit into many use cases. Below we outline the core components and some key features of the protocol.

Components

Loop smart contract

Using Loop starts with deploying the Loop smart contract. At this time, Loop deploys the smart contract on your behalf. Once the smart contract is deployed, Loop will provide API keys and access to the company dashboard.

Entity

When the contract is deployed, an entity and entityId is created. Users can save their logo and website to an entity to provide for customize payment experience.

For platforms like creator's platforms that want to manage payments on behalf of their users, Loop allows for child entities. Each child entity can have its own distinct logo, website, url, etc, thus allowing for customization as well as its own items (explained next).

Items

Items represent the "thing" that a payment is associated with. On the company dashboard you will see two types of items: subscriptions and on-time payment. However, we provide the ability via API keys to create different "types" of items for example, a "donation" or "compensation".

Companies can utilize items in the manner that best fits their use case.

Collecting authorization

Hosted checkout page

Loop provides a custom hosted checkout page for each item with the type of "subscription, donation, and fee". This page is useful for companies accepting crypto payment and can be used as a payment link or in a “pay with crypto” button.

Checkout modal

For those that prefer, Loop provides checkout modal that can be integrated in the context of your company's website or application, to enable your customers to pay with crypto. The modal allows end users to give Loop authorization to enable autopay.

Authorization modal

For applications that do not require a checkout page (i.e. display item's details), Loop provides an authorization modal that allows users to easily provide authorization and can be embedded anywhere in an application. Like the checkout page, the modal uses information configured at the item level but only displays the accepted tokens.

Billing / scheduling payment

Auto-invoicing

Items can be set to "auto-invoicing" and Loop will automatically generate the next invoice for all agreements that exist with the item using the payment frequency configured for the item. In order to use the auto invoicing feature, delegated signing must be turned on for the entity and an inbound treasury wallet (where funds will be directed) must be configured.

Stripe + Chargebee integrations

The Loop protocol is able to leverage existing solutions like Stripe and Chargebee to manage subscriptions. Using API keys, Loop can pull the relevant invoice information automatically and process crypto payments on-chain while subscription management can continue to exist in these platforms.

Manual invoicing (aka transfer requests)

Transfer requests direct the Loop relay network and smart contract to perform a specific transfer. For example, for subscriptions the transfer request would direct the movement of the subscription amount from the subscriber's wallet to the company. Or in the case of payroll, the request would direct the company's wallet to pay the contributor's wallet.

Loop only processes transfers that it receives. In cases where companies want to programmatically inform Loop of transfer requests, we offer an SDK to help with this setup.

Real-time notifications

Loop provides webhooks as a way to notify companies of events as they occur. Loop will trigger a webhook when a wallet successfully provides authorization, when a transfer is received, when a transfer is late, and when a user has canceled their subscription. Listening to webhooks allows companies to grant permission to end-products for new users and is necessary to collect the first transfer.

Receipts and reminders

Companies can elect to have Loop automatically send several notifications and receipts. Learn more in the receipts and reminders section.

Gas costs and fees

Loop's relay network covers the gas costs associated with transactions on-chain (i.e. processing the transfer request).

The keepers on this network monitor the contracts and call the relevant function to initiate the transaction. In the future, Loop aims to decentralize this activity. At this later date, there could be a fee introduced to incentivize quicker behavior among the keepers.

For more details and information on fees, please reach out to Loop directly.

Demo environment

Our demo environment is on Goerli. Only USDC and WETH are configured for testing. Please reach out at hello@loopcrypto.xyz if you would like to start testing.

When using this environment, URLs should begin with https://demo.api.loopcrypto.xyz...

Last updated