Giter Club home page Giter Club logo

shamir39's Introduction

Shamir39 Tool

A tool for converting BIP39 mnemonic phrases to shamir secret sharing scheme parts whilst retaining the benefit of mnemonics.

Online Version

https://iancoleman.github.io/shamir39/

Standalone offline version

Download standalone.html

Open the file in a browser by double clicking it.

This can be compiled from source using the command python compile.py

Usage

TODO

Donations

Since this project is the efforts of many people, most of which don't appear in the obvious places like code or issues, donating to the project itself causes significant operational difficulties.

As a result, if you would like to support this project financially you are encouraged to donate to one of the many groups that makes the internet a place amenable to projects such as this one.

Donation-accepting organizations and projects

If the list is too difficult to choose from, the EFF is a good choice.

Electronic Frontier Foundation

or for a direct bitcoin address, consider donating to the Free Software Foundation at 1PC9aZC4hNX2rmmrt7uHTfYAS3hRbph4UN

alt text

Making changes

Please do not make modifications to standalone.html, since they will be overwritten by compile.py.

Make changes in src/* and apply them using the command python compile.py

Tests

TODO

License

This Shamir39 tool is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.

shamir39's People

Contributors

djpnewton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shamir39's Issues

Consider making shamir mnemonics BIP39 compatible on their own

Aside from the leading 'version' word in shamir mnemonics, it may be useful for them to be bip39 compatible. Currently they don't have a checksum so are reported as invalid by most bip39 software*

Inspired by https://www.reddit.com/r/btc/comments/6y5q11/shamir39_mashup_of_bip39_mnemonics_and_shamirs/dmkzzzs/

I like the idea.
You could store some bitcoins on each of the Shamir39 shares to mislead a thief and as a honeypot to see if one of the parts has been compromised.

* See bip39 spec > Although using a mnemonic not generated by the algorithm described in "Generating the mnemonic" section is possible, this is not advised and software must compute a checksum for the mnemonic sentence using a wordlist and issue a warning if it is invalid.

Does not work

Please, help - cant seem to firgure out what I am doing wrong:
using this seed phrase:
ceiling luxury void exotic thunder stable very type tree fruit custom material social muffin pumpkin clog actress wolf bamboo ecology replace runway curtain hollow

keep getting Invalid Mnemonic
issue

Entropy shouldn't be fudged before splitting; shares have redundant words / long mnemonics

The entropy, along with checksum, is padded prior to splitting resulting in longer-than-necessary mnemonics.

For example, for 12 word (128-bit) mnemonic with checksum results in 132 bits, which is then further padded on a 4-bit boundary before splitting. This results in 14 words in addition the version and parameter words. More words means a higher risk of transcription errors.

This can be seen in all shares of 6 or more words beginning with 'abandon', irrespective of the input mnemonic.

I suggest splitting only the entropy, not the checksum. This results in shares only as long as the input mnemonic (other than the version and parameter words)

Presumably related but I'm still confused by this:

truncate from the left to the required multiple for the specific shamir implementation (in the case of the prototype it's 4 bits)

Share size (in bits) should be part of the specification

Changing the number of bits (see #2) breaks previous implementations. But there is nowhere in the specification that indicates what this value should be set to.

So it's not a very robust specification. It should specify this value so any future changes to the value must be reflected in the specification.

Need Help to understand the "Third Component Shamir Share"

Dear Ian, i am new on Git Hub and i dont know how to contact you, so i will write here my question :)

I try to understand your example (see below) but i did not understand well about the third component....can you please complete the example also about the third component
??

that will help me to understand in full yr example.

Thank you so much in advance,

Marco from Phuket :)

Example encoding parameters across multiple words
Consider
M = 35 = 100011
O = 10 = 1010

Left pad both to multiple of 5 bits

M = 0000100011
O = 0000001010

Split into groups of 5 bits

M = 00001 00011
O = 00000 01010

Convert this into mnemonic words:

The first word is not the final word so it:

  • starts with 1
  • then has the first five bits of M
  • then has the first five bits of O

1 00001 00000 = 10000100000 = 1056 = "lottery"

The second word is the final word so it:

  • starts with 0
  • then has the second five bits of M
  • then has the second five bits of O

0 00011 01010 = 00001101010 = 106 = "ask"

So the parameters M = 35 and O = 10 are encoded as "lottery ask"
Third Component is The Shamir Share
The third component is the data for the shamir share and is a binary blob which must be encoded to mnemonic words.

The binary shamir share is encoded to mnemonic words by:

left pad the binary share to multiple of 11 bits
convert each group of 11 bits to the corresponding word in the wordlist
The mnemonic words are decoded to the binary shamir share by:

convert each word to the 11 bit binary representation and concatenate together
truncate from the left to the required multiple for the specific shamir implementation (in the case of the prototype it's 4 bits)

Ambiguous messages encoding

I went through this scheme and following crossed my mind:
Whereas for encoding BIP39 enthropy, which is multiple of 4 bytes, this technique works well and unambiguously, the left-zero-padding inside 11 bits words is problematic if we want to encode arbitrary message (we wouldn't know where starts message and where starts padding).
This problem could be solved if the 11-bit word was left-padded by all zeros but last bit which would be '1', i. e. 5bit message (xxxxx) would be padded like this 000001xxxxx. We knew we only need to discard everything up to first '1'. In case the message fitted whole 11 bit word, dummy word 00000000001 were inserted.
What do you think about this?

Include ssss bits parameter in mnemonic

The number of bits used for ssss shares determines the maximum number of shares.

The ssss library defaults to 8 bits (max 255 shares)

The shamir39 implementation hardcodes it to 12 bits (max 4095 shares)

This should ideally be encoded into the mnemonic so there is no upper limit on the number of shares. See shamir39.js L744

20 word shares

Hi, would it be possible to split/recombine into 20 word shares:
Trezor T and Keystome offer Shamir backup options, where they split into n/m shares of 20 words. And they are compatible. Still, my concerb is if both trzor and Keystone stop working, I would not be able to recover from my Shamir 20 word share they generate. I am wondering if you could adjust the number of words per share into 20 and that way I would be able to software recombine them if needed. Thank you in advance

Prevent combination of shares from different issuances

It looks like it's possible to combine shares from different mnemonics:

M0 = generate mnemonic
M1 = generate mnemonic
A0, B0, C0 = shares(M0, 2, 3)
A1, B1, C1 = shares(M1, 2, 3)
M2 = combine(A0, B1)
M2 != M0 != M1

This would definitely be user error, but it would be nice if users were protected from this.

Permanence of this tool

Can you possibly upload this to Arweave.org and share the url here so it will exist forever?

Shamir 39 Tool: Add option to use satoshilabs word list?

I was experimenting with inputing the Shamir shares (20 word list) produced by Trezor into your tool however there is a word not used ("academic") in your tool that they use. Would it be possible to add an option/switch to use their wordlist to reconstruct shares in the combine list? Their list is located at
https://github.com/satoshilabs/slips/blob/master/slip-0039/wordlist.txt

This would be helpful as an escape hatch to restore a wallet in case Trezor/satoshilabs ever disappears.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.