Skip to main content

Creating accounts

You can create or import accounts into the Octez client just like you do so in wallet applications.

Octez keeps a local list of aliases for addresses, including user accounts, smart contracts, and Smart Rollups. You can list the aliases that the Octez client is aware of by running the command octez-client list known addresses. When you run transactions with Octez, you can use the alias in place of the account address.

Creating accounts

To create an account, run this command, replacing local_account with a local name for the new account:

octez-client gen keys local_account

You can see the address of the account by running this command:

octez-client show address local_account

To print the private key for the address, add the --show-secret argument.

The account address (technically the hash of the public key) starts with tz1, tz2, or tz3. You can use this address to send tez to this account, such as from a faucet if you are using a testnet. See Testing on testnets.

Importing pre-existing accounts

If you already have a Tezos account, you can import your private key to use the account in Octez:

  1. Export the private key from your wallet application, being careful not to expose it to anyone.

  2. Run this command, replacing the placeholder <ALIAS> with a local alias for the account and the placeholder <PRIVATE_KEY> with the private key:

    octez-client import secret key <ALIAS> unencrypted:<PRIVATE_KEY>

Now you can use the alias in place of the address when you send transactions with Octez.

Exporting accounts

To export an account and use it in another wallet, you can make the Octez client print its secret key by adding the -S switch to the octez-client show address command, as in this example:

octez-client show address local_account -S

There is no way to export all of the addresses in the Octez client at once, but you can print all of the accounts in the Octez client with the command octez-client list known addresses. You can also see the keys in the file ~/.tezos-client/secret_keys.