Blockchain for the Layman by katrinaderemee

View this thread on steempeak.com
· @katrinaderemee ·
$0.08
Blockchain for the Layman
<html>
<p>During my usual morning browse of Facebook before having my shower, I came across a request for a blockchain expert from an acquaintance who has a podcast. While I don't <em>feel</em> I'm an expert, I did feel the need to write something about it for my own reference as well as that of others. Sure, there are many other explanations covering blockchains out there, but perhaps my own may present the subject in a way some may understand. Forget about Bitcoin, cryptocurrencies, smart contracts, and all that because we won't be covering those just yet.</p>
<p>This is by no means an exhaustive summary of the blockchain, but is meant to serve as a very basic introduction for those unfamiliar with cryptography, software engineering, databases, and so on.</p>
<h3>Why "Blockchain"?</h3>
<p>Before moving to more technical details about what a blockchain is and how it functions, let's discover why it's called a "blockchain". The term encompasses two separate but interlinked concepts, a block of data and a link connecting said block to other blocks. These blocks can be thought to form a "chain" of data blocks; and <em>could</em> loosely be considered a form of <a href="https://en.wikipedia.org/wiki/Linked_list">linked-list</a>. In the computer sciences we typically refer to data blocks of many types as <em>records</em>. Note that <em>for our purposes</em> the term "record" will be used but is synonymous with the term "block" with respect to blockchains.</p>
<h3>What is a Blockchain?</h3>
<p>A blockchain is simply a form of database in which each new record is stored atop the record prior to it. This doesn't differ much from other methods of storing data; however, what makes the blockchain unique and very useful can be found in how the links connecting records operate.</p>
<p><img src="https://lh3.googleusercontent.com/HEB9xECyJy2cE_8YaGNgH_xYo8fBI-AH5o2YOJGZIi89Op_KUNPs4pwItRW0ET01jYfdcfJRsbhbdX1ZY17gq095Xzr3UxQ7McNymlD0ulZ340cwp_NzVONtgRnn281KxI0_4a76I06Fg2r2PwZFmg8d-oomg_jEUv8iULffT0tKJKOPVKCUuF88Bs5zdaSaoegAhCBW59NB57OXyaO8IH8a9C0-5Sa-9PYUjqFEmp5KayIibO-JCqwkiiYTh4kHDjmQ2L4da71jIUDt7VQfBtJVAZAsgP2PIZrQzM1Hy9pYutj5HFzZ5evLI7B4sRJ231SgCR3h00nAVQKx3ZdijqgfEPEDV44goBstvOEuRulLvn7tXgVN4LonUlibWckAIwX4cDrlO3ortWlayr3sT8IDGXYxaB5DVUK9Sfbg-NewtQ8AEe4fkL4yGD1XoqU62yjXUX4B9rNCin5z7j5ZtFMRK_qhIf4t3MFFgXPPMLB9KLjqhSbPu-F1ymI5ztSEUX22wFA7Mzt8w6AddCVmlsmaF5kWQnHYn4osLw0ifpBUi7gmobJacP5tuYbVAnqjU6PwFboE7fpMjQSsXylkz4oBrwTz-vyPUsdqEj0Dd71Qismz=w1077-h811-no" width="1077" height="811"/></p>
<p><em>Simplified diagram of a blockchain</em></p>
<p>In numerous other storage methods resembling linked-lists, the link serves as a pointer, or a "street address" of sorts, telling the computer where to find the next record. But because the records within a blockchain never change their "street address", Record 11 is always after Record 10 which is always after Record 9 and so on, the link is used instead to store a <em>representation</em> of the data within the previous record.</p>
<h3>Digesting Messages, Yummy!</h3>
<p>The representation of a record's data is called a <em>cryptographic hash</em>, and is calculated by performing a <em>cryptographic hashing function</em> on the complete contents of the previous record (the record's contents <em>and</em> link). The nature of this hashing function ensures that a change in one tiny piece of information within the record will cause a the hashing function to produce a dramatically different output (thanks to the <a href="https://en.wikipedia.org/wiki/Avalanche_effect">avalanche effect</a>). This output, or result, is known as a <em>digest</em> and is often smaller in size than the input data.</p>
<p><img src="https://lh3.googleusercontent.com/u4vGpCJDeXbUaRj97NeFbin3D6ckWKFtdQ57MzxKS6XAVoh3fsl5IwuRzRcD-IpRCnZrbfRUqqQVCSdYIfy1dz8JOOHcXiRihKf4xEqMcfH19Lh3vKUXhRGQs1VPWlvml0pfwKPPvHHxbhC1siAXv-Eu5pKbxD_t4_xlF17gRMW3xKNWpE6sxcRjRUOx1vZQPvpOxYBo6T-3Uj3UzLF2JgRkVAWjZRHZgndjvfTSZYtknRQPwEGcZzAT96Pu1W1V13Uqe4c_Axf6SSFcnnQq4fbGk3auAHerhWALODnS4VHTXOSyg46yzgpQX0aMDS9pqrhpAM8GrrtGHStf33yM9ZJEv5IeagrvRI2zBMnWKbhufYhqCQRNpZWnC36P-On-fN_QUwRqCtfTQ7yZI4h0_wbKW3lw6w9gZARA2DlUUVSqRzRJzLf7lbbEBhgAS5vSkc4OrZSRk_il3AX1bdwnUFlpdKszyU9XUmMZxGysbicMeH2BQluZm8gKn3KP_c_kS11yVN_IbHvclntzY1ol-ljQfIFWBnLuxc6jUoqsZ6vsFqvmvGoe4DaGmNft7g3GZ7opegbJFP6tcqykiYuhdsUrTWgCHv3_B23vjv_lu_jt6Z8F=w1081-h808-no" width="1081" height="808"/></p>
<p><em>Cryptographic hashing and data integrity</em></p>
<h3>Why Hash?</h3>
<p>Cryptographic hashing has numerous uses, two of which may be applied to blockchains. The first is to provide a method of reducing large and arbitrarily sized records to much smaller pieces of information with a fixed-size. This can be seen in the above diagram in the first and second entries; the second entry contains more characters than the first, yet both digests contain the same number of characters. This first application helps form the basis for the second function - checking data integrity of each record. We don't care <em>what</em> information a particular record contains, only that we can <em>detect</em> records whose contents have been changed or tampered with.</p>
<p>Let's assume we have a record containing data found in the first entry of the diagram above; we perform a cryptographic hash on it which results in the corresponding digest, colored in green. Now let's assume that we throw <em>our copy</em> of the record away to never be found again. Let's also assume that we occasionally receive records from other computers who claim these records are identical to the one we threw away. How will we know if these records are indeed identical to the one we threw away? We use the digest as a <em>fingerprint</em> to identify records whose contents have been changed. Notice in the above diagram that performing a cryptographic hash on entries two, three, and four all result in different digests because each entry is not identical to any of the others. We cannot deduce <em>what</em> has changed about a record, only that it <em>has</em> changed. If we know a record has changed we assume that it is invalid and ignore it.</p>
<p><img src="https://lh3.googleusercontent.com/syTLbJJ0SPu03-UO9RSCYX5lLdOT5-b7QgarWdMAcOL9n1VAm29fSI3InXade5WoV79YYJ8hBvkt-kC85ob_bStorEAI43Aq0rEfxZvQXv6LQFx0hsbzPsjsf3mnl2-01BNkjMLmL689FNo4PU0dqhA4CRinBdKI7H6krRgBdKIchAhs9fpwcGNw7uPJpsA93C9U5HkqY0L82RjIu_SwvFwKPeVSNuPIAJtykaOzNU3ugAxcrdVWVBDOQfw9JP718C84bNEFNeLjx_YfASyFLhLekw8u-dVbKYIBl0oGoplMSIMIp1Tsg6EsH0DHZWub0PJBFAd1whCKwRrguMoe8vwVPF5eoG8W5MwLEMy3LwEzK5SJrXbO4mmfP4OayI_9qY42AaRu4CTkybjK9rGurArLSFuXHiop81jdka9dBEMwjyNKeBD1yLoWo3zxUUyyEBItY3q3HzzmLYrZQWUtMd4LgNBczOoaEPDCIrlbKs7t5PW7w1gPeTgECBZd1Nvp2Q1B-9uLeoLYYNKlko_W9v875bujQsyd11viVEsFAc6KDU-Q3RMfm1I_dLavg-2vHdrFEO9fT2HLUjEvE9dyp5f90_Qd-jQlTvm8ZFAAD0rwGDzU=w1077-h810-no" width="1077" height="810"/></p>
<p><em>Each record's link consists of the data and link from the previous record</em></p>
<p>Employing cryptographic hashes in this way prevents tampering with existing records by making it more computationally difficult to do so with each new record added on top of the one we wish to alter. For example, we cannot merely change the contents of Record 2 and assume everything is well. Changing Record 2 would creates a different hash for the record, and in-turn results in a different hash for the record above it. This would cascade up the remainder of the blockchain and result in all records above Record 2 becoming invalid.</p>
<p>To further aid in detecting records which have been altered, each also contains a timestamp, essentially indicating the date and time it was created. This timestamp is included, along with the record's data and link, in what the cryptographic hash function processes to form the link for a new record.</p>
<p>These features lead to the characteristic that a record may not be altered once a new record is placed atop it, even if such alteration is desired and legitimate.</p>
<h3>Taking a Step Back</h3>
<p>To this point we have been focused on the very basic structure of a blockchain, but let's take a step back to view a little more of the picture, how to use a blockchain.</p>
<p><img src="https://lh3.googleusercontent.com/ckAE3_CNy9OWPC8bfynjj8VeYTHZtPT7rYvOS7tqpNN5T1NtOQQkb2WiKzOFFDdN5fgdWGu5r4PhrjsZQag3W6N1Xe_GoDU8xGL7XyH1mFYHAZ1NCl78HAskSUh7-YQg4_xU0tdoPaicwwJdTfiznBmiSXf_UX94q6IlPInd4mu42PAQ50UM6CPyMJ9I8EA-YuHvFnFVz778MEXGjPVOSiEItxwZ2BoVdUPA63WzVGKzOCie1diipBl7Q-wSCyN0mBj6S9LXMvnKcgspNBH1WUfimhCF2UPE-EZkVNfc0p44-9XtOggakak3wXhvw_oNBtcNrAF-BmLhj8EP6Asp4lXkYHvkHJV0CJlmtfhDL083zmeR76xUNvyLIMK81s5DD64epXxBj4WJLgTTplWCy8bYHu1DPyNpjpED4JssNzmMuBbvoORSGU1fy1_0dR8FGWbVYwtF1j5hijCx5CFc7_PEKwPMngN3l8-VWgYi29CSpCXpCZSoF_TyKBJfrbT049-hE8-NOGiO_jHSxwucsaV-h-ZJvuKu1Jv9KiPf1h5N0cc_NQarI49CxjMytPWGe1x0PkCfLMx7_i8xO2hri9j-vnPubxCG6w1PSBmpt1S1OWoM=w1078-h809-no" width="1078" height="809"/></p>
<p><em>Blockchains are intended to maintain identical copies of data across multiple computers</em></p>
<p>As previously discussed, blockchains are merely methods to store information; however, they are intended to be used specifically as <em>distributed databases</em>. This means that information is stored on thousands or millions of computers and is therefore resistant to corruption, loss, accessibility issues, and other problems. In addition, the way blockchains operate is in a decentralized manner with no one computer in charge of the blockchain. Each computer in a blockchain-based network maintains a copy of the blockchain which is identical to that on every other computer in the network. For the purposes of this discussion we will refer to these computers as <em>hosts</em>.</p>
<p><img src="https://lh3.googleusercontent.com/CWm5FaVGIE-ysALDz0uocWLn3JSDeZl83922v1JtSxaVe6PKa_rmSdhLdYDTzQIa60TUDIpspEgb4_ihgc0IvHhuUDcsScJRboAViqv35OHag0dc2u39OSXQfbaal1IL5FLvbWKcoPS_rBuFykJ-60aoIxqImt8K4WrO0Q1-CAIxIBtb_eQpXYtqB0CER_k9Zjg5rfHdkDTGLPgZdmPSiQEK1RXFuxzrRazLGWtnK3PN03yYnJ0g4pEXG6KZobZyLL7ivazYwW4wooaqAdFB4EKGWpKwiReErvuK_XEaHoN6AfLCH3jOo7QnqRfPy70-12YDktp-1CK-SxlJyIS8Hia_Bzmcjna-_5glLsO_oslibR6Dd9OvG0Wn5oONi4RayMAYSUUsy-D-Pm-iwHiI0pygLm94k5iweirE6-B-ieAta3847VAp8dJoFSvOJQ4oxnD4bxXHVw8ugZBVYqdQjuLmBt1Ad9JUwZOousmGshsSMxX9zhtmzR6joQ_JJyDSRvJtVhMdRNO9JHRP_NQfO3fCVho7DQ1R_58fqGhSIKW_B5bnFAG6cWhC2q-VgHZWn9NJQ7dtPaDS6kLbdIDtucJScIvfiwZgrO-9TktEZPRfR6Oa=w1078-h809-no" width="1078" height="809"/></p>
<p><em>Propagation of data from multiple clients across multiple hosts</em></p>
<p>Each record consists of data that individual clients or users submit for inclusion in said record. Because most clients are not connected to every host in the network, it is the responsibility of each host to relay (or forward) any <em>new</em> data it receives to all other hosts it is connected to. In this way data submitted by clients quickly propagates through the network to all hosts. This process of collecting data is how an individual record is built.</p>
<p>Without a mechanism to control the amount of data within a record several problems would surface, mainly that a record would never be written to the blockchain and a record could become so large that it presents a burden to the system. To prevent this, the element of time is often used as a control; for example, the Bitcoin network tries to achieve placing a new record into the blockchain approximately every 10 minutes. Once a record has been placed into the blockchain, or <em>committed</em>, it effectively becomes unalterable. The reason for this is that while there is no record on top of the newly committed record, the <em>majority</em> of hosts consider the record complete and have no reason to alter it, instead moving on to gathering data for and constructing a new record. We will next discover why hosts prefer to move on to constructing new records rather than trying to modify the previous record.</p>
<h3>Making it Pay</h3>
<p>The blockchain we have discussed so far may be suitable for distributed databases operated by a business for its own purposes or by individuals out of the kindness of their hearts, but it has no incentive for anonymous parties to maintain the blockchain. How does database maintenance become profitable?</p>
<p>The incentive lies in awarding some form of currency to hosts, but how does the system determine which host receives the award? Many blockchain systems award currency to the first host to find a particular number, called a <em>nonce</em>, that when hashed with record contents results in a digest that is numerically smaller than a set threshold.</p>
<p><img src="https://lh3.googleusercontent.com/T1ul2PyeqfjGNCpqtrF8zCL7S6JsyTYHbNnaFNBl6BKiuNKsIuSZCtkxRdU5FotIJ4x_KZ1O0itmY6ULU4coFG_xVBtckE5m_c1HK9FNJiEt74tEij7oDja40nK697sm9psD66ILRrzo6VpdBRU2wVqE9S09MdovIeGJoC4vmyGR7NgB44eTzsZwnJC4Fun9AFJXGLEDUnJIqWw_r2iRZMRdL6igEW69qDx3gVcNNTwGtYea_KoAifESugZMqplyyc81b2P6up_O_dRbO-ncnirVI0OOq_slq9dnTglhEpq7oo2naGtCEaT0tQRxM-ohp2ink-omq0-DmmoqUDD2_Ii8_MEekqKC2cwyqeEsFcDIZTI_CiMLWX6C7YaLu9LQA4bB0LabKmadgaRajZqeNwEMv__Jo7zoW2qTekTyK4-68HJpWrxnks3k6kyLb06w1I7SVau-Bd8fyfYv_i8iq0HAocZ5nzcMl31MKPwr-PHF5yVpRXi7O3y8KZrlQWbJsDx_l8y3Hu2aHk8srqxOVkYZ-kE-gQ_krq2TmQPzDHoz0GBdTljx6PE8qLeMDXlmGQ-uRuH2kJ-39sDKUzYSNGwmiRjcL9Bi2V4ZpZ3PfCH4ifPe=w1076-h810-no" width="1076" height="810"/></p>
<p><em>Hashing record data with a nonce for proof-of-work</em></p>
<p>As hosts gather data to build records they perform a cryptographic hash function on the record's data and a selected nonce. If the resulting digest is less than a predetermined difficulty threshold the host assembles the record and nonce and broadcasts them to other hosts as a proof-of-work as well as writing the record to its own copy of the blockchain. However, if the resulting digest is not smaller than the threshold, the host repeats the process using a different nonce.</p>
<p>When one host receives a proof-of-work from another host it verifies the record and nonce against the difficulty threshold. If the result is verified as smaller than the threshold, the receiving host commits the included record to its copy of the blockchain. If the verification fails, the receiving host ignores the proof-of-work and continues trying to claim the reward itself.</p>
<p><img src="https://lh3.googleusercontent.com/ULM-TL4uNZzzOf9VGVadwTZCNwyRUc_BM9VVffhcyda3pRmCg2bBCib_pJ2Qymi3Fewzi9Ms4-35hiUA3Lnp39M3y0k64BM2JQArIJQyFcGiL8KqbWebNO-Ky4oExQV3TahSHx925syBeEWgEgzK--q4hnDkgCDweEpdLhbcDsZBy-SAWSH2kF5AMC9D9cgnK4GMSFfCP8EhiqweiD3PxM4jskzDLxaAi3W3ZWACmtOe1rZAFqe282H07OrBQA9YGPEuceHnzGWgLAA0MZIoFEZK_irT_f4vt0Fa8dmVDwiNOS1lbOLI1NE2Yim9RWtEn9Eui9T7oxXvmWjocKciprfbzQvb97X0z0_-rM52sxXG79lKqPj8KxM_CDHC6pcRrV4FiwZFOgDJVPV1PPWGSwJ104wblTqLesDjfBrBdbnVMsxLAfAyZacM8aUXzW7EnJ4Ixnv9XOio9I0C1gspEriNvUxIAiKR37uQdT7IQlY2pl_z3hOAKyCRWUOgPumdvrnLyrpPBI5K7eT_ALuMt3bQvu6MkswxIbTQw1U0RPNNN8Tr6WvWsHCN4MZOj3UlU59xWifmwVIy9eP9zfZN0E-zziSVd_ftj3X91ewZuJiVFYAk=w1081-h810-no" width="1081" height="810"/></p>
<p><em>Rewards are claimed via proof-of-work</em></p>
<p>The winning host claims the currency prize by entering the transaction into the blockchain as part of the new record. The amount of currency awarded with each proof-of-work is set by an algorithm based on the current record number among several other parameters. In this way the reward is standard and can be easily calculated across all hosts.</p>
<h3>What's it Good For?</h3>
<p>We have not yet discussed what the data the entire system is designed to maintain consists of. Put simply, the data may consist of anything clients wish to place into it. In the case of Bitcoin this data is primarily transactions which transfer Bitcoin from one user to another. In other systems the data includes smart contracts. The possibilities for blockchain applications is limited only by the imagination.</p>
<p><br></p>
<p>Connect with me on <a href="https://www.linkedin.com/in/katrinaderemee">LinkedIn</a> and <a href="https://twitter.com/Katrina_Lexxa">Twitter</a>!</p>
</html>
👍  , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id1,377,507
authorkatrinaderemee
permlinkblockchain-for-the-layman
categoryblockchain
json_metadata"{"app": "steemit/0.1", "format": "html", "links": ["https://en.wikipedia.org/wiki/Linked_list", "https://en.wikipedia.org/wiki/Avalanche_effect", "https://www.linkedin.com/in/katrinaderemee", "https://twitter.com/Katrina_Lexxa"], "image": ["https://lh3.googleusercontent.com/HEB9xECyJy2cE_8YaGNgH_xYo8fBI-AH5o2YOJGZIi89Op_KUNPs4pwItRW0ET01jYfdcfJRsbhbdX1ZY17gq095Xzr3UxQ7McNymlD0ulZ340cwp_NzVONtgRnn281KxI0_4a76I06Fg2r2PwZFmg8d-oomg_jEUv8iULffT0tKJKOPVKCUuF88Bs5zdaSaoegAhCBW59NB57OXyaO8IH8a9C0-5Sa-9PYUjqFEmp5KayIibO-JCqwkiiYTh4kHDjmQ2L4da71jIUDt7VQfBtJVAZAsgP2PIZrQzM1Hy9pYutj5HFzZ5evLI7B4sRJ231SgCR3h00nAVQKx3ZdijqgfEPEDV44goBstvOEuRulLvn7tXgVN4LonUlibWckAIwX4cDrlO3ortWlayr3sT8IDGXYxaB5DVUK9Sfbg-NewtQ8AEe4fkL4yGD1XoqU62yjXUX4B9rNCin5z7j5ZtFMRK_qhIf4t3MFFgXPPMLB9KLjqhSbPu-F1ymI5ztSEUX22wFA7Mzt8w6AddCVmlsmaF5kWQnHYn4osLw0ifpBUi7gmobJacP5tuYbVAnqjU6PwFboE7fpMjQSsXylkz4oBrwTz-vyPUsdqEj0Dd71Qismz=w1077-h811-no"], "tags": ["blockchain", "computing", "cryptography", "bitcoin", "cryptocurrency"]}"
created2016-11-17 03:09:48
last_update2016-11-17 03:09:48
depth0
children2
net_rshares2,463,876,302,667
last_payout2016-12-18 04:28:27
cashout_time1969-12-31 23:59:59
total_payout_value0.066 SBD
curator_payout_value0.012 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length15,966
author_reputation7,413,102,413,009
root_title"Blockchain for the Layman"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (25)
@elumni ·
I Like the pics you used to give a better understanding on high blockchain tech works. Nice Post!!
👍  
properties (23)
post_id1,378,569
authorelumni
permlinkre-katrinaderemee-blockchain-for-the-layman-20161117t091509575z
categoryblockchain
json_metadata"{"tags": ["blockchain"]}"
created2016-11-17 09:15:09
last_update2016-11-17 09:15:09
depth1
children1
net_rshares6,448,435,865
last_payout2016-12-18 04:28:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length98
author_reputation20,209,499,381,910
root_title"Blockchain for the Layman"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@katrinaderemee ·
Thank you!
properties (22)
post_id1,378,604
authorkatrinaderemee
permlinkre-elumni-re-katrinaderemee-blockchain-for-the-layman-20161117t092755254z
categoryblockchain
json_metadata"{"tags": ["blockchain"]}"
created2016-11-17 09:28:00
last_update2016-11-17 09:28:00
depth2
children0
net_rshares0
last_payout2016-12-18 04:28:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length10
author_reputation7,413,102,413,009
root_title"Blockchain for the Layman"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000