Space and Time 백서

Space and Time

원문

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

ions. The basic constructs of SQL (selections, projections, joins, and aggregations) cover most of the processing requirements for large datasets. 3. Relational Data Models: Blockchain indexing necessitates the decomposing of the blockchain ledger into multiple tables (wallets, blocks, transactions, smart contract logs/events, price feeds, etc.) in a relational data model. For example, the “wallets” table can be joined with the “blocks” table, which can be joined with the “transactions” table. SQL is suitable for accessing structured, relational data. 2.4 Components of the Network Space and Time is a three-layer decentralized network of user-operated nodes serving distinct purposes: 2.4.1 Indexer Nodes Indexer nodes are lightweight servers designed to redundantly fetch and process data from popular blockchains such as Ethereum, Polygon, and Avalanche. These nodes: ● Continuously extract the latest block data, transactions, balance changes, smart contract event logs, storage slot updates, and more. ● Transform raw blockchain data into a relational SQL-compatible format, effectively performing Extract, Transform, Load (ETL) operations. ● Submit the transformed data as insert-data transactions to SXT Chain, ensuring the data is securely incorporated into tamperproof tables. 9 ● Can be deployed as a restaking-secured service using SXT Chain queries for rewarding or slashing Indexer nodes based on the accuracy of the source chain data they deliver. 2.4.2 Prover Nodes Prover nodes handle client requests for ZK-proven SQL execution against tamperproof tables secured by SXT Chain (via a threshold-signed commitment for each table). Their primary responsibilities include: ● Receiving client queries, often from smart contracts on EVM-compatible chains such as Ethereum. ● Executing ZK-proven SQL queries against indexed data or other secured tables. ● Generating cryptographic proofs to verify both the query’s computational accuracy and the integrity of the underlying data. 2.4.3 SXT Chain Validators Validator nodes are the backbone of SXT Chain, responsible for maintaining the integrity of the network. They: ● Update cryptographic commitments stored onchain whenever insert-data transactions are processed, ensuring that the tamperproof tables accurately reflect the latest data state. ● Collaborate via Byzantine Fault Tolerance (BFT) consensus to threshold-sign new commitments, providing a decentralized and secure mechanism for data verification. 10 Figure 0: Space and Time Primary Components 2.4.4 Target Chain and Offchain Components Space and Time is seamlessly integrated with major blockchains, delivering ZK-proven query results against onchain and offchain data to smart contracts. Below is an overview of how each step is handled: ● Client Request (Onchain): The client contract sends a payment along with query specification to the Space and Time Verifier contract, which then emits an event onchain requesting query/proof fulfillment (data processing jobs for indexed or offchain data). ● Proof Generation (Offchain): A single Space and Time Prover node (GPU) within the decentralized network listens for requests emitted onchain, then executes Proof of SQL 11 by generating a ZK proof and the associated query result for the request. Both the result and the proof are submitted to a client for verification. ● Proof Verification (Onchain): The Space and Time Verifier contract accepts the query result and proof from the Prover nodes. It verifies the proof and hands the verified query result to the client that requested fulfillment. Space and Time aims to address the pervasive problem of fragmentation in Web3 by developing a comprehensive solution that combines indexed data, proof generation, and verification, and the efficient relaying of data to smart contracts. 2.5 Ingestion Layer with Verifiable Indexing Data ingestion into Space and Time (SXT Chain) leverages BFT consensus across the Validator set, to cryptographically verify that indexed data from popular chains is accurate to that source chain. This can also be useful for customer-owned tables as well. For example, a client can define a tamperproof table in Space and Time that persists stock prices from traditional equity markets, with external business logic that captures real-time pricing information from 12 different stock market data APIs simultaneously. Space and Time Validator nodes can achieve consensus on the price of Apple stock across these 12 different data providers, for example, and only insert into SXT Chain the threshold-signed, consensus-approved price of Apple stock at the current moment. Similarly, with indexed blockchain data that the network captures, Space and Time leverages a decentralized Indexer node set to redundantly process the entire state of popular chains like Ethereum, Bitcoin, Polygon, ZKsync, etc. Each Indexer runs a light client for the source chain, an RPC service internally to get the latest block/transactions/events, decodes and transforms the data into a relational database format, and finally builds cryptographic commitments on recently indexed blocks. Indexers submit their transformed chain data to SXT Chain for consensus approval by the Validators . Through this process, Space and Time is commoditizing indexed blockchain data, and offering it at low cost through the network (SXT Chain only charges for compute costs of queries executed in Space and Time, not the underlying data storage). 2.6 Decentralized Database Design The decentralized database serves as an integral resource for smart contracts to efficiently offload computation and data storage. The solution enhances chain scalability, enables faster contract execution, and reduces the amount of gas spent onchain while allowing the entire stack to remain permissionless to operate. A growing number of developers are even starting to build ZK-rollups leveraging Proof of SQL as the L2 or L3 ledger that’s settled on a main chain 12 periodically, via a rollup contract on that main chain querying the ledger in Space and Time for updated account balances batched in a single transaction. This enables: ● Decentralization with Self-Custody: Data is stored and processed across a network of community-owned and operated nodes. Role-based and row-based access to each table/ledger in the database is governed by decentralized mechanisms using “biscuits,” [3] a budding approach to encoding user secrets and sharing permissions around CRUD operations to a table/ledger. This also facilitates self-custody of data in Space and Time, where an end-user can write directly to “public write-permissioned” tables/ledgers without intermediaries, and subsequently remove content or govern how other dapps that read from these tables/ledgers can access content. ● Offloading Compute and Storage: To maintain the efficiency and speed of onchain operations, smart contracts can offload to Space and Time any computationally intensive processes, account balance management, or voluminous storage requirements. ● Transparent data processing vs. ZK for privacy: Varying business requirements across a wide range of use cases require that some dapp developers transparently publish all data as “public read” tables/ledgers to their individual communities, while others must hide data processing to protect sensitive information. For example, a protocol that whitelists wallet addresses and calculates risk scores (for compliance reasons, OFAC protection, fraud prevention, etc.) may want to transparently publish their whitelist as a “public read-permissioned” table in Space and Time, as well as the actual model used to define risk scores associated with each wallet. On the other hand, a protocol that enables undercollateralized onchain lending may want to provide query results to smart contracts around real-world credit scores without actually revealing those credit scores to the public. Proof of SQL allows a smart contract to ask the SQL equivalent of “Is this user’s credit score greater than 600?” and prove that the ‘yes/no’ response from Space and Time is accurate without revealing the actual credit score. ● Network Effects and Scalability: As the network integrates more chains and more participants join the network, this not only increases protocol security but also the public datasets available (as well as third-party ecosystem integrations). This is traditionally known as “data gravity” and is a lucrative focus for traditional cloud database vendors. 2.7 Infinite Tables with Onchain Verification Space and Time capitalizes on the moats of both data warehousing and onchain protocol security to generate powerful network effects. By marrying the trustless properties of blockchain technology with the scale and efficiency of a data warehouse, Proof of SQL drives a new market standard of verifiable data processing at scale across both Web2 and Web3. 13 Figure 2: Marrying Scale and Provability with Proof of SQL On one hand, smart contracts can transact with Space and Time’s Verifier contracts onchain, incurring fees for data retrieval and verification. Simultaneously, enterprises can access Space and Time’s vast blockchain data (or their own customer-loaded tables), sometimes paying in fiat, which is then used to enhance the native token’s utility for: ● Offchain ZK-proven Queries on Analytic Tables: Direct access to Space and Time database nodes offchain can be achieved with REST APIs and RPC connection proxies deployed on or near the Validator nodes, for both tamperproof queries secured cryptographically by Proof of SQL as well as unverified queries secured optimistically by token-economic security. ● Cross-Chain Interoperability: Smart contracts on “Chain B” can query current or historical data (entire chain state) from “Chain A”, with arbitrary SQL business logic deployed en route. ● Joining Onchain and Offchain Data: Developers often write complex queries that join offchain data (such as TradFi market data, in-game activity, or traditional data lake reads for Web2 business processes) with onchain data (such as token swaps or perps, NFT activity, or blockchain rewards/metadata) while still retaining ZK-proven computation of query results if needed. Here is how onchain verification works, on any popular EVM chain: An SXT Chain query relayer contract is deployed to the EVM chain, which acts as an onchain endpoint for client smart contracts to interact with. The client contract sends a tiny payment along with a query ID, and the SXT Chain relayer emits an event that SXT Chain nodes listen for. A Prover node is chosen to execute the query and build the associated proof, and acts as a ZK-oracle to return the query result and proof back onchain. In doing so, the Prover builds an EVM transaction and pays 14 the EVM verification gas for the SXT Chain relayer contract to ZK-verify the provided query result before returning the result to the client contract via a callback. This entire process often happens within a block of the original client contract request. 3 Design of the Proof of SQL Protocol Within the Space and Time network, Proof of SQL is a novel cryptographic data-processing protocol that allows verifiable outsourced SQL execution using ZK proofs. This enables Space and Time to extend the security of Ethereum and other major L1s, L2s, or L3s/appchains to SQL databases. The protocol cryptographically guarantees to the client both that the underlying requested data (in many cases, indexed blockchain data) is tamperproof, and that the computational steps of the query request have been executed accurately. Proof of SQL eliminates the inefficiencies of consensus-driven data processing and offers practical, low-latency proof generation from a single Prover node (a single GPU) at a scale sufficient for enterprise-grade applications. The protocol was designed with several goals in mind. First, the protocol supports fast end-to-end queries. Second, the verification of the queries is cheap enough to run in constrained environments like EVM smart contract functions. Third, we have built it to be extremely developer-friendly: SQL is the most popular data query language and provides a familiar UX for anyone starting to build a data-forward application. Finally, this protocol facilitates complex data processing rather than simply running serial compute or blob data retrieval. 3.1 Overall Architecture In this section, we describe the general design and architecture behind the Proof of SQL protocol. The following sections go into more details about how the proof is constructed. To summarize the following sections: Section 3.1 gives an overview of the basic data flow; Section 3.2 describes the parsing of the query; Section 3.3 describes the query execution and proof setup; Section 3.4 introduces some mathematical notation that is used in later sections; Section 3.5 gives some examples of the protocol described in Section 3.3; Section 3.6 describes the sum-check protocol, which is a key primitive of the proof; Section 3.7 describes the commitment scheme. 3.1.1 Data Ingestion There are two main types of interactions as part of the Proof of SQL protocol. The first type of interaction is data ingestion and the second is a query request. Both of these could be initiated by a smart contract, a decentralized application, or any party interested in producing or consuming data. In practice, the actual data source does not need to be the verifier, but can instead be a 15 trusted data source. For example, the data could come from a trusted central party, from a trustless protocol such as the Space and Time Indexer nodes, or, as previously noted, from the Verifiers themselves. For the sake of this architecture discussion, we will separate the role of the Verifier from the role of the Validators , since this is the design of the Space and Time network. Other architectures could exist that leverage Proof of SQL and combine these roles. During data ingestion, the data source wishes to send data to the Prover so that the Prover can later query that data. However, to ensure that the data will not be tampered with, the Validators need to compute commitments of this data. The Verifier can then access these commitments, while the Prover holds onto the actual data. Without these commitments, the Prover would be able to modify the data at will, or return incorrect execution against the data. When a service or a client sends data that is to be added to the database, that data is routed to the Validators so they can create a commitment to that data. This commitment is a small “digest” of the data but holds enough information for the rest of the protocol to ensure that the data is not tampered with. After creating this commitment, the Validators route the data to the database for storage. The Validators store this commitment for later usage. An important design constraint is that the commitment must be updatable (see section 4.7). In other words, suppose that the Validators already hold the commitment to a specific table, but new data is to be ingested and appended to the table. To do this efficiently, the Validators must be able to combine the old commitment with the incoming data to create a new commitment to the entire updated table. The key constraint here is that the Validators must be able to do this without access to the old existing data. Figure 3: Sequence Diagram of Data Ingestion 16 3.1.2 Query Request The second type of interaction is a query request between the Verifier and the Prover . For example, the Verifier wants to have some data analytics executed on the data that the Prover is holding and for the result to be returned to the Verifier . The Verifier is able to trust this result because of the commitment to the underlying data. When a service, client, or the Verifier themselves send a query request, that request is routed to the Prover . At this point, the Prover parses the query, computes the correct result, and produces a proof. It then sends the query result and the proof to the Verifier . Once the Verifier has this proof, it can use the commitment to check the proof against the result and verify that the Prover has produced the correct result to the query request. The majority of this section (3) is dedicated to describing how this proof is constructed and verified. See the next subsection (3.1.3) for an overview. Figure 4: Sequence Diagram of Query Request from Verifier to Prover 3.1.3 Proof Protocol Overview In the following sections, we go into detail about how the Prover generates a proof, and how the Verifier checks that proof. Broadly, this can be divided into four sections: 1. Parsing: The query text must be parsed into a format that the Prover and Verifier can agree to (Section 3.2). 2. Query Execution and Protocol Builder: This step is effectively a “proof setup” phase. This is where the ZK “circuit” is created and the query is actually executed. (Section 3.3) 3. Relation Prover: This is the step in which the bulk of the proof is actually generated, utilizing the multilinear sum-check protocol (Section 3.5). 17 4. Commitment Evaluator. The last step of the sum-check protocol requires a commitment opening. (Section 3.6) Figure 5: Proof Protocol Overview Diagram 3.2 Parsing The first step in the process of creat
프로젝트로 돌아가기