Our journey of discovery of IOTA with Stefano Della Valle continues today with the third episode. After having seen how the IOTA network works, the time has come to talk about its use: specifically, how IOTA transactions work. If you’re missing something from the text, give a look to episode 1 and episode 2 of the series!
IOTA nodes perform two distinct activities in two different phases during a transaction:
When transactions produced by other nodes are received, they verify their structural validity, store them, and propagate them. This activity requires minimal computational resources, and also the impact on local storage is limited because the node can remove older transactions if they are no longer needed for the validation.
When it has to generate a new transaction, it decides how to insert it in the Tangle and, once finalized with a “proof of work” with anti-spam function, it propagates it.
The cost of operations carried out by the network nodes is, therefore, mainly linked to the activity carried out by generating their own transactions. Consequently, managing other people’s transactions does not require fees to cover costs.
Approval and confirmation of transactions
As mentioned above, a transaction enters the tangle without having been verified from its financial aspect. So it may not be valid for many reasons: double-spending, insufficient funds on the input address, etc. The verification of a transaction takes place when the subsequent one is inserted: the node that has to publish a transaction must choose two others in which link its own.
Since nodes are trustless, it’s possible to make an absolutely arbitrary choice among the last transactions entered in the Tangle. However, if a transaction isn’t valid, the ones connected to it will be considered invalid too, and, most likely, they won’t be chosen by other nodes, so it will never be approved.
On the contrary, if a transaction is valid, the new transaction approves it, and indirectly approves all the previous transactions connected in cascade along the paths that can be made in the sub-Tangles starting from it.
The standard implementation of the IOTA node (IRI) provides a choice algorithm that produces the highest probability of selecting a valid transaction (the so-called “Markow Chain Monte Carlo”), which consists in comparing a transaction with the previous ones along the sub-Tangle, i.e., with the path to the oldest available transaction or within a certain “depth” limit. If no conflicts are detected, the transaction is approved and will be referenced by the new transaction. Conversely, if conflicts are detected, the transaction is abandoned, and another transaction is chosen.
However, the approval of the transaction by a node does not imply that it’s actually valid. In fact, the node doesn’t compare the candidate transaction with all the transactions present in the Tangle, but only with those it encounters along the path in the sub-Tangle that starts from the transaction under examination. Other transactions may be in conflict but not detectable.
So, how does the confirmation of a transaction take place?
As with blockchain-based platforms, a transaction is defined as confirmed when it has received a sufficient number of direct and indirect approvals. In the blockchain model, this process is condensed with “a transaction is confirmed when a certain number of subsequent blocks to the one containing it have been validated (the number varies between the various blockchains)”.
The possible fork of a blockchain due to the creation of two alternative blocks where one of the two contains invalid transactions is resolved by abandoning the chain that will receive fewer additional blocks between the two. Similarly, in Tangle transactions that are invalid or that, directly or indirectly, validate invalid transactions are not chosen or are abandoned.
The nodes therefore operate in perfect synergy: the more nodes are active and the greater the consensus on the validity of the transactions and the greater transactions enter the tangle, the faster a transaction obtains the level of approval such as to consider it permanently confirmed. Formal simulations and demonstrations of the mathematical model of the IOTA systemhave highlighted how this architecture can virtually scale to infinity and produce high security at a level quite similar to that of blockchain-based systems.
In the first three episodes we have seen some basic concepts about iota. Now it is time to move further and see some potential issues and opportunities for IOTA: this is what we will see in the next episode. Have a nice day guys!