Bitcoin Forum
November 15, 2024, 06:09:40 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Java Base58 Keypair Generator?  (Read 1910 times)
rage39a (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
July 23, 2013, 11:27:19 AM
 #1

Hi

I'm trying to generate valid bitcoin Base58 public and private key addresses in java. I've download bitcoinj and bitcoinj-minimal, i've managed to generate base58 public keys from bitcoinj-minimal and some form of the private key but not base58 and can't see how this can be done with pre-existing functionality. Bitcoinj i believe has this functionality but haven't managed to get it to work because of the endless dependencies. Is there any java code out there which is simple/minimal and just is used for Base58 Keypair Generation or could some one point me in the right direction.

Cheers
rage39a
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
July 23, 2013, 12:03:40 PM
 #2

What is "bitcoinj minimal" - I've never heard of that and I wrote bitcoinj.

It's easy to get the full library. You need to use Maven. Read this:

https://code.google.com/p/bitcoinj/wiki/UsingMaven

Then you will have all the dependencies.
rage39a (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
July 23, 2013, 12:16:50 PM
 #3

bitcoinj-minimal is just a stripped down version of bitcoinj, yeh i've got the full bitcoinj library it seems to rely on loads of other random packages, and its so bloated for just the simple functions i need
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
July 23, 2013, 02:02:01 PM
 #4

You can just copy/paste the Base58, ECKey and Address classes then satisfy the dependencies for those, if you want. But Maven is so convenient it shouldn't be easier to do that, than just run the tool.

bitcoinj is a full blown Bitcoin API by this point. I would describe it as "featureful" rather than bloated Wink
rage39a (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
July 23, 2013, 02:39:50 PM
 #5

lol true but for the functions i need its overkill, well i downloaded it via github and its still got issues, if you take those three classes surely you'll need NetworkParamaters class to use the Address class and then this references some other class over and over plus those 3 classes reference about 50 other classes which again in turn refernce   another 50 etc etc
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
July 23, 2013, 06:05:25 PM
 #6

Github? It's hosted on Google Code.

The only thing it needs from NetworkParameters is the version codes. You could just hard code them. But seriously, just use the real library. It's not worth wasting your time on trying to strip it down. ProGuard can delete unused code if you're concerned about final jar size.
rage39a (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
July 26, 2013, 03:27:28 PM
 #7

github just allows you to use git on windows. Yeah managed to get it working in the end using maven to get the dependencies (i think). Turns out my pubkey is base64 instead not sure how to get it to base58 with the existing code but simple enough to write the code for it myself. But yeh the codes pretty damn slow for address generation takes around 24 seconds to generate a 1000 keypairs whereas i can read about 16000 into java through vanitygen in the same time. Might have to try and create some code which is as simple/minimal as possible for base58 key generation.
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
July 26, 2013, 05:39:15 PM
 #8

You probably aren't multi-threading it or using the server VM. Also, Bouncy Castle is really slow. bitcoinj supports a native ECDSA implementation, but you would need to provide the windows DLL for it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!