Skip to main content

Overview

The tomo account command provides a comprehensive set of subcommands for managing Viction blockchain accounts. Accounts are stored in encrypted format using the keystore mechanism.

Synopsis

tomo account <command> [options]

Description

Manage accounts, list all existing accounts, import a private key into a new account, create a new account or update an existing account. It supports interactive mode, when you are prompted for password as well as non-interactive mode where passwords are supplied via a given password file. Non-interactive mode is only meant for scripted use on test networks or known safe environments.
Make sure you remember the password you gave when creating a new account (with either new or import). Without it you are not able to unlock your account.
Keys are stored under <DATADIR>/keystore. It is safe to transfer the entire directory or the individual keys therein between nodes by simply copying.

Subcommands

list

Print summary of existing accounts.
tomo account list [options]

Options

datadir
string
Data directory for the databases and keystore
keystore
string
Directory for the keystore (default = inside the datadir)

Example

tomo account list

Output Format

Account #0: {0x1234567890abcdef1234567890abcdef12345678} keystore:///path/to/keystore/UTC--2024-01-01T00-00-00.000000000Z--1234567890abcdef1234567890abcdef12345678
Account #1: {0xabcdef1234567890abcdef1234567890abcdef12} keystore:///path/to/keystore/UTC--2024-01-02T00-00-00.000000000Z--abcdef1234567890abcdef1234567890abcdef12

new

Create a new account.
tomo account new [options]

Options

datadir
string
Data directory for the databases and keystore
keystore
string
Directory for the keystore (default = inside the datadir)
password
string
Password file to use for non-interactive password input
lightkdf
boolean
Reduce key-derivation RAM & CPU usage at some expense of KDF strength

Interactive Example

tomo account new
You will be prompted to enter and confirm a password:
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase: 
Repeat passphrase: 
Address: {0x1234567890abcdef1234567890abcdef12345678}

Non-Interactive Example

tomo account new --password /path/to/password.txt
For non-interactive use, the passphrase can be specified with the —password flag. This is meant to be used for testing only. It is a bad idea to save your password to file or expose in any other way.

update

Update an existing account.
tomo account update <address> [options]

Options

datadir
string
Data directory for the databases and keystore
keystore
string
Directory for the keystore (default = inside the datadir)
lightkdf
boolean
Reduce key-derivation RAM & CPU usage at some expense of KDF strength

Description

Update an existing account. The account is saved in the newest version in encrypted format. You are prompted for a passphrase to unlock the account and another to save the updated file. This command can be used to:
  • Migrate an account to the newest format
  • Change the password for an account (interactive mode only)

Example

tomo account update 0x1234567890abcdef1234567890abcdef12345678
You will be prompted:
Unlocking account 0x1234567890abcdef1234567890abcdef12345678 | Attempt 1/3
Passphrase: [enter old password]
Please give a new password. Do not forget this password.
Passphrase: [enter new password]
Repeat passphrase: [confirm new password]
When using —password flag, only format update can be performed. Changing your password is only possible interactively.

import

Import a private key into a new account.
tomo account import <keyfile> [options]

Options

datadir
string
Data directory for the databases and keystore
keystore
string
Directory for the keystore (default = inside the datadir)
password
string
Password file to use for non-interactive password input
lightkdf
boolean
Reduce key-derivation RAM & CPU usage at some expense of KDF strength

Description

Imports an unencrypted private key from <keyfile> and creates a new account. The keyfile is assumed to contain an unencrypted private key in hexadecimal format. The account is saved in encrypted format, you are prompted for a passphrase.

Example - Private Key File

Create a file private_key.txt containing your private key:
1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Then import it:
tomo account import private_key.txt
Output:
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase: 
Repeat passphrase: 
Address: {0x1234567890abcdef1234567890abcdef12345678}

Non-Interactive Example

tomo account import private_key.txt --password /path/to/password.txt
As you can directly copy your encrypted accounts to another Viction instance, this import mechanism is not needed when you transfer an account between nodes. Simply copy the keystore files instead.

Wallet Commands

The tomo wallet command manages Tomochain presale wallets.
tomo wallet <command> [options]

wallet import

Import Tomochain presale wallet.
tomo wallet import <keyFile> [options]

Options

datadir
string
Data directory for the databases and keystore
keystore
string
Directory for the keystore (default = inside the datadir)
password
string
Password file to use for non-interactive password input
lightkdf
boolean
Reduce key-derivation RAM & CPU usage at some expense of KDF strength

Example

tomo wallet import /path/to/presale.wallet
You will be prompted for the wallet password:
Passphrase: 
Address: {0x1234567890abcdef1234567890abcdef12345678}

Common Workflows

Creating a Masternode Account

  1. Create a new account:
tomo account new
  1. Backup the keystore file (located in ~/.tomo/keystore/)
  2. Note the address printed after creation
  3. Fund the account with VIC tokens
  4. Register the account as a masternode on TomoMaster

Recovering an Account

  1. Obtain your private key
  2. Save it to a temporary file (remove after import):
echo "your_private_key_hex" > temp_key.txt
  1. Import the key:
tomo account import temp_key.txt
  1. Securely delete the temporary file:
shred -u temp_key.txt

Listing All Accounts

tomo account list --datadir ~/.tomo

Updating Account Security

To update an old keystore format or change password:
tomo account update 0xYourAddress

Security Best Practices

Backup Your Keystore

Always backup the keystore directory before making changes. Store backups in multiple secure locations.

Use Strong Passwords

Use strong, unique passwords for each account. Consider using a password manager.

Secure Private Keys

Never share your private keys or keystore files. Never store private keys in plain text.

Test on Testnet First

Always test account operations on testnet before using on mainnet, especially for automation scripts.

Keystore File Format

Keystore files are JSON files encrypted with your password using the Web3 Secret Storage Definition. They contain:
  • Encrypted private key
  • Encryption parameters (cipher, KDF settings)
  • MAC for integrity verification
  • Account address
Example filename format:
UTC--2024-01-01T12-30-45.123456789Z--1234567890abcdef1234567890abcdef12345678

Troubleshooting

Account Not Found

If tomo account list doesn’t show your account:
  1. Verify you’re using the correct --datadir
  2. Check if keystore files exist in <datadir>/keystore/
  3. Ensure keystore files have proper permissions (readable by tomo)

Failed to Unlock Account

If you cannot unlock an account:
  1. Verify you’re using the correct password
  2. Check if the keystore file is corrupted (restore from backup)
  3. Ensure the account address matches the keystore file

Ambiguous Address Error

If multiple keystore files exist for the same address:
Multiple key files exist for address 0x...
The CLI will test your password against all matches and select the correct one. Remove duplicate files after verification.

See Also

Build docs developers (and LLMs) love