• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Using the Bitcoin python library to generate Private Key [Noob question]

Started by Bitcoin, Feb 06, 2022, 06:48 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Using the Bitcoin python library to generate Private Key [Noob question]

I have done pip install bitcoin and then wrote the below code:


from bitcoin import *
private_key = random_key()
print(private_key)

Now I am getting this error:


Traceback (most recent call last):
  File "/Users/praveen/Documents/code/sandbox/python/bitcoinkey.py", line 1, in <module>
    from bitcoinkey import *
  File "/Users/praveen/Documents/code/sandbox/python/bitcoinkey.py", line 2, in <module>
    private_key = random_key()
NameError: name 'random_key' is not defined

Any idea why 'random_key' is not defined?


Thanks,
Just getting started with tinkering.


Source: Using the Bitcoin python library to generate Private Key [Noob question]