<pre><code> sendrawtransaction signedHex
</code></pre>

<p>is the rpc you need to call which will submit your raw transaction to local node and network.</p>

CC BY-SA 4.0
2018-05-25T06:52:02.400Z
First of all thanks for replying. According to [link] (https://en.bitcoin.it/wiki/Raw_Transactions), "raw transaction API was introduced with Bitcoin-Qt/bitcoind version 0.7". I am using bitcoinj. How to use sendRawTransaction here? Can you help me to know the process for bitcoinj? or is there any alternative for sendRatTransaction there?
FairyRosie
CC BY-SA 4.0
2018-05-23T15:21:16.540Z
2018-05-23T15:21:16.540Z
Parishilan Rayamajhi
<p>I am very new to bitcoinj library. I am using 0.14.7 version of bitcoinj and developing my own application in java. I have created a watch-only wallet by using the tPub of the Offline wallet. Upto Receiving payments on watch-only wallet, it is working fine. Now, i have to spend those coins. For that, I have created a transaction and found its transaction Hash. </p>

<p>To sign that transaction Hash with private key, I have followed <a href="https://bitcoin.stackexchange.com/questions/50562/how-to-sign-raw-transaction-given-a-private-key-and-sha-hash-in-java">How to sign raw transaction given a private key and SHA hash (in java)</a> code. and now I am getting the signed hash. Please guide me that how can I use this signed hash to send and broadcast the transaction.? </p>

<p>Your help will be appreciable. Thanks in advance.</p>

<p>The sample code is given below:</p>

<pre>
// Through this way, I am finding the Transaction Hash.

SendRequest request = SendRequest.to(Address.fromBase58(params,externalAddress), Coin.parseCoin(amount));
request.signInputs = false;
request.tx.getInputs();
request.missingSigsMode = Wallet.MissingSigsMode.USE_DUMMY_SIG;
String hash = request.tx.getHashAsString();

//now using createSignHash method, which is taking transaction hash and signing that with private key and returning the Signed Hex.
System.out.println("Signed Hash : " + createSignHash(hash)); 
</pre>

<transactions><bitcoin-core><java>
How to use Signed Hash to Send Coins in bitcoinj
FairyRosie
# How to use Signed Hash to Send Coins in bitcoinj

(Asked by: username_0 on 2018-05-09)

I am very new to bitcoinj library. I am using 0.14.7 version of bitcoinj and developing my own application in java. I have created a watch-only wallet by using the tPub of the Offline wallet. Upto Receiving payments on watch-only wallet, it is working fine. Now, i have to spend those coins. For that, I have created a transaction and found its transaction Hash. 
To sign that transaction Hash with private key, I have followed How to sign raw transaction given a private key and SHA hash (in java) code. and now I am getting the signed hash. Please guide me that how can I use this signed hash to send and broadcast the transaction.? 
Your help will be appreciable. Thanks in advance.
The sample code is given below:

// Through this way, I am finding the Transaction Hash.

SendRequest request = SendRequest.to(Address.fromBase58(params,externalAddress), Coin.parseCoin(amount));
request.signInputs = false;
request.tx.getInputs();
request.missingSigsMode = Wallet.MissingSigsMode.USE_DUMMY_SIG;
String hash = request.tx.getHashAsString();

//now using createSignHash method, which is taking transaction hash and signing that with private key and returning the Signed Hex.
System.out.println("Signed Hash : " + createSignHash(hash));

**Tags:** transactions, bitcoin-core, java


---

## 1 answers

### Answer by username_1 on 2018-05-23. Score: 1

sendrawtransaction signedHex

is the rpc you need to call which will submit your raw transaction to local node and network.

> **Comments:**
> **username_0**: First of all thanks for replying. According to [link] (https://en.bitcoin.it/wiki/Raw_Transactions), "raw transaction API was introduced with Bitcoin-Qt/bitcoind version 0.7". I am using bitcoinj. How to use sendRawTransaction here? Can you help me to know the process for bitcoinj? or is there any alternative for sendRatTransaction there?  

---

