I would like to do a bitcoin transaction in testnet by embedding a custom message in the OP_RETURN. do i have to download the bitcoin core client with and the block chain to do that? or can i use a separate way without downloading the whole blockchain? Thanks!
1 Answer
If you are developing in java using the bitcoinj library, they have a mechanism in place to do it without downloading the full block chain. They just download the header lightweight simplified payment verification (SPV) mode. Maybe you can try that.This is the link.
SendRequest req;
Transaction transaction = null;
transaction = new Transaction(networkParameters);
// the following statement will help to create an OP_RETURN with "Test" as the message
transaction.addOutput(Coin.ZERO, ScriptBuilder.createOpReturnScript("Test".toString().getBytes()));
req = SendRequest.forTx(transaction);