Proof composition
Note
To understand proof composition in practice, check out our quickstart example.
The problem: clunky interactions
In zero-knowledge systems, coordinating multiple proofs is complex. Cross-contract calls often rely on recursive verification, where Program A verifies a proof of the correct execution of Program B. This is inefficient and creates overhead at the proof generation and verification stages.
The situation worsens when different proving schemes are involved. Most zero-knowledge systems force you to write your proofs in a unified scheme. By doing that, you lose all the advantages of specialization.
Different proving schemes answer different needs. Some proof systems are best for client-side proving; others allow developers to use general-purpose programming languages.
The solution: proof composition
Hyli introduces native proof composition, allowing proofs to interact while remaining independent. Each proof can use the most suitable language and proving scheme, all within a single transaction.
You benefit from composition when your transaction:
- Involves multiple applications
- Includes proofs in different languages or proving schemes
- Combines heterogeneous logic where different tools are ideal
If everything fits cleanly within one proof, there is no composition.
Cross-contract calls with proof composition
Instead of recursion, Hyli lets a program declare: "This only applies if all referenced blobs are valid." During settlement, all proofs are included in one transaction. Hyli verifies them together. If any proof fails, the entire transaction fails.
This model:
- removes the need for embedded recursion;
- improves developer experience;
- reduces gas costs;
- enables parallel proving.
Mixing proof schemes
Since proofs in Hyli remain independent, each proof in a composed transaction can use its own proving scheme. Proofs are verified separately, eliminating the need to compromise for compatibility. This also enables cross-contract calls between applications using different proof systems.
You can:
- batch heterogeneous proofs;
- call between contracts using different systems;
- choose the best proving scheme for each proof.
How Hyli settles multiple proofs
When a transaction includes multiple proofs, Hyli begins verifying each proof as soon as it's ready. If one fails or times out, the entire transaction is rejected.
Proof generation is parallelized as all proofs are independent. Verification is asynchronous thanks to pipelined proving.
Writing a cross-contract call
Your program doesn't need to verify another program’s execution directly. Instead, your contract declares claims about other apps:
Each claim consists of:
- The application (MoneyApp, TicketApp)
- The function (transfer, get)
- Parameters
- A result assertion (== true, == ticket)
See the source code from our example.
Delegating identity
Each transaction in Hyli is signed by a single identity blob. By default, this identity authorizes all blobs in the transaction.
For cross-contract composition, Hyli supports callees, blobs that run under a different identity.
This lets contracts trigger delegated actions without needing nested calls or recursion.
Consider an AMM:
- Alice signs and submits a swap
- The AMM blob executes
swap()
swap()
liststransfer()
andtransferFrom()
as callees- These callees run as if the AMM signed them
Caller
The caller is the identity under which a blob executes. By default, it’s the transaction signer (e.g., Alice.hydentity
).
If a blob is a callee, its caller becomes the blob that declared it.
Callee
A callee is a blob that runs on behalf of another blob. This lets contracts perform delegated actions without initiating their own transactions.
For example:
- Alice signs and submits a transaction that includes a blob for an AMM swap
- The AMM swap blob declares two callees:
transfer
andtransferFrom
- These execute with the AMM as the caller
Execution and validation
Each callee:
- Verifies that the caller blob explicitly listed it as a callee
- Checks authorization logic (e.g.,
transferFrom
checks for priorapprove
)
This approach lets users delegate logic to contracts without nested transactions, maintaining clarity and flatness in Hyli’s execution model.