Image by Pete Linforth from Pixabay

Unravelling the IOTA Tangle

Samantha Ouyang
13 min readDec 9, 2020

It kills me to say this, but blockchain is old.

In fact, it was first proposed nearly 30 years ago, with Stuart Haber and W. Scott Stornetta outlining cryptographically secure chains of blocks with timestamps. You might argue:

“Wait, wasn’t Bitcoin only created in 2009?”

“Didn’t it only surge in popularity like 3 years ago?”

“Aren’t Bitcoin prices actually going up for the first time in like two years right now?”

Well, the answer is yes to all of them — but the fact of the matter is: blockchain technology has been around for long enough to reveal fundamental flaws at its core that are bottlenecking the industry.

I’ll get to the *subtle* blockchain shade soon, but first, a brief history lesson!

A New Generation

Since the inception of Bitcoin, many other blockchains have sprouted into existence.

Not surprisingly, Bitcoin is referred to as the 1st generation of blockchain. The main goal was to create a decentralized currency, removing the need for intermediaries in transferring funds.

The 2nd generation rolled around with Ethereum in 2015. The use of blockchain wasn’t just limited to cryptocurrency anymore. Ethereum introduced Smart Contracts, which provided security to all sorts of transactions, and can be used to form dApps (decentralized computer applications) ranging from uses for healthcare and document verification, to even voting.

Now what you’ve been waiting for: the 3rd generation of blockchain. The main aim here is to tackle the issues that plagued previous blockchains — most prominently, scalability. And one of the biggest contenders for this is… (drum roll please) the IOTA Tangle!

Put simply, it changes up the architecture of a traditional blockchain to increase scalability and help mitigate a number of other issues that are currently bogging down blockchain-based cryptocurrencies like Bitcoin.

So as promised, here are blockchain’s biggest problems.

Why Blockchain is Failing Us…

There are a number of issues we could talk about, but I’m boiling them down to 4: scalability, fees, computing power, and quantum attacks.

Scalability

Bitcoin’s blockchain was designed to take about 10 minutes for a block to be mined, in order to slow down the speed at which blocks are created and prevent spam or 51% attacks — where someone gets access to over half of the network’s mining power.

That scales to around 4.5 transactions per second for Bitcoin. In comparison, Ethereum approves about 15 transactions per second, Paypal approves 193, and Visa approves 2000 transactions per second!

But this doesn’t really make sense. Isn’t the whole point to make transactions faster and more secure? 10 minutes is an extremely long time for a system whose sole purpose is to make payment transfers.

This has led to a backlog of transactions in Bitcoin. In fact, as of October 2020, there are over 100,000 unconfirmed transactions, the highest it’s been since 2017!

Aside from speed, storage is becoming an issue. If you wish to join the blockchain as a node, meaning you wish to participate in mining, you would have to download a copy of the entire blockchain — and as of September 2020, the Bitcoin blockchain is 302.22 GB in size!

Fees

When blockchain was designed, it separated users and miners into two groups. Users who wanted to make a payment would also have to add a transaction fee on top of that. This was the incentive for the miners, who ensure network security by validating transactions. Miners race to solve a cryptographic puzzle to confirm the transaction, and the first to do so will be given the reward — the transaction fee from the user. This is called the Proof of Work algorithm.

Due to the amount of congestion, users are paying increasingly higher amounts in transaction fees to incentivize the miners to confirm theirs sooner (the miners can see the reward they can get before beginning to mine a block!). Over the past year, the average transaction fees on Bitcoin have been well over $1, which often times is more than the value of the transaction itself. Click here to see a live chart of average transaction fees.

what w
As of the time of publishing (December 2020), the average transaction fees are $7.41 USD!

It’s kind of like the shipping fee you pay when you try to buy a K-pop album online. The album itself might only cost $15, but add shipping — boom — now it’s $50.

This has led to the problem of Bitcoin dust — bits and pieces of Bitcoins simply lying around unable to be transacted due to the high transaction costs. Not to mention, given the rise of micropayments — very small sums of money — the presence of miner fees may make blockchain-based cryptocurrency inefficient in the future.

Computing Power

Aside from the amount of storage needed to even become a miner, the amount of computational power required to mine is steadily increasing, due to the competitive nature of wanting to be the first to solve the puzzle and create a block. This makes it completely infeasible to use your personal computer for mining, and so most miners use ASICs, hardware designed for the sole purpose of mining.

But because of the vast amount of energy needed to stay competitive and be profitable, this has led to the issue of mining pools — a joint group of miners who combine their computational power and split up whatever profits they make.

Just two mining pools make up over half of the total mining power!

Even worse, there are full-on mining farms now, filled with ASICs that just collectively mine away.

First off, the use of this much energy is quite detrimental to the environment. In fact, Bitcoin mining accounts for 1% of the world’s total energy consumption, equaling that of Switzerland!

But more importantly, the fact that a select few mining pools make up most of the power means that Bitcoin is now dealing with the issue of centralization. So much for being a decentralized network.

Quantum Attacks

Bitcoin and other blockchains based on the Proof of Work algorithm would be completely screwed if faced by a quantum computer.

An average computer would need to check around 2⁶⁸ nonces (number only used once) to find the suitable hash. In other words, one would normally have to make 2⁶⁸ guesses to solve the cryptographic puzzle. However, a quantum computer would only need the square root of that number of guesses (2³⁴), making it 17 times more efficient than a regular computer in mining.

Though much of this is still theoretical, having this much computing power in one person’s hands would threaten the security of the entire network, as they would be able to rewrite the entire history of the blockchain with the speed at which they can validate transactions.

So, what’s the IOTA Tangle all about?

And so we finally get to the topic of today.

IOTA, just like blockchain, is another distributed ledger, developed to enable the ease of micropayments between machines amidst the growing world of the Internet of Things (IoT).

Here’s how it works.

Structure of the Tangle

The Tangle is made up of sites and edges. The sites are much like the “blocks” in blockchain, and the edges are like the “chainlinks.” It also takes on a structure known as a Directed Acyclic Graph (DAG). Let’s break down this down word for word.

  1. Directed → the link between two sites have a specified direction (i.e. they have one-way arrows)
  2. Acyclic → it is impossible to start at one location, follow a path of arrows, and end back up at that same location (i.e. no loops or cycles)
  3. Graph → simply a network of vertices (circles or squares) and edges (the arrows)

You can think of it like Google Drive or whatever file managing system you use. Simply double-click on a folder, and it leads you to some more folders within that folder. If for some reason the back button was broken, you would only be able to continue double-clicking folders until you reached the end — you’d never somehow come back to where you began.

The Tangle works in a similar fashion. In the diagram below, sites are added from the right. The arrows must always point to an older site (toward the left), and can never lead back to itself.

The difference in the structure of blockchain vs. the Tangle. Source: CryptoMarketsWiki

Note: Technically, a blockchain also qualifies as a DAG, though a very specific kind in which the blocks are singly linked, forming a sequential chain.

Each site on the Tangle represents a single transaction and contains all of its details, including the sender, receiver, and amount being transferred. Each edge represents a validation, with the end of the arrow pointing at the site being validated. In order for a site to be added to the Tangle and broadcast to the entire network, it must validate two other sites.

Unlike blockchain, this means that the transaction process occurs simultaneously rather than sequentially. We’ll get to why that’s such a monumental factor in a bit.

At the end of the Tangle, we have sites that are called “tips.” These are sites that have no incoming edges, only arrows coming out of it. This means that while it has validated other sites, it itself has not been approved yet.

Each site must approve two previous transactions. The black sites are the unapproved tips. Source: Perfectial

Tip Selection

When a new block is to be added, it can technically choose to validate whichever previous block it wishes. This means that some tips would simply choose to validate older transactions that have already been approved, rather than newer transactions that still need a bit more confirmation. We call these lazy tips (no literally).

Instead of approving recent transactions (i.e. 9 or 12), site 14 chooses to validate older ones. Source: IOTA Blog

This becomes an issue, since lazy tips add no value to the security and development of the network. The problem is, we can’t force them to only validate recent transactions, as that would give centralized power to the transaction added right after. What we can do however, is penalize them so that the transaction is less likely to get approved.

Here, we introduce the concept of cumulative weight. Each transaction has its own individual weight, proportional to how much work was put in to create it through the Proof of Work algorithm. To calculate the cumulative weight, we simply add up the individual weights of all approvers of that transaction — both direct and indirect — and of the site itself. Sites with higher cumulative weights are usually older, suggesting that they have had more work done on them in total and are more verified.

Individual weights are located in the bottom corner. Cumulative weights are bolded. Source: Hackernoon

How does this all play into the problem with lazy tips? We’ll use a tip selection algorithm called the Markov Chain Monte Carlo (MCMC) method. We can trace a path from the genesis transaction (the very first transaction) to one of the tips, and with every jump to a newer site, we will bias towards the site with a higher cumulative weight. How much we bias this is determined by the parameter alpha (α). What this means is that lazy tips who have tried to take shortcuts will have their weights matched up with older sites that have a higher cumulative weight. This decreases the chance for lazy tips to be chosen to be approved by newer transactions.

Note: The MCMC tip selection algorithm is not enforced, but is recommended as it provides an incentive for your own transaction to be approved.

Check out this animation to better visualize the Tangle!

Site 16 is trying to make a shortcut. However, in order for it to be selected as a tip, it would have to be chosen over site 9 once the path has been traced up to site 7. Source: IOTA Blog

Conflicts & Double Spending

After running the algorithm, we have chosen two tips to validate, called the branchTransaction and the trunkTransaction. Logically, the next step in the process would be to actually make sure they are valid.

Because the entire concept of digital currency is abstract, you need to make sure someone’s account balance is not going negative and that the person actually had the money to spend. To do this, we trace all the transactions from the past that were approved both directly and indirectly by the current transaction, going all the way back to the genesis.

This also brings up the problem of double spending — spending the same digital currency more than once. If you bought a watermelon for $2, upon checkout you would exchange a toonie for a watermelon. But what if you were magically able to get that toonie back? You would be able to buy two watermelons, having only spent $2 rather than $4. Fortunately, that magic doesn’t exist in real life. However, with digital currency, someone might try to cheat the system by copying the transaction details and sending out identical transactions, using the same money multiple times.

Through tracing the transaction history, we check if all the math makes sense and the numbers never go negative. If so, we’re good to go! If not, we end up with conflicting tips, and so a new tip must be chosen.

But what if you were a sketchy user and wanted to approve your own, fraudulent transaction? You technically could, but since the entire transaction history is traced, the most recent transaction you added wouldn’t be approved by others. This creates the incentive in the Tangle to be honest and reject faulty transactions when you see one, otherwise your own transaction won’t be approved.

Proof of Work

So now we’ve finished the job of validating two previous transactions — but we’re not done yet. Before the site is added to the Tangle, a small proof of work is done, using IOTA’s own algorithm called the Curl. As mentioned before in tip selection, the difficulty of it determines its individual weight once added to the network.

This was put into the protocol to prevent spam attacks, and similar to blockchain, requires devices to solve a cryptographic puzzle by guessing the nonce. The difference lies in the difficulty of the puzzle, as the proof of work step in IOTA requires much less computing power, enabling a broader range of devices to become nodes in the network.

Finally, we’re Added to the Network.

But we’re still not fully confirmed (what?). To add more to the mix, the Tangle has a concept called confirmation confidence. As we know, older transactions with a larger cumulative weight are more “verified” than others. To calculate this we run the following steps:

  1. Run the tip selection algorithm (usually MCMC) 100 times
  2. Count how many times a path was traced through our site
  3. Divide that number by 100 to form a percentage

As a merchant in the network, you can decide at which threshold you will start accepting transactions. Some may start accepting at 51% confirmation, while others may wait longer for over 95% confirmation.

The green sites have a high confirmation confidence as they are confirmed by all tips. Source: GitHub

What’s so great about the IOTA Tangle?

Now that we finally understand how the Tangle works, we can get back to discussing how it stacks up against blockchain.

There are 2 main differences with the Tangle that make it able to solve blockchain’s problems: 1) its structure, 2) its method of consensus.

Structure

As we know, the transaction process for IOTA occurs simultaneously rather than sequentially, since each transaction validates two others whereas with blockchain, each validates only one.

Source: Wikimedia Commons

What this means is that IOTA is far more scalable than blockchain. For every transaction added, two others are being confirmed. This means that the network actually speeds up when there are many transactions to process!

Remember the huge backlog of transactions and the speed of 4.5 transactions per second on Bitcoin? With IOTA, this wouldn’t be an issue because theoretically, it can handle almost an unlimited number of transactions per second!

With IOTA, the network speed increases as more transactions are made. Source: IOTA News

Aside from that, the Tangle is much more lightweight. Instead of having to download the entire copy of the blockchain, with IOTA, you only have to store a small portion of the network to create and approve transactions, due to its parallelized nature.

Consensus

If you recall, blockchain was made so that the miners and users were separated into two groups, creating conflicting interests that have led to crazy high transaction fees.

With IOTA, there are no miners — rather, you are both the miner and the user. When you create a transaction, you act as a user, but in having to validate two previous transactions to add your own, you act as a miner.

This eliminates the need for transaction fees. The reward for approving other transactions is being able to process your own! You can now send money around for free (the way it should be).

More Benefits (It doesn’t end just there!)

IOTA was designed to be lightweight enough so that devices as simple as laptops, phones, and even drones have enough computational power to send and approve transactions. This scalability to a broader range of devices enables for a future of machine-to-machine communication (M2M). Goodbye, ASICS!

The new consensus mechanism also helps de-escalate the growing concern for centralization among distributed ledger technology. Taking away the profit and need for computational power, mining pools are effectively eradicated and power is much more equally distributed among nodes.

Another big thing: IOTA is quantum resistant! This is because IOTA’s Proof of Work algorithm incorporates something called the Winternitz One-Time Signature Scheme. I won’t get too into that here, but click here if you’d like to know more.

IOTA Seems a Little Too Good to be True…

Of course, IOTA has some of its own drawbacks as well.

Since each transaction validates two others rather than one, a 51% attack in blockchain becomes a 34% attack in IOTA, which means it’s more vulnerable if met with an attacker with a lot of computing power. On the bright side however, even if an attacker gets hold of 34% of the network’s hashing power, there’s still only a 29% of succeeding.

To mitigate this issue, IOTA has currently implemented a coordinator. They simply oversee all activity in the network, making sure nothing fishy is going on. Though some argue that this creates centralization, it’s only temporary — just to help onboard the system and prevent any attacks in the early stages of IOTA. Essentially, they’re just training wheels up until IOTA is secure enough to completely operate on its own.

TL;DR

  • IOTA is part of the 3rd generation of blockchain, designed to increase scalability.
  • The Tangle’s structure is a Directed Acyclic Graph, parallelizing the transaction process.
  • In order to add your own transaction, you must validate two older transactions. As a result, the network speeds up when there are more transactions.
  • No miners, no fees. Everyone in the network making a transaction also participates in consensus!

If you enjoyed reading this article or learned something new, be sure to drop a follow on Medium and connect with me on LinkedIn! Also, if you’d like to keep up with the projects I’m working on, feel free to subscribe to my monthly newsletter. Thanks for reading!

--

--

Samantha Ouyang

Passionate about creating impact with emerging tech. Current obsessions include blockchain, empowering women in STEM, chemistry, and sustainable materials.