Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shamir's secret sharing scheme #553

Open
jakubtrnka opened this issue Apr 11, 2018 · 8 comments
Open

Shamir's secret sharing scheme #553

jakubtrnka opened this issue Apr 11, 2018 · 8 comments

Comments

@jakubtrnka
Copy link

I suggest adding shamir's secret sharing scheme as described Satoshi Labs's SLIP0039

My idea is to introduce command that generates n Shamir's shares with reconstruction threshold of m with m<=n. Optionally with seed encryption using passphrase.

mnemonic-to-sshare [-h ] --count <n> --threshold <m> --language <lang> [--passphrase <psh>] [WORD]...

Command produces either m shares each on separate line, or
Error: invalid mnemonic, or
Error: threshold too large

Reverse command restoring mnemonic from Shamir's shares would look like this:
sshare-to-mnemonic [-h] [--passphrase <psh>] --share [WORD]... --share [WORD]... [...]

Command produces either mnemonic, or
Error: inconsistent shares,
Error: invalid share(s), or
Error: not enough shares

@evoskuil
Copy link
Member

Pull request?

@jakubtrnka
Copy link
Author

It's not done yet. I wanted to ask at first if it was desirable. So I'll start working on that.

@evoskuil
Copy link
Member

Yes! Though expect some feedback on interface and style. Note also that bx used source code generation. Maintainers can help with that once implemented if necessary.

@evoskuil
Copy link
Member

I’m not to keen on the incorporation of both mnemonics and encryption into this single command. The result is far too complex in relation to the bx approach. We prefer to use composition vs. overloading. I haven’t looked at implementations, but we have existing commands for key encryption and mnemonics, so I assume we could compose with them to achieve the same features with less complexity and more flexibility.

@evoskuil
Copy link
Member

Multi-valued outputs in bx are generally emitted as a property tree.

@evoskuil
Copy link
Member

evoskuil commented Mar 6, 2021

@jakubtrnka did you ever get anywhere with this? I still think it's a good idea.

@jakubtrnka
Copy link
Author

Hello,
back at the time I had some WIP, but the SLIP specification was also under development. Basically I stopped working on it when I realized the specification changed dramatically.
In a meantime I think the SatoshiLabs came up with reference implementation.
I also found a different approach to the Shamir's concept here https://iancoleman.io/shamir39/
I think I'd be able to code it in c++ as a separate project, but probably not able to integrate it to libbitcoin as I'm not c++ developer and I have no knowledge of the library structrue. If other people helped me with that I'd consider working on it.

@evoskuil
Copy link
Member

evoskuil commented Mar 9, 2021

Sounds great, let’s do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants