Skip to main content

SLIP-39 Shamir Mnemonics

Project description

https://badge.fury.io/py/shamir-mnemonic.svg

Reference implementation of SLIP-0039: Shamir’s Secret-Sharing for Mnemonic Codes

Abstract

This SLIP describes a standard and interoperable implementation of Shamir’s secret sharing (SSS). SSS splits a secret into unique parts which can be distributed among participants, and requires a specified minimum number of parts to be supplied in order to reconstruct the original secret. Knowledge of fewer than the required number of parts does not leak information about the secret.

Specification

See https://github.com/satoshilabs/slips/blob/master/slip-0039.md for full specification.

Installation

With pip from GitHub:

$ pip3 install https://github.com/trezor/python-shamir-mnemonic

From local checkout for development:

$ python3 setup.py develop

CLI usage

CLI tool is included as a reference and UX testbed. It is very obviously insecure. DO NOT USE it for generating or decoding any sort of serious secrets.

When the shamir_mnemonic package is installed, you can use the shamir command:

$ shamir create 3of5   # create a 3-of-5 set of shares

Use shamir --help or shamir <command> --help to get detailed help.

If you want to run the CLI from a local checkout without installing, use the following command:

$ python3 -m shamir_mnemonic.cli

Test vectors

The test vectors in vectors.json are given as a list of triples. The first member of the triple is a description of the test vector, the second member is a list of mnemonics and the third member is the master secret which results from combining the mnemonics. The master secret is encoded as a string containing two hexadecimal digits for each byte. If the string is empty, then attempting to combine the given set of mnemonics should result in error. The passphrase “TREZOR” is used for all valid sets of mnemonics.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shamir-mnemonic-0.1.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

shamir_mnemonic-0.1.0-py3-none-any.whl (15.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page