Register (StarkEx Spot Trading)

In StarkEx for spot trading, registration is not required for user onboarding. The binding between the public Stark key 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.

The register call is done after the relevant public Stark key belongs to a vault with a positive balance. Thus, it is crucial that this key not be coupled with an incorrect Ethereum address, and therefore a Stark key signature is required.

Full Withdrawal registration

Onchain coupling of the offchain public Stark key to a specific Ethereum address is still required for supporting the full withdrawal 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 do just that - they get a public Stark key, a STARK Signature on a message containing an Ethereum address. If the signature is valid, it registers the specified public Stark key to the specified Ethereum address.

STARK signatures are very expensive to verify onchain - the cost of this transaction is around 1M gas, so it is not recommended to use it unless you need to perform a Full withdrawal.