Valis Network: A Harder, Better, Faster, Stronger Qubic
The Valis Network is a powerful middleware solution designed to support millions of concurrent Qubic users.
Spelunker, July 29, 2024.
A Megalopolis in the making
Imagine a city on the brink of massive growth, but with one major problem: its limited roads threaten to stifle this expansion. Just as a city needs more infrastructure to handle increased traffic, the Qubic ecosystem requires robust infrastructure to support its expanding user base.
Let’s do a quick calculation. With 50 public Qubic computor nodes, each handling 80 connections under current settings, the Qubic network can only support 4,000 connections. Fortunately, this limited number of connections can be shared by multiple end users through a “connection-per-request method”.
A connection-per-request method is a networking technique where a new connection is established for each individual request made by a client to a server. Once the server handles the request, the connection is closed. This allows multiple clients to share a limited pool of connections efficiently, as each connection is only used temporarily.
Just as your car doesn’t use the road 100% of the time, a client doesn’t use a connection 100% of the time. Therefore, the actual road’s capacity depends on its level of utilization. Since a quick calculation won’t do, we need some scenarios:
Utilization | Concurrent
Connections
per QCN | Total
Connections
(50 QCNs) | Connection
Load
per Wallet | Total
Users
Supported |
Maximum | 80 | 4,000 | 100% | 4,000 |
Peak | 80 | 4,000 | 10% | 40,000 |
Realistic | 80 | 4,000 | 3% | 133,333 |
Low | 80 | 4,000 | 1% | 400,000 |
In our “Peak” scenario, the Qubic network can support 40,000 concurrent users, just shy of the 43,000 members in the official Qubic Discord. Without scalability, the ambitious Qubic megalopolis risks fading away before it even materializes.
A bit of history
In late 2023, Qsilver identified this problem and began developing a solution. His primary goal was to create tools capable of supporting the first million concurrent Qubic users. Since the current Qubic network cannot handle this volume directly, Qsilver designed intermediary layers to act as a bridge between various applications (such as end users with wallets) and the Qubic network. In technical terms, he created a "middleware" that could eventually onboard the world to Qubic.
The first implementation of Qsilver’s vision was developed independently and named Qserver and Qclient. Later, funding from the Qubic Community was used for UI development. Qserver and Qclient currently power version 1 of Valis Wallet and Valis Explorer.
For the last four months, we have been working quietly and diligently to enhance our middleware. After undergoing extensive refactoring, improvements, and polishing, the codebase is ready to become the backbone of version 2 of Valis Wallet and Valis Explorer. We are extremely proud of the results. We call it the Valis Network.
Enter the Valis Network
The Valis Network is designed as a cloud service with on-demand scaling. It follows a distributed hierarchical node structure, leveraging two kinds of nodes:
- Valis Cloud Nodes (VCN): Deployed in centralized cloud environments, VCNs interact with Qubic Computor Nodes (QCN) and handle heavy data processing and storage.
- Valis Edge Nodes (VEN): Positioned at the periphery of the network, VENs manage user-facing interactions and communicate with VCNs.
The Valis Network supports multiple VCNs, each of which serves multiple VENs. Each VEN, in turn, supports numerous End-User Applications (e.g., Valis Wallets).
In the Valis Network, 99.9% of data flows from the Qubic Network to the end-user. VCNs pull data from the Qubic Network, compress it, and pass it to VENs, which process optimized data streams and handle websocket requests from end-user apps. VENs sync to the latest tick with minimal latency.
The only time data flows in the opposite direction is when end-users submit transactions via end-user apps like the Valis Wallet to the Qubic Network.
Taking cost-efficiency to the limit
When we talk about "execution" at Valis, we mean getting things done effectively and efficiently. Note that effectiveness is about the outcome while efficiency is about the process. Merely achieving the goal (e.g. scalability, usability…) does not qualify as success. You must do it while using resources wisely and minimizing waste. Therefore, to determine if the Valis Network is successful, we must look at the cost.
Cost-efficient Scalability
As we prepare to enter the testing phase, we expect the Valis Network to scale horizontally at a monthly cost of $1,000 per million users. In other words, a millicent per wallet and month. This example, assumes deploying just 1 VCN ($200/VCN/month) to manage 40 VENs ($20/VEN/month), each supporting 25,000 Valis Wallets.
In terms of scalability, this setup is more cost-efficient than decentralized solutions. Again, remember, a Qubic Computor Node supports 80 connections, and the server alone (bare metal server with at least 8 cores, 500GB or RAM and 1Gbps synchronous internet connection) has an estimated cost of around $13,000.
Granted, comparing a VCN to a QCN is like comparing apples and oranges. Each one focuses on achieving different goals. However, when it comes to serving end-users, the Valis Network (VN) in its minimal configuration of $1,000/month is 25 times more efficient than the whole Qubic Network (QN) of 50 QCNs operating at peak utilization with $650,000 in initial capex.
Cost-efficient Usability
While ensuring an optimal end-user experience, scalability is not the only threat to the Qubic Megalopolis.
In the relentless pursuit of maximum performance, Qubic makes many unorthodox choices, some of which impact usability. For example, since Qubic prunes all data except balances weekly, creating transaction histories for end users becomes a challenge. Worry not, the Valis Network comes to the rescue. By maintaining an up-to-date historical archive of transactional data, storing and indexing all transactions for quick retrieval, the Valis Network is able to offer up-to-date token balances and transaction histories to end users. As a reference, a QCN requires 35 GB of storage per epoch of raw data, while each VEN uses 6 GB for 23 epochs, or 0.26 GB per epoch.
Features aside, speed matters. Each new connection takes about a second to establish, adding unwanted latency. A second may not seem much but, when it comes to end-user apps (sign ins, POS payments, transfers with the expectation of near-instant confirmation…), that additional delay becomes pretty noticeable, well beyond the Doherty threshold. By maintaining persistent connections, the Valis Network removes that extra second at scale.
Cost-efficiency, Scalability, and Usability in Action
To better understand the benefits of the Valis Network for end-user apps, let’s use Valis Wallet as an example. We will focus on how to offer three key features at scale:
- Displaying Token Balances: Valis Wallet efficiently displays token balances without requiring user intervention. Other wallets can display balances. However, they often disconnect and require manual refreshes to reduce QCN load.
- Supporting Qx: Valis Wallet is the only Qubic wallet supporting the Qx Decentralized Exchange (DEX). Other wallets could create Qx transactions without middleware, connecting directly to a QCN, but what orders should users make without seeing the order book? In theory, other wallets could request to fetch order books every tick, but they would quickly overwhelm QCNs, so they don’t do it.
- Availability During Spikes: Valis Wallet remains responsive and functional even during high-traffic events, supporting millions of users thanks to the use of persistent connections. Other wallets may, and will, become unresponsive under heavy load.
As you can see, while others struggle or fail to mimic key features during low activity periods or under limited conditions, the Valis Wallet can offer the very same key features cost-effectively and reliably, at scale, ensuring uninterrupted service while preventing network congestion.
To sum up, the Valis Network provides businesses and developers with a unique advantage in scalability, efficiency, and usability, particularly under high-traffic conditions. Additionally, it benefits the Qubic ecosystem by offering these features without damaging the network, thereby avoiding a tragedy of the commons.
Qubic’s Exoskeleton
When reading about the challenges described above, some may perceive Qubic as flawed and the Valis Network as Qubic’s crutches. Not us. Qubic is a beautiful DRT, uncompromising in the search for performance, stripping away all unnecessary elements until only the essential remains. Instead, we view the Valis Network as Qubic’s exoskeleton, complementing and enhancing the Qubic Network.
Thanks to the use of smart contracts, Qubic end users get performance and, thanks to the Valis Network, scalability and usability. Effectively and efficiently.
Another way to think about the complementary nature of both networks is as an onion with four layers, each one encapsulating the previous ones. The inner layer is a network formed by QCNs. The second and third layers are formed by VCNs and VENs respectively. Together, the middle layers constitute the Valis Network. The outer layer is a network of end users, developers, and businesses.
Qubic’s stakeholders can choose to interact directly with the inner layer, but they will experience less reliability, higher development complexity, fewer features, slower performance, and poor scalability. Thanks to the Valis Network, Qubic becomes:
Harder (Reliability)
Persistent connections in the Valis Network prevent downtime during peak transaction periods. Your Valis Wallet will be there when you need it the most.
Better (Time to Solution & Features)
Developers can quickly integrate with Qubic using the Valis Network, avoiding the complexities of direct node interaction. End users enjoy the benefits of having access to non-transactional, non-tick-related data (address and token balances, orderbook, marketcap, richlist, smart contract state…).
Faster (Speed)
Persistent connections allow end users to enjoy minimal latency. Sharing connections across all users allows for a fast, consistent experience, similar to an express lane on a busy highway.
Stronger (Scalability)
The Valis Network can support millions of concurrent users, orders of magnitude more than wallets directly connected to Qubic nodes, which struggle with just a hundred.
The Future
As we hinted two weeks ago, we believe the Valis Network will transform the Qubic ecosystem from both a business and technical standpoint. By creating an Infura-like service on top of Qubic, instead of Ethereum, we aim to facilitate the development and deployment of high-performance end user applications, driving the growth and adoption of Qubic.
For Developers
The Valis Network abstracts the complexity of the Qubic network, allowing developers to build applications without worrying about infrastructure and scalability.
For Businesses
Businesses can build and deploy scalable applications on the Qubic network with a pay-per-use model for cost-effectiveness.
For the Qubic Ecosystem
The Valis Network supports the growth of the Qubic network by providing essential infrastructure, making it easier for developers and businesses to adopt and use Qubic.
As development continues, the focus remains on ensuring robust performance, scalability, and ease of use for all stakeholders.
If you have an idea to build on top of the Valis Network, we’d love to hear it.
Related Posts
- QWALLET and QPOOL Crowdfunding - April 30, 2024.
- Qwallet, Qclient and Qserver - March 13, 2024.
For the latest updates, join the Valis Discord, follow us on X, and bookmark our blog.
← Previous
On this Page
- Valis Network: A Harder, Better, Faster, Stronger Qubic
- A Megalopolis in the making
- A bit of history
- Enter the Valis Network
- Taking cost-efficiency to the limit
- Cost-efficient Scalability
- Cost-efficient Usability
- Cost-efficiency, Scalability, and Usability in Action
- Qubic’s Exoskeleton
- Harder (Reliability)
- Better (Time to Solution & Features)
- Faster (Speed)
- Stronger (Scalability)
- The Future
- For Developers
- For Businesses
- For the Qubic Ecosystem
- Related Posts