Hello
How can I get a public key from a private one? I need to do it in Java, but rpc procedure is ok as well.
Hello
How can I get a public key from a private one? I need to do it in Java, but rpc procedure is ok as well.
Hi, As far as I know, algorithm to convert priv to pub in Dash is exactly the same as for Bitcoin and is based on Elliptic Curve multiplication. It is well described in Andreas Antonopolous book: <LINK>
In turn, the conversion public key to it's Dash address is a bit different, but only in that, that it uses a different version prefix (76 instead of 00).
I think, that for priv->pub conversion you can simply use some existing Java bitcoin library .
Yes, https://github.com/dashpay/dash/blob/master/src/chainparams.cpp#L140Thank you, conversion from public key to Dash address was easy to made by changing bitcoinJ library.
I still have a small problem with checking if private key if from Dash world. There is a parameter called "dumpedPrivateKeyHeader" in Bitcoin witch needs to be set to 128 in order to confirm that it is private bitcoin key. When I try to guess that parameter for Dash, number 204 seems to work, can someone confirm that?