Perpetual Trading v1.0


In StarkEx for perpetual trading (v1.0), the registration function is invoked as a part of the user onboarding flow.

The function registerUser can be called to add a user to StarkEx. It creates a mapping between the user’s starkKey and the user’s ethereumAddress.

The registered user does not have to be the sender of the transaction.

The registration is accepted if the following holds:

  1. The starkKey provided is not zero and has not been registered in the past under any other ethereumAddress.

  2. The key provided represents a valid point on the Stark-friendly elliptic curve.

  3. The provided signature is a valid signature on keccak256("UserRegistration:", ethereumAddress, starkKey) by the userAdmin (i.e. the application).

If the requirements above hold, the starkKey is registered in the contract and is mapped to the ethereumAddress. Note that the contract allows registering many different starkKey's to one ethereumAddress.

This mapping is later used to ensure that withdrawal requests are valid. StarkEx checks that a withdrawal from an account that corresponds to a starkKey can only be performed by a user authenticated with its associated ethereumAddress (see Withdrawal).

A userAdmin may be instantly appointed or removed by the contract Governor (see Governance).