Understanding The Blockchain

Transcription

Understanding the BlockchainVersion 1.1 – November 2021

ContentsGlossaryWhat is the Blockchain?2The Origin5Understanding the Blockchain6Peer-to-Peer Networks7Distributed Ledger Technology8Enter the Magic Machine10The Computer Puzzles and Proof-of-Work12Mining: Putting It All Together19Miners20Blockchain: A Decentralized Integrity Platform24Sources28DescriptionHash Function InputTransitionHash Function OutputSealed SheetsBlockchain ElementsValidationHash Value /Magic Machine

What is the Blockchain?he Blockchain – A combinationof technologies used to create adecentralized peer-to-peer network tomanage ownership of digital assets.2

Bitcoin is thefirst decentralized,censor-proof,portable, secure,durable, and scarcedigital asset.”CBInsightsUnderstanding the Blockchain3

The Origint about the same time the worldwas experiencing a global financialcrisis, the beginnings of a new waveof innovation in the electronic agewas underway.On January 10, 2009, Hal Finney, aprominent cryptologist and cypherpunk,received an unusual email from an unfamiliarname – Satoshi Nakamoto.1The email included a document that describeda new form of digital money call Bitcoin. This“e-cash” was not going to be your typicalpayment gateway. It described a new formof currency and payment system based on adecentralized peer-to-peer network that requiredno trusted authority. In fact, it assumed no trustin the system and sought to eliminate the need forfinancial intermediaries altogether.2Understanding the BlockchainSatoshi combined computer science,cryptography, and mathematics to produce a suiteof technologies to realize this new network.The market cap of this payment network, thatHal Finney ultimately helped build, has exceeded 125 Billion3 and is used by millions of peopleand thousands of companies.4The underlying technology powering Bitcoin isknown as the blockchain.The blockchain is a combination of technologiesused to create a decentralized peer-to-peernetwork to manage ownership of digital assets.5

Understanding the Blockchaino understand the blockchain, youmust understand the problemsSatoshi had to solve in order tocreate Bitcoin.First, he had to eliminate the middleman by creating a completelypeer-to-peer network where both the membership and the numberof members is not known in advance.Second, he had to create a distributed ledger that stores everytransaction between all the peers in the payment network. Thetransactions had to form a clear understanding of ownership andevery peer in the network needed to keep a copy. The ledger alsohad to be immutable and not rely on the trust of the peers.Finally, he had to devise a way to maintain the integrity of theledger, even in the event of malicious behavior by some peers inthe network.Solutions to these problems are the mostimportant elements of the blockchain.6

Peer-to-Peer Networksn June 1, 1999, Shawn Fanning andSean Parker founded Napster – theworld’s first peer-to-peer (P2P) networkfor sharing music.5 Imagine iTuneswithout the cool devices and the centraldatabase controlled by Apple.In Napster’s model, all members of the computernetwork stored copies of music. Napster provideda central directory where each node listed thosesongs it had on its computer hard drive.When each node (or peer) wanted to play, itsimply asked Napster’s central server whichpeer had the song. It then provided the internetaddress of the peer that had the song, and therequesting peer contacted their nearest neighborto download a copy of the song to play.Understanding the BlockchainThe Napster network was similar to Satoshi’snetwork with some exceptions. In the Bitcoinnetwork there is no central server. In Satoshi’ssystem, every peer has a copy of the full songdirectory. At its peak, Napster had over 80 millionregistered peers or users.6 So, peers are knownin Napster. In the Bitcoin network, peers do notregister, and are unknown in advance.7

Distributed Ledger Technologyvery time you make a deposit or awithdrawal from your bank account,your bank’s computers update itscentral ledger.It is a database containing all the accountinformation and related transactions of theircustomers. It is the definitive record of the assetsyou own in the bank.This works because you trust the bank to keepaccurate records of all transactions. And, youalso expect the bank to perform this in a secureand reliable fashion with no errors or fraud inthe process.But, what if you could not trust your bank? Howwould you perform financial transactions betweenyou and another party? You could use cash,but what if the only option was a digital form oftransfer (like a wire). How could you do it withoutthe bank?Satoshi invented a way.He combined the concept of distributed ledgertechnology (DLT) and cryptography.A distributed ledger is a database that isreplicated over a P2P network. Essentially, everypeer in the network has a complete copy of the8database. Any change to the database is alsoshared with all the peers in the network.Every transfer of ownership is recorded as atransaction in the database. It records to whoma digital asset was transferred and at what time.This transaction history becomes a complete audittrail that provides evidence of how every peerachieved his or her possession.7Satoshi’s implementation of DLT resemblesa folder full of sheets. Each sheet of paperrepresents a series of transactions. Like a book,the pages are inserted into the folder in thecorrect, sequential order. Each page is a block.This ever-growing folder becomes the chain.Every peer or node in the network has a copyof every sheet and the entire folder. This isthe blockchain.Ensuring all peers can reach consensus onchanges to the folder or blockchain without theneed for trust is a hard problem.Enter The Magic Machine.

Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXAs transactions occur theyare added to the sheet.Transaction XXXXXXXXXCompleted sheets areadded to the folder.PAPERSIN FOLDER BLOCKCHAINFigure 1: Sheets in Folder BlockchainUnderstanding the Blockchain9

Hash Functions: The Magic Machineuppose a magic machine existed thattakes any length string and convertsit into a fixed length number. Call it thefingerprint number. This is becausethis machine’s output is much like adigital fingerprint.Also, suppose this magic machine has thefollowing properties:The machine works incredibly fast,It always produces the same number for thesame string,The machine only works one-way; in otherwords, it is impossible to derive the originalinput data given the fingerprint number,There is no way to predict how the fingerprintnumber changes when the string is changed,even slightly, andNo two heterogenous inputs produce thesame fingerprint number. (Just like two peoplecan’t have the same fingerprint.)10

Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXTransaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXTransaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXTransaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXFigure 2: Chain of Hashed SheetsIn computer science, this magic machine is knownas a cryptographic hash function. It is a set ofmathematical operations that runs on digitaldata. The output of the function is known as thehash value. There are many different forms ofthese functions that makeup a family designed bythe NSA.8Satoshi chose Secure Hash Algorithm #256 (orSHA-256) for his digital money network.Hash functions are very useful for determining if aset of data has maintained its integrity.For instance, all a peer in Satoshi’s network hasto do is compare the computed hash value for asheet from the folder with the known or expectedhash value. If the values differ, the peer knowssomething is wrong. In essence, you can comparetwo sheets of transactions by simply comparingtwo numbers: their computed hash values.Understanding the BlockchainOne other useful thing about hash functionsis they can be combined. The output of thehash from one set of data (like a page full oftransactions) can be combined with a new setof data as input to the hash function. You canrepeat this process forming a linked series of hashvalues. Hence, any change to the contents of asheet breaks the entire link. You can do this at thepage level or even at the transaction level to forma tree like structure.The advantage of this tool is that data canbe stored in a change-sensitive fashion. Thesheets in Satoshi’s folder can be linked into acryptographically-sealed chain.Later, if any of these hash values are found to beincorrect at any time, it is instantly evident that thedata was changed at some point after the chainwas created or while it was in transit to a peer inthe network.11

The Computer Puzzles and Proof-of-Workash functions are useful for checkingdata integrity, comparing data,referencing data, and storing data in asecure and efficient fashion.9They are also useful for creating elaborate puzzlesthat only computers can solve. The only way tosolve these puzzles is by using lots of computepower and difficult computational work.Recall earlier, the output of a hash function isa fixed length string. The length is set by theinternals of the function. Hash values can alsohave leading zeros to achieve the required length.12Suppose I have a sheet of paper in Satoshi’snetwork that contains a number of transactions.Remember, we call this a block. After we runthe sheet through the magic machine we get ahash value.

John sends Michael 7 Bitcoin.Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXJohn to Michael: 7 BitcoinSHEETFULL!HASH 1A001AEB97ABF2FE188FIGURE 3: EXAMPLE OF A HASHED VALUE, BASED ON A SAMPLE TRANSACTIONUnderstanding the Blockchain13

Now, suppose I gave you the followingpuzzle to solve:What number, thatwhen combined withthe sheet and putthrough the hashfunction produces ahash value with threeleading zeros?This puzzle has some importantcharacteristics:14You start with the original sheet of paper,and it remains unchanged.The hash function is the same hash functionused to produce the hash value for the sheet.You must find a number, which you canchange. This is called a nonce (numberused once).The resulting hash value has a restriction, itmust have three preceding zeros.

A nonce is added to the sheetthat will generate a hash valuebeginning with three zeros.78943256#18BE28DFF3E4A.Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXJohn to Michael: 7 Bitcoin78943256#000FCC45295AE.Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXJohn to Michael: 7 BitcoinThe nonce successfullygenerates a Hash Valuestarting with three zeros.FIGURE 4: ADDING THE NONCE TO SOLVE THE PUZZLEUnderstanding the Blockchain15

Because there is no way to get a hint from theoriginal hash value and since hash functions onlywork one-way – we would have to use trial anderror to solve this puzzle.The number of leading zeros (the restriction) isdirectly correlated to how challenging it will be fora computer to solve the puzzle.In fact, we’d literally have to try every numberfrom zero to infinity until the resulting hash hasthree leading zeros.So, in the world of hash puzzles, the number ofleading zeros is often referred as the difficultylevel or difficulty. The higher the difficulty, themore computational power, and average time itwill take to guess the nonce.This trial and error approach is equivalent toguessing the sequence of numbers to find thesecret passcode for a combination lock. Youwould have to try every possible sequenceuntil you find the one that opens the lock.This approach is guaranteed to work, but it istime consuming.Once a puzzle is solved, it is easy to verify. Avalidator will simply combine the original sheetwith the nonce and put it through the magicmachine. If the output has the right number ofzeros, then we know the puzzle has been solved.That is the idea.The nonce that produces a hash value thatmeets the desired leading zeros is the solution tothe puzzle.It also turns out the number of leading zeros andthe input values (sheet and nonce) are designedspecifically to make the computational workharder every time.16These puzzles are one of the most important toolsfor making Satoshi’s Bitcoin network work. Anypeer claiming to have solved the puzzle has topresent the nonce. A nonce is therefore referredto as proof-of-work since its success in solvingthe puzzle proves that someone has done thework necessary to do so.

NONCE78943256#18BE28DFF3E4A.Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXJohn to Michael: 7 Bitcoin78943256#000FCC45295AE.PREVIOUS HASHNonce is verifiedTransaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXJohn to Michael: 7 BitcoinThe sheet is now sealed.FIGURE 5: PROOF OF WORK (CHECKING THE NONCE)Understanding the Blockchain17

Satoshi uses hashing strategically in thearchitecture of Bitcoin (and its supportingblockchain) to preserve its integrity.Next, he uses it to produce a unique digitalfingerprint of each sheet in the folder (full oftransaction data).First, he uses it to store the pages in a changesensitive way (using the combination propertiesdiscussed earlier).Finally, he uses the puzzles to get peers in thenetwork to expend computational effort forchanging the sheets in the folder.FIGURE 6: COMPONENTS OF THE BLOCKCHAINPAPERSIN FOLDER BLOCKCHAIN18

Mining: Putting It All Togetherow that we understand theproblems Satoshi had to solve andtheir respective solutions, we now seehow we combined them all to form anew digital currency – Bitcoin.To do so, we’ll use an example.As we recall, in Satoshi’s P2P network there isno middleman, and the asset that is owned andexchanged is a digital “token” called Bitcoin.Let’s imagine he implemented Bitcoin using theold centralized approach.What if John gets a call from his friend Michaelasking for money to help him in an emergencyduring his business trip overseas. Michael needsUS 1800 to cover the cost of his return trip home.John calls his account manager at his bankand makes a request to send 1800 dollars toMichael. John’s account manager checks thebank’s ledger to make sure John has the requiredfunds before sending the money to Michael.Now, imagine we can no longer trust John’s bankor account manager. Perhaps he charges reallyhigh fees for overseas transactions or makeslots of errors in keeping the ledger up to date.Or perhaps, the bank was recently hacked, andUnderstanding the Blockchainthe database was compromised. Whatever thereason, our middleman is no longer trustworthy.John and Michael hear about Bitcoin and decide touse Satoshi’s network.Any number of peers (including John andMichael) are part of the network. Each memberis responsible for maintaining a public copy ofthe distributed ledger. Recall, the ledger is afolder filled with sheets, themselves filled withtransactions.Let’s say John wants to send 0.2 Bitcoin (theequivalent of 1800 as of 5/1/18)10 to Michael.He broadcasts his intention to the network.Each peer checks to make sure John has enoughBitcoin to perform the transaction. Then eachpeer writes the transaction in a free space on theirtransaction sheet. Other peers might performsimilar transactions. For example, Phillip mightsend Dip 10 Bitcoin. All of these transactions arealso added to their sheet until they are full.19

Minersnce a page is full, a subset ofthe peer network validates thetransaction sheet and performs theprocess of “sealing” the page beforeit can be added the folder.The seal ensures the page can never be changedfrom this point forward. To accomplish this, thespecial peers solve the following puzzle:“What nonce when combined with both thesheet to be sealed and the hash value of theprevious page produces a hash value withthree leading zeros?”The first special peer to find the nonce broadcastsit to all peers. The entire P2P network thenvalidates the nonce is correct. If 51-percent ofthe peers agree, the entire network seals the pagewith the nonce and adds the page to the folder.20Sealing a page means appending the nonce toa special location on the page and storing thehash value of the previous page as a referencein the page.Because the nonce takes into account the currentpage and the hash value of the previous page,each page is now linked cryptographically tothe previous page in a change-sensitive fashion.Therefore, a single change to any page, will breakthe entire chain of pages or blocks.This ensures the integrity of the entire blockchain.

The Hash of the previoussheet is added to #000G6Y78HQ2D5.#000AF9D85E742Transaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXTransaction XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXPREVIOUS SHEETCURRENT ion XTransaction XXTransaction XXXTransaction XXXXTransaction XXXXXTransaction XXXXXXTransaction XXXXXXXTransaction XXXXXXXXTransaction XXXXXXXXXJohn to Michael: 7 BitcoinThe Nonce is combinedwith the Hash of theprevious sheet and runthrough the Magic Machine.The puzzle is solved butrequires verification by theP2P Network.FIGURE 7: LINKING THE HASH TO THE PREVIOUS SHEETUnderstanding the Blockchain21

Let’s say one of the peers was malicious anddecided to tamper with the transaction betweenJohn and Michael. For example, instead ofsending 0.2 Bitcoins from John to Michael, Philliprecords the transaction as John sending 0.2Bitcoins to Phillip himself.Why do these special peers perform this computeintensive work?To do this, he would have to recalculate everynonce in the folder and convince 51-percent ofthe network to agree with him. More importantly,he’d have to expend a great deal of energy andsomehow get the rest of the peer network tocollude with him.Once a page is full and ready to be sealed, thespecial subset of the peers attempts to solvethe required computer puzzle. The first oneto present their proof-of-work (the nonce) isawarded some Bitcoin that is created from thin air,like a digital mint. In this way, the special-peersare said to have mined the new Bitcoin.This 51-percent vote is a consensus algorithmthat involves multiple peers in the network.This is like having a jury of peers validate theintegrity of the folder, its pages, and eachtransaction within.Satoshi accomplished his goal. Ownership ofBitcoin is accomplished without the need for amiddle man.22Satoshi created an elegant way to encourage aspecial subset of peers in his network to expendenergy and help secure the network.As such, these special-peers are knownas Miners.

78943256#000FCC45295AE.#000AF9D85E742.Each member of the P2PNetwork passes the noncethrough the Magic Machine.Once more than 51% of the networkverify the nonce the sheet is sealedand added to the folder.PAPERSIN FOLDER BLOCKCHAINFIGURE 8: THE P2P NETWORK REACHES CONSNSUS ANDADDS THE SHEET TO THE FOLDER.Understanding the Blockchain23

Blockchain: A Decentralized Integrity Platformo create Bitcoin, Satoshicombined a peer-to-peer networkwith cryptographic technology tocreate a distributed ledger thatmaintains its integrity through asimple consensus algorithm.More importantly, he accomplished this withoutthe need for a central authority nor the need totrust any of the participants in the network.Satoshi’s blockchain is therefore an elegant suiteof technologies to create a peer-to-peer networkthat supports the ownership of a digital currency– Bitcoin. The Bitcoin network is secure, has nolimit to its size, and unlike a central bank has alimit to the total number of Bitcoins that will everbe minted – 21 million.11Over the years as Satoshi’s design has beenexamined, it’s become clear that blockchain isuseful for achieving and maintaining integrity inany distributed system.24Satoshi Nakamoto, whose identity remains amystery, created something bigger than Bitcoin.He created a new way to manage the ownershipof any digital asset without the need for amiddleman or trusted peer network.The underlying technology to the Bitcoin networkhas unleashed one of the greatest opportunitiesfor innovation in the past decade.

The excitement aboutthe blockchain is basedon its ability to serve asa tool for achieving andmaintaining integrity inpurely distributed peerto-peer systems that havethe potential to changewhole industries due todisintermediation.”12Understanding the Blockchain25

By removing the need fora middleman, one lowerspotential security concernsfrom hacking to corruptionas well as speeding upmanual processes that areantiquated and can taketoo long.”GS Equity Research, 2015Understanding the Blockchain27

Sources[1] Popper Nathaniel, Digital Gold: Bitcoin and the Inside Story of the Misfits andMillionaires Trying to Reinvent Money, Harper Collins, New York,May 19, 2015[2] Nakamoto, Satoshi, Bitcoin: A peer-to-peer electronic cash system,www.bitcoin.org, 2008.[3] https://coinmarketcap.com/[4] Marketcap with Prices Of Cryptocurrencies Like Bitcoin & Ethereumhttps://www.ccn.com/marketcap/[5] Schonfeld, Erick. Shawn Fanning And Sean Parker Talk About Airtime And“Smashing People Together”.TechCrunch. June 4, 2018[6] em napster/[7] Drescher, Daniel, Blockchain Basics: A Non-Technical Introduction in 25 Steps,Germany, 2017[8] https://en.bitcoin.it/wiki/SHA-256[9] Drescher, Daniel, Blockchain Basics: A Non-Technical Introduction in 25 Steps,Germany, 2017[10] https://www.coindesk.com/price/[11] https://bitcoin.org/en/faq[12] Drescher, Daniel, Blockchain Basics: A Non-Technical Introduction in 25 Steps,Germany, 201728

Visitwww.solunacomputing.comfor more information.

What is the Blockchain? he Blockchain – A combination of technologies used to create a decentralized peer-to-peer network to manage ownership of digital assets. 2 Bitcoin is the first decentralized, censor-proof, portable, secure, durable, and scarce digital asset.” Understand