<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>S-trilogy &#8211; Deqode Blog</title>
	<atom:link href="https://deqode.com/blog/tag/s-trilogy/feed/" rel="self" type="application/rss+xml" />
	<link>https://deqode.com/blog</link>
	<description>Articles about blockchain and the future of technology</description>
	<lastBuildDate>Tue, 22 Oct 2024 13:32:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>

<image>
	<url>https://deqode.com/blog/wp-content/uploads/2019/02/cropped-favicon-32x32.png</url>
	<title>S-trilogy &#8211; Deqode Blog</title>
	<link>https://deqode.com/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>S-Trilogy, Part Three: Direct Acyclic Graph, IOTA and Byteball</title>
		<link>https://deqode.com/blog/2019/02/15/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/</link>
		<comments>https://deqode.com/blog/2019/02/15/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/#respond</comments>
		<pubDate>Fri, 15 Feb 2019 13:09:02 +0000</pubDate>
		<dc:creator><![CDATA[Prateek Gupta]]></dc:creator>
				<category><![CDATA[Basics of Blockchain]]></category>
		<category><![CDATA[blockchain]]></category>
		<category><![CDATA[S-trilogy]]></category>

		<guid isPermaLink="false">https://deqode.com/blog/?p=3923</guid>
		<description><![CDATA[<p>This space marks the final article in the S-trilogy &#8211; a series of articles focused on blockchain scalability. If you have missed the previous ones, we would highly recommend you to read them by clicking here, and here. In the bitcoin blockchain, a block is created every 10 minutes and the size limit of a [...]</p>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/15/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/">S-Trilogy, Part Three: Direct Acyclic Graph, IOTA and Byteball</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p><em>This space marks the final article in the S-trilogy &#8211; a series of articles focused on blockchain scalability. If you have missed the previous ones, we would highly recommend you to read them by clicking </em><a rel="noreferrer noopener" aria-label="here (opens in a new tab)" href="https://deqode.com/blog/blockchain-scalability-one/" target="_blank"><em>here</em></a><em>, and </em><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://deqode.com/blog/s-trilogy-part-two-state-channels-and-plasma/" target="_blank"><em>here</em></a>.</p>



<p class="has-drop-cap">In the bitcoin blockchain, a block is created every 10 minutes and the size limit of a block is 1 MB. This limits the total number of transactions possible in a particular period of time. As we know from our previous articles in the S-series, Ethereum has better throughput than Bitcoin, but it is limited by the block gas limit. Many different projects such as Plasma, Raiden and Lightning Network are trying to solve this problem, as explained in the previous part of this series. This article will take our discussion further, and talk about <g class="gr_ gr_16 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="16" data-gr-id="16">directed</g> acyclic graph.</p>



<h2> Directed Acyclic Graph (DAG) </h2>



<p>Directed acyclic graph solves the issue of scalability by taking a totally different approach. There are no <em>blocks</em> and no concept of <em>mining</em>. In a directed acyclic graph, one transaction validates the other to get approved. So, instead of a miner validating all the transaction in a block as in the case of <g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="13" data-gr-id="13">blockchain</g>, each new transaction validates old transactions in DAG. Every new transaction adds to the security of the directed acyclic graph. This results in a graph like structure instead of a chain of blocks.</p>



<h4>So, what is a directed acyclic graph ?</h4>



<p>A directed acyclic graph is composed of vertices and edges. Vertices represent transactions. An edge is directed from the new transaction (child) to a transaction (parent) it has validated. The first transaction of the network is the <em>Genesis transaction</em>. A parent vertex will never validate a child vertex which makes the graph acyclic. Transactions that don’t have any child transactions are referred as <em>tips</em>.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://deqode.com/blog/wp-content/uploads/1-1.png" alt="" class="wp-image-3924" srcset="https://deqode.com/blog/wp-content/uploads/1-1.png 569w, https://deqode.com/blog/wp-content/uploads/1-1-300x84.png 300w" sizes="(max-width: 569px) 100vw, 569px" /><figcaption>G is the Genesis Transaction </figcaption></figure></div>



<h5>The graph is directed and acyclic, and hence the name.</h5>



<p>If there is a directed edge from transaction A to transaction B, then we could say transaction A directly approves transaction B. If the length of the path from A to B is more than one, we could say transaction A indirectly approves transaction B.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://deqode.com/blog/wp-content/uploads/2-1.png" alt="" class="wp-image-3925" srcset="https://deqode.com/blog/wp-content/uploads/2-1.png 529w, https://deqode.com/blog/wp-content/uploads/2-1-300x166.png 300w" sizes="(max-width: 529px) 100vw, 529px" /><figcaption> <br>In above figure transaction 7 directly approves transactions 4, 5 while it indirectly approves transactions 2, 3, 1. All the transactions directly or indirectly approve transaction 1, the genesis transaction; transaction 10 is a Tip. </figcaption></figure></div>



<p><g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="13" data-gr-id="13">Directed</g> acyclic graph is also based on peer-to-peer network similar to <g class="gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="14" data-gr-id="14">blockchain</g>. In DAG, nodes are distributed throughout the world. Each of them maintain their own copy of the ledger. The transactions are added in a fraction of time in the network. Thus, the DAG network is asynchronous, which makes the system fast. In a directed acyclic graph, you can have a bunch of transactions in parallel and the degree of parallelism adapts dynamically to the current load.</p>



<p>In case of blockchain, the blocks are linked linearly. Their spacing in time and their size are optimized for near-synchrony among nodes. This leads to a cap on the block size which results in a cap on the throughput of the network. If we increase the block size as per traffic, it takes too long for a block to propagate to all nodes in the network. In such situations, there is greater uncertainty about which block is the last block to be added to the network. This leads to chain reorganisation, as discussed in the part one of <a href="https://deqode.com/blog/tag/s-trilogy/">S-trilogy</a>. More resources are wasted on extending chains that would later be orphaned.</p>



<p>To understand the technology, we will go through two hot projects currently based on DAG &#8211; <strong>IOTA</strong>&nbsp;<g class="gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Punctuation only-ins replaceWithoutSep" id="5" data-gr-id="5">and</g>&nbsp;<strong><g class="gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="4" data-gr-id="4">Byteball</g></strong>. The mechanism behind these two projects will also help you understand how directed acyclic graph solves the double spending problem .</p>



<h2 id="b3d5">IOTA</h2>



<p>IOTA is, by design, a cryptocurrency for the Internet-of-Things (IoT) industry. The importance of micro-payments is indispensable in the rapidly developing IoT industry, and to pay a fee that is larger than the amount of the value being transferred is not logical. This makes blockchain-based cryptocurrencies such as Bitcoin and Ether unsuitable for such transactions. IOTA is based on DAG which is referred as<em>&nbsp;Tangle</em>&nbsp;in their whitepaper.</p>



<p>Instead of a miner validating a transaction, in IOTA, each transaction must validate at least two previous transactions to get approved. This is analogous to an examination hall where, instead of an invigilator checking for cheating in an exam, each student is programmed in a way that he checks at least two unchecked students.</p>



<h4><strong>Weight of a Transaction</strong></h4>



<p>There are two types of weights associated with a transaction. First is the transaction&#8217;s own weight and second is the cumulative weight.</p>



<ul><li>Transaction&#8217;s own weight refers to the amount of work (POW) put in by the node in issuing that transaction. This weight can only be in the form of  3^n.</li><li><g class="gr_ gr_15 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="15" data-gr-id="15">Cumulative</g> weight of a transaction is the sum of its own weight and the <em>self</em> weights of all transactions directly or indirectly approving it.&nbsp;<strong>Cumulative weight is <g class="gr_ gr_44 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="44" data-gr-id="44">very</g> important term as it represents the importance of a transaction.</strong> <strong>&nbsp;</strong>More the weight of a transaction, less likely for it is to get orphaned.</li></ul>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*l13STomLgezpXiH0BGeT1g.png" alt=""/><figcaption>Own Weight and Cumulative Weight</figcaption></figure></div>



<p>In <g class="gr_ gr_6 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="6" data-gr-id="6">above</g> figure, each transaction has cumulative weight and its own weight. Cumulative weight is represented in bold and the <em>self</em> weight is represented in the bottom right corner of that transaction.</p>



<h6>For example, Transaction B has own weight of three and cumulative weight of four. Cumulative weight of B = own weight of B + own weight of A,  since, A is the only transaction approving it.</h6>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*ZnJDEsHVEl_iaZaGQEI03Q.png" alt=""/><figcaption>Figure4</figcaption></figure></div>



<p>In the above figure, when a new transaction X with its own weight equal to three is added to the tangle it approves tips A and C. It directly or indirectly increases the cumulative weight of every transaction by three.</p>



<h4><strong>Score of a Transaction</strong><br></h4>



<p><em>The score of a transaction = Sum of own weights of all transactions approved by this transaction + Own weight of the transaction itself.</em></p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*keWYYI_hZTOECsp1XG_b0w.png" alt=""/><figcaption>Figure 5</figcaption></figure></div>



<p>Score of transaction A = own weight of transactions D,B,F,G + A’s own weight = 9<br>Score of transaction C = own weight of transactions D,E,F,G + C’s own weight = 7</p>



<h4><strong>Height of a transaction</strong></h4>



<p>Length of the longest path from the transaction to genesis transaction of Tangle.<br></p>



<h4><strong>Depth of a transaction</strong></h4>



<p>Length of the longest path from some tip to the transaction.<br></p>



<h4><strong>Lazy tip</strong></h4>



<p>A node might not want to keep up to date with the current state of the ledger. It might approve same old two transactions for all of its own new transactions. Such new transactions are called <em>lazy tips</em>. Also, this behavior is not appreciated as no new transactions are getting validated by this node. New transactions from honest and hard working nodes must not approve such tips.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*7X2N2RkTw3zFaLS7n1C1zA.png" alt=""/><figcaption>Figure 6. 14 is Lazy&nbsp;Tip</figcaption></figure></div>



<h3><strong>Tip selection algorithm</strong></h3>



<p>The strategy for determining the two tips to approve is very important, and is the key to IOTA’s unique technology. Since there are usually no ways to enforce a particular tip selection strategy, there must be a good reason for nodes to voluntarily choose to follow a common strategy. A possible&nbsp;reason is knowing that a good portion of other nodes are following the same strategy.</p>



<p>If we choose any 2 random tips then our problem of lazy tips will not be solved. To solve this problem IOTA uses<em><strong> weighted random walks</strong></em> as described below.</p>



<p>In this algorithm, we start a walk from the g<g class="gr_ gr_27 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="27" data-gr-id="27">enesis</g> transaction towards the tips. At each transaction, we choose one of the transactions directly approving this transaction. More the cumulative weight of a transaction more is the probability of choosing that transaction. In this way, we ultimately choose a tip for approval.</p>



<h5>How does this solve the lazy tip problem?</h5>



<p>In figure 6, when we arrive at transaction 3, two transactions approving it are transaction 5 and transaction 14. The cumulative weight of transaction 14 will be much less than that of 5 until and unless 14 has very high own weight. If the <g class="gr_ gr_10 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="10" data-gr-id="10">cumulative</g> weight of 5 is much more than <g class="gr_ gr_11 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="11" data-gr-id="11">probability</g> of choosing 14 will become very low. Hence, we will be able to avoid lazy tips.</p>



<p>So, why not choose the transaction with most cumulative weight with the probability of 1?&nbsp; In figure 6, suppose 4 is the genesis transaction. Transactions 5, 6 and 7 are approving it directly. Assume that the cumulative weight of the transaction 6 is highest. The algorithm will always choose transaction 6. This will cause a problem as the tips 12 and 13 will never be chosen. Thus, some of the transactions may never get approved.</p>



<p>If the probability is too high that might leave transactions unapproved. If the probability is zero that might approve a lazy tip. Thus, the value of probability, represented by&nbsp;<em>α&nbsp;</em>needs to be chosen cautiously. This algorithm is known as&nbsp;<strong><em>Markov Chain Monte Carlo algorithm</em></strong><em>.</em></p>



<h3><strong>How are IOTA tokens issued? Can someone mine IOTA tokens?</strong></h3>



<p>There is no mining of IOTA tokens. All tokens are considered to be present at an address in the beginning which were then transferred to founder addresses in the <g class="gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="4" data-gr-id="4">genesis</g> transaction.</p>



<h5><strong>If there are no miners, how are transactions validated? What happens if a conflicting transaction is added in a Tangle?</strong></h5>



<p>Each node checks if the approved transactions are conflicting. If a node finds that a transaction is in conflict with the <g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar multiReplace" id="12" data-gr-id="12">tangle</g> history or it double spends other transaction, the node will not approve the conflicting transaction in either a direct or an indirect manner. If it validates a conflicting transaction, it fears that the majority of honest nodes will not approve the new transaction.</p>



<p>The local ledger of every node stores the conflicting transactions. Nodes don’t have to come to a consensus to decide which transaction has the right to be in a ledger, all they have to decide is to not approve conflicting transactions. The fraud transactions will ultimately get orphaned. An orphaned transaction is not dropped from the ledger. It will still be stored in the ledger.</p>



<h6>But no one directly or indirectly approves the orphaned transactions.</h6>



<p>In an IoT network, nodes are devices with specialized chips and they all follow the same set of protocols. It is not suitable for an attacker to submit a conflicting transaction. To do so, he must first reconfigure all other nodes to follow different set of protocols. So, it is best for a node to follow the same set of protocols as the rest of the network.</p>



<h4><strong>Confirmation Confidence</strong></h4>



<p>Suppose A pays to a merchant M in IOTAs for buying shoes. A might have double spent this same transaction to some other merchant also. Fraud transaction will be ultimately orphaned as discussed above. But,  it will take some more time after the initial confirmation.&nbsp;</p>



<h5>How will M decide when to deliver shoes to him?&nbsp;</h5>



<p>The merchant can decide this, using the <em><strong>tip selection algorithm</strong></em>. Many iterations of tip selection algorithm are run and the percentage of tips that directly or indirectly approve the specified transaction is calculated. That represents <em><strong>confirmation confidence</strong></em>. If out of 100 tips 80 tips directly or indirectly approve the transaction, confirmation confidence is 80%. More the confidence more difficult to double spent that transaction. Merchant M can set his own criteria. He may fix a criteria that he will deliver only when confirmation confidence is more than 95%.</p>



<h2 id="605f">Byteball</h2>



<p>Byteball is a decentralized system for&nbsp;storage and transfer of <em>value</em>. It can store arbitrary data and transferable values such as currencies, shares, property titles etc. All this data is stored in storage units. Likewise, transactions which transfer these values are stored <em>as</em> storage units. To make it easier to grasp, you should consider storage units as transactions for this blog, just as in case of IOTA. This article will also refer&nbsp;to ‘storage units’ just as ‘units’.</p>



<p>Each storage unit includes one or more hashes of earlier storage units. Hence, confirming them and establishing their&nbsp;partial order, i.e., which storage unit was stored first in the ledger.<strong>&nbsp;</strong>In IOTA , one transaction has to approve at least two other transactions, this is not compulsory in Byteball. A transaction has to confirm one or more storage units. This is discussed in detail ahead.</p>



<h6>The set of storage units and their links form a directed acyclic graph. </h6>



<p>Storage units are vertices and their links are edges in the graph. As more and more storage units are added older storage units get confirmations directly or indirectly just as in IOTA.</p>



<p>Everyone is allowed to add a new unit, provided that he signs it and pays a fee. Byteball charges fees, unlike IOTA. This fee plays an important role in keeping the system healthy.</p>



<h3>Bytes</h3>



<p><strong><em>Bytes</em></strong>&nbsp;is an internal currency in <g class="gr_ gr_7 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="7" data-gr-id="7">Byteball</g> network. To store 1 byte of data a user has to pay 1 <g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="12" data-gr-id="12">byte</g>. Anyone can issue their own currency which can then be transferred to any other user, just like the internal currency, <em>bytes</em>. All these transactions are stored as storage units. If we compare this with e<g class="gr_ gr_11 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="11" data-gr-id="11">thereum</g> environment, <em>bytes </em>is similar to Ether and all these other currencies created by users on <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="8" data-gr-id="8">byteball</g> platform are similar to tokens issued on Ethereum blockchain.</p>



<p><strong><em>Blackbytes</em>&nbsp;</strong>is another currency available on Byteball network. While <em>bytes</em> is easily traceable, it is much more difficult to trace <em>blackbytes</em>.</p>



<h5><strong>Fees in Byteball</strong><br></h5>



<p>As we have discussed before, to store some bytes of data a user has to pay equal number of bytes. This prevents spanning of the ledger with useless messages. The more space your unit takes, the more you have to pay.</p>



<p>For the purposes of calculating unit size, we assume that the unit has exactly two parents, irrespective of the number of the real parents. This is to prevent users who try to approve only a single unit to save fees.&nbsp;</p>



<p>It is good for <g class="gr_ gr_7 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="7" data-gr-id="7">directed</g> acyclic graph to be as narrow as possible. To achieve this, users are incentivized to confirm as many units as possible and as recent unit as possible. We can achieve this in two ways:</p>



<ul><li>Even if many parents are added, fees is same, as discussed above.</li><li>A part of the fees that a new unit pays to store its data is payed to the units which include it first as parent. Other part of the fees is paid to witnesses as discussed later.</li></ul>



<h6>The total number of bytes in circulation is 10^15, and this number is constant. All bytes are issued in the genesis unit, then transferred from user to user.</h6>



<h4><strong>Double Spending in Byteball</strong></h4>



<h6>Two possible scenarios</h6>



<p>There is a partial order between the two units that try to spend the same output, i.e. one of the units (directly or indirectly) includes the other unit, and therefore, comes after it. In this case, we can safely reject the later unit.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*TzWYgWpXXcV_ze9mjTuXRA.png" alt=""/><figcaption>Figure7. Partial&nbsp;order</figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*wV-dZhYKCEEaIijImw4PbA.png" alt=""/><figcaption>Figure8. No partial&nbsp;order</figcaption></figure></div>



<p>In figure 7 above, Red unit tries to double spent Green unit but ther is a partial order between these nodes as Red indirectly confirms Green. In this case, we reject the Red unit. There is no partial order between them. In this case, we accept both. We decide the total order between two units using the <em><strong>Main Chain</strong></em>. This is explained in the next section.</p>



<h5><strong>Witnesses</strong></h5>



<p>The DAG chain does not have a secure timestamp (or block number). The nodes need a reliable source of transactions that are guaranteed to be generated in a defined order. For this we need the help of the witnesses.</p>



<p><em><strong>Witnesses</strong></em> are a list of users on Byteball who are non-anonymous and reputable people or companies, or their businesses depend on the health of the network. Part of the fees paid by all the users to get their transaction approved is allocated to witnesses. It is reasonable to expect them to behave honestly. It is also unreasonable to totally trust any single witness. </p>



<p>We have a fixed number of 12 witnesses. Even in case of hack or power out situation, Byteball network will be healthy. If anyone of these witnesses tries to cheat, it will be easy to identify which address cheated and as these addresses are non-anonymous everyone will know the deceiver, which will destroy his reputation as well as he will loose the incentive from Byteball. The task for these witnesses is to just post transactions serially i.e with a partial order and post these transactions frequently.</p>



<h3><strong>Main Chain</strong></h3>



<p>Based on the transactions posted by the witnesses, a single chain along child-parent links is chosen using an algorithm which can be referred from the Byteball whitepaper. We refer to this chain of transactions as Main Chain. All the units either lie on this chain or can be reached from this chain. This chain is like a highway connecting side roads.</p>



<p>The main chain is indexed from 0 (genesis) in an increasing order. The index number is referred as <strong><em>Mai</em></strong><em><strong>n Ch</strong></em><strong><em>ain Index (MCI)</em></strong>. Units with higher MCI directly or indirectly approves all the units with lower MCI. Therefore, all the units lying on the main chain have their total order defined.</p>



<h6>To solve the problem of double spent we need true order in all of the units in the DAG.</h6>



<p>Total order needs to be defined for units that do not lie on the main chain. The total order of a unit which does not lie on the main chain is equal to the MCI of the unit (on main chain) which&nbsp;<em>first&nbsp;</em>includes the unit directly or indirectly.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*9SYpG61cxoVAK0ogAIqngg.png" alt=""/><figcaption>Main&nbsp;Chain</figcaption></figure></div>



<p>The above <g class="gr_ gr_16 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="16" data-gr-id="16">figure</g> shows two <g class="gr_ gr_19 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="19" data-gr-id="19"><g class="gr_ gr_7 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling" id="7" data-gr-id="7"><em>non-</em></g><em>serial</em></g><em> storage units</em> (shaded in orange), both of these does not lie on the main chain. One of the transactions is&nbsp;<g class="gr_ gr_6 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="6" data-gr-id="6">first</g> <g class="gr_ gr_6 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="6" data-gr-id="6">included</g> by <g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="12" data-gr-id="12">unit</g> with MCI 5 and other is included&nbsp;first&nbsp;by <g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="13" data-gr-id="13">unit</g> with MCI 6. One with MCI 5 wins and is <g class="gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="14" data-gr-id="14">valid</g> unit, the <g class="gr_ gr_15 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="15" data-gr-id="15">other</g> unit is deemed invalid. In case if both the units have the same main chain index there is a tiebreaker rule that the unit with the lower hash value (as represented in base64 encoding) is valid.</p>



<h2>Conclusion</h2>



<p>This marks the end of S- trilogy. Thank you for diving deep with us into blockchain scalability issues. If you have any questions regarding this article, please contact the author at pgupta@deqode.com or <a href="https://deqode.com/contact">drop your email here</a>.</p>



<h4>Sources</h4>



<ul><li>IOTA&nbsp;<a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://assets.ctfassets.net/r1dr6vzfxhev/2t4uxvsIqk0EUau6g2sw0g/45eae33637ca92f85dd9f4a3a218e1ec/iota1_4_3.pdf" target="_blank">Whitepaper</a>.</li><li>Byteball&nbsp;<a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://obyte.org/Byteball.pdf" target="_blank">Whitepaper</a>.</li><li><a rel="noreferrer noopener" href="https://medium.com/coinmonks/scaling-a-blockchain-vs-scaling-a-tangle-8b7182eda980" target="_blank">https://medium.com/coinmonks/scaling-a-blockchain-vs-scaling-a-tangle-8b7182eda980</a></li><li><a href="https://hackernoon.com/a-hitchhikers-guide-to-consensus-algorithms-d81aae3eb0e3" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">https://hackernoon.com/a-hitchhikers-guide-to-consensus-algorithms-d81aae3eb0e3</a></li></ul>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/15/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/">S-Trilogy, Part Three: Direct Acyclic Graph, IOTA and Byteball</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://deqode.com/blog/2019/02/15/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S-Trilogy, Part Two: State Channels and Plasma</title>
		<link>https://deqode.com/blog/2019/02/14/s-trilogy-part-two-state-channels-and-plasma/</link>
		<comments>https://deqode.com/blog/2019/02/14/s-trilogy-part-two-state-channels-and-plasma/#comments</comments>
		<pubDate>Thu, 14 Feb 2019 12:44:33 +0000</pubDate>
		<dc:creator><![CDATA[Prateek Gupta]]></dc:creator>
				<category><![CDATA[Basics of Blockchain]]></category>
		<category><![CDATA[blockchain]]></category>
		<category><![CDATA[S-trilogy]]></category>

		<guid isPermaLink="false">https://deqode.com/blog/?p=3936</guid>
		<description><![CDATA[<p>As we discussed in the first part of this series, scalability is a big issue for mainstream blockchain adoption. The solutions for scalability are mainly classified into 2 categories: layer 1 and layer 2 solutions. In this article, We will discuss the layer 2 solutions, which are state channels and plasma. State Channels As we [...]</p>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/14/s-trilogy-part-two-state-channels-and-plasma/">S-Trilogy, Part Two: State Channels and Plasma</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>As we discussed in the <a href="https://deqode.com/blog/blockchain-scalability-one/">first part of this series</a>, scalability is a big issue for mainstream blockchain adoption. The solutions for scalability are mainly classified into 2 categories: layer 1 and layer 2 solutions. In this article, We will discuss the layer 2 solutions, which are <strong><em>state channels</em></strong> and <strong><em>plasma</em></strong>.</p>



<h2 id="f911">State Channels</h2>



<p>As we discussed in the previous part of the S-trilogy, layer 2 solutions try to squeeze in the maximum number of possible operations with currently available throughput. A second layer is built in layer 2 solutions, which hinges around the first layer.</p>



<h3>State Channels &#8211; A Layer 2 Solution</h3>



<p>State channels follow the same principle, and are a layer 2 solution. Firstly, a channel is created on-chain. Secondly, transactions are made off-chain, and <g class="gr_ gr_18 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Punctuation only-ins replaceWithoutSep" id="18" data-gr-id="18">finally,</g> <g class="gr_ gr_16 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar only-ins replaceWithoutSep" id="16" data-gr-id="16">net</g> result is settled on-chain. Even if you send millions of transactions off-chain, your gas fees <g class="gr_ gr_17 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Grammar multiReplace" id="17" data-gr-id="17">is</g> still very low, because only a small number of on-chain transactions is needed to secure the settlement . This opens up the doors for micro-payments using public blockchain.</p>



<h6>Transactional capacity is increased dramatically as channels are net-settled on the blockchain.</h6>



<p>Bitcoin is implementing this concept of state channels to make payments scalable and with a project called the <strong><em>Lightning Network</em></strong>. <strong><em>Raiden</em></strong> is Ethereum’s version of Bitcoin’s Lightning Network. Both of these projects are in the development phase. These projects are quite similar and discussing any one of these will be sufficient enough to understand the concept of state channels. We will be discussing Raiden in this blog. <g class="gr_ gr_77 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar replaceWithoutSep" id="77" data-gr-id="77">As</g> these projects are focused on making payments scalable, we refer to these channels as<strong><em> payment channels</em></strong>.</p>



<h2 id="e0ba">Raiden</h2>



<p>For understanding this section, you should have a basic understanding of what <a href="https://medium.com/deqode/erc-token-standards-for-dummies-like-me-b6b8ace0f303">ERC20 tokens are and how they work</a>. Also, you should have a basic understanding of <a href="https://deqode.com/blog/concepts-blockchain-technology/">what smart contracts are and how they work</a>.</p>



<h6>Raiden is a scaling solution for transfer of ERC20 tokens on ethereum blockchain. </h6>



<p>As we discussed before, it is built on the concept of payment channels. Instead of making thousands of on-chain transfer of these tokens, we can send these transactions off-chain with ultimate settlement on-chain leading to minimum fees and maximum throughput. It is actually a system of smart contracts built on Ethereum blockchain which allows these fast and cheap token transfers between two parties.</p>



<h4>How does it work?</h4>



<p>Suppose A and B want to make cheap and fast ERC20 token transactions using payment channels. They need to take the following steps:</p>



<ol><li>A channel with a channel Id will be created on-chain where atleast one of them will escrow some amount of ERC20 tokens. Assume both of them deposit 10 tokens each, which means the initial state of channel is [10,10].</li><li>A transfers 4 tokens to B. They both sign a message which stores the current state of channel as [6,14] with the timestamp. This means that both of them agree to the current state of channel and they cannot refute their signature. These signed messages are just like checks &#8211; which once signed cannot bounce back. Signed message is not updated on blockchain instead both parties keep a copy of it. Let’s name this copy of message as SM1.</li><li>B transfers 8 tokens to A. Current state of channel becomes [14,6]. They both sign a message with current state and the timestamp and keep a copy of it with them. Let’s name this copy of message as SM2.</li><li>Any one of them can settle the channel by providing the channel Id and latest signed message to the Raiden smart contract. 14 tokens will be transferred to address of A and 6 tokens to address of B.</li></ol>



<h4>Challenge Period</h4>



<p>Now, what if B submits the signed message, SM1? Raiden contract doesn’t know that there is another signed message SM2. So, B can cheat this way and get himself 14 tokens. This is why there is a <em>challenge period</em> where A can submit the copy of signed message SM2. As its time stamp is higher than that of SM1, Raiden contract will settle the channel in <g class="gr_ gr_13 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="13" data-gr-id="13">favour</g> of A giving him 14 tokens. If A does not submit his proof before challenge period is over, <g class="gr_ gr_10 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="10" data-gr-id="10">channel</g> is settled in <g class="gr_ gr_14 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="14" data-gr-id="14">favour</g> of B.&nbsp;If both A and B are honest, <g class="gr_ gr_11 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="11" data-gr-id="11">channel</g> can settle immediately as soon as both of them submit the same signed message.</p>



<h3><strong>Raiden Network</strong></h3>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*nHM9z5F3AqSL1eWi--Y9gA.png" alt=""/><figcaption>Source:&nbsp;<a href="https://medium.com/r/?url=https%3A%2F%2Fcoincenter.org%2Fentry%2Fwhat-is-the-lightning-network" rel="noreferrer noopener" target="_blank">Link</a></figcaption></figure></div>



<p>You don’t need to open a new channel with every new party you want to transact with. Raiden is constructed as a network. This means, although Alice in the figure above might not yet have an open payment channel with Dave, she is indirectly connected to Dave via Bob, or even using multiple steps in between. With the Raiden Network, users are able to transact with anyone who is connected to their network of payment channels through multiple hops. Bob cannot steal Alice’s funds, as he will only receive the sender’s incoming payment if he has already sent the outgoing payment to the recipient.</p>



<p>Let us understand this with another example. Suppose you have to receive a check from a person with whom you have no contact. It is entirely sufficient if you know someone who knows someone &#8211; who eventually knows someone &#8211; that knows this other person. They all pass checks on to each other until one finally reaches you. But all of them are only valid if you confirm to everyone that you have received yours in the end. None of the middle man can take away your check and this is achieved using cryptography tricks. These middle man can be incentivized with a fees for a healthy network.</p>



<h4><strong>Benefits of Raiden Network</strong></h4>



<h5>Scalability</h5>



<p>Most of the transactions are made off-chain, bigger the network the lesser number of on-chain transactions. This will make the system highly scalable.</p>



<h5>Latency</h5>



<p>It takes about <a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://etherscan.io/chart/blocktime" target="_blank">15–30 seconds</a> to mine a new block in Ethereum. For the finality of transaction, we need to wait for some number of confirmations. Many exchanges wait for 32 confirmations before finalizing a transaction. In Raiden Network, once you have the signed message you can be certain that you hold the amount included in the message. There is no need to wait for any confirmations.</p>



<h5>Transaction Fees</h5>



<p>Transaction fees is much lower, as only a very small fraction of transactions is made on-chain. Combined fees on all transactions is greatly reduced in comparison to a case where all transactions are made on-chain.</p>



<h5>Privacy</h5>



<p>Privacy is improved as only net settled transaction is stored on public blockchain. All transactions are not visible to the entire world.</p>



<h2 id="ddaf">Plasma</h2>



<p>Plasma is a scaling solution proposed by Joseph Poon and&nbsp;<a rel="noreferrer noopener" href="https://medium.com/@VitalikButerin" target="_blank">Vitalik Buterin</a>. They have published a&nbsp;<a href="https://plasma.io/plasma.pdf" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">whitepaper</a>&nbsp;on Plasma. Joseph Poon is also coauthor of Lightning Network whitepaper.</p>



<p>Plasma is blockchain within blockchains. Root blockchain, the main Ethereum blockchain, has many child plasma blockchains and each of those blockchains can have their own child blockchains. It is a series of smart contracts which runs on top of a root blockchain, this allows for many blockchains within root blockchain. Root blockchain contract processes only a tiny amount of commitments from child blockchains hence providing high scalability.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*mG5O2C8fBf1rgFW7HREoAQ.png" alt=""/><figcaption><strong>Figure1</strong>&nbsp;Plasma Chains built on Root&nbsp;Chain</figcaption></figure></div>



<p>Separate plasma contracts can be deployed on root chain each working for different purposes such as private blockchain, decentralised exchange, social network, micropayments.</p>



<p>Private blockchains are a beneficial choice for institutions.&nbsp;<a rel="noreferrer noopener" href="https://medium.com/@VitalikButerin" target="_blank">Vitalik Buterin&nbsp;</a>discusses in&nbsp;<a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://blog.ethereum.org/2015/08/07/on-public-and-private-blockchains/" target="_blank">this</a>&nbsp;blog about the comparison between private blockchain and public blockchain. He says that although private blockchain seems more feasible for institutions, public blockchain has its own advantages.</p>



<h6>Plasma makes it possible to run a private blockchain over public blockchain hence providing benefits of both, making it perfect for private institutions.&nbsp;</h6>



<p>Now, that you have a understanding of state channels and plasma &#8211; a solution for the issue of scalability in blockchain, we will move forward to DAG in the next part of this series. Please <a href="https://deqode.com/blog/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/">click here</a> to navigate to the next article in this trilogy.</p>



<p>To learn more about how Deqode is working towards solving the scalability issues of blockchain, drop your email <a href="https://deqode.com/contact">here</a>.</p>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/14/s-trilogy-part-two-state-channels-and-plasma/">S-Trilogy, Part Two: State Channels and Plasma</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://deqode.com/blog/2019/02/14/s-trilogy-part-two-state-channels-and-plasma/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>S-Trilogy, Part One: Understanding Blockchain, Its Scalability Issues, and their Solutions</title>
		<link>https://deqode.com/blog/2019/02/13/blockchain-scalability-one/</link>
		<comments>https://deqode.com/blog/2019/02/13/blockchain-scalability-one/#respond</comments>
		<pubDate>Wed, 13 Feb 2019 14:03:32 +0000</pubDate>
		<dc:creator><![CDATA[Prateek Gupta]]></dc:creator>
				<category><![CDATA[Basics of Blockchain]]></category>
		<category><![CDATA[blockchain]]></category>
		<category><![CDATA[S-trilogy]]></category>

		<guid isPermaLink="false">https://deqode.com/blog/?p=3933</guid>
		<description><![CDATA[<p>This article is the first one in a three part series of beginners&#8217; introduction to blockchain scalability, its problems, and solutions.&#160;You&#160;can&#160;find&#160;the&#160;subsequent&#160;parts&#160;here and here. It all started with Satoshi Nakamoto’s whitepaper that was published in 2008. Before the now-legendary paper was published there was no known way to create an authentic digital currency without the help [...]</p>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/13/blockchain-scalability-one/">S-Trilogy, Part One: Understanding Blockchain, Its Scalability Issues, and their Solutions</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p><em>This article is the first one in a <g class="gr_ gr_83 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="83" data-gr-id="83">three part</g> series of beginners&#8217; introduction to blockchain scalability, its problems, and solutions.&nbsp;You&nbsp;can&nbsp;find&nbsp;the&nbsp;subsequent&nbsp;parts&nbsp;</em><a href="https://deqode.com/blog/s-trilogy-part-two-state-channels-and-plasma/"><em>here</em></a> <em>and</em> <a href="https://deqode.com/blog/s-trilogy-part-three-direct-acyclic-graph-iota-and-byteball/"><em>here</em></a>.</p>



<p>It all started with Satoshi Nakamoto’s whitepaper that was published in 2008. Before the now-legendary paper was published there was no known way to create an authentic digital currency without the help of a centralized authority.</p>



<p>The main issue here was the problem of double spending.</p>



<h2 id="c74c"><em>What is the Double Spending&nbsp;Problem</em>?</h2>



<p>Any digital currency is just another form of digital files. There is no authority stopping anyone from copying these files and sending them to multiple people. For instance assume that Peter has a file that has been saved locally to his computer. There is nothing preventing Peter from simply copying this file as many times as he wants and sharing the file with multiple individuals. This is known as the double spending problem. This same principle can be applied to digital currencies, which is portrayed in the image below.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*AKC-WatA0Ocz-S9Ek31Exg.png" alt=""/><figcaption>Double Spending Problem</figcaption></figure></div>



<p>The only solution to this issue, before Bitcoin, was to trust a central authority to manage these digital files. In such a system, if a single authority cheats &#8211; then the user is doomed and the only way for them to reinforce the breached contract is by taking help of the law, which we know is slow, expensive and uncertain. Another big issue was that this centralization makes the system prone to a single point of failure. </p>



<p>Satoshi Nakamoto&#8217;s whitepaper gave a solution for the double spending problem and made it possible to make digital payments without the need for a central authority, which was Bitcoin. The paper solved this problem by using a&nbsp;trustless peer to peer network. Instead of storing data only in a centralized ledger the data is broadcasted throughout the network using&nbsp;gossip protocol&nbsp;and every peer updates its own ledger. This way within a small period of time, the entire network has the same copy of ledger, or we can say that&nbsp;the <em>whole network has the same state.</em></p>



<h2 id="4de3"><strong><em>What is a transaction and what is a&nbsp;block?</em></strong><em></em></h2>



<p><strong>A transaction is an exchange of assets between 2 users</strong>, for example,&nbsp;bitcoins are assets on the bitcoin blockchain.&nbsp;An exchange of bitcoins among peers is known as a transaction. <strong>A block is the collection of these transactions.</strong>&nbsp;Every single transaction is not propagated throughout the network, instead, a block once filled is propagated in the network.&nbsp;Every block has a fixed maximum size or the number of maximum number of transactions it can have.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*hJD69VVNkcWIToRChyJ6YA.jpeg" alt=""/><figcaption>Exchange of&nbsp;assets</figcaption></figure></div>



<p>All the blocks are lined up one after other and&nbsp;each block includes the hash of the previous block, in this way forming a chain.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*h4xapRPusA_4E5d8Xs7PDA.png" alt=""/><figcaption>Hash from previous block is stored in next&nbsp;block&nbsp;</figcaption></figure></div>



<h2 id="b00e"><strong><em>How is double spending prevented?</em></strong></h2>



<p>A network is composed of nodes (the peers). Some of the nodes are miners. Any node can become a miner, and no permission is needed because it is a public ledger. In simplest terms, miners compete with each other to solve a computational puzzle. One who solves it first broadcasts the block which has a collection of transactions &#8211; that miner validates and confirms that there is no double spending. He also broadcasts the solution of the puzzle so that everyone can verify that he has actually solved the puzzle. All nodes also verify the transactions in the block before adding that block in their own copy of ledger. In case a miner has added a double spent transaction in the block the nodes will reject that block and that block will be dropped.</p>



<h2 id="428d"><em><strong>Why would anyone want to be a&nbsp;miner?&nbsp;</strong></em><strong></strong></h2>



<p>A miner who solves the puzzle and broadcasts the block gets a fixed number of native currency. For example: bitcoins in bitcoin blockchain, miner also gets the transaction fees paid by the user. Miner can choose the transactions that he wants to add in his block, <g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Punctuation only-ins replaceWithoutSep" id="13" data-gr-id="13">generally</g> miners choose transactions with high fees first, so as to maximize their profit.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*DcvT85Ul_CJAFFRqt4o3kA.png" alt=""/><figcaption> <br>Miner </figcaption></figure></div>



<h2 id="160d"><em>Why do we need to waste all this energy to solve a&nbsp;puzzle?</em></h2>



<p>Consider the following attack scenario to understand.</p>



<p>Suppose an attacker wants to double spend a transaction that is in block number 1000 and current block number is 1005. The attacker will make a change in block number 1000 but he can change it only in his own node, as the state of blockchain is same at all other nodes. Attacker forks his own chain from the main chain and adds new blocks to this forked chain and hopes that everyone in the network accepts his chain.</p>



<p>There can be two cases from here.&nbsp;</p>



<ul><li>Attacker’s hashing power (computational power to solve the puzzle) is less <g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="10" data-gr-id="10">then</g> 50% of the total hashing power. The speed with which his chain size increases will be less than that of the honest chain.</li><li>Attacker’s hashing power is more <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="8" data-gr-id="8">then</g> 50% of the total hashing power. The speed with which his chain size increases will be more than that of the honest chain.</li></ul>



<h3>Longest Chain Rule</h3>



<p><strong><em>All nodes follow the longest chain rule</em>&nbsp;i.e. the longest chain has most work done on it and so it is honest.&nbsp;</strong></p>



<p>So in the former case, attacker chain length will be less than honest chain, the probability of successful attack is less and hence attacker will not be able to double spend.</p>



<p>In the latter case attacker chain length will get longer than honest chain and suppose that after 2 hours, length of honest chain is now 1010 and that of attacker chain is 1011. All nodes will update to the chain of attacker and the blocks from 1000 to 1010 mined in honest chain will be dropped. The computational power spent to change a block increases with the depth of the block being changed. If the value of double spending exceeds the computational power cost, it is not sensible to perform such an attack.</p>



<p>Once many blocks are mined on top of a block the transactions in that block may be considered as irreversible.This attack scenario explains the importance of solving a computational expensive puzzle.</p>



<p><strong>This requirement that expensive computations be performed in order to facilitate transactions on the blockchain is popularly known as Proof Of Work.</strong></p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*oQgKzYMY9xmaXN5vQ-MvKA.png" alt=""/><figcaption>Mining Bitcoins not&nbsp;Gold</figcaption></figure></div>



<h2 id="c0f0">Scalability Issues with Blockchain</h2>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*V8BS0bX_Rq5-rVVSabAqhg.jpeg" alt=""/><figcaption>Scalability is the last&nbsp;hurdle</figcaption></figure></div>



<p>Bitcoin and Ethereum are based on the <g class="gr_ gr_31 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="31" data-gr-id="31"><g class="gr_ gr_29 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="29" data-gr-id="29">above</g> explained</g> technology and we all know how popular they are today. Despite the amazing <g class="gr_ gr_7 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="7" data-gr-id="7">technology</g> there are some problems. The main issue that this technology is facing today is the problem of scalability.</p>



<p>The throughput is small, for bitcoin it is in single digits while throughput of Visa is in 1000s of tranactions per second. As more and more people start adopting bitcoin, the transaction fees will rise (demand is more than supply) thus making small value transactions in bitcoin futile (fees will be more than the value of <g class="gr_ gr_10 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="10" data-gr-id="10">transaction</g>).&nbsp;</p>



<p>Recently on Ethereum, a game named cryptokitties took off and the traffic became high thus increasing the transaction fees and number of pending transactions by many folds. The issue of scalability is the biggest barrier for mass adoption of these currencies.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn-images-1.medium.com/max/800/1*h1p2IQdq2_MCBWfjxeuAVA.png" alt=""/><figcaption><a href="https://medium.com/r/?url=https%3A%2F%2Fwww.theatlas.com%2Fcharts%2Frkt8jKMZz" rel="noreferrer noopener" target="_blank">Link</a></figcaption></figure></div>



<p>Throughput of blockchain is limited by the fixed size of a block and the propagation time of a new block through the whole peer to peer network.</p>



<h2 id="8811">Solutions to the Scalability Problem</h2>



<p>The scalability issue is the most prominent field of research in the blockchain world. Many different solutions are being proposed to solve the issue. These solutions can be classified into two types:</p>



<h3 id="ecde"><strong>Layer 1 Solutions</strong></h3>



<p>These solutions change the blockchain protocols to deal with the problem of scalability.&nbsp;</p>



<h4><strong>Segregated Witness (SegWit)</strong></h4>



<p>This is exclusive to Bitcoin. It is a small improvement in the bitcoin protocol which increases the throughput by fitting more transactions in a single block by re-weighing the signatures of transaction data. Signature data of every transaction is moved from the main chain to the parallel side chain which frees up space in the block. Still, the throughput will be in single digits and hence not a solution for mass adoption of bitcoin. <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="8" data-gr-id="8">SegWit</g> is currently active in the present bitcoin blockchain.</p>



<h3><strong>Block Size Increase</strong></h3>



<p>Right now as per bitcoin protocol the size of the block is limited to 1 MB this limits the throughput of the bitcoin network.&nbsp;</p>



<h4><strong><em>Why don’t we just increase the size of the block?</em></strong></h4>



<p>This is currently a topic of debate, a part of bitcoin community believes that increasing block size is necessary for mass adoption of Bitcoin. As it will prevent increase of gas price at times of high traffic. They also believe that SegWit is not a permanent fix and size of blocks must be increased. When SegWit was implemented this community forked a new blockchain ‘Bitcoin Cash’ which does not implement SegWit and has a block size of 8MB.</p>



<p>Other part of the community believes that increasing the block size will centralize the Bitcoin network. As the block size increases, the amount of processing power required to mine a block will increase. This will make it impossible for small scale miners to mine a block and all the power will shift to a handful of miners. Thus making 51% attack more possible. Some of them also believe that Bitcoin should only be used as a store of value like gold.</p>



<p>Increasing block size will cause other problems as well. Size of the block is related to the propagation time of a new block through the network. More the size of the block more time it takes for each node to validate transactions in it. A node propagates a block only after it has validated the block. Increasing block size will increase the propagation time of new block through the whole network.</p>



<h4>Chain Reorganization</h4>



<p>Suppose there are 2 honest miners A and B, in two different parts of the world. A solves the puzzle and broadcasts his block in the network. Before this block reaches B, B has also solved the puzzle and he also broadcasts his block. So some of the nodes in the network have added the block mined by A to their local copy of ledger and others have added the block mined by B. Ultimately one of these blocks is dropped. This is known as chain reorganization.&nbsp;</p>



<p>Although the dropped block had honest transactions it got dropped. All the hashrate is wasted which could have been used to mine another block which would have made the network more secure. More the size of the block more the wastage of hashrate.</p>



<p><strong>Sharding<br></strong>Any transaction that takes place on the ethereum network has to be validated and stored by each node in the network so that every node has the same state. This puts a limit on the throughput on a protocol level. Hence, no matter what the implementation, without changing the protocol it is difficult to solve the scalability issue.&nbsp;</p>



<p>What if all nodes don’t have to process each transaction? The network is divided into some sections which can work semi-independently. Each section could process a different batch of transactions and hence increase the throughput by many folds. Each of these sections is termed as ‘shard’. This is the idea behind sharding.</p>



<h4 id="2b57"><strong>Layer 2 Solutions</strong></h4>



<p>Layer 2 solutions don’t change anything on the protocol level. They are built on top of the same protocols, a kind of a second layer on top of Layer1.</p>



<p>The purpose is to make maximum possible use from available throughput. We try to squeeze in maximum possible number of operations. This works by creating a second layer which is hinged around first layer. All the transactions in Layer2 take place off chain, those transactions need not to be included in Layer1 instantly. All the transactions are recorded off chain. The net result is finally pushed in the Layer1 thus giving them security of Layer 1.&nbsp;</p>



<p>Although the finality of the transaction is less in Layer2 transactions than Layer1 transactions. Layer2 transactions are also secure and final enough for many practical purposes. </p>



<p>State Channels and Plasma are a few examples of the proposed Layer2 solutions. We will discuss them <a href="https://deqode.com/blog/s-trilogy-part-two-state-channels-and-plasma/">here</a>.</p>



<p>Must read: &#8220;<a href="https://deqode.com/blog/fortnite-blockchain/">Victory Royale: How Blockchain Could Fix Fortnite</a>&#8220;</p>
<p>The post <a rel="nofollow" href="https://deqode.com/blog/2019/02/13/blockchain-scalability-one/">S-Trilogy, Part One: Understanding Blockchain, Its Scalability Issues, and their Solutions</a> appeared first on <a rel="nofollow" href="https://deqode.com/blog">Deqode Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://deqode.com/blog/2019/02/13/blockchain-scalability-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/


Served from: blog.deqode.com @ 2026-10-16 20:02:46 by W3 Total Cache
-->