Esempio n. 1
0
def seed_to_master(seed, passphrase, derivation_path, hardened_items, total_addresses, address_type, testnet):
	pbkdf2_result=PBKDF2.hexread(PBKDF2(seed, 'mnemonic'+passphrase, 
		iterations=2048, macmodule=hmac, digestmodule=hashlib.sha512), 64)
	hmac_hash= hmac.new(key=b"Bitcoin seed", msg=codecs.decode(pbkdf2_result, 'hex'), digestmod=hashlib.sha512).digest()
	master_pk, master_cc = hmac_hash[:32], hmac_hash[32:]
	master_pubkey=S256Point.sec((string_to_int(master_pk))*G)
	return path_gen_keylist(master_cc,master_pk, master_pubkey, derivation_path,
		hardened_items,total_addresses, address_type, testnet)