Skip to main content
The sui keytool command provides tools for managing cryptographic keys in the Sui keystore.

Synopsis

Global Options

path
Path to the keystore file
boolean
Return command outputs in JSON format

Commands

update-alias

Update an old alias to a new one.
string
required
Current alias to update
string
New alias. If not provided, a random one will be generated
Example:

convert

Convert private key from Hex or Base64 to Bech32 format.
string
required
Private key in Hex or Base64 format
Example:
Output:
Hex private key import/export is deprecated. Use Bech32 format (starting with suiprivkey) for all key operations.

decode-or-verify-tx

Decode transaction bytes or verify a signature.
string
required
Base64 encoded transaction bytes
GenericSignature
Signature to verify against the transaction
u64
default:"0"
Current epoch for verification
Example:

decode-multi-sig

Decode a MultiSig signature and optionally verify it.
MultiSig
required
MultiSig signature to decode
string
Transaction bytes to verify against (optional)
u64
default:"0"
Current epoch for verification
Example:

generate

Generate a new keypair.
SignatureScheme
required
Key scheme: ed25519, secp256k1, or secp256r1
DerivationPath
Optional derivation path. Defaults:
  • ed25519: m/44'/784'/0'/0'/0'
  • secp256k1: m/54'/784'/0'/0/0
  • secp256r1: m/74'/784'/0'/0/0
string
Mnemonic word length: word12, word15, word18, word21, or word24. Default: word12
Example:
Output: Creates a .key file in current directory with filename <address>.key.
Use sui client new-address if you want to generate and save the key into sui.keystore instead.

import

Add a new key to Sui CLI Keystore.
string
Alias for this address. Must start with a letter and contain only letters, digits, hyphens (-), or underscores (_)
string
required
Either a mnemonic phrase or Bech32 encoded private key (starting with suiprivkey)
SignatureScheme
required
Key scheme: ed25519, secp256k1, or secp256r1
DerivationPath
Optional derivation path (only for mnemonic import)
Example:

export

Export the private key of a given key identity.
KeyIdentity
required
Address or alias of the key to export
Example:
Output:
Keep exported private keys secure. Anyone with access to the private key has full control of the associated address.

list

List all keys in sui.keystore.
boolean
Sort by alias instead of address
Example:
Output:

load-keypair

Read a keypair from a file.
path
required
Path to keypair file
Accepted formats:
  • SuiKeyPair: Base64 encoded 33-byte flag || privkey
  • AuthorityKeyPair: Base64 encoded privkey
Example:

show

Show the public key and scheme from a keypair file.
path
required
Path to keypair file
Example:

sign

Create a signature using a private key.
KeyIdentity
required
Address or alias of the signer
string
required
Base64 encoded BCS serialized transaction data
Intent
Intent for the signature. Default: transaction intent
Example:
Output:

sign-kms

Create a signature using AWS KMS.
string
required
Base64 encoded BCS serialized transaction data
string
required
AWS KMS key ID
Intent
Intent for the signature
string
required
Base64 encoded public key
Example:
Requires AWS credentials configured in the environment.

multisig-address

Generate a MultiSig address.
ThresholdUnit
required
Threshold for the MultiSig (minimum weight required)
PublicKey[]
required
List of public keys (Base64 encoded flag || pk)
WeightUnit[]
required
List of weights corresponding to each public key
Example:
Output:

multisig-combine-partial-sig

Combine partial signatures into a MultiSig signature.
GenericSignature[]
required
List of participating signatures (Base64 encoded)
PublicKey[]
required
List of all public keys in the MultiSig
WeightUnit[]
required
List of weights for each public key
ThresholdUnit
required
Threshold for the MultiSig
Example:
The order of signatures must match the order of public keys. Sum of weights of all signatures must be >= threshold.

unpack

Unpack a keypair and output to file.
string
required
Base64 encoded 33-byte flag || privkey
Creates a file named <address>.key in the current directory. Example:

zk-login-sign-and-execute-tx

Generate OAuth URL and execute a zkLogin transaction.
u64
required
Maximum epoch for zkLogin signature validity
string
default:"devnet"
Network to use (devnet, testnet, mainnet)
boolean
default:"false"
Use a fixed keypair generated from [0; 32] seed
boolean
default:"false"
Use a multisig address with zklogin and a traditional keypair
boolean
default:"false"
Execute tx with the traditional sig (in the multisig), otherwise with the zklogin sig
Example:
The command will:
  1. Generate OAuth URLs for various providers (Google, Twitch, Facebook, etc.)
  2. Prompt you to visit a URL and paste the redirect
  3. Generate zkLogin proof
  4. Execute a test transaction

zk-login-enter-token

Workaround for zkLogin when token pasting doesn’t work.
string
required
Parsed JWT token
u64
required
Maximum epoch
string
required
JWT randomness
string
required
Ephemeral keypair as BigInt
SuiAddress
required
Ephemeral key identifier
string
default:"devnet"
Network to use

zk-login-sig-verify

Parse and verify a zkLogin signature.
string
required
Base64 encoded zkLogin signature
string
Base64 encoded TransactionData or PersonalMessage
u8
required
0 for TransactionData, 3 for PersonalMessage
u64
Current epoch for verification
string
default:"devnet"
Network to verify the signature for
Example:

zk-login-insecure-sign-personal-message

TESTING ONLY: Generate a zkLogin signature for a personal message.
string
required
Base64 encoded message to sign
u64
required
Maximum epoch for zkLogin signature validity
Example:
This command uses a test issuer and is for testing only. Do not use in production.

Key Schemes

Sui supports three signature schemes:

ed25519

  • Default derivation path: m/44'/784'/0'/0'/0'
  • Recommended for: General use
  • Advantages: Fast, small signatures

secp256k1

  • Default derivation path: m/54'/784'/0'/0/0
  • Recommended for: Compatibility with Bitcoin/Ethereum tools
  • Advantages: Wide ecosystem support

secp256r1

  • Default derivation path: m/74'/784'/0'/0/0
  • Recommended for: Hardware security modules
  • Advantages: NIST standard, hardware support

MultiSig Workflows

Creating a 2-of-3 MultiSig

Signing with MultiSig

Security Best Practices

  1. Never share private keys or mnemonics: Anyone with access has full control
  2. Backup mnemonics securely: Store in a safe, offline location
  3. Use hardware wallets for large amounts: Consider Ledger or similar
  4. Verify addresses carefully: Double-check before sending transactions
  5. Use strong aliases: Make them memorable but not personally identifying

Examples

Complete Key Management Workflow

Offline Signing