Skip to main content

Crate hyli_crypto

Crate hyli_crypto 

Source
Expand description

§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 hyli_crypto::BlstCrypto;

let validator_name = String::from("validator_name");
let crypto = BlstCrypto::new(&validator_name).expect("Failed to initialize BlstCrypto");

§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.

Structs§

AggregateSignature
BlstCrypto
Signed
ValidatorPublicKey
ValidatorSignature

Constants§

SIG_SIZE

Type Aliases§

SharedBlstCrypto
SignedByValidator