raugfer/crypto-java

Create private key and address from big integer

mehranj73 opened this issue · 5 comments

Is it possible to create private keys from my own big integer. Also how many address types your library supports? Can I create p2sh or Segwit addresses? Thanks

please

Is it possible to create private keys from my own big integer.

Yes

String privateKey = wallet.privatekey_encode(your big integer, true, "bitcoin", false);

Also how many address types your library supports? Can I create p2sh or Segwit addresses? Thanks

No, creating p2sh and segwit means creating new encoding and decoding formats, of course you can integrate them, I also implemented it, but the project has been modified a lot, so I can’t pull request

How can I get the address now? I really like what has been done here, I wish I'll learn to write my own code but the naming conventions have not been followed and functions and parameter names are not clear about their functionality.

val a = wallet.address_encode(BigInteger("2"), "address", "ethereum", false)

I found this. Is this correct?

String privateKey = wallet.privatekey_encode(your big integer, true, "bitcoin", false);
String publicKey = wallet.publickey_from_privatekey(privateKey, "bitcoin", false);
String address = wallet.address_from_publickey(publicKey , "bitcoin", false);