Skip to main content

Axiom Subqueries

Axiom subqueries are not validated inside the client circuit. Instead, they are added as requests for Axiom to validate. These requests are added as Axiom subqueries to your overall Axiom query. When Axiom fulfills your query, your client circuit proof is combined with Axiom proofs to form a complete proof of validity of all computations you specified.

All requests for historic on-chain data are Axiom subqueries and return a CircuitValue256. If an input value is of type string, number, or bigint, it will be treated as a constant (regardless of the input to your circuit, it will need to remain the same). If you pass in a CircuitValue or CircuitValue256 instead, it will be a variable input to your circuit.

Subquery Limits

For the Axiom V2 mainnet release, the client circuit is allowed to make up to 128 total subqueries.

Aside from this total limit, there are also specific limits on the number of transaction and receipt subqueries allowed, which depend on particular properties of the transactions / receipts being queried. These limits are described in the Transaction Subquery and Receipt Subquery sections.

Subquery Types

There are 6 types of Axiom subqueries:

For further details on how to use each type of Axiom subquery, see the corresponding section below.