def get_addresses_from_privkey(hex_privkey): nmc_privkey = NamecoinPrivateKey(hex_privkey) btc_privkey = BitcoinPrivateKey(hex_privkey) nmc_pubkey = nmc_privkey.public_key() nmc_address = nmc_pubkey.address() btc_pubkey = btc_privkey.public_key() btc_address = btc_pubkey.address() return nmc_address, btc_address
def test_migration_user(check_user): for entry in migration_users.find(): if entry['username'] != check_user: continue hex_privkey = aes_decrypt(entry['encrypted_privkey'], SECRET_KEY) nmc_privkey = NamecoinPrivateKey(hex_privkey) btc_privkey = BitcoinPrivateKey(hex_privkey) print hex_privkey print nmc_privkey.to_wif() print get_addresses_from_privkey(hex_privkey)
def get_addresses_from_privkey(hex_privkey): """ get both bitcoin and namecoin addresses """ nmc_privkey = NamecoinPrivateKey(hex_privkey) btc_privkey = BitcoinPrivateKey(hex_privkey) nmc_pubkey = nmc_privkey.public_key() nmc_address = nmc_pubkey.address() btc_pubkey = btc_privkey.public_key() btc_address = btc_pubkey.address() return nmc_address, btc_address