<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gabriel Chan on Medium]]></title>
        <description><![CDATA[Stories by Gabriel Chan on Medium]]></description>
        <link>https://medium.com/@GabBlockChan?source=rss-9300bd61098------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*N3ynXezHp1tdoCl8.jpg</url>
            <title>Stories by Gabriel Chan on Medium</title>
            <link>https://medium.com/@GabBlockChan?source=rss-9300bd61098------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:13:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@GabBlockChan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Designing Blockchain Applications]]></title>
            <link>https://medium.com/international-blockchain-olympiad/designing-blockchain-applications-a293d423f095?source=rss-9300bd61098------2</link>
            <guid isPermaLink="false">https://medium.com/p/a293d423f095</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cyrptography]]></category>
            <category><![CDATA[writing-tips]]></category>
            <dc:creator><![CDATA[Gabriel Chan]]></dc:creator>
            <pubDate>Wed, 05 Jun 2019 04:38:37 GMT</pubDate>
            <atom:updated>2019-06-05T04:38:37.572Z</atom:updated>
            <content:encoded><![CDATA[<p>The following are a series of videos that may help with understanding blockchain and its applications:</p><ul><li><a href="https://www.youtube.com/watch?v=SSo_EIwHSd4">Blockchains: how does it work</a></li><li><a href="https://www.youtube.com/watch?v=aQWflNQuP_o">Blockchains: how can they be used</a></li><li><a href="https://www.youtube.com/watch?v=ZE2HxTmxfrI">Blockchain automation: smart contracts</a></li><li><a href="https://youtu.be/5I3wYAwbKMM">Blockchain &amp; Privacy</a></li></ul><p>A deep-dive into cryptography within and complementary to blockchain:</p><ul><li><a href="https://youtu.be/cczlpiiu42M">Hashing</a> <strong>(actually, it would be a good idea to watch this first)</strong></li><li><a href="https://www.youtube.com/watch?v=AQDCe585Lnc">Digital Signatures</a></li><li><a href="https://www.youtube.com/watch?v=gI0wk1CXlsQ">Differential Privacy</a></li><li><a href="https://youtu.be/OcmvMs4AMbM">Zero-Knowledge Proofs</a></li></ul><p>While we do not particularly support any blockchain network or platform, here is a video about our sponsor: <a href="https://www.youtube.com/watch?v=Do8rHvr65ZA">Cardano</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a293d423f095" width="1" height="1" alt=""><hr><p><a href="https://medium.com/international-blockchain-olympiad/designing-blockchain-applications-a293d423f095">Designing Blockchain Applications</a> was originally published in <a href="https://medium.com/international-blockchain-olympiad">International Blockchain Olympiad</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a Blockchain Whitepaper]]></title>
            <link>https://medium.com/international-blockchain-olympiad/writing-a-blockchain-whitepaper-1aa8b6f74a92?source=rss-9300bd61098------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aa8b6f74a92</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[writing-tips]]></category>
            <dc:creator><![CDATA[Gabriel Chan]]></dc:creator>
            <pubDate>Tue, 04 Jun 2019 06:46:02 GMT</pubDate>
            <atom:updated>2019-06-04T06:46:02.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NAMbK_Fra1UKJIlR" /></figure><p>The whitepaper entries for the 2019 International Blockchain Olympiad shall be evaluated based on the following criteria:</p><h3>Problem</h3><ul><li><strong>Significance</strong>: how important is it to solve this problem</li><li><strong>Merit</strong>: what compelling reasons are there to solve this problem</li><li><strong>Market</strong>: how big is the problem and is it worth solving</li></ul><h3>Solution</h3><ul><li><strong>Realistic</strong>: how feasible is the solution and why blockchain is used</li><li><strong>Value Proposition</strong>: how the solution generates value to stakeholders</li><li><strong>Competitors</strong>: how other solutions address the problem</li></ul><h3>Business</h3><ul><li><strong>Partners</strong>: who must you work with for your system to go live</li><li><strong>Differentiators</strong>: how the system is different and better than competitors</li><li><strong>Revenue model</strong>: how the system will be financially sustainable</li></ul><h3>Legal</h3><ul><li><strong>Privacy</strong>: how the system handles privacy, especially personal data</li><li><strong>Compliance</strong>: how the system handles legal and regulatory compliance</li><li><strong>Identity</strong>: how does the system handles identity and access control</li></ul><h3>Tech</h3><ul><li><strong>Blockchain</strong>: justification of using selected networks or infrastructure</li><li><strong>Cryptography</strong>: justification of using selected cryptographic features</li><li><strong>Legitimacy</strong>: how does the system derive and maintain legitimacy</li></ul><h3>Execution</h3><ul><li><strong>Distribution</strong>: how to go-to-market and get users using the system</li><li><strong>Governance</strong>: how are problems and unknown unknowns addressed</li><li><strong>Risks</strong>: what the weaknesses and threats are and how to address them</li></ul><h3>Bonus</h3><ul><li><strong>Financials</strong>: projections of profits and cash flow over three years</li><li><strong>Next Steps</strong>: what is needed to proceed if implemented in real life</li></ul><p>It is strongly advised that chapters be structured to best tell the story of the project, hence the open-ended nature of the whitepaper challenge, rather than forcing conformity to any “template” structure.</p><p>Additionally, these aspects will not factor into evaluation:</p><ul><li><strong>Page length:</strong> no minimum, no maximum. <br><em>Recommendation: shorter is better.</em></li><li><strong>Language: </strong>nothing fancy. This is not a novel or play or poem!<br><em>Recommendation: simple language and concise sentences</em></li><li><strong>Graphics:</strong> diagrams, tables, graphs are not necessary unless…<br><em>Recommendation: use only if it enhances the explanation of your project</em></li><li><strong>Formatting:</strong> as long as it is readable, it does not have to be pretty!<br><em>Recommendation: use default formatting from MS Word or Google Docs</em></li><li><strong>Citations:</strong> this is not an academic paper. Any standard is good!<br><em>Recommendation: use footnotes or whatever you’re comfortable with, but facts need to be backed by some sources, otherwise it’s just #fakenews</em></li><li><strong>Team:</strong> no one expects students to be experts!<em><br>Recommendation: be candid and transparent about your experiences</em></li><li><strong>Grades:</strong> no one cares if you’re a star student or a failure in school!<br><em>Recommendation: transcripts are for verification of student credentials only, you may choose to redact the grades if you wish.</em></li></ul><p>Please submit through <a href="http://ibcol.org/registration">ibcol.org/registration</a> or if there are submission issues, please send your paper to <strong>wp@ibcol.org</strong> along with the names of your team, your affiliated academic institution(s), and advisors if applicable (credential verification can be done retroactively with the Student Relations Team). Please reference a submission number if applicable.</p><p>Other enquiries may be addressed to the Project Management Office of the International Blockchain Olympiad Organizing Committee: <strong>pmo@ibcol.org</strong></p><p>Best of luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aa8b6f74a92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/international-blockchain-olympiad/writing-a-blockchain-whitepaper-1aa8b6f74a92">Writing a Blockchain Whitepaper</a> was originally published in <a href="https://medium.com/international-blockchain-olympiad">International Blockchain Olympiad</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain from First Principles]]></title>
            <link>https://medium.com/international-blockchain-olympiad/blockchain-from-first-principles-3d615701dce7?source=rss-9300bd61098------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d615701dce7</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-education]]></category>
            <dc:creator><![CDATA[Gabriel Chan]]></dc:creator>
            <pubDate>Fri, 12 Apr 2019 09:30:08 GMT</pubDate>
            <atom:updated>2019-04-12T09:30:08.594Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a summary of the Blockchain Training Camp developed by the Hong Kong Blockchain Society and delivered across the world.</p><h3>What is blockchain?</h3><p>A blockchain is a <strong><em>magical immutable record-keeping system</em></strong>. Immutable means unchangeable, which means all records written in the blockchain are unalterable and accessible, forever. The core of the system is a magic ledger, a record-book. The magic links each line in the book with the previous line, and also links each page with the previous page, such that if the book has been tampered with, it would be very obvious to everyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTMD4L4J-UYMwVAjGP65UQ.png" /></figure><p>This <strong><em>magical immutable record-keeping system</em></strong> is a distributed ledger, literally. More copies of the ledger makes the records more trustworthy than if just one person controls the record-keeping system through one ledger. And the more people that have a copy, the more trustworthy the records are, because bribery of ledger holders or other forms of collusion is more difficult.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1LwL7368dd31Q_O3bhC8A.png" /></figure><p>The magic of the ledgers also helps people synchronise their ledgers. When a new record is made, the magic decides if it is valid or not before adding to the official record, and makes it prohibitively expensive for non-valid records to be added. So, not only can everyone have the same records within a short amount of time, everyone can easily check if their records are valid or not.</p><h3>What is a blockchain, really?</h3><p>Replace the following:</p><ul><li>“<em>magic</em>” with cryptography (where the ‘crypto’ term comes from)</li><li>“<em>people</em>” with computers, run by individual or corporate persons</li><li>“<em>lines</em>” with digital transactions</li><li>“<em>pages</em>” with digital blocks</li><li>“<em>links between lines and pages</em>” as digital chains</li></ul><p>and reimagine the “<em>ledgers</em>” not as physical books, but digital ledgers, or “databases” (hint: they are not, but use this analogy for now), and that is what blockchain is: a type of immutable distributed ledger technology, and a tool for helping parties to interact without requiring full trust with each other.</p><p>This also implies no central control—otherwise the parties would have to trust this <em>de facto</em> authority—hence blockchain applications are called “<em>decentralised applications</em>”.</p><p>For students designing projects for the <a href="https://ibcol.org/"><strong>International Blockchain Olympiad</strong></a>, this information is already enough to build a decentralised application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkWPGISmSf7PwWx3jklBUA.png" /><figcaption>There are numerous interesting use cases of blockchain in any field. Cryptocurrencies is just one of many.</figcaption></figure><p>If you are still curious, read on for a very vague explanation of blockchain:</p><h3>Why is it blockchain?</h3><p>The concept of a block chain was first introduced in 1976, but the current definition of blockchain was popularised by the publication of <strong>Bitcoin: A Peer-to-Peer Electronic Cash System</strong> by Satoshi Nakamoto, in which numerous references to blocks and chains were made, although there were no explicit mentioning of the word “blockchain” — that was coined later (#pun).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFC2cQ2QrrA1JqxN7nZNBA.png" /><figcaption>One of the references of the block chain and etymology of the Chinese translation</figcaption></figure><h3>What is not blockchain?</h3><h4>BLOCKCHAIN ≠ BITCOIN</h4><p>Bitcoin is the first application of blockchain… Bitcoin is not blockchain.</p><h4>BLOCKCHAIN ≠ CRYPTOCURRENCY</h4><p>Cryptocurrencies like bitcoin have dominated the discussion of blockchain for the last several years, but now that the bubble has bursted, it’s clear that many blockchain associations are market-focused cryptocurrency associations rather than focusing on the application of blockchain itself.</p><h4>BLOCKCHAIN ≠ DISTRIBUTED COMPUTING</h4><p>Distributed computing has been around since the 1960s, but it cannot solve the double-spend problem without relying on centralised control.</p><h4>BLOCKCHAIN ≠ DATABASE</h4><p>Databases are not blockchains, because their records can be changed or destroyed, unlike the records on a blockchain, which can never be changed nor destroyed. A blockchain reflects changes in state by adding new records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vB3-7kfGF3fuBcJdAgFi7g.png" /></figure><p>Blockchains are also not linked lists nor spreadsheets. Now that you know what blockchain is and is not, what is it good for? Between “absolutely nothing” and “pretty much everything” depending on trust…</p><h3>When to use blockchain?</h3><p>Blockchains may be useful where there are multiple parties that need to reconcile information in order to work together. When everyone has their own records, the problem with reconciliation is that it is continuous, costly, and error-prone. Duplication can also lead to inconsistencies. Also, even for more than two parties, the reconciliation is actually bilateral, i.e. between two parties at a time. This means mistakes may magnify over time.</p><p>An obvious solution is to have a reconciliation infrastructure that keeps track of everything with a so-called “master copy”. This has its own issues: who is running it (management), how is it run (governance), where is it run (jurisdiction), and so forth. A centralised setup also makes a tempting target for bad guys to hack at.</p><p>Decentralisation through distributed ledger technologies like blockchain offers an elegant solution to the drawbacks of a centralised solution, even though the technology is harder to set up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*szdl2aw9ng2oK-8TJI_y5w.jpeg" /></figure><p>Blockchain is most useful when there are <strong>trust issues</strong>. If the parties involved already have a high degree of trust, there is no need for a blockchain. If parties require some trust to work together, but do not have or want to invest resources to build that trust, then that is an excellent case for blockchain.</p><p>And speaking of trust…</p><h3>Distributed Ledger Technology (DLT)</h3><p>A distributed ledger<strong> </strong>or shared ledger is a family of technologies that facilitates a consensus or agreement of replicated, shared, synchronised digital data among parties who need not trust each other. Blockchain is one member of this family, among others such as direct acyclic graphs (DAG) and other newer hybrid protocols.</p><p>DLT removes the need for centralised administration and centralised storage. This lowers the requirement for co-operation, because parties can work together without “getting married” to each other, sharing everything and revealing everything, including risks and sensitive information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbyToRo3FqBKIcHYk8_KCg.png" /><figcaption>Distributed Ledgers solve TRUST ISSUES</figcaption></figure><p>DLT can be classified as either <strong>permissionless</strong> or <strong>permissioned</strong>, depending on who has permission to participate in the validation or consensus process of a blockchain, i.e. the rules for deciding what lines in the ledger book are legit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T3Mejh26PuKLXZ0O6bxJFQ.png" /></figure><p>In order for DLT to work, it needs <strong>cryptography</strong> for ensuring:</p><ul><li>Secure authentication of participants</li><li>Secure access by participants</li><li>Security of transactions</li></ul><p>And DLT also needs a <strong>consensus protocol</strong> for ensuring:</p><ul><li>Validity of transactions</li><li>Ordering of transactions</li><li>Integrity of the Ledger</li></ul><p>Which brings us to the next topic:</p><h3>Cryptography</h3><p>Cryptography is the magic of the magical ledger. Cryptography is fundamentally mathematics. There are two important concepts to understand: digital signatures and hashing.</p><h4>Digital Signatures</h4><p>A signature is a unique, undeniable, personal, permanent mark used a proof of identity and intent. A signature is signed on a document as evidence of that person’s witness and certification of the contents of that document.</p><p><strong>Repudiation</strong> is the denial of the truth of validity of something; <strong>non-repudiation</strong> is the assurance that someone cannot deny the truth of validity of something. A signature is a non-repudiation device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8aNxvdTag_t5B7WiqttmQ.png" /><figcaption>Signing with your signature provides non-repudiation, so you can’t later deny any part of what you signed.</figcaption></figure><p>In the digital world, the equivalent to a signature is… a digital signature. Just as a physical signature is a unique, undeniable, personal, permanent mark, a <strong>digital signature</strong> does the same thing with “<em>magic</em>”, i.e. cryptography, i.e. mathematics. A valid digital signature is a non-repudiation device, so in addition to assuring that the signatory cannot deny signing something, it also assures that the something is from a known party, and it was not altered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEIMMYRsXn8WPU5Zl297ag.jpeg" /></figure><p>Digital signatures are represented by a private key for signing something and a public key for checking that something. A public key is 100% related to the private key, so if you know the public key and its owner, you can easily verify that the ownership. Meanwhile, it is impossible to forge a private key.</p><p>What is a key? It is actually just a bunch of letters and numbers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSqjP1Yn-wG74VmqY08ofw.png" /><figcaption>RSA (Rivest–Shamir–Adleman) is a widely-used algorithm for making the key-pairs for digital signatures.</figcaption></figure><p>So, how are keys created?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*zylKKu--8eMwBk72t3I-pw.png" /><figcaption>Key generation process</figcaption></figure><p>So, how are keys used?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*JSVYLsiDUqElCUr3TAWD9Q.png" /><figcaption>Alice makes a secret, and anyone with her public key can see it.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzaUrB95VDFblT0-_L7qIA.png" /><figcaption>Bob (or anyone) can also send a secret intended only for Alice, using Alice’s public key.</figcaption></figure><p>So, how are keys used in blockchain?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*PTpwMYqL93JuaePE5-jOoQ.png" /></figure><p>Your public key is used to generate addresses, which are pseudonymous “identities” for one to interact with other on a blockchain. In the bitcoin blockchain, whoever controls the private key can send bitcoin from all addresses derived from it.</p><p>And this is why you <strong>never give away your private keys!</strong> But wait, what is hashing? Good question…</p><h4>Hashing</h4><p>A hash function is a “math equation” that produces the same results uniform every time for any input. The cyan (light blue) <strong>input</strong> is hashed by the yellow <strong>hash function</strong> to produce the pink <strong>output</strong>. Note that even a small change in the input results in a completely unrelated output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNXCiDTLBE_qXv6wBvr4mg.png" /></figure><p>The next important concept to understand is the <strong>hash tree</strong>, also known as a Merkle Tree, because it was invented by a Dr. Ralph Merkle. The idea is that the key input is hashed, and the results will be hashed again with adjacent outputs, and those results are hashed again… until there is one hash output as a final result (the Merkle root). It is very easy to see if anything was changed, because any changes will affect hashes downstream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*sp0wvRx8Kw-NH0iQXM6bPw.jpeg" /></figure><p>The hash tree is the magic that links previous things with the next things, whether the thing is a “<em>line on the page</em>” (transaction, T) or a “<em>page in the book</em>” (block). By comparing the “<em>magic</em>” between the “<em>books</em>”, the “<em>people</em>” can see who is different… and therefore which “<em>books</em>” are legitimate or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UWgNz1C2RogIKKitEk1SQ.png" /></figure><p>But wait a minute, how do the “<em>people</em>” agree who is right or wrong? They would need some sort of rule set, also known as a protocol or algorithm, to come to a consensus…</p><h3>Consensus</h3><p>Consensus is a generally accepted decision among a group of people.</p><p>The most important thing for everyone to agree on is whether there is double spending (hint: there should not be). But what is double spending?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7GQO6xwOlddZtcwZk6iFQ.png" /><figcaption>Double spending is being able to send something out 2 or more times, yet supposedly only 1 time is allowed.</figcaption></figure><p>When something is physical, it is not easily nor economically replicated. In the digital world, replication is perfect and easy. So replicating physical money or something valuable is difficult, but replicating digital money would be easy. If someone can send you $100, you don’t want that person to send the same $100 to someone else, otherwise, when you want to claim that $100, you may have a chance of not being able to claim it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tfcm4zAEcMgV_t4N2LqO7w.png" /></figure><p>For a group with centralised administration, consensus is easy: everyone agrees because the admin says so! For example, the bank says your friend had $100 and now has $0 because you had $0 and now have $100. In a decentralised group, coming to an agreement requires some rules for everyone to follow. Who gets to say your friend now has $0 and you have $100? Consult the rules!</p><p>However, there may be issues within a group of people to worry about: what if they are bad people who purposely tampered with the ledger, and what if they also encouraged other people to be bad in unison? Or what if some people are just bad at recording stuff—the difference between mistakes and tampering is intent. Or what if some people fell asleep at the meeting, or did not make it to the meeting, so they could not participate in the decision-making process?</p><p>Computers and nodes on a blockchain network are like humans, and this problem is as old as distributed computing itself. This is the Byzantine General Problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*SUbCBiI3Fsi0Kqcoruvc0g.png" /></figure><p>The Byzantine Emperor and his armies have surrounded an enemy, and the only way to win is if the majority of his generals attacks at the same time. Assuming most of the army is loyal, the challenge is for the Emperor to communicate his intentions, but things can go wrong, namely if traitor(s) say their army will attack or retreat but have the intention to do the opposite, or if messengers are intercepted and killed, or if messengers deliver the wrong message (by accident or on purpose), or if messengers are late, and so forth.</p><p>How does this relate to blockchain?</p><ul><li><strong>The Byzantine generals must agree on a strategy.<br></strong><em>The book holders must agree on legitimate lines on a page.<br></em>The blockchain must agree on transaction validity.</li><li><strong>The Byzantine generals are geographically dispersed.<br></strong><em>The book holders are not in the same room or space.<br></em>The blockchain are distributed notes in a network.</li><li><strong>The Byzantine generals have loyalists and traitors among them.<br></strong><em>The book holders have honest and dishonest or incompetent people.<br></em>The blockchain have honest nodes and malicious or faulty nodes.</li><li><strong>The Byzantine generals may receive corrupted messages.<br></strong><em>The book holders may receive illegitimate information about new lines.<br></em>The blockchain may receive invalid transactions.</li><li><strong>The Byzantine generals want to know if messages are true.<br></strong><em>The book holders want to tell if lines on a page are legitimate.<br></em>The blockchain needs to show only valid transactions.</li></ul><p>A system that is able to handle the types of failures described in the Byzantine Generals Problem is said to be Byzantine fault tolerant or BFT. It turns out that in order for the consensus protocol of a DLT to be BFT, either <strong><em>liveness</em></strong> or <strong><em>consistency</em></strong> has to be supported and the other relegated to lower priority.</p><ul><li><strong>Liveness</strong> is one of the three properties in the FLP Impossibility (1985), which states that something good will eventually happen. In the context of consensus, liveness means participants eventually decide on a value, or will never be stuck without decision.</li><li><strong>Consistency</strong> is one of the three properties in the CAP theorem (2000), which states that something bad will never happen. In the context of consensus, consistency means participants will never decide on different values, or will always come to an agreement.</li></ul><p>Depending on the blockchain or DLT, there are different ways for the network or “<em>group of people who have the magic books</em>” to achieve consensus.</p><h4><strong>Proof-of-Work</strong></h4><p>The oldest and most reliable is the Proof-of-Work (PoW) consensus protocol, also called the Nakamoto Consensus.</p><p>In simple terms, the Merkle root that is used to link blocks in a chain must be hashed again with a random input, so that the result contains some zeroes. The random input needs to be guessed randomly, so it’s a lot of work (hence the name), and more zeroes means more guess work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ASRn4dMp7Tq2r9g-g0mYNQ.png" /></figure><p>The number of zeroes depends on how many computers are guessing together to arrive at a result within a certain time in order to generate a block or “<em>to go to the next page of the ledger book</em>”. For the bitcoin network, it’s 10 minutes to generate a block. This massive guessing work is what is known as mining. A chain of blocks represents a lot of work, and the longest chain requires the most work, so the longest chain is the most trusted and thus legitimate chain and official ledger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tb8cKchUzr1NFQJw2JDJ5g.png" /><figcaption>It takes a lot of work to convince enough people to get behind the fake queue you want to form.</figcaption></figure><p>There is also a rule that says “<em>pages</em>” are valid if the “<em>team</em>” can “<em>write</em>” two pages in succession .As long as there are more computers on the “good guys” side guessing—i.e. 51% of the network—then the “bad guys” would never win… the probability of getting lucky twice in a row is really low! So, the Nakamoto Consensus is a probabilistic solution to the Byzantine Generals Problem. This also means Nakamoto Consensus favours <strong><em>liveness</em></strong> (i.e. all transactions will be settled across all notes) over <strong><em>consistency</em></strong> (i.e. it is possible for nodes to not reach an agreement).</p><p>The advantages of Proof-of-Work consensus:</p><ul><li><strong>Provably: </strong>the consensus protocol has proven resilience against internal and external attacks for 10 years and counting!</li><li><strong>PoW is highly scalable:</strong> the work is automatically adjusted based on size of network via hash-rate (the zeroes needed in the linking hash)</li></ul><p>The disadvantages of Proof-of-Work consensus:</p><ul><li><strong>PoW is environmentally disastrous: </strong>mining results in very high energy consumption and heat dissipation from the hard-working computers</li><li><strong>PoW is vulnerable to centralisation:</strong> due to the scarcity of specialist mining computers (ASIC), miners become <em>de facto</em> central authorities</li><li><strong>PoW is vulnerable to end-of-chain hijacking:</strong> formally called the 51% Attack, i.e. if the bad guys cut the queue and formed their own queue and convinced other innocent people that their fake queue is the real queue.</li></ul><p>To address the specific drawbacks of Proof-of-Work protocols, a new class of consensus protocol was proposed:</p><h4>Proof-of-Stake</h4><p>A PoS algorithm chooses validators to write the next block. Each validator owns some stake in the network, and must lock it in order to be selected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXruyP45tgNgdghy6jJpEA.png" /></figure><p>Some of famous PoS attempts are:</p><ul><li>Casper (Ethereum)</li><li>Ouroboros (Cardano)</li></ul><p>The advantages of Proof-of-Stake consensus:</p><ul><li><strong>Speed:</strong> Provides faster processing of transactions</li><li><strong>Efficiency:</strong> Consumes less energy</li><li><strong>Less hardware:</strong> Doesn’t require ASIC</li><li><strong>Agile: </strong>Active punishment of dishonest validators</li></ul><p>The disadvantages of Proof-of-Stake consensus:</p><ul><li><strong>Lower barrier to attack:</strong> a malicious party only needs enough money, unlike PoW where time, expertise, hardware, and electricity are all additionally needed besides money.</li><li><strong>Centralisation &amp; Plutocracy:</strong> over time, only the richest stakeholders are permitted to have control of consensus in the blockchain.</li><li><strong>Unknown unknowns: </strong>PoS has not existed long enough and thus no one fully understands all its vulnerabilities, such as a plethora of possible attacks—Nothing-At-Stake, Fake-Stake, Spent Stake, Amplified Stake, Long-Range Attack—and possibility that the consensus may not Byzantine fault tolerant under important assumptions (which makes or breaks a decentralised distributed ledger system).</li></ul><p>But PoS is not the only one looking to replace PoW as the king of blockchain consensus protocols:</p><h4>Other Consensus Protocols</h4><p>A plethora of novel ideas sprung out of the euphoria in the cryptocurrency markets in the last few years:</p><ul><li>Proof-of-Activity</li><li>Proof-of-Authority</li><li>Proof-of-Believability</li><li>Proof-of-Burn</li><li>Proof-of-Capacity</li><li>Proof-of-Caring</li><li>Proof-of-Contribution</li><li>Proof-of-Credit</li><li>Proof-of-Elapsed-Time</li><li>Proof-of-Existence</li><li>Proof-of-History</li><li>Proof-of-Importance</li><li>Proof-of-Relay</li><li>Proof-of-Reputation</li><li>Proof-of-Retrievability</li><li>Proof-of-Service</li><li>Proof-of-Useful-Work</li><li>Proof-of-Value</li><li>Proof-of-Weight</li><li>Delegated-Proof-of-Stake</li></ul><p>Many of these are “working” in varying degrees, all of which have not been tried-tested-and-true. So, no one can really say what the disadvantages or vulnerabilities are, or how Byzantine fault tolerant they are under what assumptions.</p><p>The commonality of the aforementioned consensus protocols were designed for public blockchains, even if the design may result in a semi-permissioned or <em>de facto</em> permissioned blockchain.</p><p>For purpose-built permissioned blockchains (such as R3 Corda or the Hyperledger projects) and consortium blockchains, they can use other special types of consensus, such as pBFT (Practical Byzantine Fault Tolerance) or Raft consensus.</p><p>Here is a summary of what blockchains use which protocols for consensus:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Uq3p5t2IQKKFb3BoEtAOA.png" /></figure><h3>Choose your Blockchain</h3><p>Now that you have this information, what are you going to do with it? Even with the basic understanding of blockchain as a magic shared ledger, you can imagine all the possibilities in applying this magical technology for many of the world’s problems. But now that you had bravely chosen to read on, you are able to make an informed decision on which blockchain to choose for your decentralised application or dapp.</p><h4>Define ‘Shared‘ in Shared Ledger</h4><p>One of the most important choices to make as a dapp designer are about sharing and trust:</p><ul><li><strong>Access: <br></strong>Who can read? Who has permission to use the contents of the blockchain?</li><li><strong>Validation: <br></strong>Who can write? Who has permission to participate in the consensus?</li></ul><p>Although permissioned ledgers seem paradoxical to the whole reason for blockchain — a decentralised censorship-resistant system — permissioned blockchains thrive because they are compliant with the strictest regulations. There may be some problem areas that are highly regulated, leaving you without much choice except choosing among the permissioned DLT platforms, but if your problem area is [relatively] lightly regulated, consider a public chain.</p><h4>Even more Magical Cryptography</h4><p>The fundamental magic is largely the same for all blockchains. What should be considered is support for privacy preserving cryptography, some next-level magic whose importance will be covered in a summary of the legal and compliance module:</p><ul><li>Commitment Schemes: one can commit to ‘something’ while keeping it hidden, with the ability to reveal this ‘something’ later.</li><li>Ring Signatures: participants can participate in some activity together without revealing their identities.</li><li>Secure Multiparty Computation: participants pass around information to calculate something together without revealing what they are passing around to do the calculation.</li><li>Homomorphic Encryption: a way to do stuff with encrypted data and have the same results as if the data was not encrypted, e.g. perform calculations without passing information around.</li><li>Zero-Knowledge Proofs: a way to prove something without revealing the details needed to make the proof, e.g. being able to prove one is over 18 without revealing one’s birthday.</li></ul><p>When choosing a blockchain, consider the support or compatibility for which cryptography you need to work with. For example, it is much easier to implement privacy features for blockchains that use the UTXO model versus the accounts model.</p><h4>Does the Consensus make sense?</h4><p>For permissioned blockchains, consensus is relatively simpler because of the setup. For permissionless blockchains, the consensus protocol makes or breaks a dapp. Objectively speaking, the boring and wasteful PoW consensus is the most dependable of public blockchain protocols, with PoS coming in a far second. If choosing a blockchain with an exotic consensus protocol, you must outweigh the risks of working with a protocol that is not widely accepted as secure with the potential of a great fit for your dapp.</p><h3>What’s next?</h3><p>Apply what you learned into designing (a) project(s) for the <a href="https://ibcol.org/"><strong>International Blockchain Olympiad</strong></a>. Submit a paper between April 21 and June 9.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d615701dce7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/international-blockchain-olympiad/blockchain-from-first-principles-3d615701dce7">Blockchain from First Principles</a> was originally published in <a href="https://medium.com/international-blockchain-olympiad">International Blockchain Olympiad</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>