1
0

cli/rpc: 'restore' and 'create' commands are now available via RPC

This commit is contained in:
SomberNight
2018-10-10 20:29:51 +02:00
parent cd5453e477
commit 1233309ebd
6 changed files with 111 additions and 108 deletions

View File

@@ -113,9 +113,10 @@ filenames = {
}
# FIXME every time we instantiate this class, we read the wordlist from disk
# and store a new copy of it in memory
class Mnemonic(object):
# Seed derivation no longer follows BIP39
# Seed derivation does not follow BIP39
# Mnemonic phrase uses a hash based checksum, instead of a wordlist-dependent checksum
def __init__(self, lang=None):
@@ -129,6 +130,7 @@ class Mnemonic(object):
def mnemonic_to_seed(self, mnemonic, passphrase):
PBKDF2_ROUNDS = 2048
mnemonic = normalize_text(mnemonic)
passphrase = passphrase or ''
passphrase = normalize_text(passphrase)
return hashlib.pbkdf2_hmac('sha512', mnemonic.encode('utf-8'), b'electrum' + passphrase.encode('utf-8'), iterations = PBKDF2_ROUNDS)