BlstCrypto
The BlstCrypto struct is used to manage cryptographic keys and operations.
Initialization
The function new is used to initialize a BlstCrypto instance. The behavior of this function depends on the environment:
use BlstCrypto;
let validator_name = Stringfrom;
let crypto = new.expect;
Non-Test Environment
This module load the private key seed from the environment variable HYLI_VALIDATOR_SECRET.
The content of the variable must be a hexadecimal string.
If the variable is not set but HYLI_USE_KEYRING is set to 'true', it tries to load the key from the keyring.
Otherwise it generates a private key from the validator name, which is highly unsecure.
Note: you can use tools like seahorse (https://wiki.gnome.org/Apps/Seahorse) to manage your keyring
Test Environment
In a test environment the modules generates a secret key based on the validator name, which is less secure but suitable for testing purposes.