<p>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 <a href="https://bitcoinj.github.io/" rel="nofollow">link</a>.</p>

<pre><code>    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);
</code></pre>

CC BY-SA 3.0
2016-06-17T04:30:42.160Z
This library can be used for testnet transactions?
Anjelo
CC BY-SA 3.0
2016-06-17T10:41:04.147Z
Yes you can do it for `testnet`,`mainnet` or `regtest` networks
jgm
CC BY-SA 3.0
2016-06-16T11:24:36.503Z
2016-06-16T11:24:36.503Z
jgm
<p>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!  </p>

<blockchain><testnet><op-return>
OP_RETURN custom message in testnet transaction
Anjelo
# OP_RETURN custom message in testnet transaction

(Asked by: username_0 on 2016-06-16)

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!

**Tags:** blockchain, testnet, op-return


---

## 1 answers

### Answer by username_1 on 2016-06-16. Score: 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);

> **Comments:**
> **username_0**: This library can be used for testnet transactions?  
> **username_1**: Yes you can do it for `testnet`,`mainnet` or `regtest` networks  

---

