Posts

Showing posts with the label How serialize

How serialize, deserialize Transactions and how sign the deserialized Transaction on Bitcoinj?

How serialize, deserialize Transactions and how sign the deserialized Transaction on Bitcoinj? Goog morning, i'm trying to create an application with a watching wallet, connected to the blockchain, and another application with a wallet, with private key, not connected to it, in order to mantain the private key secret and offline. I choose bitcoinj as java library and i would like to create the transaction on the watching wallet's application, send it serialized in an hexadecimal string to the privat wallet's application, in order to be signed by it, here the code i use for the serialization of the transaction: String hexTx = DatatypeConverter.printHexBinary(tx.bitcoinSerialize()); The problem is that i can't sign the transaction i deserialized from the string, here the code i use for deserilize the string and for sign the retured transaction: byte[] serializedTx = hexStringToByteArray(hexTx); Transaction deserializedTx = new Transaction(params,serializedTx); log...