5

So I want to understand how does Monero work under the hood.

Input of tx is structured as follows:

 "vin": [ {
      "key": {
        "amount": 0, 
        "key_offsets": [ 17927, 10436, 804, 32, 3817
        ], 
        "k_image": "67e33ecb9fc4e697248ef57ca88aa626fe670ce1551598f9cbc1565089d43c41"
      }
    }
  ]

Outputs of a given denomination are ordered in blockchain order, and thus can be represented by their index in that list. Moreover, they're stored as offsets from the previous one (the first one from 0), as this will result in smaller values, which can often result in a yet smaller amount of data, since those numbers are written out in a variable length output. [1]

So I imagine some dictionary where value is a key and a list of offset is a value of that dictionary to exist. Or something similiar to that.

But then, when we inspect the output of the transaction, we have something like this:

"vout": [ {
      "amount": 0, 
      "target": {
        "key": "7787bbef1a35b936e439aee4ae97cc245ba55ef35186efa3e9e86076a8fba1a6"
      }
    }, {
      "amount": 0, 
      "target": {
        "key": "f981817b20f7a866abb6a9cb29e8062a16fb15f11f0a20c0f0f296eb26e1eab1"
      }
    }
  ]

Now my question is the following:

How can I know if some other transaction is referencing one of those outputs as input to that transaction?

How to link output of this transaction with input of some other transaction?

[1] Understanding the structure of a Monero transaction

5

The daemon keeps a table of all the transaction outputs in the order where they appear in the blockchain. The offsets in a transaction input allow to quickly recover the indexes of the referenced outputs in this table.

There is no command in the daemon to query the table of outputs directly. But there are some external programs that can be used or modified to make custom blockchain queries. For example, the transactions-export could be a good start.

  • So basically what you are saying is that it's not possible to link input of transaction with referenced output (from some other transaction for sure) without using some external program like the one you linked? – Martin Matak Dec 11 '17 at 16:40
  • Indeed, as far as I know, the basic Monero daemon doesn't provide a command to do that to the user. – glv Dec 12 '17 at 8:49
  • Thank you for the answer, I will try to come up with something then. – Martin Matak Dec 16 '17 at 8:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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