-
Notifications
You must be signed in to change notification settings - Fork 1
Wallet User Guide
A Grin wallet maintains its state in an LMDB database, with the master seed stored in a separate file. When creating a new wallet, the file structure should be:
~/[Wallet Directory]
-wallet_data/
-db/
-/lmdb
wallet.seed
grin-wallet.toml
grin-wallet.log
-
grin-wallet.toml
contains configuration information for the wallet. You can modify values within to change ports, the address of your grin node, or logging values. -
wallet_data/wallet.seed
is your master seed file. Its contents are encrypted with your password (required). You should back this file up somewhere in order to be able to recover or restore your wallet. Your seed file can also be recovered using a seed phrase if you lose this file or forget your password.
By default grin will create all wallet files in the hidden directory .grin
under your home directory (i.e. ~/.grin
). You can also create and use a wallet with data files in the current directory, as explained in the grin-wallet init
command below.
Logging configuration for the wallet is read from grin-wallet.toml
.
The wallet supports multiple accounts. To set the active account for a wallet command, use the '-a' switch, e.g:
grin-wallet -a account_1 info
All output creation, transaction building, and querying is done against a particular account in the wallet. If the '-a' switch is not provided for a command, the account named 'default' is used.
The wallet generally needs to talk to a running grin node in order to remain up-to-date and verify its contents. By default, the wallet tries to contact a node at 127.0.0.1:3413
. To change this, modify the value in the wallet's grin_wallet.toml
file. Alternatively, you can provide the -r
(seRver) switch to the wallet command, e.g.:
grin-wallet -r "http://192.168.0.2:1341" info
If commands that need to update from a grin node can't find one, they will generally inform you that the node couldn't be reached and the results verified against the latest chain information.
Your wallet.seed file, which contains your wallet's unique master seed, is encrypted with your password. Your password is specified at wallet creation time, and must be provided for any wallet operation. You will be prompted for your password when required, but you can also specify it on the command line by providing the -p
argument. Please note this will place your password in your shell's command history, so use this switch with caution.
grin-wallet -p mypass info
grin-wallet --help
will display usage info and all flags.
grin-wallet help [command]
will display flags specific to the command, e.g grin-wallet help listen
Before using a wallet a new grin-wallet.toml
configuration file, master seed (contained in wallet.seed
) and storage database need to be generated via the init command as follows:
grin-wallet init
You will be prompted to enter a password for the new wallet. By default, your wallet files will be placed into ~/.grin
. Alternatively, if you'd like to run a wallet in a directory other than the default, you can run:
grin-wallet -p mypass init -h
This will create a grin-wallet.toml
file in the current directory configured to use the data files in the current directory, as well as all needed data files. When running any grin-wallet
command, grin will check the current directory to see if a grin-wallet.toml
file exists. If not it will use the default in ~/.grin
On success, the init command will also print a 24 (or 12) word recovery phrase, which you should write down and store in a non-digital format. This phrase can be used to re-create your master seed file if it gets lost or corrupted, or if you forget the wallet password. If you'd prefer to use a 12-word recovery phrase, you can also pass in the --short_wordlist
or -s
parameter.
If you need to recreate your wallet, you can init
a wallet with an existing recovery phrase using the -r
recover
flag. The following initializes a wallet in the current directory, prompting the user for a recovery phrase to use when creating its wallet.seed
file.
grin-wallet init -hr
File /home/yeastplume/wallet/grin-wallet.toml configured and created
Please enter your recovery phrase:
phrase> error decide hen crunch despair play entry decorate moon risk mixed exit century razor endless attack either spray small stable fan result wrong brief
Please provide a new password for the recovered wallet
Password:
Confirm Password:
20190110 11:33:42.111 WARN grin_wallet::types - Generating wallet seed file at: /home/yeastplume/wallet/wallet_data/wallet.seed
Your recovery phrase is:
error decide hen crunch despair play entry decorate moon risk mixed exit century razor endless attack either spray small stable fan result wrong brief
Please back-up these words in a non-digital format.
Command 'init' completed successfully
Note this will just recreate your wallet seed, not restore your wallet's contents from the chain's UTXO set. If you wish to restore your wallet outputs, you then need to run grin-wallet restore
It is highly recommended that you back up the ~/.grin/wallet_data/wallet.seed
file somewhere safe and private, and ensure you somehow remember the password used to encrypt the wallet seed file.
The recover
command is used to regenerate your wallet seed file from your recovery phrase. Note that this operation only restores your seed file, not the outputs stored in your wallet. If, for instance, you forget your wallet password, you can run grin-wallet recover
, and (provided you used the correct recovery phrase,) your wallet contents should again be usable.
If you're lost your password and want to recover your wallet seed while keeping all wallet contents intact, run:
grin-wallet recover
Existing wallet.seed file already exists. Continue?
Continuing will back up your existing 'wallet.seed' file as 'wallet.seed.bak'
Replace seed? (y/n)> y
Please enter your recovery phrase:
phrase> bracket sail recipe violin blur trip public dance ladder wire fuel aunt rude vast gas funny deposit health fame illegal spare spell finger deer
Please provide a new password for the recovered wallet
Password:
Confirm Password:
20190109 16:16:00.378 WARN grin_wallet::types - /home/me/wallet_data/wallet.seed backed up as /home/me/wallet_data/wallet.seed.bak
20190109 16:16:00.383 WARN grin_wallet::types - Seed created from word list
Command 'recover' completed successfully
As shown above, you will be asked to confim backing up your existing wallet.seed
file, an then prompted for your recovery phrase as well as a new password for your seed file. The old wallet.seed
file will be renamed as described in the log output.
To recreate a wallet from scratch, you can also pass -r
to grin-wallet init)
.
If you're restoring a wallet from scratch, you'll then need to use the grin-wallet restore
command to scan the chain for your outputs and restore them.
You can also view your recovery phrase with your password by running the recover command with the -d (display) argument, e.g:
grin-wallet recover -d
Password:
Your recovery phrase is:
shiver alarm excuse turtle absorb surface lunch virtual want remind hard slow vacuum park silver asthma engage library battle jelly buffalo female inquiry wire
Please back-up these words in a non-digital format.
The account
command is use used to manage wallet accounts. To create a new account, use the grin-wallet account
command with the argument '-c', e.g.:
grin-wallet account -c my_account
This will create a new account called 'my_account'. To use this account in subsequent commands, provide the '-a' flag to all wallet commands:
grin-wallet -a my_account info
To display a list of created accounts in the wallet, use the 'account' command with no flags:
grin-wallet account
____ Wallet Accounts ____
Name | Parent BIP-32 Derivation Path
------------+-------------------------------
default | m/0/0
my_account | m/1/0
The info
command summarizes wallet account balances. Note that the Total
sum may appear
inflated if you have a lot of unconfirmed outputs in your wallet (especially ones where a transaction is initiated by other parties
who then never it by posting to the chain). Currently Spendable
is the most accurate field to look at here.
grin-wallet info
Password:
____ Wallet Summary Info - Account 'default' as of height 13833 ____
Total | 60.482000000
Immature Coinbase (< 1440) | 60.030000000
Awaiting Confirmation (< 10) | 0.452000000
Locked by previous transaction | 1200.453000000
-------------------------------- | -------------
Currently Spendable | 0.000000000
Command 'info' completed successfully
And you can pass the minimum confirmations
optional parameter for this info
command:
grin-wallet info --min_conf=100
Password:
____ Wallet Summary Info - Account 'default' as of height 33868 ____
Total | 0.407000000
Awaiting Confirmation (< 100) | 0.058333333
Locked by previous transaction | 0.174333333
-------------------------------- | -------------
Currently Spendable | 0.348666667
Command 'info' completed successfully
The listen
command opens an http listener on the specified port, which will listen for:
- Coinbase Transaction from a mining server
- Transactions initiated by other parties
By default the listen
commands runs in a manner that only allows access from the local machine. To open this port up to other machines, you can either modify the api_listen_interface
parameter in grin-wallet.toml
, or use the -e
switch:
grin-wallet -e listen
To change the port on which the wallet is listening, either configure api_listen_port
in grin-wallet.toml
or use the -l
flag, e.g:
grin-wallet -l 14000 listen
The wallet will listen for requests until the process is cancelled with <Ctrl-C>
. Note that external ports/firewalls need to be configured properly if you're expecting requests from outside your local network (well out of the scope of this document).
When listening start, you will see a green color tip which looks like:
Listener for tn1-qvgsq0kd-7gvgqksg58fkqm9-ms5cplcllev4fnw-svevuqs2jukrtrc-guuvze started
The long string here is the Grin Relay address, you can tell your payer to send to your Grin Relay address.
The send
command is the method through which you interactively send Grins to another party. This can either be an immediate synchronous exchange, as happens when contacting a listening wallet directly via http, or an asynchronous process, such as exchanging transaction files via email.
It's important to understand exactly what happens during a send command, so at a very basic level the send
interaction is as follows:
- Your wallet selects a number of unspent inputs from your wallet, enough to cover the 60 grins + fees.
- Your wallet locks these inputs so as not to select them for other transactions, and creates a change output in your wallet for the difference.
- Your wallet adds these inputs and outputs to a transaction, and sends the transaction to the recipient.
- The recipient adds their output for 60 grins to the transaction, and returns it to the sender.
- The sender completes signing of the transaction.
- The sender posts the transaction to the chain.
Outputs in your wallet that are involved in a send
transaction will appear as unconfirmed or locked until the transaction hits the chain and is mined and validated.
There are currently several methods of sending:
If the recipient is running an accessible wallet listener, sending a transaction via HTTP is the most direct method. Usually, all that should be required are the destination (-d
) and the amount itself. To send an amount to another listening wallet:
grin-wallet send -d "http://192.168.0.10:13415" 60.00
This will create a transaction with the other wallet listening at 192.168.0.10, port 13415 which credits the other wallet 60 grins while debiting the 60 Grin + fees from your wallet.
-
-m
'Method', which can be 'http', 'file' or 'self' (described above). If 'http' is specified (default), the transaction will be sent to the IP address which follows the-d
flag.
Transaction can also be created via the exchange of files. If the parameter -m file
is specified, Grin wallet will generate a partial transaction file under the file name specified in the -d
flag:
grin-wallet send -d "transaction.tx" -m file 60.00
This file then needs to be sent to the recipient, who can then import the transaction into their wallet using:
grin-wallet receive -i transaction.tx
This will create a transaction.tx.response
file, which the recipient must send back to the sender to finalize:
grin-wallet finalize -i transaction.tx.response`
You can also create a transaction entirely within your own wallet by specifying the method 'self'. Using the 'self' method, you can send yourself money in a single command (for testing purposes,) or distribute funds between accounts within your wallet without having to run a listener or manipulate files. For instance, to send funds from your wallet's 'default' account to an account called 'account1', use:
grin-wallet send -m self -d "account1" 60
or, to send between accounts, use the -a flag to specify the source account:
grin-wallet -a "my_source_account" send -m self -d "my_dest_account" 60
When sending to self, the transaction will be created and posted to the chain in the same operation.
-
-m
'Method', which can be 'http', 'file', 'relay' or 'self' (described above). -
-s
'Selection strategy', which can be 'all' or 'smallest'. Since it's advantageous for outputs to be removed from the Grin chain, the default strategy for selecting inputs in Step 1 above is to use as many outputs as possible to consolidate your balance into a couple of outputs. This also drastically reduces your wallet size, so everyone wins. The downside is that the entire contents of your wallet remains locked until the transaction is mined validated on the chain. To instead only select just enough inputs to cover the amount you want to send + fees, use:
grin-wallet send -d "http://192.168.0.10:13415" -s smallest 60.00
-
-f
'Fluff' Grin uses a protocol called 'Dandelion' which bounces your transaction directly through several listening nodes in a 'Stem Phase' before randomly 'Fluffing', i.e. broadcasting it to the entire network. This reduces traceability at the cost of lengthening the time before your transaction appears on the chain. To ignore the stem phase and broadcast immediately:
grin-wallet send -f -d "http://192.168.0.10:13415" 60.00
-
-g
'Message' - You can specify an optional message to include alongside your transaction data. This message is purely for informational purposes between all transacting participants, and is not included in transaction data sent to the chain. Each participant message includes a signature that can be verified with the participant's public key. A message can also be specified by the recipient during agrin-wallet receive
command.
$ grin-wallet send -f -d "http://192.168.0.10:13415" -g "This is from Dave" 60.00
The most simple way for personal user to receive Grin is to use the Grin Relay service, the usage looks like this:
$ grin-wallet --floonet send -d tn1-qgfaqdqy-vm8ryd2k6zfp6cm-359cs4gnudxhljm-d0v38yut4u9r7rg-93d4jp 0.9
Put the payee's Grin Relay address as the destination and method with relay
. Here the address tn1-qgfaqdqy-vm8ryd2k6zfp6cm-359cs4gnudxhljm-d0v38yut4u9r7rg-93d4jp
is a Floonet address.
Simply displays all the the outputs in your wallet: e.g:
$ grin-wallet outputs
Wallet Outputs - Account 'default' - Block Height: 49
------------------------------------------------------------------------------------------------------------------------------------------------
Key Id Child Key Index Block Height Locked Until Status Is Coinbase? Num. of Confirmations Value Transaction
================================================================================================================================================
Wallet Outputs - Account 'default' - Block Height: 12548
------------------------------------------------------------------------------------------------------------------------------------------------------
Output Commitment Block Height Locked Until Status Coinbase? # Confirms Value Tx
======================================================================================================================================================
0916ac8d29511c1c75a190981c09664fc077eb917888ee1755114de0e0d01101fa 12548 0 Unconfirmed false 0 14.742000000 3
------------------------------------------------------------------------------------------------------------------------------------------------------
088c087a1efcd3b0711fde1ef56f95b0d781dc7f9678411e8ae7fcfcd94b40c3b1 12548 0 Unconfirmed false 0 10.250000000 4
------------------------------------------------------------------------------------------------------------------------------------------------------
08f2218522fcc3b7e6bc24f26de25e429d057219716615e77061fcbed37df73e2b 6762 6762 Locked false 5787 0.049000000 3
------------------------------------------------------------------------------------------------------------------------------------------------------
08feb352971ed97918759ba29461aed9634989c3080c9319bcd2a99b46662cd3f2 6762 6762 Locked false 5787 24.950000000 3
------------------------------------------------------------------------------------------------------------------------------------------------------
Spent outputs are not shown by default. To show them, provide the -s
flag.
$ grin-wallet -s outputs
And we can query by a minimum output value, and/or an OutputStatus
(unconfirmed/unspent/locked/spent), and/or limit the total display lines. For example:
$ grin-wallet --floonet outputs -m 10.0 -s unspent -l 10
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Output Commitment MMR Index Block Height Locked Until Status Coinbase? # Confirms Value Tx
==============================================================================================================================================================
0921f2619701739cdc074db764fa8c0e7d4bfac55d1c1eaffdc594f719f34e22a6 None 132833 134273 Unspent true 1019 60.000000000 176
--------------------------------------------------------------------------------------------------------------------------------------------------------------
091fbf7a15452d0d9721645c1947a25f8ed41f4a594997e52332b954adc3a4322c None 132834 134274 Unspent true 1018 60.000000000 193
--------------------------------------------------------------------------------------------------------------------------------------------------------------
089deb6f82682c81983e568d7fef48996606e15a36f8b434364f26e651e13c15c5 None 132835 134275 Unspent true 1017 60.000000000 214
--------------------------------------------------------------------------------------------------------------------------------------------------------------
09e3cecf8b71454a9623a924cf7a3a4b63185f5bc3269f4851b7c43fd0236a7e11 None 132836 134276 Unspent true 1016 60.000000000 191
--------------------------------------------------------------------------------------------------------------------------------------------------------------
092afb5ffbbf054fb7f918aca652400affe3aa3b7270e38dcb1c319a87dba2d696 None 132837 134277 Unspent true 1015 60.000000000 197
--------------------------------------------------------------------------------------------------------------------------------------------------------------
09222fae87042f3eba739251e9b834a74a5682ab61b5de509282bb15de68714ca8 None 132838 134279 Unspent true 1014 60.000000000 171
--------------------------------------------------------------------------------------------------------------------------------------------------------------
091f982371ccb093c1575054d91ff71a253731c7d1b477874b1f470036d303ac66 None 132839 134279 Unspent true 1013 60.000000000 180
--------------------------------------------------------------------------------------------------------------------------------------------------------------
0878e27b6498085ed00663da8231e65500b0eaa0a8128c06a3290dd9b40df022a9 None 132840 134280 Unspent true 1012 60.000000000 192
--------------------------------------------------------------------------------------------------------------------------------------------------------------
087d49726e011eb2346378e7569de305bf2f4b0c3f30b27d770dbe899d19038b38 None 132841 134281 Unspent true 1011 60.000000000 174
--------------------------------------------------------------------------------------------------------------------------------------------------------------
0951d232d25c692afd7b44f6dbe9399510b77cf6157574374c597fc2a5a7cb7701 None 132842 134282 Unspent true 1010 60.000000000 200
--------------------------------------------------------------------------------------------------------------------------------------------------------------
total displayed outputs: 10
For the detail usage, please use --help
for it:
grin-wallet --floonet outputs --help
grin-wallet-outputs
Raw wallet self owned output info (list of outputs)
USAGE:
grin-wallet outputs [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-l, --limit <limit> Limit the maximum display lines (show the latest ones)
-m, --minvalue <minvalue> Filter outputs by minimum value
-s, --status <status> Filter outputs by status (unconfirmed/unspent/locked/spent)
Every time an operation is performed in your wallet (receive coinbase, send, receive), an entry is added to an internal transaction log containing vital information about the transaction. Because the Mimblewimble chain contains no identifying information whatsoever, this transaction log is necessary in order to allow your wallet to keep track of what was sent and received. To view the contents of the transaction log, use the txs
command:
$ grin-wallet txs
Transaction Log - Account 'default' - Block Height: 49
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Inputs Num. Outputs Amount Credited Amount Debited Fee Net Difference
==========================================================================================================================================================================================================================================
1 Confirmed Coinbase None 2018-07-20 19:46:45.658263284 UTC true 2018-07-20 19:46:45.658264768 UTC 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Confirmed Coinbase None 2018-07-20 19:46:45.658424352 UTC true 2018-07-20 19:46:45.658425102 UTC 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 Confirmed Coinbase None 2018-07-20 19:46:45.658541297 UTC true 2018-07-20 19:46:45.658542029 UTC 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4 Confirmed Coinbase None 2018-07-20 19:46:45.658657246 UTC true 2018-07-20 19:46:45.658657970 UTC 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 Confirmed Coinbase None 2018-07-20 19:46:45.658864074 UTC true 2018-07-20 19:46:45.658864821 UTC 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 Received Tx 03715cf6-f29b-4a3a-bda5-b02cba6bf0d9 2018-07-20 19:46:46.120244904 UTC false None 0 1 60.000000000 0.000000000 None 60.000000000
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To see the inputs/outputs associated with a particular transaction, use the -i
switch providing the Id of the given transaction, e.g:
$ grin-wallet txs -i 6
Transaction Log - Account 'default' - Block Height: 49
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Inputs Num. Outputs Amount Credited Amount Debited Fee Net Difference
===========================================================================================================================================================================================================
6 Received Tx 03715cf6-f29b-4a3a-bda5-b02cba6bf0d9 2018-07-20 19:46:46.120244904 UTC false None 0 1 60.000000000 0.000000000 None 60.000000000
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Wallet Outputs - Block Height: 49
------------------------------------------------------------------------------------------------------------------------------------------------
Key Id Child Key Index Block Height Locked Until Status Is Coinbase? Num. of Confirmations Value Transaction
================================================================================================================================================
a7aebee71fdd78396ae6 9 5 0 Unconfirmed false 0 60.000000000 6
------------------------------------------------------------------------------------------------------------------------------------------------
And we can also query by tx type (i.e. coinbase/rx/tx/rxc/txc
for coinbase/received/sent/ReceivedCanceled/SentCanceled). For example:
$ grin-wallet --floonet txs -l 50 -s "2019-05-02 01:33:31" -e "2019-05-04 00:00:00" -t tx
Transaction Log - Account 'default' - Block Height: 133851
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Num. Amount Amount Fee Net Tx
Inputs Outputs Credited Debited Difference Data
========================================================================================================================================================================
1228 Sent Tx 0e860bb4-557c-4234-b165-188ee458b364 2019-05-03 03:50:24 true 2019-05-03 04:52:50 1 1000 1.86247 6.99647 4.004 -5.134 Yes
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1229 Sent Tx 8deeb63d-7118-498d-b501-9e523b0b9fd8 2019-05-03 04:54:38 true 2019-05-03 07:26:26 1 1 5.84847 6.99647 0.008 -1.148 Yes
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
total displayed txs: 2
For the detail usage, please use --help
for it:
$ grin-wallet --floonet txs --help
grin-wallet-txs
Display transaction information
USAGE:
grin-wallet txs [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-e, --enddate <enddate> Filter txs by creation date from 'startdate' to 'enddate', with format '1970-01-01
00:00:00'
-i, --id <id> If specified, display transaction with given Id and all associated Inputs/Outputs
-l, --limit <limit> Limit the maximum display lines (show the latest ones)
-s, --startdate <startdate> Filter txs by creation date from 'startdate' to 'enddate', with format '1970-01-01
00:00:00'
-t, --type <type> Filter txs by tx type (coinbase/rx/tx/rxc/txc, means
Coinbase/Received/Sent/ReceivedCanceled/SentCanceled)
Simply displays all the the payments outputs in your wallet: e.g:
$ grin-wallet --floonet payments
Wallet Payments - Account 'default' - Block Height: 133859
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Output Commitment Block Height Locked Until Status # Confirms Value Shared Transaction Id
============================================================================================================================================================================
086379f1d6af37a7ea51db0d9a181589dacce970e4ca5e6e878847fdca30125e92 132740 0 Confirmed 1120 1.000000000 e7988b4d-1084-4c43-91e8-2b61cc80e227
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0869fa44efc77963cd5c225f6563cc5eb5be53dfaa2575894466e467c5f7630f65 75886 0 Confirmed 57974 2.600000000 56fc4c00-7b10-4ddf-97a6-91038294a5b0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
total displayed payments: 2
And we can query by a minimum output value, and/or payment status (unconfirmed/confirmed), and/or limit the total display lines. For example:
$ grin-wallet --floonet payments -l 10 -s confirmed
Wallet Payments - Account 'default' - Block Height: 133859
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Output Commitment Block Height Locked Until Status # Confirms Value Shared Transaction Id
==========================================================================================================================================================================
086379f1d6af37a7ea51db0d9a181589dacce970e4ca5e6e878847fdca30125e92 132740 0 Confirmed 1120 1.000000000 e7988b4d-1084-4c43-91e8-2b61cc80e227
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0869fa44efc77963cd5c225f6563cc5eb5be53dfaa2575894466e467c5f7630f65 75886 0 Confirmed 57974 2.600000000 56fc4c00-7b10-4ddf-97a6-91038294a5b0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
092b7d92a0a9be2caf58abb0540abff5900b8446c13b7fb852cb2a2837a288bac5 132672 0 Confirmed 1188 1.000000000 7991a71a-9428-4086-873a-4d1ce370bec9
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0930bdb50e15bccb6b5e2ec4ebab62dc917a192df28044a3331d17f8c94ed42b0d 132770 0 Confirmed 1090 1.000000000 a0be127e-a53d-45ef-bacb-3d47b05b5f1d
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0954c69ad8783d980c18ee56e2f279f08830a5875543b7f341f3faf1f044205f36 133838 0 Confirmed 22 1.130000000 0e860bb4-557c-4234-b165-188ee458b364
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0961cc41bb181aa8c035232a8ed86723134c8e1cfe764fdcf71f7f4a41a950135a 75884 0 Confirmed 57976 2.500000000 a07b9394-bb6e-4d1d-88f0-819b3be07105
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
096adb30e7964f28eee3eb24b2b08e90120a87afd11b5aa37dfa9e9f4263ed632e 76109 0 Confirmed 57751 2.700000000 f7849395-67e8-4622-bcb4-49387ee16276
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
098e3a1af5a1337551a7b61bbe0b9ac873ef31f0d28afdcf3280e32a5bc2ac69ba 76109 0 Confirmed 57751 2.800000000 35d5a4bd-eb71-4ea3-8804-db098b8bc1e7
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
09c66ad57396b93303fb1203858227410b78522f9538bd0293213bb58aef06bff6 133842 0 Confirmed 18 1.140000000 8deeb63d-7118-498d-b501-9e523b0b9fd8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
total displayed payments: 9
For the detail usage, please use --help
for it:
$ grin-wallet --floonet payments --help
grin-wallet-payments
Raw wallet payment output info (list of outputs)
USAGE:
grin-wallet payments [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-l, --limit <limit> Limit the maximum display lines (show the latest ones)
-s, --status <status> Filter payments by status (unconfirmed/confirmed)
Everything before Step 6 in the (send)[send] phase above happens completely locally in the wallets' data storage and separately from the chain. Since it's very easy for a sender, (through error or malice,) to fail to post a transaction to the chain, it's very possible for the contents of a wallet to become locked, with all outputs unable to be selected because the wallet is waiting for a transaction that will never hit the chain to complete. For example, in the output from grin-wallet txs -i 6
above, the transaction is showing as confirmed == false
meaning the wallet has not seen any of the associated outputs on the chain. If it's evident that this transaction will never be posted, locked outputs can be unlocked and associate unconfirmed outputs removed with the cancel
command.
Running against the data above, as an example:
$ grin-wallet cancel -i 6
$ grin-wallet txs -i 6
Transaction Log - Account 'default' - Block Height: 49
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Inputs Num. Outputs Amount Credited Amount Debited Fee Net Difference
=======================================================================================================================================================================================================================
6 Received Tx - Cancelled 03715cf6-f29b-4a3a-bda5-b02cba6bf0d9 2018-07-20 19:46:46.120244904 UTC false None 0 1 60.000000000 0.000000000 None 60.000000000
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note that the Receive transaction has been cancelled, and the corresponding output was removed from the wallet. If I were the sender, my change output would have been deleted, and any outputs that were locked for the transaction would again be available for use in another transaction.
Be sure to use this command with caution, as there are many edge cases and possible attacks that still need to be dealt with, particularly if you're the recipient of a transaction. For the time being please be 100% certain that the relevant transaction is never, ever going to be posted before running grin-wallet cancel
If you're the sender of a posted transaction that doesn't confirm on the chain (due to a fork or full transaction pool), you can repost the copy of it that grin automatically stores in your wallet data whenever a transaction is finalized. This doesn't need to communicate with the recipient again, it just re-posts a transaction created during a previous send
attempt.
To do this, look up the transaction id using the grin-wallet txs
command, and using the id (say 3 in this example,) enter:
$ grin-wallet repost -i 3
This will attempt to repost the transaction to the chain. Note this won't attempt to send if the transaction is already marked as 'confirmed' within the wallet.
You can also use the repost
command to dump the transaction in a raw json format with the -m
(duMp) switch, e.g:
$ grin-wallet repost -i 3 -m tx_3.json
This will create a file called tx_3.json containing your raw transaction data. Note that this formatting in the file isn't yet very user-readable.
If for some reason the wallet cancel commands above don't work and you believe your outputs are in an inconsistent state, you have two options, check
and restore
. It's highly recommended you try the check
command first, as it will leave your transaction history log intact.
The check
command will scan the entire UTXO set from the node, identify which outputs are yours and update your wallet state to be consistent with what's currently in the UTXO set. This command will unlock all outputs, restore any missing outputs, and mark any outputs that have been marked 'Spent' but are still in the UTXO set as 'Unspent' (as can happen during a fork). It will also attempt to cancel any transaction log entries associated with any locked outputs or outputs incorrectly marked 'Spent'
For these reasons, you should be fairly sure that nobody will attempt to post any unconfirmed transactions involving your wallet before trying this command, (but even it someone does, it should be possible to re-run this command to fix any resulting issues.
To attempt a repair, ensure a wallet listener isn't running, and enter:
$ grin-wallet check
The operation may take some time (it's advised to only perform this operation using a release build,) and it will report any inconsistencies it finds and repairs it makes. Once it's done, the state of your wallet outputs should match the contents of the chain's UTXO set.
If check
isn't working, or you need to restore your wallet from a backed up wallet.seed
file and password, or have recovered the wallet seed from a recovery phrase, you can perform a full wallet restore.
This command acts similarly to the check command in that it scans the UTXO set for your outputs, however it will only restore found UTXOs into an empty wallet, refusing to run if the wallet isn't empty.
Generate an empty wallet somewhere with:
$ grin-wallet init -h
Delete the newly generated wallet seed file:
[host@new_wallet_dir]$ rm wallet_data/wallet.seed
Copy your backed up wallet.seed
file into the new wallet_data
directory.
Create a new wallet using the -r
flag:
$ grin-wallet init -r
or to create in the current directory instead of in ~/.grin:
grin-wallet init -hr
Check the the grin-wallet recover
command for further options
Ensure the Grin node with which your wallet is communicating is running, and make sure nothing is attempting to mine into your wallet. If you're restoring into a custom wallet location, ensure your current directory is the one containing its grin-wallet.toml
file.
Then:
$ grin-wallet restore
Note this operation can potentially take a long time. Once it's done, your wallet outputs should be restored, and you'll be able to transact with your restored wallet as before the backup. Your transaction log history is not restored, and will simply contain incoming transactions for each output found.
Change wallet password.
$ grin-wallet passwd
Password:
Changing password for wallet. Please Input your new password.
Password:
Confirm Password:
Command 'passwd' completed successfully
Query current Grin Relay receiving address.
$ grin-wallet address
Your current Grin Relay address for receiving: gn1-qfy4n9rh-j8lfa7342rzcpt7-lj2sqgd4lryum25-ss2gnfa3t43z3a6-n8va0s
(Please run `grin-wallet listen` for receiving Grin on this address.)
Command 'address' completed successfully
Export or verify a transaction proof.
$ grin-wallet proof export -i 113 -f tx113.proof -m "an optional proof message here!"
Proof exported to tx113.proof
This file proves that 0.900000000 grin was sent.
To: tn1-qw3x5lvq-zu4mx5dzdr483hy-allyv00r0yualjs-y8vjqqpff730w8z-h7cwu3
From: tn1-qftfsjg4-gdqxxp6zayr0jv2-d9shyd7sqmwwfef-ruhgzr52q700rgg-dukzlv
Outputs:
09182d88cd360dcfcc08b79530efad55800ade482be756f08ea42a15aa700e42e9
Kernel Excess:
096150cd6b503ce43048079359de4660da555a461162860c6665ec473b802043d7
Command 'proof' completed successfully
$ grin-wallet proof verify -f tx113.proof
This file proves that 0.900000000 grin was sent.
To: tn1-qw3x5lvq-zu4mx5dzdr483hy-allyv00r0yualjs-y8vjqqpff730w8z-h7cwu3
From: tn1-qftfsjg4-gdqxxp6zayr0jv2-d9shyd7sqmwwfef-ruhgzr52q700rgg-dukzlv
Outputs:
09182d88cd360dcfcc08b79530efad55800ade482be756f08ea42a15aa700e42e9
Kernel Excess:
096150cd6b503ce43048079359de4660da555a461162860c6665ec473b802043d7
Command 'proof' completed successfully
Other than the default communication methods (http, file), grin exposes an interface that developers can use to integrate any communication channel (i.e Telegram, Signal, email) for the exchange of slates.
Grin comes bundled with an experimental keybase.io plugin. The keybase client must be installed in the system. Usage is as follows:
Recipient starts a keybase listener.
$ grin-wallet listen -m keybase
Sender creates a transaction, sends it to the recipient and awaits for the reply.
$ grin-wallet send <amount> -m keybase -d <recipient>
Where recipient is a keybase username. If everything goes well the transaction is finalized and sent to the node for broadcasting.