ChangePubKey
Modifies the public key hash of the Layer3 account.
Name | Type | Required | Description |
---|---|---|---|
type | String | yes | The value is "ChangePubKey" |
chainId | yes | ID defined by zkLink, for example, when the user performs ChangePubKey on ETH, the front-end needs to set this value to the Ethereum ID defined by zkLink on Layer3 | |
accountId | yes | Target account ID of ChangePubKey | |
subAccountId | yes | Target subaccount ID of ChangePubKey, the fee will be deducted from this subaccount | |
newPkHash | yes | New public key hash | |
nonce | yes | Current nonce of the target account | |
feeToken | yes | The token used as the fee token | |
fee | yes | Fee obtained via | |
ethAuthData | yes | ChangePubKeyAuthData to set the public key | |
signature | yes | the public key hash corresponding to the signature must be aligned with the newPkHash | |
ts | u32 | yes | Timestamp of the API call, used as front-end request id to generate transaction hash |
where the ChangePubKeyAuthData is an Enum which contains 3 types: EthECDSA
, EthCreate2
, Onchain
Name | Type | Required | Description |
---|---|---|---|
type | String | yes | The value is "EthECDSA" |
ethSignature | String | yes | eth signature with |
Refer to EIP712 to create the signature content in this way, where the domain is:
Note: Different chain has different
chainId
andverifyingContract
, you can get the chain information from rpc interfacegetSupportChains
.
For Example:
sign
For more detail please refer to Golang example in SDK
Last updated