Volition mode, which enables your user to choose between ZK-Rollup or Validium mode for each transaction.
The StarkEx flow
All transactions in the system are executed by the application and sent to the StarkEx Service.
The StarkEx Service batches transactions and sends the batch to SHARP, a shared proving service, to generate a proof attesting to the validity of the batch.
SHARP sends the STARK proof to the on-chain STARK Verifier for verification.
The StarkEx Service then sends an on-chain state update transaction to the StarkEx Contract, which will be accepted only if the verifier finds the proof valid.
You interact with the system by sending on-chain transactions to the StarkEx Contract, and off-chain transactions to the application.
Your user's interactions
Your user deposits their funds to the StarkEx Contract.
After the application accepts the deposit, your user can access their funds off-chain.
Types of user interactions
Your user submits transfers or limit orders, signed by their starkKey, directly to the application. Limit orders are matched together and sent as a settlement to the StarkEx Service. Transfers are sent as-is. Additional logic can be enforced on different types of transfers.
To withdraw their funds, your user submits an off-chain withdrawal request to the application. This request is sent to the StarkEx Service, and the user can access their funds on-chain once the state update containing the withdrawal is accepted.
To prevent censorship, if the user's withdrawal requests are not fulfilled, they can force the execution with forced transactions.
The StarkEx system consists of the following components:
Application – system operator
This off-chain component receives user transactions and defines the business logic and order of execution. It passes transactions to the StarkEx Service.
StarkEx Service – batching and coordination
An off-chain component responsible for batching a set of operations and updating the state of the system according to the operations. For each batch, it sends the batch of operations (as a Cairo execution trace) to SHARP in order to prove its validity. Once the proof is verified, it publishes the new state on-chain. The state is represented by a Merkle tree in which "leaves" are vaults. The structure and content of each vault vary according to the specific business logic implemented. See here for more details. The Merkle tree root represents the state commitment to be submitted on-chain.
SHARP – proving
A shared proving service for Cairo programs. It receives proof requests from different applications and outputs proofs to attest to the validity of Cairo executions. The output proof can be shared among multiple proof requests.
STARK Verifier – verification
An on-chain component that receives a state update validity proof and verifies that the proof is valid.
StarkEx Contract - state updates, deposits, and withdrawals
This contract has two main functionalities:
Update the state of the system after verifying that the validity conditions are met.
Manage deposits and withdrawals to and from StarkEx in a non-custodial manner, so that in any scenario, the user is able to withdraw their funds.