Open onvej-sl opened 4 weeks ago
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:
slip39.recovery
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
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:
Interestingly enough, the
slip39.recovery
module works correctly: