ChangePubKey
Last updated
Last updated
Modifies the public key hash of the Layer3 account.
Name | Type | Required | Description |
---|---|---|---|
where the ChangePubKeyAuthData is an Enum which contains 3 types: EthECDSA
, EthCreate2
, Onchain
Name | Type | Required | Description |
---|---|---|---|
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:
For more detail please refer to Golang example in SDK
Name | Type | Required | Description |
---|---|---|---|
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 estimateTransactionFee
API, the value should be packable
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
type
String
yes
The value is "EthECDSA"
ethSignature
String
yes
eth signature with 0x
prefix
type
String
yes
The value is "EthCreate2"
creatorAddress
String
yes
creator address
saltArg
String
yes
The salt argument when create address, H256 hex string
codeHash
String
yes
code hash, H256 hex string
type
String
yes
The value is "Onchain"