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

API does not support single-share slip39 menmonic #21

Open
onvej-sl opened this issue May 31, 2024 · 0 comments
Open

API does not support single-share slip39 menmonic #21

onvej-sl opened this issue May 31, 2024 · 0 comments

Comments

@onvej-sl
Copy link

This function incorrectly assumes that slip39 backups consists of at least two shares.

This can lead to "Invalid mnemonic words." exception. You can test it using the following test:

def test_slip39_compatibility():
    """Test that SLIP-39 backup of a wallet generated by Trezor can be recevered"""
    # The 1th vector from https://github.com/trezor/python-shamir-mnemonic/blob/master/vectors.json
    mnemonics = [
        "duckling enlarge academic academic agency result length solution fridge kidney coal piece deal husband erode duke ajar critical decision keyboard"
    ]
    account = Account( crypto="Bitcoin", format="legacy" )
    account.from_mnemonic( "\n".join(mnemonics), passphrase = 'TREZOR', path="m/" )
    assert account.xprvkey == "xprv9s21ZrQH143K4QViKpwKCpS2zVbz8GrZgpEchMDg6KME9HZtjfL7iThE9w5muQA4YPHKN1u5VM1w8D4pvnjxa2BmpGMfXr7hnRrRHZ93awZ"

Interestingly enough, the slip39.recovery module works correctly:

python3 -m slip39.recovery -p TREZOR -m "duckling enlarge academic academic agency result length solution fridge kidney coal piece deal husband erode duke ajar critical decision keyboard" 
bb54aac4b89dc868ba37d9cc21b2cece
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant