IOTA for IoT
Someone recently asked me a question around how to use or if we can at all use blockchain framework in IOT? My answer was yes, we can. But, the catch is, there could be a much better solution than Blockchain. I asked them to read some cool stuff about IOTA, what is it, how is it coming up and how better it is, if implemented with right set of security models.
Thus, this blog post with my key notes based on some of the secondary research I have done thus far on this topic. It should be noted that IOTA is currently still in Beta, major improvements to performance, features as well as ease of use are still work in progress.
What is IOTA?
It is a revolutionary new, next generation public distributed ledger that utilizes a very unique invention, called as “Tangle”. Now, what is Tangle then? It is a new data structure based on a Directed Acyclic Graph (will explain later). Points to note, it has no Blocks, no Chain, no Miners and thus no fees involved. It is a completely new radical architecture that works quite differently compared to other Blockchains. At its core, the Tangle still has the same underlying principles as a Blockchain: it’s still a distributed database, it’s still a P2P Network and it still relies on a consensus and validation mechanism.
Why was it created?
IOTA was created to satisfy the need for interoperability and sharing of resources between every device and utility connected to the internet in the future — known as Internet-of-Things (IoT) devices. Its aim is to be the currency for the IoT economy, creating a brand-new network of connected peers for a wholly decentralized system. I believe, some of the key limitations with Blockchain proved to be the source of IOTA. What are those? Scalability, Transaction Fees, High H/W and resource requirements.
· Check this out, over 1070 transactions were unconfirmed at the time of writing.
· Also check out the key bitcoin stats and check the mining cost and hash rate
This is cumbersome for users, and means that most of use cases cannot be executed, simply because you will less probability of your transactions getting through. For a large corporate, it’s simple you won’t either want to wait in the queue or end up paying higher fee or live with the uncertainty of not getting your transactions through.
Imagine your Tesla car paying a charger in IOTAs, and the charger in turn paying the electricity grid in IOTAs, and so on, without any fees, all automatically and in a decentralized fashion.
What is so good about IOTA?
IOTA is envisioned to be the public, permission less backbone for the Internet of Things that enables true interoperability between all devices. IOTA has a range of features that are uniquely enabled due to its architecture:
· Scalability: IOTA can achieve high transaction throughput thanks to parallelized validation of transactions with no limit as to the number of transactions that can be confirmed in a certain interval. It's designed to be extremely lightweight, and enable free, instant transactions. It is more scalable than a cryptocurrency based on blockchain is, and is designed for IoT devices which need smaller, more scalable programs for a variety of use cases.
· No Transaction Fees: IOTA has no transaction fees.
· Decentralization: IOTA has no miners. Every participant in the network that is making a transaction, actively participates in the consensus. As such, IOTA is more decentralized than any Blockchain. Unlike other cryptocurrencies based on blockchain technology like Bitcoin, Ethereum etc.
· Quantum-immunity: IOTA utilized a newly designed trinary hash function called Curl, which is quantum immune (Winternitz signatures). Which makes it a lot superior to other types of binary security methods. Curl works on a completely new technology; ternary functions are new and require a totally new ecosystem. This function is made possible with the use of JINN-processors as we saw earlier, information about which is not available publicly. If a function and its processors work on tech that is new and yet to be revealed to the world, the chances of a security breach are lessened.
· Proof of Work: Also, IOTA uses Proof-of-Work to make the Tangle network secure, and more transactions mean more security because each transaction brings in more proof of work.
What is a DAG and how does Tangle work?
A Directed Acyclic Graph (DAG) is a finite directed graph with no directed cycles, and where the nodes have edges with a direction associated with them. The DAG that IOTA uses is called the Tangle. As mentioned in the earlier section that, Tangle allows the participants of a transaction become the transaction approvers too thus the key difference from how Blockchain works. In general, it all comes down to some kind of web, consisting of nodes connected to each other with edges.
· An edge is basically a connection between nodes with a specific direction.
· It is not possible to traverse it in the opposite direction.
· Acyclic means that it’s not possible to encounter the same node for the second time when moving from node to node by following the edges and thus it is non-circular.
Another key difference lays in the data structure of Tangle.
· Instead of adding blocks sequentially to a chain, Tangle uses its Direct Acyclic Graph, thus the validation is parallelized which results in higher throughput.
· Every node here consists of multiple layers of transactions. When a transaction is registered in a node, it first must verify two other transactions before his transaction will be verified.
· Those two transactions are chosen according to an algorithm. The node must check if the two transactions are not conflicting. For a node to issue a valid transaction, it must solve a cryptographic puzzle like those in the Bitcoin network (Proof of Work).
· Just two verifications are needed to verify a transaction. This gives the benefit of a drastic decrease in unnecessary verification.
· Besides that, miners are not required. You may think this is not a good thing, but it is! The only incentive for miners is the reward they get when they’ve mined a block. This can result in conflicting visions and goals between miners and token holders.
· Within a DAG, the nodes itself become the ‘miners’. This process is also much more lightweight because you only must verify transactions for the two closest nodes. As miners are eliminated and we validate transactions ourselves, transaction fees are reduced to zero.
· Added to that, the power of some blockchains is more centralized than you might have thought. Miners form large mining pools to reduce variation of the mining reward. In case of Bitcoin, it is possible that the ledger becomes so large, that only few servers can host and verify it. A Tangle tackles this problem of unwanted centralization.
IOTA vs Blockchain.
The major difference that is worth mentioning (apart from the DAG vs. Blockchain) is how IOTA achieves consensus and how transactions are made.
· IOTA is different from other cryptocurrencies in that it’s not based on the blockchain technology — instead, it uses what is called a “Tangle Network”, which allows instant, free, decentralized transactions.
· It uses Proof-of-work (relative to cumulative weight for all transactions) for transaction approval.
· No Miners: What this means is that each participant in the network that wants to make a transaction must actively participate in the consensus of the network by approving 2 past transactions. This referencing of transactions is an attestation: with your transaction you attest directly that two transactions, and indirectly that a subsection of the Tangle are valid and conform to the protocols rules and it enables a variety of unique features that are only seen in IOTA.
· No transaction fees: What sets IOTA apart is not just its unique block-less technology but the fact that it does not charge any transaction fee. The amount sent from one user or device will be the amount received by another without any deductions. The transacting nodes will only have to approve two previous unconfirmed transactions. There is no other incentive involved, letting IOTA serve a truly democratic and decentralized function.
· It is scalable: IOTA is an asynchronous, decentralized and distributed ledger. Every new transaction is built on two previous transactions, so long as a new incoming transaction, verifies two previous transactions, the Tangle network can keep growing making IOTA highly scalable.
· It is ternary: IOTA is not binary (zeros and ones) like all other cryptos, instead it is based on a ternary model of computation. This means that three possibilities or states can exist in this network: negative, zero and positive. It gives more power to the network than binary computations can.
· It is supported by custom hardware: JINN processors which are “general-purpose-processors” that can conduct thousands of transactions per second. Unlike binary processors, they can go into three states: +, – and zero due to their ternary model. JINN processors will help IOTA scale in the future and work with newly designed technologies with ease. These processors are not very popular right now, and publicly very little is known about them.
Let's compare IOTA to a blockchain with an example to understand it:
· On a Bitcoin blockchain, if a person A sends bitcoins to person B, the transaction will have to be validated by a miner and when a miner approves a transaction, it becomes sealed into the bitcoin ledger as part of the mined block, and the miners have incentives in the form of fees.
· IOTA Tangle works a little differently: each sender and receiver has to be the approver of two previous transactions. Since there are no miners involved, the transactions are free. Instead, a node (sender/receiver) first approves two transactions according to an algorithm. It double checks if the two transactions it approves are not conflicting, and then solves a cryptographic puzzle to validate the transaction.
Let us look at it in more detail: The algorithm forces you to traverse the DAG by going to the same path indirectly. So, A cannot approve B’s transaction directly. However, if there is a path of at least two previous transactions that connect A and B, A will approve the two previous transactions while traversing this other path. Once both these transactions are approved, B’s transaction will be approved as well. As more and more of the transaction paths between A and B get approved by different nodes in the network, the transaction gets solidified.
· What happens when nodes find a conflicting transaction?
· Tangle is an asynchronous network. This means that conflicting transactions can exist in the network. However, when such a transaction comes forth, one will eventually have to be orphaned.
· So how does the network decide if one transaction will become orphaned and other will stay?
· The network checks how ‘connected’ the pathway of transactions from A to B is. This means that the more ‘connected’ or ‘validated’ the previous two transactions for either of the conflicting transactions is, the more likely it is to stay. More validation leads to more ‘cumulative weight’ of the transaction. If transaction 1 has more cumulative weight than a conflicting transaction 2, transaction 1 will stay while transaction 2 becomes invalid.
Key Limitations that are still worked upon in the Beta phase
Security vulnerabilities
IOTA has had its share of past security vulnerabilities. In an MIT study, researchers found that the Curl hash function could be used to create an unpredictable output from a given input. The IOTA team has since patched this vulnerability. The continues testing still on in the current phase.
Threat of Spammers
IOTA, as it grows further, could eventually lead to groups of spammers on the network who create their own mini-Tangle networks within the system that can potentially have more cumulative weight. These spammers may aggressively put out smaller transactions to gain more cumulative weight and dash out honest transactions with lesser weight. Although IOTA has shifted through this possibility in their white paper, it is yet to be tested as the Tangle network grows, and remains a valid security concern.
IOTA and the double-spending problem
As IOTA is an asynchronous network, the ledger does not necessarily have to tally at the end of the day. Unlike blockchain, there is no miner who decides which transaction gets to stay in order to make the ledger synchronous. IOTA confuses people because of the double spending problem — how does IOTA avoid two conflicting transactions, where the same IOTA has been double spent?
How does IOTA avoid double spending problem?
Every node must approve two transactions in Tangle before making its own transaction. Some other node will then approve your transaction to validate it. This gives each transaction a weight, which later helps in validation, in case there is a double spending problem.
Assume there are two conflicting transactions Tx1 and Tx2 recorded in the Tangle ledger. The cumulative weight of these transactions will decide which one gets to stay. If Tx1 has more cumulative weight than Tx2, it will get "approved" and Tx2 will become stagnant and ultimately perish.
Conclusion
IOTA is gaining traction in the tech industry and is one of the most innovative project in this space. It is currently worth billions of dollars by market valuation and as tech giants like Microsoft continue to work with it, IOTA will gain more precedence in the future.