Title: How to sign an OP_RETURN transaction with BitcoinJ Post by: topflankerkiller on November 28, 2017, 08:50:11 AM I want to create and sign an OP_RETURN transaction and broadcasting to my Regtest network. I face up two problems:
First: I have created successfully the transaction output but how to sign and broadcast my transaction to the regtest network? Here is my code for creating the output: Code: public TransactionOutput createOpReturnTransaction(org.bitcoinj.core.Transaction tx, ScriptBuilder sb) { And here are the steps that i have to finish in Main: Code: //create the OP_RETURN transaction in Main Second: Despite the fact that I have send bitcoins through the regtest network with the RPC : -regtest sendtoaddress n4MN27Lk7Yh3pwfjCiAbRXtRVjs4Uk67fG 10.00 balance in regtest. in Java the wallet.getBalance() function returns zero concerning the balance of my wallet which has the n4MN27Lk7Yh3pwfjCiAbRXtRVjs4Uk67fG address How it is possible to align my balance in regtest with this in BitcoinJ? I guess i will need balance in order to sign my OP_RETURN transaction. Here is the output in the console: https://i.stack.imgur.com/rchS1.png |