Registeration (StarkEx Perpetual Trading v1.0)
In StarkEx for perpetual trading (v1.0), the registration function is invoked as a part of the user onboarding flow.
registerUser can be called to add a user to StarkEx. It creates a mapping between the user’s public Stark key,
starkKey, and the user’s Ethereum address,
The registered user does not have to be the sender of the transaction.
The registration is accepted if the following holds:
The value provided for
starkKeyis not zero and has not been registered in the past under any other Ethereum address.
The key provided represents a valid point on the Stark-friendly elliptic curve.
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 public Stark key is registered in the contract and is mapped to
ethereumAddress. Note that the contract allows registering multiple Stark keys to one Ethereum address.
This mapping is later used to ensure that withdrawal requests are valid. StarkEx checks that a withdrawal from an account that corresponds to a public Stark key can only be performed by a user authenticated with its associated
ethereumAddress (see Withdrawal).
userAdmin may be instantly appointed or removed by the contract Governor (see Governance).