Flow Payment: A New Paradigm of Payment Empowered by Blockchain

IOSG Ventures
2022-12-20 09:59:24
Collection
Flow payments have the potential to bring programmable money into a broader realm of imagination and creativity, resulting in a real-time finance system where value flows more fairly, efficiently, and smoothly than the current financial system.

Author: Leo, IOSG Ventures

More than twenty years ago, the medium for music transmission was mainly tapes; over a decade ago, apart from cinemas, consumers primarily relied on CDs to watch movies at home. Now, tapes and CDs have basically disappeared from our options, replaced by streaming media—where media data is compressed and transmitted over the internet in a streaming manner, enabling real-time transmission of media content online[1]. Thanks to streaming media, consumers can access content faster and more conveniently, with per capita content consumption and frequency continuously rising. The form of multimedia content transmission has changed the way and habits in which we consume content.

Imagine if payments could also shift from lump-sum transfer to streaming; what kind of changes would this completely different value transfer method bring to our economic activities and lives compared to the current financial system?

Andreas M. Antonopoulos introduced the concept of "Streaming Money" in his speech on October 19, 2016[2]. It refers to on-chain funds no longer being transferred in bulk at regular time intervals (such as monthly salaries or annual membership fees), but rather flowing continuously like water at a set transfer rate from the payer to the payee.

If you are hearing about streaming payments for the first time, you might only vaguely accept this abstract concept and find it hard to grasp its significance. Here are a few examples to illustrate the advantages of streaming payments:

Payroll

Typically, companies pay employees their salaries at a fixed time each month, which has at least two areas that could be improved by streaming payments. First, from the company's perspective, paying salaries at a fixed time each month means that the company needs to prepare a large amount of cash to distribute to employees at that time, which may put pressure on the company's cash flow management.

If streaming payments are adopted, the large sum of money concentrated for monthly payments can be distributed slowly and evenly throughout the month, smoothing the company's cash flow. Second, from the employee's perspective, streaming payments allow employees to receive compensation in real-time based on their work. Compared to the current method, streaming payments enable employees to access their earned wages earlier and faster. With the rise of DAOs and the gig economy, there is a vast market demand for freelancers to receive payment for their labor through streaming payments.

● Subscription & Time-based service

The current Netflix subscription model charges users monthly, regardless of whether they use the product or how long they use it; the fee is fixed. Streaming payments can provide a more accurate and fair payment method for subscription and time-based services and products. For example, in the streaming media industry, the fees users pay for music or films depend on how long they actually listen or watch, rather than paying for the entire work or a full month/year subscription; similarly, in time-based online games, streaming payments can completely replace point cards, with players paying based on the time they are online.

● Rental application

If a rental agreement is developed on a streaming payment protocol, when on-chain assets/items are rented, the rent can be charged and settled in real-time according to the streaming payment preset procedure. When the streaming payment is interrupted, the on-chain assets/items can be automatically reclaimed and returned according to the rental agreement. This ensures fair billing for the renter and guarantees real-time payment for the lender, eliminating the risk of rent arrears.

● Airdrop & Token Vesting

When blockchain projects airdrop tokens to early participants and distribute tokens to investors, using streaming payments to release tokens linearly and gradually can effectively reduce the impact on the secondary market caused by the one-time distribution of a large number of tokens.

Streaming payments can also serve as a DeFi Building Block to bring more interesting products and applications into DeFi

● Under-collateralized lending/Income-backed lending

Each streaming payment represents proof of income that continues into the future. Streaming payments materialize trustless, verifiable future income proof in a tangible form on-chain. Loans collateralized by streaming payments will introduce under-collateralized lending into DeFi, using tangible, traceable future income as collateral, enhancing capital efficiency. This could be the foundation for on-chain credit development.

● Securitized/Tradable cash flow

Streaming payments can securitize cash flow on-chain for trading, greatly improving capital utilization efficiency and circulation speed.

The above are just a few examples. Many protocols have emerged in the Web3 payment space, notably Sablier and Superfluid, while other projects can generally be seen as revisions of these two protocols.

The technical implementation of Sablier streaming payments is simple and straightforward. The Sablier protocol deploys a main contract on each supported EVM-compatible blockchain, which manages all token streams on that chain. Users interact with the main contract to create token streams, revoke token streams, and withdraw funds from token streams.

Each token stream has exactly six attributes: 1. Sender address; 2. Recipient address; 3. Deposit (total amount of tokens sent); 4. Token address (contract address of the sent tokens, only supports ERC-20 tokens); 5. Start time; 6. Stop time.

From these six attributes, it can be seen that the functionality of Sablier streaming payments is quite basic. Once a user creates a token stream, Sablier can only mechanically execute according to the pre-set attribute parameters. As of now, Sablier does not support refilling deposits, changing the amount of tokens sent in a stream, altering the transfer rate, or changing the end time of a token stream. The lack of refill deposit means that the total amount of tokens sent must be stored in the stream at the time of its creation, requiring the payer to prepare all funds in advance. From the payer's perspective, choosing whether or not to use Sablier streaming payments does not alleviate their cash flow pressure. Additionally, all funds in the token stream are stored in the Sablier main contract, and when the payee wants to withdraw the received funds, they need to pay gas fees to withdraw the funds from the contract for free use. From the payee's perspective, this extra step and the associated gas costs create a negative user experience.

Sablier is the first protocol to implement streaming payments. Although its functional weaknesses limit its widespread adoption, Sablier laid the foundation for the subsequent flourishing development of many streaming payment protocols. Its founder, Paul, proposed EIP-1620: Money Streaming[3] in 2018, aiming to establish a set of streaming payment standards for Ethereum, which also facilitated Sablier's launch in 2019. However, the subsequent development of the EIP-1620 proposal has stagnated and is currently in a halted (incomplete) state. Sablier supports major EVM-compatible blockchains, including Ethereum, Optimism, Arbitrum, Polygon, Ronin, Avalanche, and BSC. As of December 19, Sablier's TVL is 4.5M USD, with a historical peak of 1.57B USD. image

Superfluid, as a newcomer, has made many improvements compared to Sablier. The Superfluid protocol consists of four important parts: Super Tokens, Super Agreements, Super Apps, and Super Host. The Superfluid protocol draws on the ERC-777[4] token standard, which is backward compatible with ERC-20, introducing an extended ERC-777 token standard with real-time finance capabilities, named the Super Token standard.

Super Tokens possess all the characteristics of ERC-20 tokens and support Constant Flow Agreements[5] and Instant Distribution Agreements[6]. Flow agreements and instant distribution agreements make up the two main types of contracts in the current version of Super Agreements, and more contract types may be added in future versions. These agreements define how Super Tokens can be interacted with and how balances can change beyond the basic ERC-20 token functionalities (e.g., linear increase or decrease of balance).

Notably, the flow agreement in Super Agreements introduces a very simple accounting rule for "streaming" payments, but this simple rule is effective in the real-time finance system created by Superfluid.

Before introducing this accounting method, let's understand the following variables:

  • Flow Rate: The transfer rate of a single streaming payment, with receipts as positive values and payments as negative values.
  • Netflow Rate: The sum of all cash flows for an account.
  • Latest CRUD Timestamp: The timestamp of the latest addition, modification, or deletion of any streaming payment for that account.
  • Real-time Balance: The real-time (dynamic) account balance.
  • Static Balance: The static account balance.
  • Current Balance: The current actual balance.

Using the account shown in the following diagram, let's see how Superfluid's "streaming accounting" works: image

The account in the diagram has two incoming token streams and three outgoing token streams, with the flow rate and direction of each stream shown in the diagram, resulting in a Netflow rate of -100USDCx/month for that account. Superfluid's "streaming accounting" divides the user's balance into two parts: one part is Static Balance, and the other part is Real-time Balance. The static balance corresponds to the actual balance at the timestamp of the last addition, modification, or deletion, i.e., the static balance plus the real-time (dynamic) balance. The real-time (dynamic) balance can be calculated as Netflow Rate * (current time - latest CRUD timestamp).

- Static Balance

Static Balance = Initial Current Balance at the latest CRUD timestamp - Real-time (dynamic) Balance Real-time Balance = Netflow Rate * Time elapsed since the latest CRUD timestamp - Current Balance Current Balance = Static Balance + Real-time Balance

Whenever any token stream for this account is created, modified, or deleted, the following variables will be immediately updated on-chain: 1. Netflow rate is recalculated based on changes in the token streams; 2. Latest CRUD timestamp is updated to the moment the change occurs; 3. Static Balance is updated to Current Balance; 4. Real-time Balance is reset to zero.

The main advantage of this streaming accounting is that it enables gasless on-chain value transfer. Gas costs are incurred only when a new token stream is created, or an existing token stream is modified or deleted.

Superfluid supports refill deposits, which can alleviate cash flow pressure for payers. In the earlier example of payroll, the finance and HR departments of a company need to prepare all employees' salaries on the payroll date and distribute them that day. This creates a peak in funding demand on that day each month, putting pressure on the company's cash flow. If payroll is implemented using the Superfluid protocol that supports refill deposits, the peak funding demand can be effectively smoothed out. Superfluid also supports changing token stream rates, setting no limits on token stream end times, and other functions, flexibly meeting the continuously changing payment requirements of various users.

Superfluid's vision is not limited to building a streaming payment protocol that satisfies fund transfers between wallets, wallets and contracts, and contracts to contracts, but rather to create a readable, verifiable, and programmable real-time finance system composed of numerous real-time finance applications. In this system, funds flow in real-time and continuously in the form of streams, minimizing idle funds for each user, organization, and company.

Superfluid has supported Ethereum, Gnosis Chain, Polygon, Optimism, Arbitrum, Avalanche, and BSC, and is exploring deployment on non-EVM-compatible chains. Since its launch in 2021, Superfluid has steadily risen, but its current TVL is only about 1.5M USD. It is worth mentioning that Superfluid experienced a security incident in early February 2022, where assets worth over 13 million USD (at the time of the incident's market value) were stolen.

The reason for the theft was that in the original version of the Super Agreement, a function call did not check a serialized state environment parameter when calling data from the Super Host, allowing this parameter to be injected with an incorrect value, causing the correct value to be discarded. This parameter was sufficient for the hacker's account to impersonate other accounts and transfer funds from them.

image

In addition to Sablier and Superfluid, other projects deeply engaged in streaming payments include Roketo from the Near ecosystem, Zebec, Streamflow, MeanFi from the Solana ecosystem, and multi-chain projects like Calamus and LlamaPay.

Streaming payments bring much more than just a new transfer method. Its application scenarios are not limited to simple streaming transfers between accounts; the previously mentioned payroll payments, automatic subscriptions, pay-per-time, and token distributions are examples we can already glimpse. The payment process itself, rather than just the on-chain assets being paid, becomes part of programmable money. The characteristics of streaming payments—real-time settlement with no delays, no risk of arrears, high composability, and efficient circulation—will introduce new DeFi building blocks for developers to create previously impossible DeFi applications.

Since the birth of blockchain, early adopters of Web3 have begun to experience the Internet of Money—value internet, allowing assets and value to transfer over the network. However, the Internet of Money and various decentralized applications that have been explored may only be the tip of the iceberg. Streaming payments have the potential to bring programmable money into a broader realm of imagination and creativity, leading to a real-time finance system that is fairer, more efficient, and smoother in value flow than the current financial system.

Appendix:

image

Reference:

[1]Maniar, N.J. (2012). Streaming Media. In: Seel, N.M. (eds) Encyclopedia of the Sciences of Learning. Springer, Boston, MA. https://doi.org/10.1007/978-1-4419-1428-6_602

[2]Bitcoin, Lightning, and Streaming Money https://www.youtube.com/watch?v=gFZQeijPs

[3] https://eips.ethereum.org/EIPS/eip-1620

[4] https://eips.ethereum.org/EIPS/eip-777

[5] https://docs.superfluid.finance/superfluid/protocol-overview/in-depth-overview/super-agreements/constant-flow-agreement-cfa

[6] https://docs.superfluid.finance/superfluid/protocol-overview/in-depth-overview/super-agreements/instant-distribution-agreement-ida

[7] https://halborn.com/explained-the-superfluid-hack-february-2022/

[8] https://medium.com/superfluid-blog/08-02-22-exploit-post-mortem-15ff9c97cdd

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators