W3bstream: A Layer-2 Rollup for DePIN
The recent ascendance of the DePIN space into the crypto mainstream poses several questions and challenges, such as decentralization, scalability, verifiability, identity management and data trust. The article below will delve into some of these challenges and the solutions proposed by the IoTeX core team through one of its products: W3bstream, a Rollup-centric scalable architecture for off-chain data computation.
A DePIN Refresher
The DePIN (Decentralized Physical Infrastructure Networks) sector represents a significant shift from traditional Web2 based IoT systems. Traditionally, IoT systems have been either cloud-centric, where data from physical devices passes through an IoT gateway to the cloud for processing and storage, or edge-centric, involving edge servers that process data closer to the source. These architectures, while popular in IoT applications, are centralized or hybrid in nature. DePIN, however, introduces a novel approach by integrating three core technologies: Blockchain, IoT, and Tokenomics. This combination enables the creation of infrastructure networks and machine economies from the grassroots level. DePIN's distinctiveness lies in its community-driven model, encouraging the building of applications for the common good, rather than centralized deployment and maintenance by a single company.
There are two main categories within DePIN:
- Physical Resource Networks (PRNs): These networks focus on location-dependent hardware for delivering unique goods or services. Examples include wireless connectivity, geospatial intelligence through sensors in specific areas, and mobility applications like automotive services.
- Digital Resource Networks (DRNs): DRNs incentivize the deployment of hardware for fungible resources, such as computing power, storage, or bandwidth. This allows for the creation of large networks for tasks like video/audio rendering or storage services, without the need for location-specific hardware.
The DePIN landscape is rich and varied, with numerous startups exploring different aspects such as decentralized computing, storage, bandwidth networks, and communication protocols. Regardless of what kind of category a certain project falls into, DePINs come with inherent challenges such as establishing system identities, addressing privacy issues, and notably, scalability.
The DePIN Scalability Challenge
As hinted at earlier, scalability emerges as a crucial challenge, driven by the inherent characteristics of DePIN applications. DePINs typically encompass large-scale networks with numerous devices, generating and processing vast amounts of data. Concurrently, the integration with blockchain technology, while providing a robust trust foundation, brings its own set of limitations. Blockchains, known for their high trust factor, suffer from limited processing capability and costly data storage. This juxtaposition of extensive network and data requirements against the constrained processing capabilities of blockchains clearly illustrates the scalability challenges faced in DePIN applications.
The Ethereum Rollup Approach
The approach Ethereum has been adopting to tackle scalability issues is through a Rollup-centric roadmap. This strategy fundamentally rethinks the way data processing and transaction execution are handled in a blockchain network.
- Layer 2 Rollups: Instead of relying solely on the Layer 1 (main blockchain) for all data processing and execution, Ethereum proposes offloading much of this work to Layer-2 Rollup networks. These networks operate alongside the main blockchain but handle transactions in a more efficient manner.
- Batch Processing of Transactions: The Layer 2 networks collect transactions from the Layer 1 network and process them in batches. By aggregating multiple transactions, the Rollup networks can process them more efficiently than if they were handled individually on the main blockchain.
- Proof Generation and Validation: After processing transactions in a batch, the Layer 2 networks generate a proof. This proof is a cryptographic evidence that verifies all transactions processed in a Rollup network are valid. The Layer 1 network, through a smart contract, then validates this proof. This process ensures the integrity of the transactions processed on the Layer 2 networks.
- Layer 1 as the Trust Anchor: Despite offloading data processing to a Layer 2 network, the Layer 1 blockchain retains its role as the core trust anchor. It achieves this by validating the proofs from the Layer 2 network, thereby maintaining overall network integrity and security.
- Efficient State Transitions: With the Layer 1 network accepting these proofs and the resultant state transitions, it can process the batch of transactions more efficiently. This approach reduces the burden on the Layer 1 network, allowing it to function more effectively as a trust anchor while handling fewer, but more critical, tasks.
This Rollup-centric approach allows Ethereum to significantly enhance its scalability, and it can be adapted to DePIN, with certain modifications.
W3bstream: A Layer-2 Rollup for DePINs
As mentioned earlier, a Rollup-centric approach could also be used to scale DePIN applications. This approach is the core philosophy behind IoTeX's W3bstream, IoTeX's Layer-2 network specifically catered towards scaling DePIN projects, which is able to compress (aggregate) large amounts of off-chain data into much smaller, verifiable zk-proofs to trigger on-chain transactions. Let's now look at the main components of such an approach:
- Sovereign Smart Devices: These are crucial for data trustworthiness in DePIN projects. Deployed in the physical world, these devices not only collect data but also attest to the trustworthiness of the data collection process.
- Data Availability Layer: This layer is responsible for temporarily storing data received from devices. It can be either on-chain or off-chain and is different from persistent storage due to its short-term nature.
- Decentralized Sequencer Network (DSN): DSN reaches consensus on the data collected from devices and stores it in the data availability layer. This consensus is necessary for any meaningful computations to be carried out.
- Decentralized Aggregator Network: Responsible for computation, this network retrieves data in batches from the data availability layer and generates aggregated zk-proofs for one or multiple devices.
- Layer-1 Network: Smart contracts on a Layer-1 can be used as verifiers to verify the zk-proofs generated by off-chain aggregators. In this way, the Layer-1 serves as the trust foundation and settlement layer for DePIN applications.The high-level flow of such architecture is as follows:
The sections below analyze this architecture in more detail, starting from how to collect trusted data, then explaining the data pre-processing and data availability to then talk about the aggregate proof generation process.
Trusted Data Collection
In DePIN applications, trusted data collection is crucial and primarily achieved through two approaches: TEE (Trusted Execution Environment)-based and zero-knowledge proof (ZKP)-based.
- TEE-based Approach: TEE ensures secure data collection by isolating data collection code in a protected area of the device. It also includes remote attestation, allowing external verification of the device's operation and code integrity.
- ZKP-based Approach: This method enables devices to prove their data collection accuracy without revealing the underlying data. It varies based on device capability, with on-board ZKP generation for powerful devices and remote generation for more constrained ones.
Combining TEE and ZKP enhances data collection trustworthiness in DePIN applications, impacting the overall effectiveness of the associated financial systems. Future research aims to improve ZKP efficiency, especially for devices with multiple sensors or complex data collection needs.
Data Pre-Processing and Data Availability
The second main component in DePIN architecture involves data pre-processing and ensuring data availability, facilitated by a decentralized sequencer network. This network serves multiple DePIN projects and addresses the challenge of device diversity, particularly in communication protocols.
Decentralized Sequencer Network:
- Function: Performs data preprocessing. As data arrives from various devices, the network processes it to ensure uniformity and compatibility.
- Verification Process:
Each node in the network verifies the data in two steps:
1) Confirming the validity of the data collection process, either by checking the attestation report from TEE-enabled devices or by verifying the proof generated by the device.
2) Validating the device's signature to ensure the authenticity of the data source.
Data Storage and Availability:
- Post-Preprocessing: After data is preprocessed and consensus is achieved within the network, it is stored in a project-specific data availability layer.
- Customizable Storage Solutions: Projects have the flexibility to choose their preferred data availability layer. This is enabled through configurable storage adapters, allowing data to be stored in the selected data availability layer.
This component of the DePIN architecture plays a critical role in standardizing and securing the flow of data from diverse devices, ensuring that it is processed uniformly and stored efficiently.
Data Proof Aggregation
The third component of the DePIN architecture focuses on aggregate proof generation, an essential process for validating computations in DePIN projects.
Aggregator Nodes and Computation Pool:
- The network consists of aggregator nodes forming an off-chain computing resource pool, shared across all DePIN projects.
- These nodes periodically select an idle aggregator, based on an on-chain status monitor, to handle computation tasks for a specific DePIN project.
Task Execution by Aggregator Nodes:
- The selected node retrieves data from the data availability layer.
- It then performs the necessary computations for the DePIN project and generates a proof.
- This proof is sent to a Layer 1 smart contract for verification, after which the node returns to idle status.
In order for this aggregate proof to be generated, the system will leverage a layered aggregation circuit, comprised of the following components:
- Data Compression Circuit: Functions like a Merkle tree, validating that all collected data originates from a specific Merkle tree root.
- Signature Batch Verification Circuit: Verifies the validity of the data from devices in batch, each associated with a signature.
- DePIN Computation Circuit: Proves that specific computation logic for a DePIN project, such as verifying step counts in a healthcare project, or energy produced in a solar plant, is correctly executed.
- Proof Aggregation Circuit: Aggregates all proofs into a single one for final validation by the Layer 1 smart contract.
The data proof aggregation is critical in ensuring the integrity and verifiability of computations within DePIN projects, providing a reliable and efficient method for validating off-chain computations and data processing.
Conclusion
In conclusion, W3bstream contributes to the scalability of DePIN by efficiently managing data pre-processing through its decentralized sequencer network. It supports aggregate proof generation, which is essential for validating complex computations across large-scale networks. By facilitating off-chain computations and providing a robust mechanism for on-chain proof verification, W3bstream significantly enhances the throughput and efficiency of DePIN applications. While the orchestration of W3bstream relies on the IoTeX blockchain, which still remains the perfect choice for new DePIN applications due to its speed, security and cost-effectiveness, W3bstream can support any existing DePIN project on any blockchain. Its architecture, allows for a scalable and secure infrastructure, making it a vital component in the broader ecosystem of decentralized networks.
This article is based on the research work by IoTeX's head of research, Prof. Xinxin Fan and Lei Xiu from Kent State University. For more information, feel free to checkout the full research paper here.
Learn more about W3bstream and all the tools the IoTeX team is offering to DePIN builders and founders. New to DePIN? Find everything about the DePIN landscape on the IoTeX powered DePINscan.