CLI stand for "command line interface" (aka "console"), unlike GUI - "graphical user interface".
Download the ZIP archive of precompiled files of the latest release from the official repository and extract them to whatever location suitable for you. Choose a proper version for your OS: xxx-win64.zip for Windows users, xxx-osx.zip for Mac user, xxx-linux.zip for Linux. Make sure you're not downloading the testnet release (the one with the "Testnet" postfix in the release name), these are for a developers' test network, not the main one you need.
In the following text, all examples will be written for the case when files are unpacked into a C:\Kaspa\
folder. If you unzip the archive to another folder, replace this path in the examples and explanations with your own. Also, all explanations are given for Microsoft Windows.
After unpacking, there will be 5 files in the C:\Kaspa\
folder: genkeypair.exe
, kaspactl.exe
, kaspad.exe
, kaspaminer.exe
and kaspawallet.exe
, the one you need is a kaspawallet.exe
.
Kaspa CLI wallet can't be run without a command line parameters. If you just double-click kaspawallet.exe
, its console window will appear for a split second and then close, you won't be able to catch anything, meanwhile it will actually show you the message about inability to start without a command line parameters.
If you're used to working with command line then just make sure your console's working directory is C:\Kaspa\
and use the command lines described below.
Otherwise it is recommended to create a windows batch execution (.bat
) file for each operation described below. To create it, right click in the C:\Kaspa\
folder window, select "Create->New text document"
and then rename a created file into, say, create-wallet.bat
for wallet creation operation, or wallet-daemon.bat
for starting a wallet daemon and so on. Make sure Windows doesn't hide file extensions from you, otherwise you'll end up with a file named create-wallet.bat.txt
without knowing it, and that's not what you need.
For each operation described below open the newly created file with a Windows Notepad, and add the operation command line into it, e.g. for creating a wallet the .bat
file's content should look like this:
kaspawallet.exe create
pause
This 2nd line, pause
, is required to see the wallet's output, so you can see or copy something (say, your balance, your newly created kaspa address, or your seed phrase) from here, or to see an error message in case something goes wrong, before the console window is closed.
Create a .bat
file with the following content:
kaspawallet.exe create
pause
You will be asked about a password for your wallet, don't forget it right away, otherwise you'll be unable to access your wallet anymore unless you've backed up your seed phrase.
There will be a keys.json
file created in the %localappdata%\Kaspawallet\kaspa-mainnet
folder. This file will be used from now on by the kaspawallet.exe
as a source of wallet parameters (an encrypted private key, number of addresses used etc).
If you want that file to be situated in some non-default place, use an additional --keys-file <keys file path and name>
parameter. If you'll stick to that way don't forget to add this parameter (--keys-file blabla
) whenever it is required later.
There are 2 ways to backup your wallet.
First is to locate (%localappdata%\Kaspawallet\kaspa-mainnet
) and copy your keys.json
file along with its password to some safe place. Better do 2 or more separate copies on a different media (backup HDD, encrypted flash drive, cloud storage etc).
Seconds is to create a .bat
file with the following content:
kaspawallet.exe dump-unencrypted-data
pause
You'll be asked for a password and then you'll be shown a set of 24 words. Write them down somewhere safe, in the same order as they are shown.
You'll be later able to restore your wallet on any other PC where the kaspawallet.exe
exists and the node is accessible by running kaspawallet.exe create --import
command.
In that case you'll be asked for the seed phrase; enter it as it was shown to you by dump-unencrypted-data
command, and a new keys.json
file will be created in the folder said above. You'll be also asked for a password here; this password could be the same or a different one, there's no password-related dependencies between the original wallet and the wallet being restored. Just make sure you remember your new password.
You may use any of these backup methods or even both at once.
Check now if you still remember your password: call kaspawallet.exe dump-unencrypted-data
again :) If you don't then re-create a wallet anew while it's not too late, or import it from a seed phrase and this time make sure you really remember the password you're choosing!
From now on, all operations with the wallet prior to being performed will require its daemon (service) up and running, and a fully synced node running as well (so make sure you have set up a node, also don't forget to add --utxoindex
parameter to its command line, otherwise the wallet daemon will show error and refuse to work). This daemon will serve as a proxy between the instance of a kaspawallet.exe
performing a requested operation, and a node to which it communicates.
In order to start a daemon, if you have a local node running (a node on the same PC), create a .bat
file with the following content:
kaspawallet.exe start-daemon
pause
Double-clicking that file will start a wallet daemon and you'll see the following output:
<date and time> [INF] KSWD: Listening on localhost:8082
<date and time> [INF] KSWD: Connecting to a node at <node IP address and port>...
<date and time> [INF] KSWD: Connected, reading keys file ...
<date and time> [INF] KSWD: Read, syncing the wallet...
And (a series of) the following line(s):
<date and time> [INF] KSWD: X addresses of XX processed (N.NN%)...
Then finally
<date and time> [INF] KSWD: Wallet is synced, ready for queries
This window will not close; the last line (...ready for queries)
appearance means daemon has been successfully started and is waiting for actions from other instances of kaspawallet.exe
. You may close a daemon when it's no longer needed by either pressing Ctrl+C
or Ctrl+Break
on a keyboard, or by clicking a console window "close" button. But for now leave it running until the wallet setup is complete.
If you have a node running on some other PC then you can aim a daemon to that node by adding the following parameter to a daemon's command line: -s <node IP>
, so that command line will look for example like this:
kaspawallet.exe start-daemon -s 192.168.1.50
Make sure you have your node PC's RPC port 16110
open for incoming connections, it is not blocked by a firewall, and is forwarded by your router if it is required.
You can even try to find an RPC-welcoming public node and connect you wallet daemon to it if you need this.
Make sure you've added a --keys-file
parameter if needed.
Take into account that a daemon reads your keys.json
file content only once when it is started, so if you've replaced that keys.json
file while the daemon is active, you have to restart it so it could use a new file data instead of the previous one.
By creating a wallet you have essentially created a secret master key. But Kaspa's wallet is BIP-39 compliant HD wallet, and this means that from that master key you can create almost infinite number of public addresses to which you can mine and receive coins, and that you ought to create at least one such address. So create a .bat
file with the following content:
kaspawallet.exe new-address
pause
Double-clicking that file will show you the following:
New address:
kaspa:qblablabla
This kaspa:qblablabla
is your new public address, one of many and many possible. Each time you call kaspawallet.exe new-address
a new public address is created.
The count of public addresses created so far is kept in the keys.json
file. So if you restore your wallet from a seed phrase, the newly created keys.json
will know nothing about the number of addresses created earlier. But since these addresses are generated by a certain algorithm they will be recreated in the same order once you will start creating them anew, so don't worry about forgetting or losing them and all.
To see the list of public addresses generated so far create a .bat
file with the following content:
kaspawallet.exe show-addresses
pause
Double-click it and you will see the said list.
To check the balance on your wallet create a .bat
file with the following content:
kaspawallet.exe balance
pause
Double-click it and enjoy.
If you want to see a per-public-address balances (including balances of change-addresses that are automatically created as the result of coin sending operations and is not shown by the show-addresses
command), add a -v
parameter to that command line: kaspawallet.exe balance -v
.
To send coins to some public address create a .bat
file with the following content:
kaspawallet.exe send -v <amount of Kaspa to send> -t <wallet public address>
pause
Here the <amount of Kaspa to send>
is a floating point number, <wallet public address>
is the address in the form of kaspa:qblablabla
as it is shown by the new-address
command execution result.
Since version Kaspad v0.12.12 the command kaspawallet.exe send --send-all -t <wallet public address>
was added.
Double-click it, enter your password when requested, see the report.
You can even send coins to yourself: use a Kaspa faucet to gain some coins to your previously generated public address, and then send them to the same address by your .bat
file.