The withdrawal flow

Step 1: Off-Chain Withdrawal Request Initiated by the User
The user submits a withdrawal request to the off-chain application.
Step 2: Off-Chain Transfer Transaction
In StarkEx for spot trading, starting v4.0, there is no on-chain registration. This means that the registration of the Ethereum address must happen off-chain. This is implemented using the transfer transaction as follows:
A transfer request, signed by the user, moves the funds from the user’s Vault to another off-chain Vault, which is identified with the user’s Ethereum address instead of the starkKey
.
Step 3: Off-Chain Withdrawal Transaction
The off-chain app checks the validity of the withdrawal request according to its business logic and the relevant vaultId
state. If it is valid, it sends the off-chain withdrawal transaction to the StarkEx service.
Step 4: Withdrawal Included in a Batch
StarkEx verifies that the withdrawal request is valid, according to the relevant business logic statement to be proved, and the relevant vaultId
state. If the withdrawal is valid, it is aggregated to a batch to be submitted on-chain along with a validity proof.