Created
August 4, 2019 16:34
-
-
Save webmaster128/bb0230bf8a57afa7835bdf89336c9bf5 to your computer and use it in GitHub Desktop.
Retoring original mnemonic from part 1 and part 2 using @iov/crypto
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
const part1 = 'pencil accuse tennis element peanut tent venue message process stove glory gym' | |
const part2 = 'panic roof boil axis mom enjoy change margin stove heavy forum food' | |
const part1Entropy = Bip39.decode(new EnglishMnemonic(part1)) | |
const part2Entropy = Bip39.decode(new EnglishMnemonic(part2)) | |
const restoredEntropy = part1Entropy.map((byte, index) => byte ^ part2Entropy[index]) | |
const restored = Bip39.encode(restoredEntropy).toString() | |
// 'dial ring shiver firm connect nominee stairs army large rubber deal crater' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment