Grin wallet – How to send a blockchain transaction without an address

Anonymous coin Grin (Gulin, named after Harry Potter’s Gringotts), after a storm of propaganda in the currency circle, we still have to face a reality: because Grin abandoned the concept of address, which makes it Trading operations are more complicated than traditional cryptocurrencies such as BTC. How does this cryptocurrency complete the transaction without an address?

This article is a specific use of Grin wallet tutorial, including initializing the wallet, sending a transaction, receiving a transaction, completing a transaction, viewing the balance, viewing the transaction log, canceling the transaction, checking the wallet, restoring the wallet with the help word.

(Image courtesy of pexels.com )

Prerequisites

For this tutorial, assume that you have downloaded and installed the Grin software and are running the sync node. For instructions on how to do this, see How to Run the GRIN Nodes Page.

Initialize the wallet

Before using the Grin wallet, it must be initialized. This process will initialize the wallet’s database and create a private master seed file for you.

To do this, run:

grin wallet init

You will then be prompted to enter your password. This password will be used to encrypt the primary seed file, which you will need to provide each time you use your wallet.


File /home/yeastplume/.grin/grin-wallet.toml configured and created
Please enter a password for your new wallet
Password:
Confirm Password:

Once this is done, the system will generate your wallet seed file and provide you with a 24-word recovery phrase (mnemonic) that you can use to recover your wallet if you lose the seed file or forget the password. Write these mnemonics in pen and paper and place them in a safe place, because anyone with the phrase can control all your money:


20190105 17:36:35.814 WARN grin_wallet::types - Generating wallet seed file at: /home/yeastplume/.grin/wallet_data/wallet.seed
Your recovery phrase is:
foster approve pen ancient engage bomb fantasy life short stuff mesh bus design truck oyster ankle shallow torch double melody town century nice report
Please back-up these words in a non-digital format.
Command 'init' completed successfully

Your wallet torrent file is located .grin/wallet_data/wallet.seed. Be sure to back up this file to a safe place and make sure it is still private.

Your wallet profile is located .grin/grin-wallet.toml. By editing this file, you can change the default node address, the default listener port, and more options. See below for more information on these options.

Connect to a node

Your wallet must always have a working Grin node to communicate. The nodes should be fully synchronized.

Currently the development community recommends that everyone run their own nodes. For instructions on how to do this, see How to Run the GRIN Nodes Page.

By default, the wallet attempts to communicate with nodes running on the local computer. To communicate with another node, you can specify it on the command line --api_server_address(or abbreviated as -r), for example:


grin wallet -r http://some_public_node.org:3413 info

Or you can edit grin-wallet.tomlthe check_node_api_http_addrvalue in .

View wallet funds

To view the information in your wallet, use the infocommand:


# 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

  1. TotalIs the total amount of your wallet, including funds waiting to be confirmed;
  2. Immature Coinbase Indicates any CoinBase transaction (ie winning block) that is not yet mature before it can be used;
  3. Awaiting Confirmation(Waiting for confirmation) means that the wallet will not spend the balance until a given amount of confirmation. The default is 10 blocks.
  4. Locked by previous transactionIs the output of the previous transaction sent lock, they cannot be included in subsequent transactions. This information usually disappears when the transaction is confirmed.

Send Grin Coin

There are many different ways to send grin coins to another wallet:

Send by file

It is currently recommended for beginners to send Grin coins through documents. The tutorial is as follows:

Create a transaction file:


grin wallet send -m file -d my_grin_transaction.tx 10.25

This will create a my_grin_transaction.txtransaction file named in the current directory .

Send this transaction file to the recipient

Send this file to the intended recipient in any way (email, ftp). The recipient must fulfill their trading operations in their wallet and send the corresponding file back to you. See the Receive Transaction Tutorial below.

Finalize the transaction

The recipient will send you a transaction corresponding file. After confirming with the recipient that they have processed your send file, you can complete the transaction and send it to the blockchain:


grin wallet finalize -i my_grin_transaction.tx.response

This action will broadcast the transaction to the grin listening node, and after a few block times, your wallet and the recipient’s wallet balance will be confirmed.

Send to a running wallet listener

If the recipient is running an HTTP listener, you can send the amount in the wallet to their wallet and post the transaction to the chain in one step:


grin wallet send -d  10.25

If successful, the wallet balance of both parties will be confirmed after several block times.

Receive Grin Coin

Receiving by file

The sender will send you a transaction file (as described above), which you must import into the wallet by receiving the command:


grin wallet receive -i my_grin_transaction.tx

This action creates a my_grin_transaction.tx.responseresponse file called and you must send the file back to the sender to complete the transaction and then post the transaction to the chain.

Through the wallet listener

Running a wallet listener is considered an advanced operation, and only those who have the infrastructure to support their NAT/firewall, DOS, etc. can perform this operation, all of which go far beyond this guide. range.

By default, the wallet will only listen for requests on the local computer. To accept wallet connections from other machines, you can edit them ~./grin-wallet.tomlas follows:

Change


api_listen_interface = "127.0.0.1"

To


api_listen_interface = "0.0.0.0"

Or you want to bind to any specific IP address. Then you can run an external wallet listener with the following code:


grin wallet listen

Alternatively, you can listen to 0.0.0.0 by passing in the -e (external) wallet parameter:


grin wallet -e listen

You can also change grin-wallet.tomlthe listening port in the command line or through the command line (see for details grin wallet help listen). Once your listener is running, any sender who wants to send you a Grin coin can do so as described above.

Transaction log

Grin Wallet will keep a log of all trading operations. It tracks all completed and outstanding transactions, as well as the output associated with each transaction. This log is useful for viewing the source of Grin and for canceling some transactions that may not have been completed.

Here’s how to view the transaction log:


grin wallet txs

Transaction Log - Account 'default' - Block Height: 13830
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Num. Amount Amount Fee Net Tx
Inputs Outputs Credited Debited Difference Data
====================================================================================================================================================================================================================
0 Received Tx 20f978d4-d2a5-4df2-a1a4-806330db5718 2019-01-02 12:50:33 true 2019-01-02 15:56:23 0 1 20000.0 0.0 None 20000.0 None
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 Sent Tx c2dd4216-7820-4545-bd49-eea8119c39d0 2019-01-02 15:59:20 false None 1 1 19998.992 20000.0 0.008 -1.008 c2dd4216-7820-4545-bd49-eea8119c39d0.grintx
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 Sent Tx c8a7b02e-78e1-4813-b8a9-7367b630a070 2019-01-02 15:59:27 false None 1 1 19997.984 19998.992 0.008 -1.008 c8a7b02e-78e1-4813-b8a9-7367b630a070.grintx
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 Sent Tx 856c3c85-0cb9-4951-9f33-124f032ac21e 2019-01-02 15:59:31 false None 1 1 19996.976 19997.984 0.008 -1.008 856c3c85-0cb9-4951-9f33-124f032ac21e.grintx
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To see the full details of the transaction and the output associated with it, use the -i parameters:


grin wallet txs -i 3

Transaction Log – Account ‘default’ – Block Height: 13830 ————————————————————————————————————————————————————————————————————– Id Type Shared Transaction Id Creation Time Confirmed? Confirmation Time Num. Num. Amount Amount Fee Net Tx Inputs Outputs Credited Debited Difference Data ============================================================================================================================================================================================================== 3 Sent Tx 856c3c85-0cb9-4951-9f33-124f032ac21e 2019-01-02 15:59:31 false None 1 1 19996.976 19997.984 0.008 -1.008 856c3c85-0cb9-4951-9f33-124f032ac21e.grintx ————————————————————————————————————————————————————————————————————–

Wallet Outputs - Account 'default' - Block Height: 13830
----------------------------------------------------------------------------------------------------------------------------------------------------
Output Commitment Block Height Locked Until Status Coinbase? # Confirms Value Tx
====================================================================================================================================================
08ad4948a215e22e37f7909c7e36460afa5e38d6696361b0a27b983b38e78540c5 6742 0 Spent false 7089 19997.984000000 3
----------------------------------------------------------------------------------------------------------------------------------------------------

cancel the deal

When using Grin, it is very possible to create invalid transactions, especially when using file-based or fully asynchronous trading methods.

If you have an unconfirmed transaction in your log, but you think the transaction will not be completed, you can cancel the transaction using the following methods:

grin wallet cancel -i 3

This sets the status of the transaction to “Cancelled”, deletes any unconfirmed change output, and unlocks any output previously locked by the transaction so they can be used again. Please note that if you or someone else completes a transaction after canceling the transaction, your output may still be wasted and not available to your wallet. Or, if you use the same output in a new transaction and someone tries to complete the cancelled output, the published transaction will fail.

Wallet check

Due to all the possibilities listed in the cancel command and the possibility of forks, your wallet is likely to end up in an inconsistent state. Therefore, Grin provides a manual check command to scan any output belonging to your wallet in the utxo collection of the chain and ensure that they are in line with the local wallet database.

It is important to remember that the status of the wallet can always be rebuilt from the chain via the wallet’s seed file or recovery phrase. If your wallet balance or output is unusual or unexpected, make sure they are safely located in the utxo collection (as long as they are not used up) and can always be recovered by checkor restoreoperation.

To check your wallet and make sure its content matches the version on the chain, make sure you have no outstanding transactions and make sure the node is up to date, then:

grin wallet check

This will scan the blockchain and cancel all pending transactions, unlock all locked outputs, restore all lost output, and ensure that the contents of the wallet match the version of the blockchain. You can run this command at any time to check and update the contents of your wallet.

Recover wallet by recovering phrases (mnemonics)

Back up your existing wallet:

mv ~/.grin/wallet_data ~/.grin/wallet_data_bak

then:


grin wallet init -r
[... follow onscreen instructions...]
grin wallet restore

For more information, see the ” restore” action in the User Guide .

Other orders

Additional important commands and details of all the commands mentioned in this article can be found in the detailed wallet user guide . It is recommended that you read the guide carefully to understand the possible uses of your wallet.

Some of the commands you should pay special attention to are:

  1. recover – Recover wallet seeds from seed phrases, or view existing recovery phrases;
  2. restore – Recover empty wallet from seed file

Original Post: https: //github.com/mimblewimble/docs/wiki/How-to-use-the-Grin-wallet
Author: Juraj Bednar

The above guide is about how to use of Grin wallet, it can be said that it is very troublesome, I hope to improve later.



Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.