I have my ECKey key
. In order to create an ECDSASignature
object with BitcoinJ, we have to call ECDSASignature mySignature = key.sign(Sha256Hash input)
.
Is the Sha256Hash input
my message? Or is it the result of Sha256(byte[] myArray)
?
What if I don't have a message to sign? Is it acceptable to sign the key.getPrivKeyBytes()
in order to create an ECDSASignature
, or it is unacceptable because it reveals information including in getPrivKeyBytes()
and as a result reveal my private key?
And if it is unacceptable what must be my message? Can I can sign whatever I want in order to create my ECDSASignature
?
Wallet.signTransaction(Wallet.SendRequest.forTx(transaction));
If you're trying to sign a message, you should hash the message first with SHA256. – Nick ODell Jan 09 '16 at 21:55