Looking for a tutorial of grin-wallet CLI - View Wallet function (rewind_hash and scan rewind_hash) (150 grin bounty)

Hi all

Thanks to @deevope’s recent contribution, grin-wallet CLI can be scanned publicly which is important for integration of grin with exchanges.

I would like to announce that grinnode.live is offering a 150 grin bounty for a tutorial of a step by step usage of this feature with screenshots and preferably involving scenarios that cover integration of grin with exchanges.

9 Likes

is it like a view key ?

This is a great contribution indeed :clap: I’m not sure if that’s for integrating with exchanges though, it’s more like having the ability to observe how much money a wallet has e.g. donation transparency, tracking of your outputs without having the private key around and similar.

1 Like

A good example use-case would have been my funding request which was approved by the CC using community donations (not from the fund). It was left up to me to tell you when I had reached the goal and ended up receiving enough to run slatepcks for 12 months which I then divided to also create MWSocial.

In the future I would create an address as a public listener and use grin-wallet rewind_hash to get my hash and then share that with people who then can use the grin-wallet scan_rewind_hash command to scan the outputs of that wallet – is that right?

I’ll be happy to create a step-by-step tutorial and video tomorrow.

4 Likes

A real world use-case would be well suited.

An exchange would most likely manage multiple wallets. It could enable them to secure wallets in one security zone and the frontend that do calculations in another security zone. Also it may help them on automation of interaction between deposit wallets and hot wallets that service users.

1 Like

I’m unable to run grin.wallet rewind_hash:

error: Found argument 'rewind_hash' which wasn't expected, or isn't valid in this context

Any advice? DO i need to upgrade my version of grin?

Yes, you need to update your wallet by building a new bin from the github master branch:

BUILD STEP

git clone https://github.com/mimblewimble/grin-wallet.git
cd grin-wallet
cargo build --release
5 Likes

Thank you! I’ll do just that.

edit: having trouble running grin-wallet and the holidays are among us – sorry for being so late with this!

1 Like

thanks for update @dog.

Bounty is open for more than 1 tutorial, so if you have any more ideas please share

1 Like

I will start this little tutorial by sharing operation system infos. i’am running Macos Big Sure 11.1

workstation@MacBook-Pro-de-workstation grin-wallet % uname -a

Darwin MacBook-Pro-de-workstation.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

Here is the steps to BUILD the latest grin-wallet version. thank you @deev for sharing the steps

git clone https://github.com/mimblewimble/grin-wallet.git
cd grin-wallet
cargo build --release

Once completed you will find the executable file in the target/debug/ folder

First Let’s check our balance by running the “info” command like below :point_down:

workstation@MacBook-Pro-de-workstation grin-wallet % grin-wallet info

____ Wallet Summary Info - Account 'default' as of height 1308955 ____

 Confirmed Total                  | 0.731000000 
 Awaiting Confirmation (< 10)     | 0.731000000 
 Awaiting Finalization            | 0.000000000 
 Locked by previous transaction   | 0.000000000 
 -------------------------------- | ------------- 
 Currently Spendable              | 0.000000000 

Command 'info' completed successfully

the rewind_hash cmd will help us get the hash we can share publicly if you want to disclose your balance

grin-wallet rewind_hash
Wallet Rewind Hash
-------------------------------------
73ff74121c34e5e4fae53c1e7d1ef807ad36be63788f6730caff2bb19f0e45e2

in order for others to check your balance they will also need the latest grin-wallet version by using cmd in step 1 and run the command below :point_down:

grin-wallet scan_rewind_hash 73ff74121c34e5e4fae53c1e7d1ef807ad36be63788f6730caff2bb19f0e45e2

View Wallet Outputs - Block Height: 1308955
-----------------------------------------------------------------------------------------------------------------------------------------------
 Output Commitment                                                   MMR Index  Block Height  Locked Until  Coinbase?  # Confirms  Value 
===============================================================================================================================================
 09e2a601ecef1f1d1145c8ba66af77450e7fe7896fa125b080346aff86c1b1e8c6  10056359   1308949       1308949       false      7           0.731000000 
-----------------------------------------------------------------------------------------------------------------------------------------------

you can see that the Confirmed Total found by running the info command = Value found by running scan_rewind_hash (0.731)

10 Likes

For the build steps, if that the first time you build it, you`need to install the following package:
apt install build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config libssl-dev llvm

And you find the executable in the target/release

2 Likes

Before building i used these commands :

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env  

then

cargo build --release 
1 Like