Expand description
harpo
The harpo
crate provides functionality to secret-share seed phrases.
The main functions that harpo
provides are:
- generate_seed_phrase: Generate a random seed phrase.
- validate_seed_phrase: Validate a given seed phrase.
- create_secret_shared_seed_phrases: Given a valid seed phrase, create the requested number of secret-shared seed phrases. A threshold must be provided as well, specifying how many secret-shared seed phrases are required to reconstruct the original seed phrase.
- reconstruct_seed_phrase: Given a set of secret-shared seed phrases, the function reconstructs a seed phrase.
The additional functionality that harpo
provides is documented below.
Modules§
- seed_
phrase - The
seed_phrase
module provides the functionality to convert a seed phrase into a finite field element and vice versa.
Enums§
- Harpo
Error - This enumeration type is returned by the main library functions if there is an error.
Constants§
- MAX_
EMBEDDED_ SHARES - The maximum number of shares that can be embedded.
It is
2^NUM_BITS_FOR_INDEX = 16
because 4 bits are used to encode the index in the embedding. It is not easily possible to use more than 4 bits because only 4 additional bits are used when using a 12-word seed phrase (12*11 = 132 bits to encode a secret of 128 bits).
Functions§
- create_
secret_ shared_ seed_ phrases - The function is called to create secret-shared seed phrases.
- create_
secret_ shared_ seed_ phrases_ for_ word_ list - The function is called to create secret-shared seed phrases.
- generate_
seed_ phrase - The function generates and returns a random seed phrase.
- generate_
seed_ phrase_ for_ word_ list - The function generates and returns a random seed phrase.
- reconstruct_
seed_ phrase - The function is called to reconstruct a seed phrase.
- reconstruct_
seed_ phrase_ for_ word_ list - The function is called to reconstruct a seed phrase.
- validate_
seed_ phrase - The function validates a given seed phrase using the standard word list.
- validate_
seed_ phrase_ for_ word_ list - The function validates a given seed phrase.
Type Aliases§
- Harpo
Result - A result that contains a HarpoError in the
Err
case. - Seed
Phrase Result - A HarpoResult that encapsulates a
SeedPhrase in the
Ok
case.