$MYSTdecentralised vpndeveloperspayments

Layer 1, 2, 3 and beyond: The search for the cheapest and fastest microtransactions

By Ноябрь 5, 2020 No Comments

How many layers does it take to get cheap and fast microtransactions?

Building on top of a quickly iterating Layer-2 scaling ecosystem has meant murky navigation of several new technologies. This is especially difficult for builders looking to find workarounds for high transaction fees on the Ethereum blockchain. 

The recent DeFi boom has led to users cramming into Ethereum Network and creating a large backlog of unprocessed transactions. This has meant network congestion, and high transaction fees – both of which are natural killers for decentralized applications and networks. 

Why are cheap and fast microtransactions important for decentralized networks? 

In Mysterium, a decentralized VPN, payments are peer to peer. Consumers of VPN are directly paying exit node runners for VPN service. As such, there is no middleman with the power to freeze payments. This means that payments happen minute by minute, with transaction values as small as 0.0001 USD (in our native token MYST).

The nature of the peer to peer, and second by second service consumption mean that decentralized VPNs, and other incentivized distributed networks depend on microtransactions as a means of reducing risk within their network economy. Learn more about peer to peer technologies.

Earlier this year, we released our own Layer 2 solution (based on payment channels) on Testnet. This enabled users to transact with one another autonomously, without a need for an intermediary (including us) and without touching Layer 1 (Ethereum blockchain). This introduced super cheap and instant transactions, and allowed paying with values as small as $0.0001.

However, one of the challenges with payment channels, our protocol included, is the need to have specific on-chain transactions. In the case of Mysterium Network this is seen in two events, dVPN account creation and top-up. 

Onward - the search for scalability

User story: As a user in Nigeria, I am looking for a VPN solution that lets me pay for what I consume. I am unable to afford the expensive subscription pricing of traditional VPNs. I try Mysterium VPN, which allows me to stream a video for $0.05 USD in MYST on their freemium version. I run out of free MYST and want to add an additional $1 USD (in MYST). I try to top up. It costs me $2.25 in ethereum tx fees to top up my Mysterium Account. I delete the app.

See our how our userbase is growing in Nigeria.

As you can clearly see, the nature of the service we are offering and the emerging markets that we are a natural ally to, make Ethereum’s current transaction fees a lock out when onboarding new customers. 

As such, like many other Ethereum-based projects, Mysterium Network has had to reroute our roadmap in search of scalability solutions to give our users the cheapest and fastest service possible, while maintaining decentralized and noncustodial architecture. 

In the following sections, we will review existing Layer 2 solutions in relation to Mysterium Network’s use case, explaining how they offer both opportunities and limitations.

Methodology: An Overview of Existing Solutions

Recently at Mysterium we did more research on various Layer 2 solutions and conducted an overview of the most recognised and trustworthy ones in 2020. In this overview, we looked at different sidechains, taking into consideration the differing motivations and user personas of actors within Mysterium Network – [Consumer/ User; Provider/ Mysterium Node Runner]. 

1. Sidechains or alternative blockchains with bridges to Ethereum blockchain

These types of solutions are characterised by xDAI, MaticRSK (RSK is creating bridges into Ethereum, meaning that you can technically move Ethereum based assets onto this Bitcoin sidechain).

The main value proposition of these solutions is they are scalable, capital efficient and offer fast withdrawal into Layer 1. The main drawback is that validators control the network and are able to freeze and confiscate funds with consensus.

This make sidechains unattractive to DeFi (who lock hundreds of millions) offerings, while they remain relevant for a decentralized VPN use case such as Mysterium Network. This is due to the fact that DeFi carries with it different risks when compared to a dVPN.

Matic Network

The following two examples, Plasma and Rollups are different articulations of sidechains, built more specifically for the Ethereum ecosystem.

2. Plasma

Plasma is a framework proposed for scaling Ethereum using hierarchical sidechains. Plasma type sidechains (also referred to as child chains) allow a majority of transactions to occur outside of the Ethereum blockchain. Only deposits and withdrawals, and points of entry and exit are handled on the main blockchain smart contract.

To make sure that transactions are final, Plasma operators run a “state commitment”. This is a cryptographic method for storing a compressed version of the state of sidechain inside the Ethereum blockchain. This storage of a compressed version of the state impacts the user experience of Plasma as it makes it challenging for users to withdraw their tokens. Users are required to be both online frequently and to download data.

While offering significant speed (up to 1000 transactions per second) and latency improvements over Ethereum, Plasma cannot offer the near-zero latency and near-free transaction fees required for a decentralized VPN micropayments solution.

One of the differentiators, and drawbacks of Plasma as a Layer 2 solution is it allows users to leave the network at any time – an action referred to as “exiting”. This means that users can safely withdraw their funds from Plasma even if it is shut down by validators. But this has to be done in a certain period of time and done by everyone. Read more about the mass exit problem in Plasma.

Another drawback, Plasma is not 100% EVM compatible. This would mean any decentralized application building on Ethereum would have to update their smart contracts or it might even not be possible to build on Plasma

Dive deeper into Plasma and its potential applications within distributed networks in Mysterium Network’s Micropayments Whitepaper.

Plasma network

3. Rollups

Rollups are Layer-2 scaling solutions similar in form to Plasma in that a single mainchain contract holds all funds and a cryptographic commitment to larger sidechain state. This state is maintained by users and operators offchain, providing an independence from Layer 1 storage. This is the biggest scalability benefit of Rollups.

 

    1. Optimistic Rollups


      Optimistic Rollups are constructions which enable autonomous smart contracts on Layer 2 using OVM. Borrowing heavily from both Plasma and ZK Rollup designs, Optimistic Rollups trades of some scalability to enable running fully general smart contracts on Layer 2, secured by Layer 1.

      It promises an easy way to migrate existing decentralized solutions and services with a reasonable degree of security/ scalability trade offs. Karl Floresch goes into more detail on Optimistic Rollups and OVM.

    2. ZK Rollups


      ZK Rollups is a Layer 2 solution where data is placed onchain.

      With ZK Rollups operators generate Zero-Knowledge Proof (SNARK) for every state transition, making it impossible for operators to commit an invalid or manipulated state.

      ZK Rollups should theoretically be able to process up to 2,000 transactions per second. 


ZK Rollups solution differs from Plasma as it solves the mass exit problem, meaning that validators are unable to freeze funds and users have no time limit to move funds out of Layer 2 even in case of emergency This makes ZK Rollups a great fit for both DeFi or cold wallets for Hodlrs. 

Its most known application is Loopring, a next-generation high-performance decentralized exchange and payment protocol also focused on scalability.

The challenge with ZK Rollups is the fundamental limitation in transaction amounts [2000 transactions per second], with current real world implementation, Loopring, achieving 500 transactions per second. 

Also, while transaction costs are lower than Ethereum, they cannot in theory be more than 100 times cheaper than Ethereum’s transaction costs. Most like 20 – 50 times cheaper according to our math.

Also, ZK Rollups are the more sophisticated and long term answer. Which as always, will take a longer time to implement. 

zKRollup

4. Payment channels

We have written extensively about payment channels both within our micropayments whitepaper released in 2019, and in several of our more recent updates:

    1. Introducing micropayments on Mysterium Network
    2. MYST, Migration and Mainnet
    3. Mysterium Network begins token migration

TL;DR

Payment channels fuse together the technologies and methodologies used by other payment solutions such as State Channels.

With payment channels parties exchange digital value without committing transactions to the blockchain. Only channel opening and closing are logged on the blockchain.

To open payment channels both parties have to lock some funds into a multisig smart contract. This allows both parties to update channel balances without the fear that funds will be double spent or stolen.

As these microtransactions are “commitments” rather than on-chain payments, we drastically reduce the total amount of transactions sent to the blockchain.

We dive deeper into what payment channels are, and how we envision them functioning in our micropayments whitepaper. Read more.

How are payment channels different from Plasma, ZK Rollups and Sidechains?

Layer 2 solution

From a technical perspective, Plasma and zkRollups – all fall into a wider umbrella of sidechains. Sidechains are fundamentally different in nature from payment channels. We highly recommend “Evaluating Ethereum Layer 2 Scaling Solutions: A Comparison Framework” for a deeper dive into the distinct differences between sidechains.

In our comparison of Layer-2 solutions, we saw that while Rollups are great in terms of security and give significant scalability over Layer 1, they do not completely solve for the challenge of micropayments needed for Mysterium Network. They have a limit of 2K tx/sec, and they don’t give users instant finality. Also the transaction price is still too expensive for $0.001 transactions.

In the following section we will explain how payment channels, and more specifically unidirectional payment channels are the best fit for the peer to peer decentralized virtual private network use case in Mysterium Network.

Payment channels are different as they are:

  • Flexible – i.e. able to live on layer 3, or 2 
  • Cheapest solution when it comes to transaction fees.
  • Most scalable in terms of peer to peer payments.
  • Could be used for cross-chain payments (e.g. from one side-chain to another, or from Layer 1 to Layer 2).

Sidechains (broadly speaking to include Plasma and ZK Rollups) bring with them limitations on transaction amounts. Payment channels on the other hand, could be foundational to cross-chain interoperability as they allow payments to move from one chain to another without custody – with zero costs, and in seconds. Don’t take my word for it, hear it from Vitalik himself.

Unidirectional vs Bi-directional payment channels

Why unidirectional payment channels?

In the case of Mysterium Network, most network actors are either consumers or providers (nodes) of VPN service. Payments are always going in one direction. There is only a need for providers (Mysterium Nodes) to rebalance the payment channel and settle earned tokens on Layer 1. 

Bi-directional payment channels are more complex and do not give Mysterium Network’s use case much value. Also, thanks to unidirectional payment channels our consumers don’t need to have apps online all the time to ensure that their funds will not be stolen. 

 

Payment Channels as Layer 3, on top of Layer 2 

As we continued to take apart different Layer 2 solutions, we came to the same conclusion. Payment channels – as described in our micropayments whitepaper – should be on Layer 3. 

  • Consumers of VPN service need at least one onchain transaction to top up their funds. With payment channels on Layer 3, we can capitalise on cheaper channel openings (account creation) and top-ups on Layer 2. So adding $1 to your dVPN app account will cost users 2 cents, not 2 dollars. This would greatly reduce friction in onboarding new users.
  • Providers of VPN service need at least one onchain transaction once in a week or so to receive their funds. In payment channels, once the value of the offchain commitment is bigger than the channel size, a settlement onchain is required. By offering flexibility we can let providers choose whether they choose to settle on Layer 2, or Layer 1.

    Why is this important? Some providers may send their funds to DeFis or exchanges often, this will mean moving from Layer 2 to Layer 1 regularly. As such being on Layer 1 makes more sense for providers with this particular profile. 

In a world of zkrollups, payment channels can be used as bridges within networks. – Vitalik Buterin

In conclusion: Multichain, cross-chain and the future of interoperability

We did all that research to find a solution for our own problem. We believe that we found it! 

Just to recap:

  • Ethereum transaction fees are killers for decentralized applications and services which depend on cheap onchain transactions
  • ZK Rollups seem to be a promising Layer 2 solution, but unfortunately, it is new and smart contract support is only on testnet. We will need to wait for at least half a year or longer. 
  • There are good sidechains such as xDAI and Matic network, but no one knows which will gain mass adoption or how they will evolve. Being tightly connected to one blockchain is a risk to Mysterium Network, or any decentralized service. It may mean a hard and complex migration in the future. 
  • Payment channels are able to be used in cross-chain transactions – this means that consumers of VPN services can hold their wallets on Layer 2, while a provider is on a different Layer 2 or even on a Layer 1 blockchain. 

Mysterium Network will be deployed on multiple chains and we already are working on cross-chain payments support. We see this as the future for most payment channel-based solutions. 

Exciting updates to our roadmap and partnership announcements coming soon. If you haven’t already – Get Mysterium VPN: Free on Testnet.