Running ZK-proven Queries
Get started running tamperproof queries with Proof of SQL℠!
The <Glossary>Space and Time Database</Glossary> allows users to run tamperproof queries that use ZK cryptography to generate a proof that ensures neither the SQL nor the data have been tampered with. You can have that proof immediately applied within the <Glossary>SxT</Glossary> network, or send it to another third-party verifiers, allowing you to extend the zero-trust model of a blockchain into a big-data system.
Automated Verification
Running a tamperproof query is surprisingly simple - you only need a <Glossary>Space and Time</Glossary> account, a tamperproof table, and a verifier.
<Glossary>Native Verification</Glossary> with Space and Time Studio
The easiest way to run a tamperproof query is using <Glossary>Space and Time Studio</Glossary>, as it provides a seamless and unified experience.
Step 1: Login to Space and Time Studio
Step 2: Run a Tamperproof Query
<Glossary>Native Verification</Glossary> with Space and Time API
If you interface with the <Glossary>Space and Time Database</Glossary> using APIs and you want to run <Glossary>Native Verification</Glossary>, the change is as easy as using a different, but identical, SQL API endpoint.
To keep examples OS and programming language agnostic, the example below uses the SXT CLI in a <Glossary>terminal</Glossary> window.
Step 1: Install SXT CLI
If not already complete, follow these instructions to install the Space and Time CLI.
Step 2: Login to Space and Time
Step 3: Run a Tamperproof Query
Other Ways to Verify
Run Your Own Verifier
<Glossary>Space and Time</Glossary> has open-source the verifier code, meaning for centralized use-cases you can install and perform local verification. This is great for any use-case where you alone need to verify the proof, such as internal analytics, centralized transactions, or fully internal work not shared with 3rd parties (or those parties trust you to perform the work correctly).
To get started with your own verifier, simply clone the Proof of SQL Verifier repo, located here:
https://github.com/spaceandtimelabs/SXT-proof-of-sql
Coming Soon! Verify with Partners (like Chainlink)
<Glossary>Space and Time</Glossary> is partnering with ZK verifier networks to broaden the choice of decentralized, 3rd party verifiers for your proofs. These will be coming online over the course of the next few months, so check back frequently for the growing list!
Coming Soon! Verify On-Chain
<Glossary>Space and Time</Glossary> cryptography teams are working hard to hyper-optimize the verifier to run onchain efficiently enough to be financially practical, even for high-cost / settlement chains. Look for this coming soon!
Ready to Build Your Own Tables / Queries?
Check out this page, where you can read up on currently available Proof of SQL syntax and learn tamperproof table best practices!
{/*
New section:
add gas cost analysis examples (from all 3 chains, along with query results) from Wael
*/}
Updated 5 months ago