Space and Time
Reference Documentation

Proof of SQL Syntax

Proof of SQL requires cryptographic proofs for query results. This reference covers what SQL features are provable—not just what parses successfully.

Capability profile: Centralized EVM Proof Planner via commitments_v1_evmProofPlan. Upstream specification. Last verified 2026-07-13.

Quick Reference

At-a-glance view of what's provable in Proof of SQL

FeatureStatus
SELECT & FROM
SELECT columnsSupported
SELECT *Supported
LIMIT / OFFSETSupported
SELECT DISTINCTPartial
WHERE Clause
=, !=, <, >, <=, >=Supported
AND, OR, NOTSupported
BETWEEN / NOT BETWEENSupported
IN / NOT IN value listsSupported
LIKE / ILIKENot Supported
IS NULLNot Supported
Aggregation
GROUP BYPartial
SUM()Supported
COUNT()Supported
COUNT(DISTINCT) / SUM(DISTINCT)Partial
AVG(), MIN(), MAX()Not Supported
HAVINGSupported
Joins & Unions
INNER JOINPartial
LEFT / RIGHT / FULL JOINNot Supported
UNION ALLSupported
UNION (distinct)Partial
Advanced
Query parameters ($1, $2)Supported
ORDER BYNot Supported
SubqueriesPartial
CTEs (WITH clause)Not Supported
Window functionsNot Supported
Division (/)Not Supported
Scalar functionsNot Supported

Detailed Reference

The SELECT clause supports column selection, aliases, wildcards, and arithmetic expressions.

Supported

  • • Column selection: SELECT col1, col2
  • • Wildcard: SELECT *
  • • Aliases: SELECT col AS alias
  • • Arithmetic: col1 + col2, col1 * col2
  • • Type casting: CAST(col AS BIGINT)
  • • Single-expression SELECT DISTINCT on non-string data

Not Supported

  • • Division (/)
  • • String functions (CONCAT, UPPER)
  • • CASE expressions
  • • COALESCE / NULLIF
sql
-- ✅ Basic column selection
SELECT NAME, AREA, LONGITUDE FROM NAMESPACE.LOCATIONS
-- ✅ Arithmetic expressions
SELECT PRICE, QUANTITY, PRICE * QUANTITY AS TOTAL FROM NAMESPACE.ORDERS
-- ✅ DISTINCT supports one non-VARCHAR/non-BINARY/non-VARBINARY expression
SELECT DISTINCT BLOCK_NUMBER + 1 FROM ETHEREUM.TRANSACTIONS LIMIT 10
-- ✅ Column aliases
SELECT ID AS USER_ID, NAME AS USER_NAME FROM NAMESPACE.USERS

Test Your Query

Always verify your query via the RPC endpoint before deploying. If you receive an error, the query is not provable.

bash
curl -X POST https://rpc.mainnet.sxt.network \
-H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "commitments_v1_evmProofPlan",
"params": { "query": "SELECT NAME FROM NAMESPACE.TABLE WHERE ID = 1" }
}'

Response Interpretation

Success

Response contains "proofPlan": "0x..."

Failure

Response contains "error" with details