IoTeX 백서

IoTeX

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 6쪽 중 4쪽

as popular DSLs (e.g., Circom [ 32], Halo2 [ 33], ZoKrates [ 34], Noir [ 35], Cairo [ 36], etc.) for building custom- ized zk circuits. 44 Figure 4.3: The System Architecture of a SNARK-Based Application Built upon a Customized Circuit • TEE Prover: According to the definition by Confidential Computing Con- sortium (CCC), a trusted execution environment (TEE) is a dedicated hard- ware (and software) environment that provides a level of assurance of the following three properties: 1) Data Confidentiality: Unauthorized entities cannot view data while it is in use within the TEE; 2) Data Integrity: Unau- thorized entities cannot add, remove, or alter data while it is in use within the TEE; and 3) Code Integrity: Unauthorized entities cannot add, remove, or alter code executing in the TEE. These salient security properties ensure the confidentiality and integrity of both data and program, thereby allowing a remote party to trust the computation results on a TEE-enabled hardware platform (e.g., Intel SGX, AMD-SEV , Arm CCA, AWS Nitro, NVIDIA H100, etc.). TEE-based systems root their security in hardware and users have to trust that the hardware has not been tempered with or is broken in an undetectable manner. A typical system architecture of a TEE-based application is shown in Fig- ure 4.4, which relies on the remote attestation mechanism of a TEE-based hardware platform. Remote attestation is a process by which one party 45 (i.e., a verifier) assesses the trustworthiness of a potentially untrusted re- mote peer (i.e., an attester). The goal of attestation is to allow the verifier to gain confidence in the trustworthiness of the attester by obtaining an au- thentic, accurate, and timely report about the software and data state of the attester. With the aid of an attestation service, an attestation report can be obtained which contains the cryptographic measurement of the execution environment (i.e., hardware, software, custom data, etc.). Figure 4.4: The System Architecture of a TEE-Based Application A TEE prover can be implemented by following the general development flow of a certain TEE provider. The TEE prover facilitates DePIN de- velopers to utilize the state-of-the-art confidential computing technology for performing privacy-preserving off-chain computing. W3bstream will gradually support the development flow of the leading TEE-based hard- ware platforms such as Intel SGX [ 37], Intel TDX [ 38], AMD SEV [ 39], AMD SEV-SNP [40], AWS Nitro [ 41], Arm CCA [ 42], etc. • SMPC Prover: MPC represents a collection of techniques for privacy-preserving collaborative computations over distributed data and reveals nothing but the computation result. Given various security assumptions and threat models (e.g., semi-honest adversaries, malicious adversaries, covert ad- 46 versaries), a SMPC protocol should at least satisfy three properties, namely input privacy , correctness and independence of inputs. A typical system ar- chitecture of a SMPC-based application which is built upon a pre-processing model is shown in Figure 4.5. Figure 4.5: The System Architecture of a SMPC-Based Application A SMPC prover can be realized by following the general development flow of a specific SMPC protocol (e.g., SPDZ). However, achieving public verifi- ability in an efficient manner is still an ongoing research direction. • Bring Your Own Prover (BYOP) : The BYOP offers great flexibility for De- PIN developers deploying optimized provers that are tailored to specific DePIN projects or exploring new efficient verifiable computation techniques in the context of DePIN. 4.1.2 Our In-house Innovation on ZKP Multi-scalar multiplication (MSM) is one of the core components of many zero- knowledge proof systems, and a primary performance bottleneck for proof gen- 47 eration in these schemes. One major strategy to accelerate MSM is utilizing pre- computation. Several algorithms (e.g., Pippenger [ 11, 12] and BGMW [ 13]) and their variants have been proposed in this direction. In our recent research [ 15], we revisit the recent precomputation-based MSM calculation method proposed by Luo, Fu and Gong at CHES 2023 [ 14] and generalize their approach. In partic- ular, we presented a general construction of optimal buckets. This improvement leads to around 15% ⇠ 40% performance improvements, which are verified by both theoretical analysis and experiments. We also introduced a bucket-amenable recording using fast endomorphisms on j = 0 elliptic curves to divide the stor- age requirement by 3, at almost no performance penalty , compared to our LFG already optimized algorithm. 4.2 W3bstream Workflow 4.2.1 Prover Onboarding and Management The prover onboarding is based on ioID and follows the process described in Section 5.2.2 - ioID Registration and Binding. An on-chain fleet management contract is responsible for scheduling tasks and tracking the lifecycle of all the prover nodes. Each prover node can be either in a ’Busy’, ’Idle’ or ’Offline’ status and the node status will be continuously updated in the fleet management contract. A W3bstream explorer can be used to check the status of all prover nodes. 4.2.2 Workflow In a modular DePIN infrastructure, W3bstream is an implementation of the off- chain computing layer (OCCL) featuring multiple provers as described in Section 4.1. W3bstream is a decentralized heterogeneous prover pool that is able to per- form a project-specific business logic on the data stored in the data availability 48 layer (DAL) and generating validity proofs (e.g., zero-knowledge proofs, attesta- tion reports, etc.) of the computations executed. W3bstream works as a stateless computing component in a modular DePIN infrastructure and follows the high- level OCCL workflow as illustrated in Figure 4.6 below. Figure 4.6: The High-Level Workflow of the Off-Chain Computing Layer 1. A coordinator node in the off-chain computing layer retrieves data from the data availability layer based on the configuration of a DePIN project; 2. The coordinator node feeds data to an idle prover node or a selected set of idle nodes in the off-chain computing layer; 3. The prover node(s) performs computation specified by the DePIN project and generates the computation result and corresponding validity proof; 4. The computation result and validity proof are returned to the coordinator node; 49 5. The coordinator node sends the computation result and validity proof to a smart contract for further processing. Once a proof is verified on-chain successfully , the computation result can be trusted and consumed by the dApp of a DePIN project. 4.3 DePIN V erification and Off-Chain AI The comprehensive suite of provers available in W3bstream allows a developer to prove integrity of off-chain computations to layer-1 blockchain for a wide range of DePIN applications. In particular, a developer can choose the most suitable verifiable computation technique for a specific application. 4.3.1 DePIN V erification As Guy Woullet of a16z has pointed out [ 43], the success of DePIN hinges on addressing a pivotal challenge: ensuring trusted verification of geographically dispersed service nodes without the need for central authority . The current tech- nology for DePIN verification can be roughly classified into three categories [ 44], namely trusted hardware based approach, statistical approach, and validity proof based approach. Each verification approach has its own pros and cons and a combination of multiple approaches might be required in practice. W3bstream facilitates various DePIN projects to deploy and subsequently update their veri- fication algorithm on the platform. These verification algorithms can be written in high-level programming languages such as Rust, Golang, C++, etc. By using one of the provers provided in W3bstream, the trustworthiness of DePIN verific- ation algorithms can be guaranteed. 4.3.2 Off-Chain AI DePIN applications unlock new opportunities for AI training and inference across different industry sectors. On the one hand, DePIN applications are able to bring 50 huge amounts of real-world data to Web3 in a trustworthy manner, which could improve AI models’ accuracy significantly . On the other hand, DePIN applic- ations can effectively organize computing and storage resources for AI train- ing and inference on a global scale. However, AI applications are often com- putationally intensive and pose significant challenges to be deployed on-chain. W3bstream allows a developer to conduct off-chain AI computations and en- sures trustworthiness of the computation process simultaneously . While zero- knowledge proofs are able to provide strong integration protection for off-chain computing, applying zero-knowledge proofs for AI (e.g., ZKML) might easily incur 10,000x to 100,000x overhead when compared to non-verifiable AI compu- tations [ 45]. In lieu of using a ZKP prover, a developer could switch to a more efficient TEE prover for off-chain AI computations in W3bstream. Our initial work [7, 8] built upon Arm’s V eracruz framework and AWS’s Nitro enclave has shown some very promising results. 51 Chapter 5 ioID - A Unified Identity System for DePIN DePIN applications involve extensive on-chain (i.e., staking, asset transfer, lend- ing, etc.) and off-chain (i.e., person-to-machine and machine-to-machine) inter- actions among different system participants. The identity layer in a modular DePIN infrastructure is an essential component to manage relationships of vari- ous entities and ensure secure interactions among them. As a result, designing a unified identity layer that is able to meet the requirements of both on-chain and off-chain interactions is highly desirable for DePIN applications. 5.1 On-Chain vs. Off-Chain Identity 5.1.1 On-Chain Identity The primary goal of an on-chain identity is to attest ownership of crypto assets and perform a variety of crypto asset related operations such as transfer, staking, lending, etc. A blockchain address of an Externally Owned Account (EOA) or a Smart Contract Wallet (SCW) as specified in ERC-4337 [ 25] serves well for this purpose. In particular, a SCW that allows arbitrary verification logic is able to 52 abstract the complexities of blockchain transactions (e.g., signature verification, nonce increase, gas payment, chain compatibility , etc.) and make interaction with blockchain more intuitive for end users. Additional attributes (e.g., event parti- cipation, proposal voting, etc.) could also be associated with an on-chain identity (i.e., a blockchain address) via Non-Fungible Tokens (NFTs) [ 26] or Soulbound Tokens (SBTs) [ 27]. Those attributes might be required for certain dApps (e.g., token airdrop). 5.1.2 Off-Chain Identity In DePIN applications, an off-chain identity is required for establishing trusted person-to-machine and machine-to-machine relationships. While a digital certi- ficate (e.g., X.509) , which binds an identity to a public key , is widely used to enable trust in a centralized system, self-sovereign identity (SSI) [ 48] provides a promising identity solution for securing communications between two entities in a decentralized setting. As illustrated in Figure 5.1, SSI is composed of three key pillars, namely decentralized identifiers (DIDs) [ 49], verifiable credentials (VCs) [ 51] and DIDComm messaging [ 50]. Once each participant (i.e., person or machine) in a decentralized system registers its DID on a verifiable data registry (e.g., blockchain), two entities can establish a secure communication channel and authenticate with each other by exchanging DIDComm messages. VCs come in handy when additional identity attributes are required to be attested by certain entities (i.e., VC issuers). 5.2 The ioID Design ioID, which leverages blockchain wallet addresses (either Externally Owned Ac- count (EOA) or Account Abstraction (AA) wallet) as on-chain identities and DIDs as off-chain identities, is a unified identity system designed by IoTeX for hand- ling on-chain and off-chain digital relationships among participants in DePIN applications. As a general-purpose identity system, we envision that ioID could 53 Figure 5.1: The Three Key Pillars of SSI be utilized in different layers of the DePIN modular infrastructure, as shown in Figure 5.2. 5.2.1 On-Device ioID Generation A DePIN device is able to generate a DID and the corresponding DID document on-the-fly within the device by integrating the IoTeXâs ioConnect SDK [ 16]. For a DePIN node deployed to support operation of a certain centralized or decent- ralized layer in a modular DePIN stack, a node operator could generate a DID and DID document using a command-line interface (CLI). For embedded DePIN devices, manufacturers could integrate the ioConnect SDK into the device firm- ware and allow users to read a DID and DID document (e.g., via serial ports) from devices. 54 Figure 5.2: An Overview of the ioID Identity System 5.2.2 On-Device ioID Generation A DePIN device owner can onboard a device via a web portal (e.g., the IoTeXâs MachineFi Portal). The onboarding process is shown in Figure 5.3. 1. A device owner first logs into the web portal using Metamask; 2. The device owner makes a minimum token deposit (e.g., 10 IOTX tokens) on the web portal. Those tokens are used for paying gas fees during the device onboarding process; 3. The device owner obtains a DePIN deviceâs DID and DID Doc: (a) For a DePIN node, the device owner (i.e., a node operator) needs to log into a node locally or remotely and uses the CLI to generate a DID and the corresponding DID Doc on the node; (b) For an embedded DePIN device, the device owner needs to i. Connect the device to PC via USB; 55 Figure 5.3: A Miner’s Journey for Onboarding DePIN Devices ii. Click "Read Device DID & DID Doc" button on the web portal to retrieve the deviceâs DID and DID Doc via the serial port; 4. The device owner selects a centralized or decentralized storage layer pro- vider (e.g., AWS S3, IPFS, etc.), stores the DID Doc, makes it publicly ac- cessible, and obtains its URI; 5. The device owner invokes the device registry contract with the deviceâs DID, hash of the DID Doc, and URI of the DID Doc. After a successful device onboarding process, a DePIN device owner is able to see a device NFT shown in his/her blockchain wallet, which represents on-chain ownership of a DePIN device. 56 5.2.3 Secure Machine-to-Machine Interactions Once a DePIN deviceâs DID is registered on-chain during the device onboarding process, it is able to conduct secure off-chain communications with other entities in the network based on the standardized DIDComm messaging protocol. 5.3 Integration of ioID in a DePIN Project A DePIN project needs to complete a number of setups before using the ioID module. 5.3.1 Smart Contracts in ioID The ioID suite of smart contracts provides a robust framework for decentral- ized identity management on the IoTeX blockchain. These contracts collectively provide a robust framework for identity management and interaction within the IoTeX ecosystem. • DePIN Project Registry : The DePIN Project Registry is an NFT-based re- gistry that manages all DePIN projects. It ensures that each project is uniquely identified and authenticated within the network. • ioID NFT Contract : The ioID NFT contract is an essential part of the ioID framework for decentralized identity management on the IoTeX blockchain. It’s directly managed by the Project Registry and is in charge of creating and assigning unique ioID tokens for devices. This involves linking devices to project IDs and owners, and generating associated wallet addresses accord- ing to the ERC6551 standard. • ioID Store: The ioID Store is responsible for managing the application and activation of ioID across all projects. It handles the lifecycle of identity management applications, ensuring that identities are correctly set up and maintained. 57 • ioID Registry: The ioID Registry contract is used for registering devices on- chain and activating their ioID. It also serves as a DID resolver, providing a reliable means for verifying device identities across different projects. 5.3.2 Deploying the Device NFT Contract To integrate a DePIN project with the IoTeX ioID module, the project owner starts by deploying a "Device NFT" contract to tokenize each device within their project. A user who owns a device NFT from a DePIN project is entitled to register a new ioID identity for a physical device and bind it to their blockchain wallet. When a new ioID is registered for a device, an ioID NFT is minted to the owner’s wallet, and the corresponding device NFT is transferred to the ERC-6551 wallet of the ioID. This process effectively "activates" the ioID, linking the physical device to its digital identity and to its owner on the blockchain. 5.3.3 Registering a DePIN Project Any DePIN project intending to use ioID identities must apply for a certain number of ioIDs by paying the required amount. ioIDs can only be requested by registered DePIN projects on the IoTeX blockchain. A project owner can either make a direct smart contract call or use the IoTeX command line interface (i.e., ioctl) to register a DePIN project. Once the transaction is completed you will receive a Project NFT with a certain Token ID, representing your DePIN Project ID on the IoTeX blockchain. 5.3.4 Setting the Device NFT Contract After registering a DePIN project, the next step is to set the Device NFT contract for that project in the ioID Store. This contract must be set before a device at- tempts to register an ioID for your project. A project owner can either make a direct smart contract call or use the IoTeX command line interface (i.e., ioctl) to complete this step. 58 5.3.5 Requesting ioIDs A project owner needs to apply for ioIDs by paying the required amount of IOTX tokens. The amount is determined by the number of ioIDs requested. The project owner can either make a direct smart contract call or use the IoTeX command line interface (i.e., ioctl) to request ioIDs. After the transaction, the number of requested ioIDs will be associated with the DePIN project. 5.3.6 Registering a Device After setting the Device NFT contract and requesting a certain number of ioIDs for a DePIN project, physical devices can now be activated for the project by registering them in the ioIDRegistry contract. This process is performed by the device owner and will mint a new ioID NFT to the device owner’s account, bind it to the device’s DID and to the Device NFT. 59 Chapter 6 ioConnect - A Universal Embedded SDK for Empowering Device Abstraction DePIN applications involve diversified hardware devices with different capab- ilities and functionalities. The primary goal of the Hardware Abstraction Layer (HAL) in the modular DePIN infrastructure is to abstract the complexity and het- erogeneity of a wide range of smart devices (big or small) and facilitate them to connect with a centralized or decentralized Connectivity Layer (CL) in a secure manner, as illustrated in Figure 6.1. A challenging question is designing a uni- versal embedded SDK that allows device manufacturers to connect their devices to a DePIN backend easily . In practice, ioConnect SDK aims to support pop- ular microcontroller families (e.g., ESP32, Arduino, STM32, etc.), single-board computers (e.g., Raspberry Pi, ODROID, Rock Pi, etc.), and smartphones (e.g., Android and iOS) is highly desirable. 60 Figure 6.1: Secure Connection between HAL and CL 6.1 Connectivity Options 6.1.1 Connecting to a Centralized Connectivity Layer Connecting a smart device to a centralized connectivity layer (e.g., a cloud-based IoT gateway) has been extensively investigated in the traditional IoT industries and adopted by quite a few early-stage DePIN projects due to its technology maturity . Digital certificates (e.g., X.509) are often utilized to ensure secure com- munication between smart devices and a centralized connectivity layer. Using a cloud-based IoT gateway (e.g., AWS IoT Core [ 46]) as an example (see Figure 6.2), a
프로젝트로 돌아가기