The IOTA network utilizes a unique structure known as the Tangle, a directed acyclic graph (DAG) that fundamentally differs from traditional blockchain architectures. Instead of blocks arranged in a linear, time-sequenced chain, the Tangle allows transactions to be connected directly to multiple previous transactions, enabling parallel processing and validation. This article explores how transactions are added, confirmed, and how consensus is achieved within this innovative system.
The Initial State of the Tangle
In its initial state, the Tangle consists of a set of unconfirmed transactions, known as tips. These are the most recent transactions that have not yet been validated by subsequent transactions. Visually, confirmed transactions are often represented in green, indicating high certainty. Partially confirmed transactions might appear in blue, while unconfirmed tips are gray. Invalid or conflicting transactions are typically marked in red.
A key feature of the Tangle is that each new transaction must validate two previous tips. This validation includes checking cryptographic signatures and ensuring no conflicts exist with any prior transactions in its history.
How a New Transaction Is Added
To add a new transaction to the Tangle, a user performs the following steps:
- Select Two Tips: The user randomly selects two unconfirmed tips from the Tangle.
Validate the Tips: The user validates these tips. This process involves:
- Verifying the cryptographic signatures of the tips.
- Performing a small amount of Proof-of-Work (PoW).
- Ensuring the selected tips do not conflict with any past transactions, either directly or indirectly.
- Reference the Tips: If the tips are valid, the new transaction references them, effectively adding itself to the Tangle by establishing a direct link.
Transactions that are not referenced by the selected tips are considered unrelated for this specific validation act. They will be validated by other users or in future transactions, ensuring the entire network is eventually reviewed.
👉 Explore real-time transaction tools
Achieving Consensus Through Parallel Validation
The decentralized consensus of the Tangle emerges from the collective actions of all users. Since each user validates a small, random part of the graph, no single entity needs to process the entire network. Over time, as more transactions are added from various points, a collaborative and continuous validation process occurs.
- Transaction Confirmation: A transaction is considered confirmed when it is directly or indirectly referenced by all current tips. This means it is buried deep enough within the Tangle that every new transaction inevitably reinforces its validity.
- Confirmation Certainty: The level of certainty for a transaction is determined by the percentage of tips that reference it. A user or merchant can set a personalized confirmation threshold. For low-value micropayments, a 75% certainty might be acceptable, while high-value transfers may require a 95%+ certainty.
This probabilistic model is similar to blockchain, where each subsequent block confirmation increases the certainty of a transaction's permanence.
Handling Double-Spend Attacks
A double-spend occurs when a user attempts to issue two conflicting transactions (e.g., spending the same funds twice). In the Tangle, these transactions might initially be added in different locations and be validated by different users who are unaware of the conflict.
The conflict is resolved organically:
- Conflict Discovery: Eventually, a user will attempt to validate a tip that requires checking both conflicting transactions. This user will identify the conflict.
- Tip Re-selection: The user will reject the invalid tip and select a different, non-conflicting one for their transaction.
- Branch Competition: The two branches of the Tangle containing the conflicting transactions will compete for validation. The branch that accumulates the most subsequent transactions (and thus the most cumulative weight) will become the accepted version of truth.
- Branch Pruning: The losing branch, along with all transactions that solely validate it, will be orphaned and never achieve confirmation. These orphaned transactions can be reattached to the valid Tangle later if they are still valid, requiring new PoW but not a new signature from the sender.
Offline Transaction Capability
A powerful feature of the Tangle is its ability to function offline. Users can create and validate transactions amongst themselves in a local network without an internet connection.
- Building an Offline Tangle: Transactions are created and validated locally, referencing the last known tips from the main online Tangle.
- Reconnecting to the Mainnet: Once connectivity is restored, a final "merge" transaction is created. This transaction bridges the offline Tangle with the current tips of the online network.
- Validation: The next online user who selects this merge tip will validate the entire offline transaction history, incorporating it into the main Tangle. Conflicts are resolved using the same double-spend mechanism described above.
👉 Get advanced consensus methods
Frequently Asked Questions
What is a "tip" in the IOTA Tangle?
A tip is the most recent, unconfirmed transaction in the Tangle. It is an transaction that has not yet been validated by any subsequent transaction. Adding a new transaction requires selecting and validating two tips.
How is confirmation different from validation?
Validation is the act a single user performs when they check two previous transactions. Confirmation is a state achieved by a transaction once it has been validated by a sufficient number of subsequent transactions, making its acceptance by the network statistically irreversible.
How does IOTA prevent double-spending without miners?
Double-spending is prevented through network consensus. Conflicting transactions create competing branches in the Tangle. The branch that gains the most support (accumulates the most weight from subsequent transactions) wins, and the other is discarded. This is a decentralized, emergent form of consensus.
Can transactions be truly confirmed offline?
No, transactions created offline only achieve final confirmation once the offline Tangle is reconnected to the main network via a merge transaction and validated by online participants. Offline transactions remain in a pending state until this happens.
Is 100% confirmation certainty possible?
Achieving absolute 100% certainty is theoretically difficult because there could always be a tiny, isolated branch of the Tangle that doesn't reference a transaction. However, the probability of a transaction being reversed decreases exponentially as it gets buried deeper, making it practically immutable after a short time.
What happens if I select an invalid tip?
During transaction creation, your node checks the validity of the tips it selects. If a tip is found to be invalid (e.g., has an invalid signature or conflicts with history), the protocol instructs you to discard it and select a different one at random until two valid tips are found.