Withdrawal

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 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 3: 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.

Step 4: Funds Move to the Withdrawal Area

Upon performing state update , the StarkEx smart contract moves the relevant funds to the withdrawal area, under the starkKey of the corresponding vaultId.

Step 5: On-Chain Withdrawal Transaction

Once the funds are in the withdrawal area, the ethereumAddress under which the starkKey is registered can make an on-chain call to withdraw the funds to any recipient. For more info, see withdrawals​