What is the Tangle (IOTA)
Last Updated: 1st November 2018
The IOTA protocol uses an underlying architecture called the Tangle to operate, this is similar to how Bitcoin utilizes a blockchain as its underlying architecture.
The Tangle is a type of directed acyclic graph, or DAG, which must first be understood in order for the Tangle itself to be understood.
What is a Directed Acyclic Graph (DAG)
DAG is a data structure that is represented by squares (vertices) which are then connected by arrows (edges). An example illustration of a DAG can be found below:
This method of structuring data in a DAG format forms the basis of the Tangle.
For example, each square on the DAG above (numbers 1-9) represents a transaction on the Tangle network. When a transaction is made on the network, two previous transactions must be “approved”. This approval is represented by the arrows in the image above. To illustrate, transaction 6 approves previous transactions 4 and 3, so thus can be considered to be a valid transaction. Transactions can either directly or indirectly approve other transactions. A direct arrow between two transactions, e.g. 6 and 4, would be classed as a direct approval. If there is no direct arrow, but there is a path of at least 2, e.g. 6 and 1, then transaction 6 would be considered as an indirect approval of transaction 1. Newly issued transactions with no approvals are called tips. In the image above, the tips would be transactions 8 and 9.
Transaction 0 is a special kind of transaction known as the Genesis Transaction. The Genesis Transaction represents the beginning of the Tangle network, and has the function of distributing its native digital asset, IOTA. An address containing all the IOTAs that is to ever exist on the network are distributed to what are known as, founder addresses. These founder addresses are owned by the original investors of the IOTA project. A Genesis Transactions is akin to the Genesis block in a blockchain-based protocol.
Nodes
The Tangle network also consists of nodes which have the function of issuing and validating transactions. A node must do the following in order for any issued transaction to be valid:
- Nodes must choose two other transactions to approve
- Nodes ensure approved transactions are not conflicting
- Nodes must solve a cryptographic puzzle
Nodes must choose two other transaction to approve – As previously mentioned, two previous transactions must be approved before a transaction can successfully be issued. In order to choose which two transactions to verify, the IOTA protocol currently employs the tip selection algorithm: Markov Chain Monte Carlo (MCMC).
Nodes ensure approved transactions are not conflicting – If two transactions are conflicting, then nodes must decide which one to orphan. The term orphan, in this context, is similar to that of orphan blocks in blockchain-based technologies. A tip selection algorithm is once again utilized in order to determine which transaction will be orphaned.
Nodes must solve a cryptographic puzzle – Similar to how Bitcoin miners must solve cryptographic puzzles, or perform proof-of-work, in order to add a transaction to the Bitcoin blockchain, nodes must do the same in order to issue a transaction. The IOTA protocol uses proof-of-work algorithm, Hashcash Lite, which allows a wide range of devices to issue transactions on the Tangle network.
Weights
The weight of a transaction is directly correlated with the amount of work put in by a node in issuing it. This means, the more proof-of-work employed in issuing a transaction, the larger the weight the transaction will have.
A transaction with a larger weight is perceived as being more important than a transaction with a smaller weight, and thus, is used as a method of preventing spam transactions. It is thought that spam transactions would possess a smaller weight, as an attacker would want to minimize the amount of work employed, therefore, these smaller weight transactions would be rejected by the network.
Transactions can also have what is known as a cumulative weight. Cumulative weight is the weight of a particular transaction plus the sum of the weights of other transactions that directly or indirectly approve it.
The Coordinator
The Coordinator is a type of consensus mechanism, controlled by the IOTA Foundation, that issues milestone transactions roughly every minute. These milestones transactions, just like regular transactions, must approve two previous transactions before it.
The function of the Coordinator is to prevent attacks on the Tangle network. Attacks such as parasite chain attacks are prevented through use of this protocol. More potential attack vectors can be found in the IOTA whitepaper.
Once the Tangle network is sufficiently large enough, it is suggested that the Coordinator will be shutdown and the Tangle network allowed to grow organically.
For more information on how the Tangle network works, please refer to the whitepaper.