harpo

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.

Compilation

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

Usage

Generation of a Seed Phrase

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.

Creation of Secret-Shared Seed Phrases

In order to create secret-shared seed phrases, run the following command:

harpo create --num-shares [N] --threshold [T] (--file [F])

The input is provided in one of two ways: * By default, the seed phrase is entered on the command line. * When using the --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

Note that the input seed phrase must be BIP-0039 compliant, otherwise the execution will terminate with an error message.

Apart from specifying the input source, two other parameters are required:

The created seed phrases are written to standard output.

Reconstruction of a Secret-Shared Seed Phrase

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: * By default, the seed phrases are entered on the command line, one after the other. * When using the --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.

Additional Parameters

The following additional parameters can be specified (before entering the subcommand):

There is one optional parameter for the create subcommand:

All available parameters can be printed using the --help (-h) flag for each subcommand.