2. Setting up BLS Keys

Creating new BLS keys

You will need to generate one or more BLS keys in order to run a validating node. When generating a BLS key, the CLI will ask you to provide a passphrase to encrypt the BLS key file.‌

./psc keys generate-bls-keys --count 1 --shard 0 --passphrase

On the command above --count defines the number of BLS keys you want to generate and --shard the shard associated. On this example, we are generating 1 BLS key on shard 0.

Remember your passphrase. You will need it to decrypt the BLS key file in order to create a validator & start a node with that key.

Create a backup of your BLS key file or save the BLS private key (optional).

The BLS public key is the same as the name of the file, without the .key

Configuring the BLS keys

1. You need to manually create a folder called .psc/blskeys:

mkdir -p .psc/blskeys

2. Move all the previously created BLS key(s) to this new folder:

mv *.key .psc/blskeys

Make sure all your BLS keys belong to the same shard when using multiple BLS keys. You can use the command below to check each one of them.

./psc --node="https://api.posichain.org" utility shard-for-bls [BLS PUBLIC KEY]

3. For each BLS key file, a corresponding <blskey>.pass file needs to be created inside folder.psc/blskeyswith the passphrase inside it.

following this format:

echo -n '[replace_with_your_passphrase]' > .psc/blskeys/[replace_with_BLS_without_.key].pass

you should finally have in your .psc/blskeys folder :

ls .psc/blskeys/

Setting up a standby node with the same BLS key

It is NOT recommended now to run multiple nodes using the same set of BLS keys. As we are moving towards full decentralization, external validators will become the shard leader and start to propose blocks. If one validator runs multiple nodes using the same set of valid keys, they may all become valid leaders when the key is rotated to this validator, in this case, the blockchain is experiencing a high risk of hard-fork as different valid leaders may propose different blocks. So, do not run redundant validator nodes anymore on the POSI chain. This is also strictly forbidden on all PoS blockchains such as Ethereum 2, Cosmos.

It is recommended to set up standby nodes in case the main node is going to maintenance mode. Check out this bounty on how this feature is supported to run and switch backup nodes.

Last updated