{"id":9006,"date":"2020-03-28T13:40:35","date_gmt":"2020-03-28T08:10:35","guid":{"rendered":"https:\/\/bitcoinik.com\/?st-import=a944d682cd9d1ac0f4f7d73d745b345d"},"modified":"2020-03-28T13:40:35","modified_gmt":"2020-03-28T08:10:35","slug":"what-is-double-spend-problem","status":"publish","type":"post","link":"https:\/\/bitcoinik.com\/?p=9006","title":{"rendered":"What is Double Spend Problem?"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_91 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#What_does_actually_miner_do\" >What does actually miner do?<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#The_most_common_question_arises_the_difference_between_51_attack_and_double_spend\" >The most common question arises the difference between 51% attack and double spend.<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#What_does_that_mean\" >What does that\nmean?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#Double_Spend\" >Double Spend<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#What_is_BIP\" >What is BIP?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#Also_Read_How_to_Buy_Bitcoin\" >Also Read: How to Buy Bitcoin?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#How_does_Double_Spend_attack_perform\" >How does Double Spend attack perform?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#CONCLUSION\" >CONCLUSION<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#Myths\" >Myths<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/bitcoinik.com\/?p=9006\/#Also_Read_How_Does_Blockchain_Works\" >Also Read: How Does Blockchain Works?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_does_actually_miner_do\"><\/span><strong>What does actually miner do?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Miner just picks some unconfirmed transactions from the mempool and uses the hash of the previous block and tries to find out some output (hash of the current block) continuously. We know that output will surely come out  (sometimes takes a long time than usual)  but the interesting thing is the probability of the next block in the <a href=\"http:\/\/bitcoinik.com\/what-is-blockchain-how-does-blockchain-work\/\" target=\"_blank\" aria-label=\"blockchain (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">blockchain<\/a> will be mined.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, that\u2019s calculated by <strong>hashing power of your machine\/ Total hashing power of the entire network.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Miners find the new block hash using previous block hash which satisfies the output and given difficulty level. After finding that block miner broadcast that blocks to other miners.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_most_common_question_arises_the_difference_between_51_attack_and_double_spend\"><\/span>The most common question arises the difference between 51% attack and double spend.<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>One special property about the blockchain a <\/strong>longer chain is the survival chain. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_does_that_mean\"><\/span><strong>What does that\nmean?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In the case of splitting a chain (Assuming fork), if any problem happens longer chains survive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>So how does it decide which one is the longest chain?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Basically, the chain which has more proof of work is considered as a longer chain and that chain survived and more likely longer chain has more proof of work because any other split chain is shorter than the parent chain and it obviously has less proof of work. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Double_Spend\"><\/span><strong>Double Spend<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In simple words, double spending is an assault where the given arrangement of coins is spent more than once. In more simple words a double spend means the same coins can be used in more than one transaction. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_BIP\"><\/span><strong>What is BIP?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">BIP stands\nfor Bitcoin Implementation Protocols. It\u2019s a standard for proposing changes to\nthe Bitcoin convention. In some cases BIPs are proposed changes to the BIP\nprocedure itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s\ndive into some deeper concepts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Also_Read_How_to_Buy_Bitcoin\"><\/span>Also Read: <a href=\"http:\/\/bitcoinik.com\/how-to-buy-bitcoin\/\" target=\"_blank\" aria-label=\"How to Buy Bitcoin? (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">How to Buy Bitcoin?<\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_does_Double_Spend_attack_perform\"><\/span><strong>How does Double Spend attack perform?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Assuming a bitcoin blockchain is continuously growing, miner, adding block after block in that blockchain.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-18.png\" alt=\"double spend\" class=\"wp-image-9022\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you join a mining pool with 51%+ hashing power (let say 55% or 60%) and the pool will mine block much faster than others and having a high probability of next block in the blockchain network. So, as far as an attacker has the advantage of mining block faster than others, attacker mined the block now its job is to broadcast that block to other miners but attacker here didn\u2019t broadcast that block and gone offline.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-19-1024x214.png\" alt=\"\" class=\"wp-image-9024\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example: Assume block number is 500 is the latest block solved and attacker solved a block number 501 and gone offline and using previous block hash and every values and input and solving more blocks 502, 503, 503 and so on and till now haven\u2019t broadcast any block yet after going offline.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-20.png\" alt=\"\" class=\"wp-image-9025\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-22-1024x265.png\" alt=\"\" class=\"wp-image-9027\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The attacker still have that block and continues doing its job (this type of mining often called selfish mining). So, attacker mining more blocks corresponding to the previous block using those block values and input finds another block and continue this process and still, the attacker didn\u2019t broadcast any block to the network.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, the upper scenario is the rest of the miner are still finding block 501 on the basis of the previous block (which is block 500) and so on but they take more time in producing block because the attacker has more hash power than other miners in that network means he will generate longer chain in less time w.r.t other miners but in the offline medium.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Assume attacker has 60% hash power and all other combine is 40% then the probability is higher than attacker will find the next block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-23-1024x282.png\" alt=\"\" class=\"wp-image-9028\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The attacker launches its chain and becomes the official chain. Now the question of how that attacker chain joins the previous chain and becomes official and legit chain?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the answer as said in the above concept longer chain is the survival chain if anything wrong happens then chain which has more no. of proof of work (POW) will survive and other blocks mined by rest of the miners are wasted. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>We have just learned a deeper concept of double spend but why it is a threat to the network<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/*Let have one concept of bitcoin: Transaction are sum up of each and every transaction in a <a href=\"https:\/\/www.blockchain.com\/explorer\" target=\"_blank\" aria-label=\"blockchain (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">blockchain<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Balances in the blockchain are sum up of every transaction. Assume current latest block is 500 and if you have any bitcoin address then you can your balance whatever incoming and outgoing transactions happened in already mined blocks. Basically your balances are the sum of every transaction in your address.*\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now below image blockchain which is running by miners and the chain running by the attacker will have the longest chain as of now. The green glowing chain is a normal chain and the red one is the attacker generated chain. Now imagine a person named *Charlie* accepts bitcoin as payment in his store so he will wait for confirmation (Majority users waits for 3 confirmation). Assume a person named Bob send bitcoin (BTC) to Charlie for purchase of a product and that transaction contains in block #501 and in #502 he got 1 confirmation in #503 2<sup>nd<\/sup> confirmation and in #504 3<sup>rd<\/sup> confirmation after that *Charlie* will release\/ give the product. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/bitcoinik.com\/wp-content\/uploads\/2020\/03\/image-24-1024x395.png\" alt=\"\" class=\"wp-image-9029\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now after that attacker broadcasts its chain and now his chain is the official chain due to property of longer chain rule explained above. Let\u2019s think while mining attacker changes bitcoin address of Sunny with his own bitcoin address (and can do it with any of the receiving address), as soon is attacker broadcast its chain all the blocks mined by miner became invalid and that\u2019s how double-spend happen, attacker invalided that miner chain and that\u2019s the main reason he can do double spend.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CONCLUSION\"><\/span><strong>CONCLUSION<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Myths\"><\/span>Myths<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Numerous individuals think double spend gives the intensity of changes in BIP which isn&#8217;t correct they just have a little monopoly on mining till they having high hashing power. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">51% attack and double spend are not the same. A 51% attack offers the ability to do double spend. In a genuine model in other cryptographic money precisely 51% is not required too. On account of bitcoin, a huge mining farm also can do that because of the colossal system. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">51% assault is not limited to double spend, it has an intensity of freeze the framework, stopping a specific transaction, suspend mining, keep different miners from checking transactions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Also_Read_How_Does_Blockchain_Works\"><\/span>Also Read: <a href=\"http:\/\/bitcoinik.com\/what-is-blockchain-how-does-blockchain-work\/\" target=\"_blank\" aria-label=\"How Does Blockchain Works? (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">How Does Blockchain Works?<\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>What does actually miner do? Miner just picks some unconfirmed transactions from the mempool and uses the hash of the previous block and tries to find out some output (hash of the current block) continuously. We know that output will surely come out (sometimes takes a long time than usual) but the interesting thing is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9039,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-9006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-crypto-education"],"acf":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/bitcoinik.com\/index.php?rest_route=\/wp\/v2\/posts\/9006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoinik.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinik.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinik.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9006"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinik.com\/index.php?rest_route=\/wp\/v2\/posts\/9006\/revisions"}],"wp:attachment":[{"href":"https:\/\/bitcoinik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinik.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}