starkKey
derivation, depending on the type of the wallet:starkPath
and a key derivation algorithm that uses this path to derive the starkPrivateKey.
starkPath
consists of four passed parameters and two internal parameters as described below, and has the following structure: m/purpose'/layer'/application'/ethAddress1'/ethAddress2'/index
2645
sha256(layer) & ((1 << 31) - 1))
. In the context of starkex
, the value would be 579218131
as described in EIP-2645.sha256(application_name) & ((1 << 31) - 1))
.ethAddress & ((1 << 31) - 1))
(ethAddress >> 31) & ((1 << 31) - 1))
starkKey
proceeds in 2 steps:(r,s,v)
is used as an input to the grinding algorithm that outputs the starkPrivateKey
. You can use StarkEx crypto SDK to derive the key. Call the function getPrivateKeyFromEthSignature
to generate the private key from the signature and then privateToStarkKey
to comput the StarkKey.