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?