avax.exportKey

Get the private key that controls a given address.

🚧

Not recommended for use on Mainnet.

Description

Get the private key that controls a given address. The returned private key can be added to a user with avax.importKey.

Signature:

avax.exportKey({  
    username: string,  
    password:string,  
    address:string  
}) -> {privateKey: string}

Request:

  • username must control address.
  • address is the address for which you want to export the corresponding private key. It should be in hex format.

Response:

  • privateKey is the CB58 encoded string representation of the private key that controls address. It has a PrivateKey- prefix and can be used to import a key via avax.importKey.
  • privateKeyHex is the hex string representation of the private key that controls address. It can be used to import an account into Core or other wallets, like MetaMask.
Language
Credentials
Header
Click Try It! to start a request and see the response here!