I still do not understand the security model when proving the zero-knowledge property.
Take the Sigma protocol as an example:
In the book Proofs, Arguments, and Zero-Knowledge (Section 12.2.1), the definition of the Honest Verifier Perfect Zero-Knowledge property is as follows:
the distribution over transcripts output by the simulator is identical to the distribution over transcripts produced by the honest verifier in the $\sum$ protocol produced by the honest verifier in the $\sum$ protocol interacting with the honest prover.
My confusion is that, to output a valid proof without the witness, the simulator firstly needs to select challenge $e$, sample $z$ (response), and finally compute the corresponding first commitment message $a$. The order of the message has changed.
Does the order of the message matter? I already asked a similar question in Why is the definition of Special-honest verifier zero-knowledge probabilistic?. However, that question focuses on the completeness property.