Feat/slip39 shamir secret sharing 407#765
Open
MkDev11 wants to merge 2 commits intoopentensor:stagingfrom
Open
Feat/slip39 shamir secret sharing 407#765MkDev11 wants to merge 2 commits intoopentensor:stagingfrom
MkDev11 wants to merge 2 commits intoopentensor:stagingfrom
Conversation
Contributor
Author
|
@thewhaleking Please review this PR and let me know the result when you are available. |
…ment Implements issue opentensor#407 - SLIP39 wallet creation and recovery Features: - New 'wallet new-coldkey-slip39' command to create coldkeys with SLIP39 shares - New 'wallet recover-coldkey-slip39' command to recover coldkeys from shares - Configurable M-of-N threshold scheme (default 3-of-5) - Optional passphrase protection for additional security - Save shares to files or display on screen - Interactive share entry for recovery Security benefits: - Plaintext seed phrase is NEVER exposed - Eliminates risk of screen reader and keylogger attacks - Shares can be distributed to separate custodians - Threshold scheme allows recovery even if some shares are lost Files changed: - bittensor_cli/src/bittensor/slip39.py - Core SLIP39 utilities - bittensor_cli/cli.py - New CLI commands - tests/unit_tests/test_cli.py - 11 unit tests for SLIP39 - pyproject.toml - Added shamir-mnemonic>=0.3.0 dependency
f136e2a to
eb8c50b
Compare
Contributor
|
Do you think adding a new command rather than adapting the current command is the best approach here? |
Contributor
Author
I chose separate commands because SLIP39 has fundamentally different parameters ( However, if you prefer, I can refactor to add a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add SLIP39 (Shamir's Secret Sharing) Support for Coldkey Management
Summary
This PR implements SLIP39 support for coldkey management, addressing issue #407. It allows users to create and recover coldkeys using Shamir's Secret Sharing, where the plaintext seed phrase is never exposed - eliminating the risk of screen reader and keylogger attacks.
Closes #407
What's Changed
New Commands
Create a coldkey with SLIP39 shares:
Recover a coldkey from shares:
How It Works
SLIP39 splits a secret into N shares where M shares are required to reconstruct the original (M-of-N threshold scheme). For example, with a 3-of-5 setup:
Security Benefits
Use Cases
Files Changed
bittensor_cli/src/bittensor/slip39.pybittensor_cli/cli.pynew-coldkey-slip39,recover-coldkey-slip39)tests/unit_tests/test_cli.pypyproject.tomlshamir-mnemonic>=0.3.0dependencyTesting
All tests pass:
Dependencies
Added
shamir-mnemonic>=0.3.0- the official Trezor implementation of SLIP39.References
Checklist
stagingbranch