2

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 1

1

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);
2
  • This library can be used for testnet transactions?
    – Anjelo
    Commented Jun 17, 2016 at 4:30
  • Yes you can do it for testnet,mainnet or regtest networks
    – jgm
    Commented Jun 17, 2016 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.