# Generate Validator Keys

#### Build Requirement

* [Python **3.8+**](https://www.python.org/about/gettingstarted/)
* [pip3](https://pip.pypa.io/en/stable/installing/)

#### For Linux or MacOS users

**File Permissions**

On Unix-based systems, keystores and the `deposit_data*.json` have `440`/`-r--r-----` file permissions (user & group read only). This improves security by limiting which users and processes that have access to these files. If you are getting `permission denied` errors when handling your keystores, consider changing which user/group owns the file (with `chown`) or, if need be, change the file permissions with `chmod`

***

#### Get Started to generate validator keys

1. Clone the Deposit-CLI repository from JIBChain-net Github

```sh
git clone https://github.com/jibchain-net/deposit-cli.git && cd deposit-cli
```

2. Install dependencies (Ensure you are using Python version >= Python3.8)

```sh
pip3 install -r requirements.txt
python3 setup.py install

# Or use the helper script
./deposit.sh install
```

3. Create key and `deposit_data-*.json`

```sh
mkdir validator_keys-test
```

```sh
./deposit.sh new-mnemonic --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=jib --eth1_withdrawal_address=<withdraw_address> --folder=validator_keys-test
```

Example:

```sh
./deposit.sh new-mnemonic --num_validators=1 --mnemonic_language=english --chain=jib --eth1_withdrawal_address=<change-to-your-address> --folder=validator_keys-test
```

4. Create your password and confirm your password

```
Running deposit-cli...

***Using the tool on an offline and secure device is highly recommended to keep your mnemonic safe.***

Please choose your language ['1. العربية', '2. ελληνικά', '3. English', '4. Français', '5. Bahasa melayu', '6. Italiano', '7. 日本語', '8. 한국어', '9. Português do Brasil', '10. român', '11. Türkçe', '12. 简体中文']:  [English]:
Create a password that secures your validator keystore(s). You will need to re-enter this to decrypt them when you setup your Ethereum validators.:
Repeat your keystore password for confirmation:
```

5. Remember your mnemonic key

```
This is your mnemonic (seed phrase). Write it down and store it safely. It is the ONLY way to retrieve your deposit.


onion margin nuclear expire december wild fever actress educate picnic key urge slow tape fruit quantum dial hero curtain disorder exercise lawsuit fashion dash


Press any key when you have written down your mnemonic.
```

6. Put your mnemonic key to verify that you saved

```
Please type your mnemonic (separated by spaces) to confirm you have written it down. Note: you only need to enter the first 4 letters of each word if you'd prefer.

: onion margin nuclear expire december wild fever actress educate picnic key urge slow tape fruit quantum dial hero curtain disorder exercise lawsuit fashion dash
```

7. Waiting for generate key

```
                  #####     #####
                ##     #####     ##
    ###         ##   #######     #########################
    ##  ##      #####               ##                   ##
    ##     #####                 ##                       ##
    ##     ##                     ##                      ###
   ########                        ##                     ####
   ##        ##   ###         #####                       #####
   #                          ##                         # #####
   #                            #                        #  #####
   ##                             ##                    ##
   ##                              ##                   ##
   ##             ###              ##                   ##
   ###############                 ##                   ##
   ###               ##                                 ##
      #############################                    ##
                     ##                             ###
                     #######     #################     ###
                     ##   ## ##        ##   ##    ###
                     ##############          #############

Creating your keys.
Creating your keystores:	  [####################################]  1/1

Success!
Your keys can be found at: validator_keys-test/validator_keys


Press any key.
```

8. Your keys can be found at: `validator_keys-test/validator_keys`

```sh
cd validator_keys-test/validator_keys && ls -la
```

example:

```
total 16
drwxr-xr-x  4 user  staff  128 Dec  3 15:14 .
drwxr-xr-x  3 user  staff   96 Dec  3 15:14 ..
-r--r-----  1 user  staff  702 Dec  3 15:14 deposit_data-1701591267.json
-r--r-----  1 user  staff  710 Dec  3 15:14 keystore-m_12381_3600_0_0_0-1701591267.json
```

***

> If you input --num\_validators more than 1, the list of files will show keystore-m\_ equal to the number of validators that you input
