Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated address showing as invalid on any bitcoin Block Explorer #3

Open
ghost opened this issue Jul 31, 2016 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Jul 31, 2016

I used this lib to generate bitcoin private key and corresponding bitcoin address:

use lib "./lib";
use Bitcoin;
my $private_key = random Bitcoin::Key;
my $address = $private_key->address;

but when I try to query it on any Bitcoin block explorer, I got info that my address is invalid.

For example,
generated private key: 92Fk6Zk2VEjE32swoWrVvJdV39VqHaBWR3tSYMyZxsjwYwRwSda
corresponding address: mzitbXSyuN5hYMdRr9tZP9F97riBVq1y6r

BlockChain (https://blockchain.info/address/mzitbXSyuN5hYMdRr9tZP9F97riBVq1y6r) throws error: "Unrecognized Address Version 111".

(I am using perl version 5.18)

@jes
Copy link
Contributor

jes commented Aug 28, 2016

That's a testnet address. You need to set the environment variable BITCOIN_TEST=no to generate mainnet addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant