In the overview, we treat the StarkEx service as one component of the system that includes the STARK Prover inside. Here we discuss what exactly is done by the Prover, and what is the goal of wrapping the Prover along with the StarkEx service.
What our STARK Prover actually proves, is a correct execution of a Cairo program. Cairo is a general, Turing-complete language. You can read more about the Cairo language here. An important thing to bear in mind for this description is that Cairo operates in the following framework:
It is stateless. i.e. - the Cairo/Prover component of the system is not the one that holds the off-chain state.
It cannot prove wrong transactions. By comparison, on L1, an invalid transaction can be executed, shown to be invalid and reverted. If the input to the Cairo program has an invalid transaction - the Cairo program would not be able to run with it (and then, we will have nothing to prove).
StarkEx backend service has two goals which naturally derive from the Cairo framework described above:
Ensure that all transactions to be executed and proved, are valid according to the application business logic - so the Cairo program will be able to complete a run with them as an input.
Prepare the input for the Cairo program and run it. This is done by first aggregating a sufficient number of valid transactions into one batch and then invoking the Cairo program with this batch of transactions as input. In this process, the STARK prover attests to the Cairo program's correct execution.
As a result of the modus operandi described above, we see that StarkEx works in units (and proves the validity) of batches. This is important since each batch contains a header, in addition to the transactions, that is used in the proof.