0

I'm trying to build a Monero transaction using the mymonero-core library. So far I've been following the code from the tests, however I'm not quite sure what to do with the "rct" part of the previous output. Here (ref) the rct in constructed as the string concatenation of outpk[i],mask[i],amount[i], which is possible because the used transaction 9d37c7fdeab91abfd1e7e120f5c49eac17b7ac04a97a0c93b51c172115df21ea has all these fields:

""rct_signatures"": {
    ""type"": 3, 
    ""txnFee"": 327860000, 
    ""ecdhInfo"": [ {
        ""mask"": ""889e4a48335cbbf163ca9cd0299df86f28818ebb45960e0dd00e3f1a0549a704"", 
        ""amount"": ""9b07dcf00b7bf6cbdf269da3d9772af2ae377e1f58f13158359f6c96bfd2e50d""
      }, {
        ""mask"": ""b5b234ccdd70beca8b1fc8de4f2ceb1374e0f1fd8810849e7f11316c2cc06306"", 
        ""amount"": ""0008ffa5ac9827b776993468df21af8c963d12148622354f950cbe1369a92a0c""
      }], 
    ""outPk"": [ ""3ef9880e8fed3f5222096938a6bc773d2a12cbbc9caf30d12bc6a216b4fad70b"", ""86a2c9f1f8e66848cd99bfda7a14d4ac6c3525d06947e21e4e55fe42a368507e""]
  }, 

In my case however the transaction which I want to use UTXOs from has this structure

""rct_signatures"": {
    ""type"": 4, 
    ""txnFee"": 30790000, 
    ""ecdhInfo"": [ {
        ""amount"": ""54dd48f41f3670f3""
      }, {
        ""amount"": ""c0c11a7c62dc0f68""
      }], 
    ""outPk"": [ ""f4449d60fbc9087f9dcfa856537b4d2d02433454ba5245d4d46ea36ea5922c46"", ""29660983d695b61492d9a213c150da443997f8c9397e2910a07717fbda87f64d""]
  }, 

So the mask is missing and amount has a different format. How do I build RCT for those?

6
  • This should answer your question: monero.stackexchange.com/a/11273/7493 – jtgrassie May 4 '20 at 15:11
  • 1
    @jtgrassie Thanks for help, however it's still not quite clear if the RCT format stays the same? Do I still need to build it using a regular string concat once I got encrypted amount and mask in the "old"(?) format? Unfortunately this step is missing from the tests with only the resulting value being hard-coded – Oleg Golovkov May 4 '20 at 15:19
  • I've reopened (for now) but perhaps you should rewrite the question. The mask and amount are discussed in the other Q/A as the masks are now deterministically derived. Therefore they do not form part of the transaction any longer. And: "if the RCT format stays the same" is clearly no. type 3 is not the same as type 4. – jtgrassie May 4 '20 at 15:26
  • 1
    @jtgrassie oh I see, do you by chance know if this implementation should be fine (for type4?)? github.com/monero-project/monero/blob/master/src/crypto/… it's really hard to find any docs or code samples for it – Oleg Golovkov May 4 '20 at 15:44
  • It is not clear what you are trying to achieve. You link (in the question) to a mock test which gets the output of an RPC call, then in the comment above link to a function which generates a signature. What precisely are you trying to do? Build a tx? Sign? – jtgrassie May 4 '20 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.