Hello,
i’m just testing my new Model 5, with the Shamir/shared words (3/6).
The Trezor gave me those words (Yes, I WON’T use those, don’t worry, i’ll factory-reset the device).
revenue scared academic acne animal budget educate airline blind course trash pajamas ruler huge oven example bulb finance chubby glen
revenue scared academic agree crush born browser domain spend email firefly unfair manual keyboard profile declare treat payroll smoking usual
revenue scared academic amazing daughter transfer penalty voter ranked empty forecast dynamic alarm capital helpful license keyboard starting taught repeat
revenue scared academic arcade ambition tidy withdraw shadow indicate cowboy threaten improve evaluate argue friendly year mental charity benefit course
revenue scared academic axle document guest holiday axle eyebrow away inform hairy ladybug sidewalk duke vocal mayor olympic voice main
revenue scared academic bishop camera gravity detect database mild kind short client depend strike aviation manager laden have again branch
If I go to SLIP39 - Mnemonic Shares, and I finish to paste even the first series of words, at the site indicates :
Error: Invalid mnemonic checksum
Should I be worry about this ? I’m not a python expert, and with the help of some IA assistant, I “wrote” this code, based on the spec here : slips/slip-0039.md at master · satoshilabs/slips · GitHub
def rs1024_polymod(values):
GEN = [0xe0e040, 0x1c1c080, 0x3838100, 0x7070200, 0xe0e0009, 0x1c0c2412, 0x38086c24, 0x3090fc48, 0x21b1f890, 0x3f3f120]
chk = 1
for v in values:
⦙ b = (chk >> 20)
⦙ chk = (chk & 0xfffff) << 10 ^ v
⦙ for i in range(10):
⦙ ⦙ chk ^= GEN[i] if ((b >> i) & 1) else 0
return chk
def rs1024_verify_checksum(cs, data):
return rs1024_polymod(cs + data) == 1
def mnemonic_to_indices(mnemonic, wordlist):
return [wordlist.index(word) for word in mnemonic.split()]
if __name__ == "__main__":
# Word list (1 share) to test
mnemonic = "revenue scared academic acne animal budget educate airline blind course trash pajamas ruler huge oven example bulb finance chubby glen"
# Load the slip39 word list (https://github.com/satoshilabs/slips/blob/master/slip-0039/wordlist.txt)
with open("slip39_wordlist.txt", "r") as f:
⦙ wordlist = [line.strip() for line in f]
# Convert word list in indices
try:
⦙ indices = mnemonic_to_indices(mnemonic, wordlist)
except ValueError as e:
⦙ print(f"Erreur : Invalid word in the list - {e}")
⦙ exit(1)
# Verify the checksum
checksum_valid = rs1024_verify_checksum(indices[:3], indices[3:])
if checksum_valid:
⦙ print("Checksum is valid.")
else:
⦙ print("Error : checksum invalid.")
And this seems to confirm that the checksum IS NOT valid.
On the other side, I checked with “shamir-mnemonic” python tools, and it does not gives any alarm.
I’m a bit out of clue. Am I doing anything wrong ?