how can I hardcode a private key in bitcoinJ - ECKey constructor? Can someone please explain how to use the following constructor (listed here):
ECKey(BigInteger priv, org.spongycastle.math.ec.ECPoint pub) 

Say my private key is: priv = &quot;L4...5&quot;.

How do I get the big integer representation of it (in other words, and if I understood correctly, is there a function to go from check58 to biginteger?) , and

what about the second parameter?


Thanks
If all you are after is getting an ECKey object for that private key, then Bitcoinj has a DumpedPrivateKey class for just such an occasion.

import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.DumpedPrivateKey;
import org.bitcoinj.params.MainNetParams;

public class Example {

    public static void main(String[] args) {
        String priv = "L4...5";
        ECKey key = DumpedPrivateKey.fromBase58(MainNetParams.get(), priv).getKey();
    }

}


If you would like to use an ECKey constructor explicitly, then you should be able to get the code you need from here: 


  https://github.com/bitcoinj/bitcoinj/blob/release-0.14/core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java#L70-L91




With respect to the constructor you listed, it is a protected constructor, so it's probably not one you would be looking to use. It lists a private key and public key parameters. The private key may be null if the ECKey instance is only going to be used for verifying signatures, not actually producing them. The public key must not be null, and it saves time by not needing to re-compute the public key, which is a CPU intensive operation.

Note that most of the public ECKey constructors are deprecated. The preferred way of creating the ECKey objects now is to use the static factory methods.