zkLink X Documentaion
HomeGitHubBlogExplorer
  • 🙂Welcome
    • Introduction
  • ⚖️Architecture
    • Overview
    • Settlement Layer
      • Working Principal of A Multi-Chain ZK-Rollup
      • Nexus: Settlement on ETH L2s
      • Origin: Settlement on ETH and Alt-L1s
      • Multi-Chain State Synchronization
        • In-Detail: Nexus Multi-Chain State Synchronization
      • Supported Networks of zkLink Nexus and Origin
      • Security Assumptions of zkLink Nexus and Origin
    • Execution Layer
      • TS-zkVM for App Rollup
    • Sequencing Layer
    • DA Layer
  • 🛠️Developer
    • Developer Overview
    • Get Started
    • Examples
      • Base Demo
    • JSON RPC & Websocket & Kafka
      • JSON-RPC API
      • JSON-RPC Errors
      • Websocket
      • Kafka
    • Transactions
      • Basic Types
      • State Update
      • Transaction
        • Deposit
        • FullExit
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • AutoDeleveraging
        • ContractMatching
        • Funding
        • Liquidation
        • UpdateGlobalVar
      • Private Key & Signature
        • Algorithm
        • ChangePubKey
        • Withdraw
        • Transfer
        • ForcedExit
        • OrderMatching
        • ContractMatching
        • Funding
        • Liquidation
        • AutoDeleveraging
        • UpdateGlobalVar
    • SDK
      • Go
        • Types
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Js
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
      • Dart
        • Signature
        • Utils
        • Transactions
          • ChangePubKey
          • Withdraw
          • Transfer
          • ForcedExit
          • OrderMatching
          • ContractMatching
          • AutoDeleveraging
          • Funding
          • Liquidation
          • UpdateGlobalVar
  • ⚙️Network Information
    • Connected Networks
      • Mainnet
      • Testnet
    • DApps & Deployment Addresses
      • Mainnet
      • Testnet
  • Wallet & User Fund Streamline
    • Withdraw
    • Wallet Integration & AA Wallet
    • Deposit
  • Integration Cases
    • Heavyweight Integration (Multi-Chain Derivatives & Spot Exchange)
    • Simple Integration (Multi-Chain Spot Exchange)
  • Appendix
    • Audits
    • FAQ
    • glossary
Powered by GitBook
On this page
  • Type Create2Data
  • Type ChangePubKeyAuthDataEthCreate2
  • Type ChangePubKeyAuthDataEthEcdsa
  • Type ChangePubKeyAuthDataOnchain
  • func CreateSignedChangePubkey
  • type ChangePubKeyBuilder
  • type ChangePubKey

Was this helpful?

  1. Developer
  2. SDK
  3. Go
  4. Transactions

ChangePubKey

Type Create2Data

type Create2Data struct {
	CreatorAddress ZkLinkAddress
	SaltArg        H256
	CodeHash       H256
}

Type ChangePubKeyAuthDataEthCreate2

type ChangePubKeyAuthDataEthCreate2 struct {
	Data Create2Data
}

Type ChangePubKeyAuthDataEthEcdsa

type ChangePubKeyAuthDataEthEcdsa struct {
	EthSignature PackedEthSignature
}

Type ChangePubKeyAuthDataOnchain

type ChangePubKeyAuthDataOnchain struct {}

func CreateSignedChangePubkey

func CreateSignedChangePubkey(zklinkSigner *ZkLinkSigner, tx *ChangePubKey, ethAuthData ChangePubKeyAuthData) (*ChangePubKey, error)

input:

type ChangePubKeyBuilder

type ChangePubKeyBuilder struct {
	ChainId       ChainId
	AccountId     AccountId
	SubAccountId  SubAccountId
	NewPubkeyHash PubKeyHash
	FeeToken      TokenId
	Fee           BigUint
	Nonce         Nonce
	EthSignature  *PackedEthSignature
	Timestamp     TimeStamp
}

type ChangePubKey

func NewChangePubKey

func NewChangePubKey(builder ChangePubKeyBuilder) *ChangePubKey

input:

func (*ChangePubKey) GetSignature

func (*ChangePubKey) GetSignature() ZkLinkSignature

func (*ChangePubKey) GetBytes

func (*ChangePubKey) GetBytes() []uint8

func (*ChangePubKey) TxHash

func (*ChangePubKey) TxHash() []uint8

func (*ChangePubKey) JsonStr

func (*ChangePubKey) JsonStr() string

func (*ChangePubKey) IsValid

func (*ChangePubKey) IsValid() bool

Check if all the fields in ChangePubKey are valid. For example, if the ChainId is exceeded the maximum ChainId, it will return false.

func (*ChangePubKey) IsOnchain

func (*ChangePubKey) IsOnchain() bool

Check if the transaction's auth data is OnChain.

func (*ChangePubKey) IsSignatureValid

func (*ChangePubKey) IsSignatureValid() bool

Check if the L3 signature is valid or not.

func (*ChangePubKey) SubmitterSignature

func (*ChangePubKey) SubmitterSignature(signer *ZkLinkSigner) (ZkLinkSignature, error)

Create the submitter signature.

input:

func (*ChangePubKey) ToZklinkTx

func (*ChangePubKey) ToZklinkTx() ZkLinkTx

PreviousTransactionsNextWithdraw

Last updated 1 year ago

Was this helpful?

Create a signed

zklinkSigner: zklink

tx: unsigned transaction

ethAuthData: ChangePubKeyAuthData is a interface which can be , or

The ChangePubKeyBuilder is used to build the type

transaction type, it's a opaque data type.

Create a

builder:

Get the L3 signature of the

Get the encoded bytes of , which is used to create the L3 signature.

Get the Transaction Hash of

Get the json str of

signer:

Change the ChangePubKey transaction type to type.

🛠️
ChangePubkey
ChangePubkey
ChangePubkey
signer
ChangePubKeyAuthDataOnchain
ChangePubKeyAuthDataEthCreate2
ChangePubKeyAuthDataEthEcdsa
ChangePubKey
ChangePubkey
ChangePubKeyBuilder
ChangePubKey
ChangePubKey
ChangePubKey
ChangePubKey
ZkLinkSigner
ZkLinkTx