2

I'm looking for the specs to craft a Monero transaction and then sign this transaction with my Monero private spend key. Then broadcast this signed transaction to a node. I want to do this in javascript. Is there an easy to follow tutorial on how to go about doing this?

jtgrassie
  • 19,601
  • 4
  • 17
  • 54
Patoshi パトシ
  • 4,608
  • 4
  • 27
  • 69

2 Answers2

3

Monero transactions are much more than some simple data that is signed with a private key. You need outputs to spend, mixin outputs from the blockchain, lot's of math for RingCT etc. This is one of the reasons the RPC interfaces (daemon and wallet) exist. These can be called by any language which can call a URL and create/parse JSON.

If you use the wallet RPC, you can call transfer with get_tx_metadata: true and do_not_relay: true to get tx_metadata which can later be broadcast with submit_transfer (or of course do this all in one step with just transfer, without the aforementioned parameters).

If you just want to understand the math that goes into RingCT, read the MRL-0005 paper, or the broader Zero to Monero book. And if you just want to understand the structure of a transaction, see the Monero source code which defines the structures used.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54
1

This can now be done with monero-javascript which supports local, offline transaction signing.

woodser
  • 41
  • 1