Grin: Private & Lightweight

Mimblewimble Blockchain

Cuckoo Cycle Proof-of-Work

Grin’s approach to ASIC resistance is its Cuckoo Cycle Proof-of-Work. Similarly to BEAM, ASIC resistance is achieved by heavy memory use. Therefore, the time to solve a block depends on memory bandwidth rather than CPU / processor speed. Thus, energy consumption is considerably lower than most processor based Proof-of-Work algorithms.

To learn more about Grin’s Proof-of-Work, check the official documentation on GitHub.

Grin Specs And Data

Specifications and features of Grin:

  • Programming language: Rust
  • Algorithm: Cuckoo Cycle Proof-of-Work
  • Total supply: no limit (but declining emission over time)
  • Scripting
  • Cross chain atomic swaps
  • Blocktime: 60 seconds
  • privacy focused blockchain using Mimblewimble
  • Scalable (transaction cut-through)
  • Pruning

How to build Grin from source

Introduction

First, you will need to install the Rust programming language on your (GNU/Linux) computer. According to the Grin docs, Windows is kind of supported, but not really (mining does not work). So, let’s focus on GNU/Linux, for now.

This tutorial assumes that you have a 64bit Ubuntu 16.04 or compatible.

Step 1: install Rust

Refresh the package source list:

sudo apt update

Now, let’s fetch the Rust installer from https://rust-lang.org/. Open a Terminal (Ctrl+Alt+t) and paste the following command:

wget -O - https://static.rust-lang.org/rustup.sh | bash

After the download of rustup.sh has completed, the Rust installer opens:

01 Install Rust
Rust installation welcome screen

Follow the instructions in the terminal window:

  • select 1) Proceed with installation (default)
  • wait for the installer to finish downloading (default version, including rustc, rust-std, cargo and rust-docs: ~145mb)
  • adjust the PATH variable:
source $HOME/.cargo/env

Step 2: Dependencies

Now, let’s install all depedencies required to build and run Grin:

sudo apt install build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config libssl-dev llvm

This might take a while to install. Once it’s done, we’re ready to run the actual Grin installation.

Step 3: Grin Wallet installation

Having all requirements on our system now, we can clone grin and run a build:

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

Cargo will start downloading some libs and continue with the build process. Again, this might take a while. Finally, cargo will start the build process, showing

Building [=====================================================> ] 355/359: grin_wallet

in the terminal window. After that, the build process should finish without major warnings or issues.

Cargo downloading libs after the cargo build --release command
Cargo downloading libs after the "cargo build --release" command

cd into target/release and inspect the results of the build process. It should look something like this:

03 check build
03 check build

The grin file is what we wanted. To get an overview of what you can do, run one of the following commands:

grin help
grin wallet help
grin client help

Congratulations, you did it! You have successfully installed the wallet, therefore you’re ready to use it.

See the next tab for more details!

How to use the Grin wallet

Step 1: open wallet

As described in the previous section, we’ve compiled Grin and we cd‘ed into its working directory. Next, we will run the grin binary:

# for testnet:
./grin --floonet
# for mainnet:
./grin

The wallet should open in the terminal window.

Grin wallet after launch
Grin wallet after launch

In a new terminal window, you might wanna check out the wallet’s command line options to get an idea about its capabilities:

./grin wallet help

Hit return and the command will present you a list of flags, options and subcommands you can use:

command "grin wallet help"
Command "grin wallet help". If you've set your environment variable, this command works as-is, otherwise you'll have to type "./grin wallet help" from within the directory containing the "grin" binary.

Step 2: initialize wallet

Let’s first check our account by typing:

./grin --floonet wallet account

Remember, as of the time of this writing, we’re still in testnet, so we have to set the --floonet flag to issue commands.

Grin will now tell us that we don’t have an account, yet, and that we should first create a wallet seed file.

./grin --floonet wallet account                                                              
Wallet seed file doesn't exist. Run `grin wallet init` first

This isn’t 100% accurate, yet, so let’s run:

./grin --floonet wallet init

to create a seed. It will ask you to set a password, so pick a secure one.
If everything worked well, you should get your seed. Store it in a safe place! If you lose your seed, you will lose your money!

Please enter a password for your new wallet
Password: 
Confirm Password: 
20190101 16:21:44.564 WARN grin_wallet::types - Generating wallet seed file at: /home/tommi/.grin/floo/wallet_data/wallet.seed
Your recovery phrase is:
(this is where your seed is)
Please back-up these words in a non-digital format.
Command 'init' completed successfully

This looks good! Now, let’s issue the ./grin --floonet wallet account command again to check if we have a working testnet account. Enter your password when asked and you should get an output similar to this:

"grin wallet account" command
The "grin wallet account" command. After initializing the wallet, it should give an output.

Step 3: send & receive

soon™

How To Mine BEAM?

Coming soon!

We’re constantly adding content – expect mining articles in this section, soon!

Where Can I Trade BEAM?

Check out our dedicated page for Grin Trading to get more information on how / where to trade the Grin cryptocurrency.

Frequently Asked Questions

Everything you want to know about Grin.

What is Grin?
Can I mine it?

This section will grow as the project grows. If you:

  • found an error in this FAQ,
  • have anything to add,
  • or just want to ask a question,

feel free to drop me an email.

Leave a Reply

Your email address will not be published. Required fields are marked *