Register (StarkEx Perpetual Trading v2.0)

In StarkEx for perpetual trading v2.0, registration is not required for user onboarding. The binding between the starkKey and the Ethereum address happens in the Withdrawal flow by requiring the user to specify a destination Ethereum address. This flow has changed due to the effort to reduce gas costs for users.

However, on-chain coupling of the off-chain starkKey to a specific Ethereum address is still required for supporting the forced action flow as we want to enforce that only the true owner of the Vault could submit such requests for the Vault.

The functions registerSender and registerEthAddress are doing just that - they get a starkKey, a STARK Signature on a msg containing an (or the sender’s)ethereumAddress. If the signature is valid, it registers the specified starkKey to the specified ethereumAddress.

STARK signatures are very expensive to verify on-chain - the cost of this transaction is around 1M gas, so it is not recommended to use it unless you need to perform forced actions.