Skip to main content

Creating a Massa wallet

In this tutorial you will learn how to create or import a Massa wallet.

A wallet is a file that contains a list of keypairs. Like other blockchains, Massa uses elliptic curve cryptography (specifically ed25519) to secure your coins. It means that your secret key is your password allowing you to spend coins that were sent to your address.

From the command line interface

If your client is not running

Go to the client folder:

cd massa/massa-client/

Start the interactive client and load a wallet file:

cargo run

It will ask your wallet password in order to load the wallet.dat file. If the file does not exist, you will be asked to set a password and it will be created.

If your client is running

Now you can either generate a new keypair (and associated address):

wallet_generate_secret_key

The list of addresses of your wallet can be accessed with:

wallet_info

Access public key(s) of addresse(s):

wallet_get_public_key <Address1> <Address2>

Access secret key(s) of addresse(s):

wallet_get_secret_key <Address1> <Address2>

Importing your wallet in the client

In order to import a wallet into your client, the procedure depends on how you have saved your wallet in the first place.

If you have saved your secret/private key

Then you can import it in the client using the following command:

wallet_add_secret_keys <your_secret_key>

If you have saved an encrypted wallet file

Then you can import it in the client by placing the corresponding .yaml file in the massa/massa-client/wallets folder. Make sure it is the only wallet in the folder.

What next ?

Congratulations, you are now running a node and have access to a wallet. But your node is still not staking, so it is not producing blocks nor receiving rewards.

It is time to activate staking on your node. Follow the tutorial: Staking with a node.