If I have a large offline Subtangle with 1000 transactions and I choose to bring it online by attaching it to tip T, what happens if tip T ends up being invalid later on? Does my entire Subtangle become invalid? Do I have to reattach the entire thing to another tip or do I have to reattach all 1000 transactions to new tips?
Successfull merging of a subtangle and the main tangle: How to start a new offline subtangle?
The case, that you have to reattach your whole subtangle occurs when you start your subtangle at a transaction that is not very likely to be confirmed and conficting with the main tangle.
In this example, the two transactions marked with Xs are conflicting and the network/coordinator chose the white transaction to be the valid one. Therefore the red transaction and all transaction referencing it, also your subtangle, are invalid and have to be reattached at another transaction in the tangle. That means the PoW has to be done again.
I created the tangles with the yEd Graph Editor. Source files can be found here.
When you have a large offline subtangle (which somebody already did the POW for); it is already attached to some (very old) transaction, which has hopefully confirmed until now (when starting an offline subtangle I'd start at a "confirmed" transaction anyway - at least as long as there is the coordinator, you can just use a milestone).
When you bring the tangle online, you can promote your subtangle's tips to get it confirmed. In case you attach the promote transactions at the wrong point, you'd only have to redo those, and not the whole subtangle.
Wouldn't I have to attach the offline subtangle to a tip of the main tangle, making it impossible to pick one with any amount of validations? For the 2nd part, thanks, that makes sense now. Feb 13, 2018 at 22:32
1@Matt Keep in mind that every transaction has been a tip at some point in time. Due to the decentralized network you can attach wherever you want, as you can always claim that the transaction you attached to was still a tip when you attached it. Due to the tip selection algorithm it is a good idea though to choose a recent tip if you are able to, as it increases the chances of your transactions to be selected (and therefore confirmed) by others.– mihi ♦Feb 14, 2018 at 19:39
I didn't know I could pick any transaction to attach to! Why would the tip selection algo not pick a transaction I attach to some random spot on the tangle? Isn't it a tip just like any other tip at that point... Feb 14, 2018 at 21:07
1@Matt the tip selection algorithm weighs the tips by the number of ways you can reach them from milestones. So a tip that is reached only by few (old) milestones is less likely to be chosen than a one that is reached by more (=more recent) milestones). You can read the "Equilibria on the tangle" blog posts for mathematical background why to do so and why it is no advantage for nodes if they use a different tip selection algo.– mihi ♦Feb 15, 2018 at 20:59
Entire subtangle will be treated as invalid and won't be confirmed. That means you have to reattach all of the transactions.
I still don't get how this works in a post-COO world. I'm under the assumption that they would all still be in the Tangle, but tip selection wouldn't pick them anymore so that part of the Tangle "dies". Am I supposed to monitor those transactions and figure out myself that new tips are not validating it anymore? Feb 13, 2018 at 20:56
There is a checkConsistency api call, so you can check if a particular transaction is consistent with the rest of the tangle. How it will work without COO I don't know.– PomykFeb 13, 2018 at 21:09
1Without the COO, you would never know for sure, that a transaction is consistent with the rest of the tangle (in theory). But you would be able to check, if a transaction is consistent with a probability of 50%, 75%, 99%, 99.9999%, ... by looking at how many regular transactions confirm it.– ZauzFeb 15, 2018 at 17:21