Crates.io | harpo |
lib.rs | harpo |
version | 0.7.0 |
source | src |
created_at | 2021-10-29 16:13:38.673022 |
updated_at | 2021-12-17 09:06:46.371926 |
description | The harpo crate provides functionality to secret-share seed phrases. |
homepage | https://github.com/THLO/harpo |
repository | https://github.com/THLO/harpo |
max_upload_size | |
id | 474084 |
size | 171,356 |
harpo
is a tool and library that provides the following functionality:
The harpo
crate gets its name from
Harpocrates, the ancient god of
silence, secrecy, and confidentiality.
While harpo
is reasonably well tested, use it at your own risk.
Make sure that Rust is installed.
After cloning the repository and changing the directory to harpo
, run the
following command:
cargo build --release
The binary can then be found under target/release
(or target/debug
when
running the command without the --release
flag).
A seed phrase can be generated by running the following command:
harpo generate --length [L]
The length [L]
must be either 12, 15, 18, 21, or 24.
The generated seed phrase is written to standard output.
A seed phrase can be validated, i.e. checked for BIP-0039 compliance, by running the following command:
harpo validate (--file [F]))
The input is provided in one of two ways:
--file
(-f
) option, the space-delimited seed phrase is
read from the file at path [F]
.For example, the content of the file or input provided interactively may be:
cat swing flag economy stadium alone churn speed unique patch report train
In order to create secret-shared seed phrases, run the following command:
harpo create --num-shares [N] --threshold [T] (--file [F])
The input is again provided in one of two ways, on the command line or
using the --file
(-f
) option, in which case the space-delimited seed phrase
is read from the file at path [F]
.
Note that the input seed phrase must pass validation, otherwise the execution will terminate with an error message.
Apart from specifying the input source, two other parameters are required:
--num-shares
(-n
) [N]
: The desired number [N]
of secret-shared seed
phrases must be provided. Note that the number of shares can be at most 16
unless the option --no-embedding
is used (see
Additional Parameters).--threshold
(-t
) [T]
: The desired threshold [T]
, i.e., the minimum
number of secret-shared seed phrases required to reconstruct the original
seed phrase, must be provided. The threshold must not exceed the number of
shares.The created seed phrases are written to standard output.
In order to reconstruct the original seed phrase, run the following command:
harpo reconstruct (--file [F] | --interactive)
Again, the input is provided in one of two ways:
--file
(-f
) option, the space-delimited seed phrases are
read from the file at path [F]
, one seed phrase per line.The reconstructed seed phrase is written to standard output.
If at least [T]
secret-shared seed phrases are provided, the output will
match the original seed phrase. Otherwise, the output is indistinguishable
from a random seed phrase.
The following additional parameters can be specified (before entering the subcommand):
--verbose
(-v
): Add this flag in order to
activate verbose output.--word-list
(-w
) [W]
: A different word list (other than the
standard English word list) can be provided. It has to be a list of 2048
distinct words, with one word per line.There is one optional parameter for the create
subcommand:
--no-embedding
(-N
): By default, the secret-shared seed phrases are not
BIP-0039 compliant because they encode an index that is required for the
reconstruction. In order to obtain BIP-0039 compliant seed phrases, the
embedding can be turned off using this flag. In this case, the indices must be
provided explicitly when using the reconstruct
command. The format is
[INDEX]: [SEED PHRASE]
.All available parameters can be printed using the --help
(-h
) flag for
each subcommand.