-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add Shamir's secret sharing protocol #1010
Comments
Hi @tupui, this is a very good proposal, but I suggest we build this feature based on python-shamir-mnemonic. I think we can trust the implementation provided by Trezor. We just need to add two functions: BTW. SLIP-39 was drafted by Trezor, so I hope that when using the same shamir mnemonic, the Python SDK and Trezor wallet can generate consistent keypair. |
In addition, for the existing BIP-39 method, I strongly recommend adding an extra passphrase (aka. 25th word) and memorizing it, which can alleviate this concern to some extent. |
Awesome, I can take a shot at it if you want 😃 I like the 25 words hack. Wondering if this should get into the API in a way or not. But that's another discussion. |
Hi @tupui, The 25th word is not hack; it is something from the BIP-39 standard, so we have already included support for it, please check https://github.com/StellarCN/py-stellar-base/tree/c5d656f13e63c4049e5cd6c81f396541b96c9833/stellar_sdk/keypair.py#L241-L242 SLIP-39 also has a similar concept, so if you are willing to add SLIP-39 support to this SDK, please also include support for passphrase. |
I had a Quick Look at the Trezor repo and I two thing caught my eyes:
Now I am not sure how much we should be concerned about that. Do you have some thoughts there? |
Hi @tupui, I personally prefer using the Trezor library; I believe the risks involved are acceptable, but I suggest configuring this feature as an optional one. Of course, I don't oppose implementing this feature based on pycryptodome, but if you want to do it using pycryptodome, I recommend creating a brand-new Python package that implements SLIP-39 using pycryptodome, and then we can introduce this package into the SDK. What do you think? This way, other users can also more easily use this new package. However, I estimate that this will require a considerable amount of effort. |
Is your feature request related to a problem? Please describe.
Keeping secrets can be hard and if someone finds the paper wallet, it's compromised.
Describe the solution you'd like
I would like to propose to add a helper function to split the secret key using the Shamir protocol. The PyCryptodome library has an implementation we could leverage.
We could propose the following APIs:
Of course, naming and input parameters should be worked on.
As usual, I am happy to make a PR if wanted 😃
Describe alternatives you've considered
If not suitable in this library, I will add the feature on my higher level Soroban API library.
Additional context
https://pycryptodome.readthedocs.io/en/latest/src/protocol/ss.html
The text was updated successfully, but these errors were encountered: