Skip to content

Commit

Permalink
docs: refine the document for creating validators (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing authored Apr 7, 2024
1 parent ed02b74 commit ff35253
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 25 deletions.
Binary file added docs/assets/bcfusion/create-validator0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 84 additions & 25 deletions docs/bcfusion/validators/creation.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,52 @@
import Validator0 from '../../assets/bcfusion/create-validator0.png';
import Validator1 from '../../assets/bcfusion/create-validator1.png';
import Validator2 from '../../assets/bcfusion/create-validator2.png';
import Validator3 from '../../assets/bcfusion/create-validator3.png';
import Validator4 from '../../assets/bcfusion/create-validator4.png';

# Validator Creation Guide

This guide outlines the process for creating a new validator on the BNB Smart Chain. If you're migrating validators
from the Beacon Chain to BSC, please pay attention to the instruction for setting the `identity` field correctly.

To create a validator, access the BNB staking dApp:
This guide outlines the process for creating a new validator on the BNB Smart Chain (BSC).
The BNB staking dApp is the official tool for creating and managing validators on the BSC.

- **Testnet
**: [https://testnet-staking.bnbchain.org/en/bnb-staking](https://testnet-staking.bnbchain.org/en/bnb-staking)
- **Mainnet**: *To be announced*

Navigate to the dApp and select the `Become a Validator` button to initiate the creation process.
## Terminology

- **Operator Address**: The address for creating and modifying validator information on the BSC. You should use this
address when connecting to the staking dApp. The corresponding account should have more than 2001 BNB for creating
validtors and paying transaction fees.
- **Consensus Address**: A unique address for your validator's node. It is used for consensus engine when mining new
blocks. It should be different from the operator address. If you have an existing validator created on the Beacon
Chain, the old consensus adddress cannot be reused and you should create a new one.
- **Vote Address**: An address used for fast finality voting. If you have an existing validator created on the Beacon
Chain, the old vote adddress cannot be reused and you should create a new one.
- **BLS Proof**: A BLS signature verifying ownership of the vote address.
- **Identity**: For associating a new validator with an existing one from the Beacon Chain. It is useful when delegators
[migrate their stakes](../users/stake-migration.md) - they can know there is a new validator running by the same
validator operator. This is optional unless you're migrating an old validator.

## Steps

### 1. Connecting to the dApp

Please connect to the staking dApp using your **Operator Address**. `Trust Wallet`, `MetaMask`, and `WalletConnect`
options are available for the step. Make sure that the account has more than 2001 BNB before moving on to the next step.

<img src={Validator0} width="400"/>

### 2. Filling out the form

Navigate to the dApp and select the `Become a Validator` button in the right middle of the page
to initiate the creation process.

## Basic Information
The following information is required to create a validator.

<img src={Validator1} width="400"/>
### Basic Information

<img src={Validator1} width="600"/>

You'll need to provide the following details on the `Create Validator` page:

Expand All @@ -30,9 +58,9 @@ To enhance your validator's visibility, consider uploading additional informatio
the [BSC validator directory](https://github.com/bnb-chain/bsc-validator-directory). Your avatar, once uploaded, will be
displayed in the staking dApp.

## Addresses
### Addresses

<img src={Validator2} width="400"/>
<img src={Validator2} width="600"/>

The following addresses are required:

Expand All @@ -42,30 +70,56 @@ The following addresses are required:
- **Identity**: For associating a new validator with an existing one from the Beacon Chain. This is optional unless
you're migrating an old validator.

### Generating Vote Address and BLS Proof
#### Generate Consensus Address

Download the BSC geth binary from [the official release page](https://github.com/bnb-chain/bsc/releases/tag/v1.3.10).

Note: Make sure you are downloading the correct binary based on your machine's platform, e.g., if you are using MacOS,
you should download the `geth_mac` file. In the following, we will refer the binary as `geth` for simplicity.

To create a new account for mining, please use the following command and set a password for the account.

```shell
geth account new --datadir ${DATA_DIR}
```

- `DATA_DIR`: The directory where you want to store your key store files.

This command will return the public address (i.e. consensus address) and the path to your private key.
Please backup the key file!

An example consensus address is `0x4b3FFeDb3470D441448BF18310cAd868Cf0F44B5`.

If you already have an account for mining, you can use the seed phrase to recover the account.

```shell
geth account import --datadir ${DATA_DIR}
```

If you have created a validator on the Beacon Chain, please use a different one for the consensus address.

#### Generate Vote Address and BLS Proof

To create a new BLS account please use the following command.

```shell
geth bls account new
geth bls account import
geth bls account new --datadir ${DATA_DIR}
```

- `DATA_DIR`: The directory where you want to store your key store files.

If you already have a voting key, create a bls wallet and use the keyfile to recover it, using the following command.

```shell
geth bls account import <keyFile>
geth bls account import ${KEY_FILE} --datadir ${DATA_DIR}
```

- `DATA_DIR`: The backup file for restoring the BLS account.

Then you can get your vote address by running the following command.

```shell
geth bls account list
geth bls account list --datadir ${DATA_DIR}
```

An example address
Expand All @@ -77,14 +131,14 @@ Then you can get your bls proof by running the following command.
geth bls account generate-proof --chain-id ${BSC_CHAIN_ID} ${OPEATOR_ADDRESS} ${VOTE_ADDRESS}
```

An example proof
is `0xaf762123d031984f5a7ae5d46b98208ca31293919570f51ae2f0a03069c5e8d6d47b775faba94d88dbbe591c51c537d718a743b9069e63b698ba1ae15d9f6bf7018684b0a860a46c812716117a59c364e841596c3f0a484ae40a1178130b76a5`.

- `BSC_CHAIN_ID`: `56` for BSC mainnet, and `97` for BSC testnet.
- `OPEATOR_ADDRESS`: The address of your account, which will be reconginzed as the operator of the new validator.
- `VOTE_ADDRESS`: The vote address created in the last step.

### Create indentity
An example proof
is `0xaf762123d031984f5a7ae5d46b98208ca31293919570f51ae2f0a03069c5e8d6d47b775faba94d88dbbe591c51c537d718a743b9069e63b698ba1ae15d9f6bf7018684b0a860a46c812716117a59c364e841596c3f0a484ae40a1178130b76a5`.

#### Create indentity

Identity is used for assocaiting the new validator to the old validator created on the Beacon Chain, to facilitate
delegators moving their stakes to the same validator operator when [migrations](../users/stake-migration.md).
Expand All @@ -97,7 +151,7 @@ Note: Make sure you are downloading the correct binary based on your machine's p
you should download the `macos_binary.zip` file, and after unzip it your will find `bnbcli` (for mainet)
and `tbnbcli`(for testnet). In the following, we will refer the binary as `bnbcli` for simplicity.

#### Local Key
##### Local Key

```shell
${workspace}/bin/bnbcli \
Expand All @@ -108,7 +162,7 @@ ${workspace}/bin/bnbcli \
--chain-id ${BC_CHAIN_ID} \
```

#### Ledger Key
##### Ledger Key

```shell
${workspace}/bin/bnbcli \
Expand Down Expand Up @@ -143,17 +197,22 @@ PubKey: 0x021afe2e504c2e08941643fbe6422e256d581ebb13cb7f4678e755f886934440cd

The `Signature` is your `identity` for associating to the old validator created on the Beacon Chain.

## Commissions
### Commissions

<img src={Validator3} width="400"/>
<img src={Validator3} width="600"/>

- **Rate**: The commission rate of the validator.
- **Max Rate**: The maximum commission rate that the validator can set.
- **Max Change Rate**: The maximum rate change the validator can set to every epoch (1 day).

## Self-delegation
### Self-delegation

<img src={Validator4} width="400"/>
<img src={Validator4} width="600"/>

- **Self Delegate Amount**: The amnout to delegate when creating the validator. The minimal number to input is `2001` -
for the minimal self delegation amount is 2000 BNB and extra 1 BNB for locking to a dead address.
for the minimal self delegation amount is 2000 BNB and extra 1 BNB for locking to a dead address.

### 3. Submitting the form

Once you have filled out all the required information, click the `Submit` button to submit the transaction.

0 comments on commit ff35253

Please sign in to comment.