Skip to content

Instantly share code, notes, and snippets.

@esneider
Last active September 12, 2020 09:33
Transform an old copay Spanish mnemonic (with the composed unicode bug) into a seed
import sys
import hashlib
import unicodedata
if len(sys.argv) != 2:
print('Usage: python3 old-copay-spanish-mnemonic-to-seed.py "here go the mnemonic words"')
exit(1)
mnemonic = sys.argv[1]
composed = unicodedata.normalize('NFKC', mnemonic).encode('utf-8')
passphrase = 'mnemonic'.encode('utf-8')
stretched = hashlib.pbkdf2_hmac('sha512', composed, passphrase, 2048)
seed = stretched[:64]
print('seed: ' + seed.hex())
@esneider
Copy link
Author

esneider commented Sep 12, 2020

Run with:

python3 old-copay-spanish-mnemonic-to-seed.py "here go the mnemonic words"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment