1

How can I construct a transaction using a watch only wallet RPC and cold sign using any nodejs library? In the end, I have to send this to the blockchain using the daemon or watch only wallet RPC.

0

1 Answer 1

1

Using the wallet RPC on your view only (hot) wallet, you can call transfer with get_tx_metadata: true and do_not_relay: true which will yield an unsigned_txset in the response.

Then on the spend wallet RPC (your cold wallet), call sign_transfer, passing in the unsigned_txset from above, which will yield a signed_txset in the response.

Back on the view only (hot) wallet RPC, call submit_transfer, passing the data from signed_txset above in the tx_data_hex parameter.

The linked methods all have examples of these steps using curl. The calls are just simple HTTP POST requests, so libraries are not really needed.

2
  • It's not solve my problem. I can't use cold wallet in my solution, I want to sign transaction in my nodejs application. In other words, the private spend key should not leave my code.
    – intosKai
    Nov 7, 2019 at 6:06
  • Doing this without the RPC is far from trivial and there is no javascript library that has all the code you would need. My answer to a previous question of yours applies.
    – jtgrassie
    Nov 7, 2019 at 13:04

Your Answer

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

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