0

How do transactions reference other transactions in the Tangle, is it through the Merkle root, or signature message fragment?

And how can you make a transaction reference another chosen transaction. For example, you create a chain of transactions (a branch) all related to the exchange of a specific good that somehow all reference each other.

2 Answers 2

1

Each transaction has two fields, trunk transaction hash and branch transaction hash, which refer to 2 other transactions (contain the hash of the entirety of these two transaction). When building transactions, you can set both of them, or you can set one of them (to promote it), or you can set none (both are determined by tip selection).

How exactly you set them depends on which library you are using.

But in general, except for bundles (which need to be connected directly, and all have the same bundle hash), you should not try to "group" transactions together manually - using the default tip selection will attach your transactions at the point where they are more likely to get confirmed fast. Deliberately attaching your transaction to 2 old transactions is a good way of making sure it will most likely never get confirmed.

2
  • So if I want to "connect" transactions, this needs to be done through a bundle? Can a new transaction somehow reference the bundle of a transaction that was already created. The reason I ask this is, if for example, a service like ride sharing was using the Tangle to keep track of transactions, how could the ride sharing service connect them, so they, or the user, could see something like a history of their activity, like receipts. Let me know if this is actually a separate question. Commented Jan 3, 2020 at 0:32
  • So you just want to logically "connect" transactions (for the viewer)? In that case, you'd probably use parts of the message fragment to store the hashes of the other transactions. The message fragment is free-form - you can store anything in it, that you (or others) can later parse out again. I am not aware of any convention that others use for similar things.
    – mihi
    Commented Jan 3, 2020 at 20:27
0

Each transaction has a tag field, which can contain up to 27 arbitrary trytes. If you are looking for a way to group or categorise transactions, this is probably the field you are looking for.

IRI nodes also support a findTransactions command, which you can use to query for transactions that match (amongst other things) a specific tag.

Your Answer

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

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