Ejemplo n.º 1
0
def electrum_keystretch(seed, password=None):
    if isinstance(seed, string_types) and re.match('^[0-9a-fA-F]*$', seed):
        seed = from_str_to_bytes(seed)
    if is_elec1_seed(seed):
        return slowsha(seed)
    elif is_elec2_seed(seed):
        password = from_str_to_bytes(password) if password else None
        return electrum_extract_seed(seed, password)
    else:
        return seed
Ejemplo n.º 2
0
def electrum_keystretch(seed, password=None):
    if isinstance(seed, string_types) and re.match('^[0-9a-fA-F]*$', seed):
        seed = from_str_to_bytes(seed)
    if is_elec1_seed(seed):
        return slowsha(seed)
    elif is_elec2_seed(seed):
        password = from_str_to_bytes(password) if password else None
        return electrum_extract_seed(seed, password)
    else:
        return seed
Ejemplo n.º 3
0
def electrum_mpubk(seed):
    # TODO: add electrum_seed function to return mpk for both Elec1/2
    if len(seed) == 32 and not is_elec2_seed(seed):
        seed = electrum_keystretch(seed)
    return privkey_to_pubkey(seed)[2:]
Ejemplo n.º 4
0
def electrum_mpubk(seed):
    # TODO: add electrum_seed function to return mpk for both Elec1/2
    if len(seed) == 32 and not is_elec2_seed(seed):
        seed = electrum_keystretch(seed)
    return privkey_to_pubkey(seed)[2:]