Wallet management on V Systems

Kwun Yeung
Forbole
Published in
4 min readDec 2, 2019
Photo by Pixabay

Securing your crypto is important. If you are planning to run a supernode on V Systems, you need to attach a wallet on the node as a signing key. A node operator should understand the risks on managing the signing wallet and securing the wallet with the fund of the supernode.

Before you begin, please prepare a full node and make sure it is synced to the latest height.

As described in the previous post, the installation of the V Systems node is too automated. Node operators always would like to have a better understanding behind the scene and apply their own secure measures. When you start a V Systems node from scratch, the software would automatically create a wallet file wallet.dat at the default location /var/lib/vsys/.vsys/wallet. This is the wallet of your supernode.

To get the address of the node, you run

curl -X GET --header 'Accept: application/json' --header 'api_key: <API_KEY>' 'localhost:9922/addresses'

It will return a result like this

[ "AU6LkVS1d35ctHdUonVZFeJRcvvDVdVQMHm" ]

A V Systems wallet is an HD wallet based on BIP32. It can hold many addresses. The default behaviour of the V Systems node is to generate one address in the wallet and the first address of the wallet attached with the node will be the address of the supernode.

Say we are going to use this wallet for our supernode. We need to backup the wallet and secure the backup offline. The wallet can be restored with the seed of the private key. We can get the seed of the wallet private key by calling the following endpoint.

curl -X GET --header 'Accept: application/json' --header 'api_key: <API_KEY>' 'localhost:9922/wallet/seed'

It will return the wallet seed

{
"seed" : "31tWeQN4mxqBpydSg3eBNfJfB72YnmJ6qe3EeXbFVb2MiKAWbR561NyBm3H8euNQAKdV4D5Ahm5PrWQsfHRLRwCD"
}

Store the seed securely so that you can restore the wallet in the future.

The default behaviour of the V Systems node is to create a default wallet.dat file without password protection. Let’s restore our wallet and create a new wallet file and secure with a password. This can be done with the V Wallet Generator. It can be run with sbt. You can install sbt with the following commands on Linux.

$ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
$ curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
$ sudo apt-get update
$ sudo apt-get install sbt

Or install it with Homebrew on MacOS.

$ brew install sbt

Now, run sbt at the wallet generator source directory.

$ git clone https://github.com/virtualeconomy/v-wallet-generator.git
$ cd v-wallet-generator
$ sbt
sbt:walletgenerator>

After the sbt prompt, run the following command.

sbt:walletgenerator> run --testnet --count 3 --csv --password <PASSWORD> --seed "<THE SEED YOU GET FROM THE NODE EARLIER>"

You will see output like this.

Output of wallet generation

The command restores a wallet from seed ( --seed), generates 3 ( --count 3) testnet addresses (--testnet) with the password provided (--password) and export in an CSV file (--csv). You should see the first address generated is the same as the address you got from the node previously using the /addresses endpoint.

Now, exit sbt and take a look at the directory.

sbt:walletgenerator> exit
$ ls

There are two more files in the directory. They are the wallet.dat and addresses.csv. The wallet.dat is the wallet file and the addresses.csv has the same information as the output of the wallet generator. Keep the addresses.csv safe as your backup.

To verify your wallet.dat file is password protected, run sbt again and try to decrypt the file with the password.

sbt:walletgenerator> run --decrypt --password <PASSWORD>

It will return with the wallet seed if the decryption is successful.

{"seed":"31tWeQN4mxqBpydSg3eBNfJfB72YnmJ6qe3EeXbFVb2MiKAWbR561NyBm3H8euNQAKdV4D5Ahm5PrWQsfHRLRwCD","accountSeeds":["3nHiMMjNdTCtcgxHaL4cyHszTaGQtfFRWRnzD76LuqFS","2wqeFTwY2pcEtN4xu6nc4KCB1ZisAsPLxxUHv6YnqpwU","GzDGznPMpySXdrhoxGofUGnbpwVL3jvrR9rhn7MbHcUM"],"nonce":3,"agent":"V Systems Wallet Specification:1.0/V Wallet Generator:0.1.0/testnet"}

You can now use this wallet.dat as your node wallet file. Replace the file under /var/lib/vsys/.vsys/wallet. If you restart the V Systems node, it will not start as it cannot read the encrypted wallet file. Update the /etc/vsys/vsys.conf with the wallet password.

wallet {
password = "<PASSWORD>"
}

Save the configuration file and restart the node again. It should run again with the same supernode address using a password protected wallet.

Caution

Please note that V Systems currently doesn’t support HSM or remote signer. If your node is compromised and hackers can access to the configuration file and the wallet file, they can steal your key. Please make sure these information are in different access levels and you have enough security measures on running the node.

  1. Joining V Systems Testnet
  2. Wallet management on V Systems
  3. Become a Supernode on V Systems

We have recently declared our Supernode Candidate on the V Systems. If you are a V Systems token holder and considering leasing out your tokens, please consider leasing to us. Our Supernode address is AR45wyKHZnmt7ujqJRT7b4hSk9wX1bjwDkz. You can see our leasing status on the https://vsysrate.com/.

--

--

Kwun Yeung
Forbole

Cofounder of Forbole. Active blockchain explorer.