def api_generate(): k = Key() address = { 'address': k.address, 'segwit_address': k.segwit_address, 'pem': k.to_hex() } session['pem']= k.to_hex() return Response(json.dumps(address), mimetype='application/json'), 200
# Status: generates private key from bit import Key, PrivateKey, PrivateKeyTestnet key = Key() # Print PrivateKey print(key) # Print public point using one way Elliptic key Function print(key.public_point) # Print public Key print(key.public_key) # Print Sharable Bitcoin address print(key.address) # Print export Wallet Import Format Private key print(key.to_wif()) # Print export private key in hex format print(key.to_hex()) # Print to be exported private key in integer Format print(key.to_int()) # Print to be exported private key print(key.to_pem())
def btc_new(): nk = Key() privKey = nk.to_hex() addr = nk.address return {"privateKey": privKey, "address": addr}