Open jakubtrnka opened 6 years ago
Pull request?
It's not done yet. I wanted to ask at first if it was desirable. So I'll start working on that.
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.
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.
Multi-valued outputs in bx are generally emitted as a property tree.
@jakubtrnka did you ever get anywhere with this? I still think it's a good idea.
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.
Sounds great, let’s do it!
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
, orError: 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)
, orError: not enough shares