<?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 Jeremy Serror on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Serror on Medium]]></description>
        <link>https://medium.com/@diezna?source=rss-ee4a39b93112------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Jeremy Serror on Medium</title>
            <link>https://medium.com/@diezna?source=rss-ee4a39b93112------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:42:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diezna/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[Blockchain technologies for financial applications]]></title>
            <link>https://medium.com/belem-blockchain/blockchain-technologies-for-financial-applications-423527facead?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/423527facead</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[tezos]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Mon, 02 Dec 2019 12:59:35 GMT</pubDate>
            <atom:updated>2019-12-02T12:59:35.791Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blockchain software for financial applications</h3><h4>A technical look at four blockchain technologies for the finance industry</h4><p><em>Our full report can be found at </em><a href="https://belem.io/research"><em>https://belem.io/research</em></a></p><p>The security and robustness guarantees brought by blockchain technology to cryptocurrencies are of particular interest to financial institutions. Blockchain offers the opportunity to rethink financial interactions while improving the security of transactions and lowering operational costs. This study offers a comparison of distributed ledger technologies. It intends to assist decision making within financial institutions wanting to build distributed infrastructures and leverage a technology suited for finance and banking applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*dihSXs07lKfVrq7n.png" /></figure><h4>Introduction</h4><p>A blockchain can be understood as a database equipped with specific properties, implemented using cryptography and distributed algorithms. It is typically used to deploy critical applications requiring a high level of availability. Well-reviewed and well-tested open-source technologies are a natural fit: we consider Ethereum, Tezos, Fabric and Corda as best suited for further evaluation by financial institutions. We use the term <em>replicated ledger</em> for Ethereum and Tezos, and the term <em>distributed ledger</em> for Fabric and Corda.</p><p>Without limiting the scope of possible applications, we focus on the deployment of a ledger for the exchange of currency, assets or financial instruments: the goal is to establish a value transfer network. The underlying technology keeps official and immutable records, allowing the exchange of units of account in a trust-less environment. Blockchain simplifies and improves the security of applications built overtop: such as currency, payments, asset tokenization, treasury optimization, or OTC trading. Cryptocurrencies technology is directly applicable to such use cases. For other applications, such as the exchange of financial information, the reconciliation of financial operations, or the modelisation of secure business logics, a full replicated ledger (as used with cryptocurrencies) is often not required, favoring the use of a more distributed (or partionned) ledger: some blockchain fundamentals are preserved without necessarily having to reach a global consensus on every transaction.</p><p><strong>Ethereum</strong> and <strong>Tezos</strong> are similar technologies from a functionality standpoint, but they differ greatly in terms of conception and technical ambition.</p><p><strong>Fabric</strong> and <strong>Corda</strong> allow the definition of more general distributed networks and do not impose a global consensus. While it is possible to configure these technologies to operate in a manner close to Ethereum or Tezos, it is not their primary use case. Indeed, relaxing the need for a global consensus delivers a higher throughput.</p><h4>RESILIENCY AND PERFORMANCE</h4><p>Ethereum and Tezos aim to establish homogeneous networks, with a stable and predictable level of performance. Fabric and Corda are comparable to traditional networks of services offering a higher level of performance that can be more complex to guarantee over time.</p><h4>DEVELOPMENT ENVIRONMENT</h4><p>Fabric and Corda are akin to time-stamping platforms with authenticated computations certified by network nodes, while their execution is itself not part of the consensus. Tezos and Ethereum place smart contracts code on the blockchain and their execution is fully guaranteed by the network.</p><h4>SECURITY AND TECHNOLOGY RISK</h4><p>Public blockchain implementations offer a unique level of software security given their constant exposure to real world threats. Distributed ledger networks, by construction, offer a wider surface of attack and remain difficult to test and audit. From a reliability point of view, the design of Tezos gives it a convincing advantage.</p><h4>CONFIDENTIALITY</h4><p>Keeping operations confidential can be achieved in two ways. O<em>ff-chain</em>, with external mechanisms built on top of the blockchain to exchange information; or, <em>on-chain</em>, by maintaining information on the ledger. While the <em>on-chain</em> approach remains limited to certain applications as of today, the technology is rapidly progressing and may be a game changer in blockchain adoption.</p><h3>CHOOSING BETWEEN ETHEREUM, TEZOS, CORDA AND FABRIC</h3><p>When independent entities want to create a shared infrastructure of trust without the need for a global consensus, the approach employed by Corda and Fabric is well suited. To maintain a global ledger, and when it is critical to reach consensus on the outstanding supply and on transaction finality, the approach employed by Ethereum and Tezos is better suited. Replicated ledgers are clearly a compromise: deliver the highest stability and robustness at the expense of performance and with additional complexity for confidentiality. Distributed ledgers rely on different assumptions: maintain confidentiality and deliver performance, but with security guarantees that vary greatly depending on the exact application.</p><p>Corda and Fabric offer mechanisms that can also be developed on top of a blockchain network. The question is whether this model, which is quite different from the spirit of initial blockchains, is suitable, or if a custom solution is best, in particular if existing services within the organization already offer the required storage and communication infrastructure. The richness and flexibility of Corda and Fabric are also their greatest weakness, preventing the emergence of standard deployment strategies validated by the industry. Distributed ledgers are well suited to handle independent interactions within small groups of entities, and in particular when there is limited coupling and short asset lifetimes. Supply-chain is a good example: tracked items are independent from one another, and after processing of an item, its state remains unmodified.</p><p>Ethereum and Tezos are better suited to transactions between a large and dynamic number of entities sharing a common representation of assets with long-term value. Ethereum and Tezos offer software that has survived the constant challenge of securing large-scale public blockchains, reaching a level of safety likely unattainable by enterprise-driven efforts, which only have accumulated experience in the form of disparate private deployments. Smart contracts must be developed to extend the limited core blockchain protocol, however this is done without weakening the fundamental guarantees of the blockchain. Ethereum benefits from an older and richer environment, which is a strength and a weakness. New development efforts are focused on Eth2, raising questions over the long-term viability of the current protocol. Tezos directly offers a dynamically upgradable protocol, which, along with the modularity of its client, should allow for more substantial evolutions than are likely possible with Ethereum. Tezos also benefits from a skilled community of developers, clearly committed to the long-term development of the most robust software possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wZQfaRRNBOGmZTTVw09sQ.png" /><figcaption>Final round-up</figcaption></figure><h4>The full report can be accessed at <a href="https://belem.io/research">https://belem.io/research</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=423527facead" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/blockchain-technologies-for-financial-applications-423527facead">Blockchain technologies for financial applications</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ethereum Casper Project — Part 3/3]]></title>
            <link>https://medium.com/belem-blockchain/the-ethereum-casper-project-part-3-3-35e76daef732?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/35e76daef732</guid>
            <category><![CDATA[proof-of-stake]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[casper]]></category>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Tue, 12 Nov 2019 14:45:04 GMT</pubDate>
            <atom:updated>2019-11-12T14:45:04.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGAi4okbfx27EWpUmC22mw.jpeg" /></figure><h3>The Ethereum Casper Project — Part 3/3</h3><h4>The Casper FFG Project</h4><p><em>This post is part of a research report conducted by BELEM for Crédit Agricole CIB in December 2018. The full report can be found at </em><a href="https://belem.io/research"><em>https://belem.io/research</em></a></p><p>We first presented the history of the Ethereum project with regard to the transition to Proof-of-Stake and the Casper project. Now, we will present, from a technical standpoint, the Casper Friendly Finality Gadget (FFG) project. Lastly, we will illustrate the challenges ahead and the next steps of the project.</p><p>The idea of switching to a Proof-of-Stake mechanism has been present from the start of the Ethereum project. V. Buterin published many blog posts in 2014 on the subject, and we can find his first comments on the matter in Bitcoin Magazine. In early 2014, he introduced the notion of “slash”, which penalises validators who break the rules. For example, if a validator signs two checkpoints proposed at the same height, i.e. competing checkpoints, he loses his starting bet. From there, the PoS research in Ethereum focused on two main lines. The first conducted by Buterin which will lead to Casper FFG, and the second conducted by Vlad Zamfir which will lead to Casper CBC.</p><p>Vlad Zamfir started his work in 2014 after discussions with Vitalik on the idea of slashing. After identifying key PoS issues, such as long-term attacks or the Cartel effect, he focused on the CBC (Correct-By-Construction) approach.</p><h3>Focus on the Casper FFG contract of May 2018: over-laying PoS on PoW</h3><p>The Casper FFG project is therefore seen as a transition in several stages towards PoS. First, we need to build an overlay applicable to blockchains based on PoW. The goal is to further secure the network by offering additional guarantees. These guarantees are possible through the participation of members of the network who agree to place a deposit (the stake) so that they can be punished (slashed) if their behavior deviates from the rules of the protocol.</p><p>The first guarantee that Casper FFG seeks to offer concerns the finality of the blocks registered in the blockchain. In PoW, when a new block is proposed by a miner, it is broadcast in the network to the participants. However, while the block is being broadcast, other participants may also find a block. There is a certain confirmation waiting period before consensus is reached between all participants on one branch or the other. The rule of PoW encourages participants to always choose the longest chain (in terms of the number of blocks, and therefore computing power expended). From the point of view of the stakers, they can thus temporarily see a rewriting of the recent blocks, in other words: the registration of a block is considered as final only after a certain period of time after which it is considered that the energy to be spent on a rewriting is beyond the reach of any participant. In this sense, PoW consensus is not final, and in fact, cannot be rigorously considered as a conventional consensus algorithm: it is a probabilistic consensus, in the sense that the probability that the consensus is called into question is arbitrarily considered to be close to zero, but never exactly equal to zero.</p><p>Purpose of Casper FFG: Guarantee immediate finality in a Proof-of-Work blockchain via a Proof-of-Stake protocol.</p><p>This first step is very important, because, if this problem cannot be solved, there is a good chance that we will not be able to design PoS consensus algorithms with finality in the general case. In fact, having Proof-of-Work as a base layer helps in building.</p><p>The term <em>immediate</em> finality can be misleading; it means that once the finality is obtained by the PoS layer, one immediately considers that one will return to it: observing it is enough, there is no need to wait. On the other hand, the time between two Casper FFG validations is much longer than that of the PoW scale. In other words, with Casper FFG, we have more certain information, but it is slower to determine.</p><p>In simple terms, the principle of Casper FFG is:</p><ul><li>Using PoW as a block proposal mechanism for the registration protocol of the participants (stakers) and taking into account their security deposit (stake) and penalties (slashing).</li><li>The blocks produced are signed by stakers who have sequestrated a certain amount of Ether coin,</li><li>If a competing block is offered by the PoW layer, then we have two possible versions of the blockchain. PoS stakers are then required to choose only one of the two blocks and to sign only one. If a staker signs two competing blocks, the latter is slashed: his stake is lost,</li><li>If a majority of stakers have signed a given block, then we can consider the block as close to being finalized because it will not be possible to find a block signed by more participants. Unless a stake has chosen to sign a block twice and lose his stake.</li></ul><p>The introduction is accompanied by necessary practical complications that we introduce below, in a more technical description of how Casper FFG works.</p><p><strong>How Casper FFG works</strong></p><p>Casper FFG introduces the concept of “checkpoint”: it consists, for practical reasons, of works on a time scale of 100 Ethereum blocks. Every 100 blocks, the Proof-of-Stake confirmation status of the blockchain has the opportunity to change.</p><p>At first, it is assumed that there are registered stakers who have deposited Ether as a security deposit (stake). They have the opportunity to sign votes linking two checkpoints: a source checkpoint and a target checkpoint. By signing their vote, they agree to follow this version of the blockchain or else face a penalty.<strong> The idea of Casper FFG is to build a unique path of checkpoints for which the majority of participants have voted.</strong></p><p>Specifically, when &gt;⅔ of the participants (of the sum of the stakes, to be exact) have voted for a version of the blockchain between two checkpoints, it is said that these checkpoints are linked by a link of <strong>supermajority</strong>. Technically, we can find the framework of the consensus for which we know we can guarantee a finality with&gt; ⅔ of valid nodes: here, ⅔ of honest participants reach a consensus on the version to follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4oG4Orj8ix6QMiRi3r5POA.png" /><figcaption><strong><em>Figure 1. Simplified framework with 3 validating nodes, an arrow illustrates a signature validating the checkpoint</em></strong></figcaption></figure><p><em>A checkpoint is </em><strong><em>justified</em></strong><em> if strictly more than ⅔ of the validators sign it. A checkpoint is </em><strong><em>finalized</em></strong><em> if it is justified and followed by a justified checkpoint. In reality, we calculate the proportion of stakes, and strictly more than ⅔ of the total stake enables a checkpoint to be justified, then it is necessary for the next checkpoint to be justified again by &gt;⅔ of the stake, so that the previous one is finalized.</em></p><p>So, a checkpoint is said to be <strong>justified</strong> if one can go back from this one to the first checkpoint, by links of supermajority. Without more constraints, nothing prevents from having checkpoints<em> </em>that are justified, yet different and of the same height, that is to say, which directly compete with each other. This is a problem for determining the consensus, so the supermajority must make a unique choice. We then introduce the two rules to be observed in Casper FFG:</p><p><strong>Rule 1</strong>: A validating staker cannot vote for two different target checkpoints of the same height</p><p><strong>Rule 2</strong>: The votes of a staker must not overlap: there is no vote of stakers having a source or a target located between the source and the target of another vote of the same staker.</p><p>There remains one last key concept to introduce: a checkpoint is <strong>finalized </strong>if it is justified, AND if the next checkpoint is also justified. In simple terms, “finalized is twice justified”.</p><p>Casper FFG offers the following guarantees, subject to the two rules being observed by more than ⅔ of the participants:</p><ul><li>There cannot be two finalized checkpoints in conflict, so there will be only one version of the finalized blockchain (safety condition)</li><li>It is still possible to produce finalized checkpoints, provided that new blocks continue to be offered (liveness condition)</li></ul><p>Casper FFG solves a first problem: if we have a PoW blockchain, so subject to short-term reorganizations, FFG ensures, by the amount of stakes, that only one version of the blockchain will be determined and that a once a checkpoint is finalized, we do not return to it (unless &gt;⅓ votes do not observe the rules).</p><p>It lacks the addition of the last element to obtain a PoS solution: allowing a variable number of participants to join the protocol over time.</p><p>To participate in the consensus, one must stake Ether coin and join the group of validators, authorized to sign links between checkpoints. For this, Casper FFG proposes to rely on the chain of finalized checkpoints: at each finalized checkpoint, new entrants can stake their Ether (or the current participants may ask to exit), and after two checkpoints are finalized, the change is effective. From a certain point of view, the dynamic number of validators is made constant by periods of time: these periods are called dynasties. The implementation of such a mechanism is quite simple, but the consequences for Casper’s security are significant.</p><p><strong>Resilience of Casper FFG</strong></p><p>We have already mentioned the Nothing-At-Stake problem and Casper’s solution in this regard, which penalizes the stakers who sign conflicting checkpoints. There are still several problems to be solved, such as long-range attacks.</p><p>If a participant leaves the set of validators, he recovers his stake after a certain time. From there it is no longer subject to penalties, so a group of validators could rebuild an alternative version of the blockchain starting from a period when they were validators. If this group represented more than ⅔ validators at the time, then it is impossible for current validators to distinguish a new version of the blockchain from that at which they were previously.</p><p>This fundamental problem can only be solved by assuming that participants are regularly connected to the blockchain and will be able to refuse the new version simply because it is new. For us, this is the main criticism of the Casper approach, but it is a limitation that affects all PoS approaches in the sense that no other solution exists, and that the ecosystem seems to agree on this point. This leads to introducing the idea of subjectivity into consensus algorithms.</p><h3>The notion of subjectivity</h3><p>From a certain point of view, the innovation of the PoW consensus focuses on one specific point: Bitcoin is the first large-scale objective consensus. An open consensus is objective if an incoming entrant receives a copy of the state of the system and is able to validate it and ensure that it is the original version. In a PoW blockchain, one always chooses the longest chain and the problem is solved by assuming that there cannot exist an alternative version as long, that is still unknown to the participants. The argument is economic: as the PoW blockchain advances, the cost to produce a long-term revision increases exponentially. In other words, from a technical point of view, nothing prevents the production of an apparently valid alternative version; it simply costs so much that it is beyond the reach of any actor.</p><p>Casper, and the PoS approaches, cannot adopt the same solution so they introduce the notion of subjectivity: information external to the system — so-called social data — is needed to ensure that we are on the right version of the blockchain. For example, it is possible to ask a friend who has remained connected for current blockchain hash or refer to sites that publish this information. The PoS problem is, therefore, understood as follows: what is the minimum external information required to protect against long-term revisions?</p><p><strong>Continuation and withdrawal of PoW: difficulties and challenges</strong></p><p>Casper FFG relies on PoW to focus on the implementation of block finality. Otherwise, from a PoW consensus, what does it take to ensure that there is no return to a block once it is accepted in the blockchain? (And thus, avoid having to wait for a confirmation time of about 1 hour?) Using PoW protects the checkpoint chain from long-term revisions but does not solve the main problem: replacing PoW with a more energy-efficient mechanism. This involves introducing a block proposal mechanism for PoS validators so that they can sign and include the blocks in the consensus. This mechanism remains to be determined and shows the real PoS difficulties that the FFG approach faces In particular, long-term reviews must be prevented by appropriate safeguards.</p><p>The FFG approach therefore remains an interesting area of research, but it seems to be fraught with many unresolved difficulties. For this reason, the Ethereum research has also looked at the Correct-By-Construction approach, which we present in the full report.</p><h4>The full report can be accessed at <a href="https://belem.io/research">https://belem.io/research</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35e76daef732" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/the-ethereum-casper-project-part-3-3-35e76daef732">The Ethereum Casper Project — Part 3/3</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ethereum Casper Project — Part 2/3]]></title>
            <link>https://medium.com/belem-blockchain/the-ethereum-casper-project-part-2-3-e6e746c40baa?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6e746c40baa</guid>
            <category><![CDATA[casper]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[proof-of-stake]]></category>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 14:43:23 GMT</pubDate>
            <atom:updated>2019-11-06T13:31:46.855Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGAi4okbfx27EWpUmC22mw.jpeg" /></figure><h3>The Ethereum Casper Project — Part 2/3</h3><h4>The Proof-of-Stake problem</h4><p><em>This post is part of a research report conducted by BELEM for Crédit Agricole CIB in December 2018. The full report can be found at </em><a href="https://belem.io/research"><em>https://belem.io/research</em></a></p><p>In a way, the Proof-of-Stake problem can be formulated like this: can we reproduce the algorithmic equivalent of the Proof-of-Work by using algorithms inspired by those used in a private blockchain? We have good consensus algorithms where there is a known number of participants — can we extend these results for a variable and unknown number of participants, without basing the algorithm on the computing power available but on another quantity, say, voting rights or amount of cryptocurrency?</p><h4><strong>Overview of existing solutions using PoS</strong></h4><p>The first reference to Proof-of-Stake can be found in a BitcoinTalk forum thread in 2011. The first generation of solutions such as Peercoin led the way but did not initially make use of the available academic solutions. The first attempt was that of Jae Kwon with Tendermint, which was the first to attempt to apply research on Byzantine Fault Tolerance to a public blockchain. Since then, many projects using PoS have emerged (a non-exhaustive list includes Peercoin, PIVX, Stratis, Cardano, Decred, NEO, EOS and Tezos).</p><p>In the blockchain ecosystem, the main contributors to PoS research to date are:</p><ul><li>Sunny Aggarwal, who works on the Cosmos project</li><li>Vitalik Buterin, Karl Floersch and Vlad Zamfir (Casper)</li><li>Emin Gun Sirer (@el33th4xor) for the Avalanche Project</li><li>Silvio Micali for the @Algorand project</li><li>Dominic Williams &amp; Mahnush Movahedi for the Dfinity project.</li></ul><h4><strong>The difficulties of Proof-of-Stake</strong></h4><p>We summarise below the main problems with the PoS approach compared to the PoW approach.</p><ul><li><strong>Nothing-at-stake</strong></li></ul><p>If it costs nothing to produce a block, then everyone can make a different version of the blockchain, all valid according to the rules of the protocol. In Proof-of-Work, creating blocks is inherently expensive, therefore no one has the means or interest to try to rewrite the blockchain.</p><p>Since signing or voting for blocks does not cost anything, PoS needs to put mechanisms in place to prevent multiple valid variants from competing with each other.</p><ul><li><strong>Block proposal</strong></li></ul><p>This is how the nodes work together to determine the next block to be validated via consensus. In Proof-of-Work, block proposal is incensurable. A miner’s address is indeed anonymous. Miners could exclude blocks from addresses they do not know, but it’s expensive for them to do so.</p><p>Conversely, in Proof-of-Stake, blocks are partially censurable. Voters must have the cryptocurrency, so they can trace it and censure or ignore the votes of a given address.</p><ul><li><strong>Cartel effect</strong></li></ul><p>This is, for example, if more than 51% of miners agree, they can just ignore all the other participants (and therefore look honest and respect the protocol). With Proof-of-Work, one needs to continually spend energy to censure others and rewrite their block if they get there. It is by design less profitable than being honest! (no further incentive to form a cartel). In Proof-Of-Stake, few things prevent it, especially if all validators come from a known set (per period)</p><ul><li><strong>Initial investment</strong></li></ul><p>To participate in the consensus, it is necessary to invest or mobilise resources in one way or another, in the hope of collecting fees: purchase of equipment and electrical expenditure. It is truly an investment as it is also necessary to pay upfront before seeing a return, which remains rather uncertain. In short, it forces participants to commit for a some time.</p><p>In Proof-Of-Stake, mining requires purchasing of cryptocurrency. PoS solutions try to lock the coins in play for quite a long time to reproduce this effect and so replaces upfront payment with capital immobilization</p><p><strong>Long term chain reorganisation</strong></p><p>Can the blockchain be rewritten after some time? Is it easy to produce a altered, yet valid, copy of the blockchain?</p><p>In Proof-of-Work , it is by design exponentially expensive to rewrite the chain. If the network is partitioned, for example, it could happen, but a direct attacker could not manage it. For example, all Bitcoin miners take 10 minutes to produce a block, so it would take a lot more power than all miners put together to rewrite the chain in the long run faster than what the current chain is moving forward.</p><p>In Proof-of-Stake, since there is no cost related to the creation of the blocks, after a while the PoS miners are released from their commitment and could then rebuild an alternative copy of the blockchain. This is the challenge of PoS. With PoW, we know directly how much it costs. With PoS, we do not know if it’s possible; we try to show that it isn’t.</p><ul><li><strong>Block immediate finality</strong></li></ul><p>PoW requires waiting a few blocks before considering a certain blockchain transaction. This is the promise of the PoS, that it is possible, thanks to the penalty mechanism in particular, to achieve transactions that are confirmed immediately.</p><ul><li><strong>Objectivity</strong></li></ul><p><strong>This is a strong argument in favour of Proof-of-Work</strong>. A disconnected participant who receives a copy of the blockchain is able to know if it is the original version without resorting to other external information (social). The amount of energy spent creating the blockchain makes it unique.</p><p>Proof-of-Stake solutions use additional information known as “social information”, which confirms to a participant that they in fact have an original copy of the blockchain. PoS protocols are in this sense subjective; the blockchain alone does not ensure its authenticity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6e746c40baa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/the-ethereum-casper-project-part-2-3-e6e746c40baa">The Ethereum Casper Project — Part 2/3</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ethereum Casper project — Part 1]]></title>
            <link>https://medium.com/belem-blockchain/the-ethereum-casper-project-part-1-dd8802d730e9?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd8802d730e9</guid>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[casper]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[proof-of-stake]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Wed, 02 Oct 2019 12:15:13 GMT</pubDate>
            <atom:updated>2019-12-02T16:42:50.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGAi4okbfx27EWpUmC22mw.jpeg" /></figure><h3>The Ethereum Casper Project — Part 1/3</h3><h4>Introduction to blockchain consensus</h4><p><em>This post is part of a research report conducted by BELEM for Crédit Agricole CIB in December 2018. The full report can be found at </em><a href="https://belem.io/research"><em>https://belem.io/research</em></a></p><p>Read <a href="https://medium.com/belem-blockchain/the-ethereum-casper-project-part-2-3-e6e746c40baa">Part 2</a> &amp; <a href="https://medium.com/belem-blockchain/the-ethereum-casper-project-part-3-3-35e76daef732">Part 3</a></p><p>The consensus problem emerges in the context of the need to replicate critical computer systems such as databases [Johnson 1975]. The principle is simple: if a critical system can be faulty, then replicating it can serve to tolerate a number of failures of it. This is known as a fault-tolerant system. A considerable amount of academic research has been conducted since then, in order to characterize, among other things, the types and number of failures that can be tolerated and the best replication algorithms achievable in practice.</p><p>In simple terms, the consensus problem can be explained as follows: if a system is replicated in several instances, some of which are faulty, how can we determine the actual <em>consensus</em> within the replicates? In other words, when faced with several results that should all be identical, which one should be chose if they are not all identical?</p><p>Intuitively, one may infer that consensus is like a form of majority vote in instances. Indeed, it is assumed that a majority of instances work properly, otherwise determining the correct state of the system would seem a difficult task. The question is, however, how many faults can be tolerated.</p><p>A fundamental aspect of the consensus problem is that it is up to the instances themselves to vote. In other words, the instances must run a communication protocol, and this protocol must guarantee convergence to a deterministic state despite the occurrence of various faults. Any external element is excluded from the field, since it would then be necessary to characterise its degree of reliability, which amounts to integrating it into the initial system to be replicated.</p><p>The problem of general consensus is complex because the solution must tolerate all type of faults such as failures, transmission delays or loss of messages, or adverse behavior on the part of certain instances. This is called a Byzantine fault tolerance. The term refers to the Byzantine Generals’ Problem introduced by L. Lamport in 1982.</p><p><strong>The Byzantine Generals’ Problem (Lamport 1982)</strong></p><p>A group of generals in which each one commands a part of the Byzantine army encircles a city. These generals want to come up with a common plan of attack and must decide whether to withdraw or attack. Some want to attack, others do not; what is most important is that all take the same decision because a small attack will fail for sure.</p><p>These generals can exchange messages to take a decision, but some are traitors and can lose or alter messages. The problem, then, is how to ensure that honest generals come to a joint decision safely?</p><p>This reference problem gave its name to the so-called Byzantine faults. A Byzantine fault is as general as possible — anything can happen. While Byzantine fault tolerance is adapted to public blockchains, it is often too strong (too restrictive) for classical contexts. It is used in ultra-critical systems (aviation in particular); other systems use less-general failures, such as the initial crash model which is used often. Either an instance is working properly, the general is honest, or the instance is down and does not participate in the protocol, the general does not respond nor send a message.</p><p>To solve the problem, we must first ask a precise communication model (synchronous, bounded time, asynchronous, etc.). Without going into the details, we note that there is not always solution to the problem, in some cases, a single faulty instance can systematically cause the protocol to fail. In others, a certain number of failures can be tolerated: the strict threshold of two-thirds of valid instances often shows up and appears as a limit to what can be tolerated in practice. It is noted as “&gt; ⅔” below.</p><p><strong>Proof-of-Work: the Bitcoin solution to the consensus problem</strong></p><p>Bitcoin introduced a new consensus algorithm based on Proof-of-Work (PoW). However, this algorithm solves a very particular consensus problem related to what we can call an “open consensus” (or “public consensus”, but this term is confusing) that was previously little studied by companies or research laboratories. In fact, most of the research work focused on the scenario where there is a fixed number of replicates controlled by a single entity. In addition, Bitcoin introduces a mechanism of economic incentive, which Ethereum copied, that is absent from the classical research framework.</p><p>The <em>open consensus</em> focuses on the case where the number of replicates is large and evolves over time as participants join and leave the system, which is the case for public blockchains.</p><p>On the one hand, Proof-of-Work proposes investing computing power to receive a cryptocurrency: the security of the algorithm cannot be approached without cryptocurrency at the heart of the solution. On the other hand, the Proof-of-Stake proposes replacing the computing power expended by a security deposit in cryptocurrency.</p><h4><em>Many questions remain unresolved for open consensus problem posed by blockchain. The Casper project deals with one of them: can we do without the Proof-of-Work and replace it with another economic mechanism based on cryptocurrency sequestration and penalties?</em></h4><p><strong>The Ethereum project</strong></p><p>Ethereum was originally described in a white paper by Vitalik Buterin, a programmer involved in Bitcoin Magazine, in late 2013, with the aim of building decentralised applications. The development of the Ethereum software officially began early in 2014 via a Swiss company, Ethereum Switzerland GmbH (EthSuisse).</p><p>Ethereum offers the possibility of completely programming the transactions of a blockchain via <em>smart contracts.</em> While Bitcoin offers similar functionality, Ethereum is set apart by its more effective (and more centralised) governance that allows it to move faster towards its primary purpose: to be a universal platform of decentralised, trustless applications.</p><p>The Ethereum Foundation (<a href="https://www.ethereum.org/foundation">https://www.ethereum.org/foundation</a>) is in charge of the project governance and promotion. For the most part, Vitalik Buterin remains the face of the project, but many developers have taken a key role in its development. Among them, Gavin Wood and Jeffrey Wilcke who contributed to the creation of the platform, and Vlad Zamfir for Proof-of-Stake developments. Also worthy of mentioning are Péter Szilágyi and Felix Lange who contribute to the Go implementation of the Ethereum client. For more information, refer to the project wiki which remains the main source of information on the project. <a href="https://github.com/ethereum/wiki/wiki/">https://github.com/ethereum/wiki/wiki/</a>. The project blog and Vitalik’s blog are also useful resources: <a href="https://blog.ethereum.org/">https://blog.ethereum.org/</a>.</p><p>The Ethereum project is open-source and free. As a result, several companies have adapted or deployed public implementation of the technology in the private setting of a corporate network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd8802d730e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/the-ethereum-casper-project-part-1-dd8802d730e9">The Ethereum Casper project — Part 1</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lightning Network : Principes de fonctionnement]]></title>
            <link>https://medium.com/belem-blockchain/lightning-network-principes-de-fonctionnement-4f84f54c5f84?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f84f54c5f84</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[lightning-network]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Wed, 20 Jun 2018 14:38:06 GMT</pubDate>
            <atom:updated>2018-06-21T13:40:49.008Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dFQVIahDM3LAydZClTdAg.png" /><figcaption>Visualisation d’un noeud BELEM sur le réseau Lightning Network. Voir en live sur <a href="https://lnmainnet.gaben.win/">https://lnmainnet.gaben.win</a></figcaption></figure><p><em>Un nouveau protocole Bitcoin pour des transferts ultra-rapides</em></p><p>Une transaction Bitcoin permet le transfert de bitcoins entre membres du réseau Bitcoin. Une transaction contient généralement le montant de bitcoins transférés, l’adresse du destinataire, et surtout la signature de l’émetteur autorisant la transaction. Son inscription dans le registre du Bitcoin (la blockchain) lui confère son caractère officiel.</p><p>En réalité, le protocole permet de signer des transactions plus complexes, aussi appelés Bitcoin scripts ou smart contracts. Les transactions spécifient l’adresse du ou des destinataires, mais également les preuves que celui-ci doit fournir pour disposer des bitcoins reçus.</p><p>Le Lightning Network (LN) est une extension du Bitcoin, c’est un réseau de noeuds Bitcoin concluant des contrats particuliers et dont le but est de permettre le transfert instantané de bitcoins entre ses participants. Le Lightning Network cherche à tirer profits des transactions complexes du Bitcoin en réduisant au minimum la nécessité de recourir à l’inscription en blockchain.</p><p>Jusqu’au déploiement du Lightning Network début 2018, il n’était en effet possible d’envoyer des bitcoins qu’en passant par la blockchain. Si le transfert direct par blockchain demeure aujourd’hui encore la voie la plus sûre, c’est aussi la plus lente et la plus coûteuse.</p><p>Le LN ouvre la possibilité d’échanges garantis ou dit autrement la possibilité de faire des chèques en Bitcoin. Ces chèques peuvent être encaissés sur la blockchain du Bitcoin avec une garantie de provision, on pourrait ainsi les assimiler à des chèques de banque pour lesquels on a la certitude que ce ne sont pas des chèques en bois. Une transaction Lightning n’a pas besoin d’être inscrite sur la blockchain du Bitcoin pour garantir son existence, sa validité et la solvabilité de son émetteur. Les frais de transactions et le temps d’exécution sont alors réduits au minimum.</p><blockquote>Une transaction Lightning n’a pas besoin d’être inscrite sur la blockchain du Bitcoin pour garantir son existence, sa validité et la solvabilité de son émetteur</blockquote><h3><strong>Principe général</strong></h3><p>Partons d’une transaction simple. Alice souhaite transférer des bitcoins à Bob, elle signe donc une transaction autorisant le transfert vers l’adresse de Bob. Pour une transaction Bitcoin classique, Alice doit la diffuser à travers le réseau du Bitcoin afin que celle-ci soit incluse dans la blockchain. Après un certain temps (dit de confirmation), Bob peut considérer que la transaction est inscrite de façon irrévocable dans la blockchain. Il possède alors pleinement les bitcoins envoyés par Alice.</p><p>Le Lightning Network cherche à donner à Bob le même niveau de garantie sans devoir recourir à l’inscription coûteuse et lente dans la blockchain.</p><p>Imaginons qu’Alice envoie directement sa transaction à Bob sans la diffuser dans le réseau. Celui-ci, vérifiant la validité de la transaction, pourrait se dire qu’il suffira de la diffuser quand il souhaitera lui-même dépenser les bitcoins. Le problème est qu’Alice peut entre temps diffuser une autre transaction envoyant ses bitcoins à Charlie. Lorsque Bob diffusera la transaction pourtant signée par Alice, elle sera alors rejetée par le réseau. C’est le fameux problème de la double dépense ou <em>double spending</em>. Pour contourner cette difficulté, Alice doit d’abord inscrire une transaction particulière dans la blockchain : un verrou avec une date d’expiration et des règles définies à l’avance.</p><p>Ainsi, l’idée fondatrice du LN est de verrouiller temporairement les bitcoins d’Alice dans un canal. Ce canal stipule que seul Bob peut recevoir les bitcoins verrouillés. Le verrou permet à Bob d’être sûr que les bitcoins envoyés par Alice ne pourront pas être transférés avant que Bob ne diffuse la transaction d’Alice. A partir de ce mécanisme de base, Joseph Poon [1] a imaginé la formation d’un réseau de canaux, le Lightning Network. Dans ce réseau, on s’échange des transactions Bitcoin sans les diffuser immédiatement sur la blockchain. Le temps de confirmation devient quasi-instantané. Les membres de ce réseau se mettent d’accord sur les transferts à effectuer, et, en cas de désaccord, le différend est résolu par la voie classique de la blockchain.</p><h3>La brique de base : le canal de micro-paiement</h3><p>Alice commence donc par verrouiller ses bitcoins en diffusant une première transaction sur la blockchain, étape inévitable. Cette transaction stipule deux choses :</p><p>1. Si Bob présente une transaction signée par Alice sur la blockchain, les bitcoins verrouillés dans le canal seront envoyés à Bob.</p><p>2. Si aucun transfert n’a lieu jusqu’à l’expiration du verrou, les bitcoins seront déverrouillés et retourneront à Alice.</p><p>À partir de cette transaction, Bob est certain que seules deux choses peuvent arriver : soit il récupère les bitcoins d’Alice, soit le verrou expire. Voilà le problème du <em>double spending</em> résolu de façon extrême : Alice ne peut qu’envoyer ses bitcoins à Bob et à personne d’autre. Si le canal seul n’est pas suffisant pour envoyer des bitcoins à quiconque, il offre une possibilité fondamentale à Alice et Bob : ils peuvent réécrire la transaction autant de fois qu’ils le souhaitent, car celle-ci n’est justement pas encore inscrite sur la blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*aWBB_S6IvT6ljV0UZhU3nw.png" /><figcaption>Les transactions d’un canal de micro-paiement Bitcoin peuvent être renégociées instantanément et en toute sécurité par les tenants du canal. On peut ainsi enchaîner les paiements et seule la transaction finale passera effectivement sur la blockchain du Bitcoin</figcaption></figure><p>Par exemple,</p><p>0. Alice verrouille 1 bitcoin dans le canal</p><p>1. Alice achète une part de pizza à Bob et signe une transaction envoyant 0.1 bitcoin à Bob depuis le canal</p><p><em>Bob sait qu’il peut diffuser cette transaction dans la blockchain à tout moment, mais comme les fonds sont verrouillés rien ne presse, il peut considérer que le transfert est effectif.</em></p><p>2. Supposons qu’Alice souhaite acheter une autre part de Pizza à Bob. Alice et Bob peuvent alors annuler la transaction précédente et Alice signe une nouvelle transaction de 0.2 bitcoin vers Bob.</p><p>L’invalidation de la première transaction, et son remplacement, est la fonctionnalité clef du LN. Elle permet aux membres du réseau de négocier des échanges sans passer par la blockchain, sauf en cas de litige. L’invalidation repose sur le principe de pénalité, Alice et Bob signent un engagement à ne pas diffuser la transaction invalide, si l’un deux le fait, l’autre pourra alors diffuser une transaction infligeant une pénalité au tricheur. La pénalité choisie est supérieure au montant de la transaction, ainsi Alice n’aura aucun intérêt à diffuser l’ancienne version de la transaction (cela lui coûterait plus cher), Bob n’a quant à lui aucun intérêt en premier lieu, car la nouvelle version lui attribue plus de bitcoins.</p><h3>Du canal au réseau</h3><p>Le canal de micro-paiement est très pratique, mais il ne permet pas à Alice d’envoyer ses bitcoins à Charlie (qui lui vend des boissons).</p><p>La première option est qu’Alice ouvre aussi un canal vers Charlie, reproduisant le schéma mis en place avec Bob. Toutefois, cela lui coûterait des frais de transactions et l’obligerait à verrouiller d’autres bitcoins.</p><p>La seconde option, à la base du LN, est d’imaginer que Bob et Charlie ont ouvert un canal de micro-paiement entre eux. Ainsi, tout client ayant un canal avec l’un pourra envoyer des bitcoins à l’autre. S’il faut également une transaction initiale dans la blockchain, elle aura l’avantage d’être réutilisable par n’importe quel client de Bob ou de Charlie : c’est ainsi que le LN nous fait économiser des frais de transactions.</p><p>Il manque cependant un outil essentiel pour qu’Alice passe par Bob, sans que celui-ci ne puisse conserver les bitcoins initialement destinés à Charlie. Il s’agit du Hash Timelock Contract (HTLC). Dans la version simple du canal, il suffit à Bob de disposer d’une transaction signée par Alice pour effectuer le transfert. Dans le cas du HTLC, on ajoute une règle liée à la connaissance d’un secret.</p><p>Initialement, seule Alice a connaissance du secret. Celle-ci signe alors une transaction d’envoi de 0.1 bitcoin à Bob sous réserve que le secret soit connu. Si Bob a connaissance du secret, il sera à même de déclencher la transaction. Notons que si Alice ne revèle jamais le secret, les bitcoins seront déverrouillés après expiration du canal et retourneront à Alice. Bob, sans connaître le secret à ce stade, signe une transaction qui envoie 0.1 bitcoin à Charlie, sous la même réserve liée au secret. Alice prenant connaissance de cette transaction, peut alors révéler le secret en toute sécurité. Bob reçoit donc 0.1 bitcoin d’Alice, et Charlie reçoit 0.1 bitcoin de Bob. <strong>Les deux transactions sont soit toutes les deux possibles soit toutes les deux impossibles.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*-QRWLCjT1ZjGS1McImdmUw.png" /><figcaption>Les transactions conditionnées à la connaissance d’un secret sont à la base du Lightning Network, elles permettent de lier des transactions les unes aux autres de sorte que leur exécution soit atomique. Soit toutes les transactions sont possibles, soit aucune ne l’est. Par ce mécanisme, Alice peut faire transiter ses bitcoins par Bob en toute confiance.</figcaption></figure><p>Le réseau LN a pour ambition de créer un grand nombre de canaux entre tous les acteurs du Bitcoin. On pourra envoyer des bitcoins quasi-instantanément à n’importe quel participant en s’appuyant sur les membres du réseaux.</p><p>Si les principes fondateurs sont séduisants, il n’en reste pas moins que la mise en pratique comporte de nombreuses subtilités, voir [1]. On mentionne ici simplement une difficulté attendue. Un des intérêts du LN est d’éviter à tout le monde d’ouvrir un canal avec tout le monde (c’est en effet par la réutilisation des canaux qu’on réalise des économies), mais entre qui doit-on créer des canaux, et par quel chemin doivent passer les chaînes de transactions, sont deux questions qui restent complexes à gérer à grande échelle, de façon décentralisée.</p><p>Le réseau Lightning est en développement, plusieurs équipes travaillent en effet sur des implémentations indépendantes afin de préserver l’aspect décentralisé du Bitcoin. Le réseau est néanmoins <em>live </em>et les premiers tests sont très prometteurs. On y dénombre plus de 2500 noeuds pour presque 8000 canaux ouverts.</p><p>[1] Joseph Poon, Thaddeus Dryja, <a href="https://lightning.network/lightning-network-paper.pdf">https://lightning.network/lightning-network-paper.pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f84f54c5f84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/lightning-network-principes-de-fonctionnement-4f84f54c5f84">Lightning Network : Principes de fonctionnement</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three lessons learned from building a DApp World Cup game on Ethereum Blockchain]]></title>
            <link>https://medium.com/belem-blockchain/three-lessons-learned-from-building-a-dapp-world-cup-game-on-ethereum-blockchain-ba566f28336?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba566f28336</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[world-cup]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Fri, 08 Jun 2018 10:41:02 GMT</pubDate>
            <atom:updated>2018-06-08T11:37:33.307Z</atom:updated>
            <content:encoded><![CDATA[<p>In this piece, we focus on Ethereum Smart contracts and how they can be used in the field of sport forecasting.</p><p>At BELEM, we wrote a smart contract in Solidity to manage an open, hopefully secure, mutual betting game. A player inputs its forecast for World Cup games from Group phase to Final. The more accurate the prediction, the more points the player gets. Players in the top 1% split all the pool - more precisely we use a square root function to spice things a bit. A player buys a ticket for a fixed price, but can buy several tickets. You have a little chance to win big.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7G8JYP-uDWrYO62C44Wcaw.png" /></figure><p>From a high level perspective, the contract is pretty simple :</p><ul><li>Player sends their bet with their prediction for the games</li><li>World Cup happens, results are known</li><li>Players scores are known, top ones get the prize</li></ul><p>The job of the smart contract is to enforce that the rules of the games are correctly followed. The rules can be made public in advance, verified and tested by anyone. Once deployed as smart contract however they cannot be changed, or only changed by protocols concluded in advance.</p><h3>The oracle problem</h3><p>It’s worth reminding that smart contracts cannot read information from external sources. They can only read data written on the blockchain.</p><p>We have a first issue here, how can we ensure World Cup results received by the contract are correct ? We could introduce a multi-party agreement between a set of known trusted entities. For example, famous people could tweet their Ethereum address to register as game results. The game proceeds only if enough validators validate the results. Implementation would be quite straightforward in Solidity :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*AiPnPXq4RFNVpWtzXlql_Q.png" /><figcaption>A simple process that could validate official results by multiple parties, a solution to the Oracle problem.</figcaption></figure><p><em>Note : for this to be fair, validators would need to be identified and registered before the game begins without possibility of changing the set afterwards.</em></p><p>But, here is a question though : if validators can validate World Cup results, why could not they validate the whole game ? Well, they could, but that would probably be less practical. That is really what blockchain is about: s<em>eparating specific levels of trust in a process</em>. Validators only have to verify the World Cup results are correct and click OK, they don’t need to understand the game or run a blockchain node. As a player, you only trust them for that. For the game rules and your money flow, you trust the smart contract.</p><p>We work here under the assumption published results are correct. We consider then the security we can achieve with a smart contract in this setting.</p><h3>Security</h3><p>By using a blockchain we get a first (non) free lunch, we can prove our users that:</p><ul><li>Forecasts were actually made before the deadline</li><li>Money was committed : this ensures the prize to win is real</li><li>The rules are known in advance and cannot be changed</li><li>Money cannot be stolen and will only go to winners</li><li>We don’t take a fee</li></ul><h3>The GAS</h3><p>For any transaction on Ethereum you have to pay a fee in GAS units. GAS units represent costs for running contract code, reading from and storing data in the blockchain. As a consequence, for any players action in our game, a transaction fee has to be paid. This can be serious downside for DApp. A potential solution for this would be to allow the contract to use its own balance to pay for users initiated transaction, something not yet possible in Ethereum.</p><p>For this reason, writing a Smart Contract feels a bit like like hardware programming: you must be very careful about resources you consume. In our game, we faced multiple issues with GAS and other limitations, computing players prediction points was going to cost a non-negligible amount of GAS.</p><p>Firstly, we had to think an encoding for predictions data, we packed games scores into <em>bytes32</em> variables. Even with that, the GAS to play amounts for 0.0018 ETH (or about $1 as the time of writing)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJlQyAbECWACYuAFNHebMA.png" /><figcaption>Registering a new forecast</figcaption></figure><p>The main issue though was to sort all players scores and find out the best ones. We instead used the smart contract as a verifier. It does compute the score for each player, but only once and to compare it to a provided score threshold. The players with a score above the threshold are the winners, we know all of them and we can verify the number of winners follows the rules.</p><p>Finally, if the number of players happens to be large, computing the score would be to expensive to do at once, so we have to split the computation over several blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msw6shfDurfW3JAuVSbgtg.png" /><figcaption>Contract is in fact mostly validating game results rather than computing everything. This is the most expensive function in the contract, we had to split the execution step by step to avoid reaching block GAS limit.</figcaption></figure><p>Overall, we decided to minimize costs for players, assuming that if operations can be trust-less even if they are initiated and paid by contract’s creators, players would rather have their gas at minimum.</p><p><strong>Conclusion</strong></p><p>We explore Ethereum smart contracts by implementing a sport prediction game. Smart contracts provide several insurances that could easily be applicable to many use cases where parties agree on a set of rules.</p><p>Smart contracts provide real benefits but one must keep in mind:</p><ul><li>All this only works provided you trust the underlying blockchain coin (Ether here) has <strong>value</strong>. <em>Without value, there is no binding. </em>In fact even basic blockchain security could probably not be maintained. Miners would fleet and history could be rewritten…</li><li>Smart contracts are not autonomous, <em>someone or something has to </em><strong><em>trigger</em></strong><em> them</em>. Blockchain is more about splitting trust between parties. One party being the smart contract.</li><li>Smart contracts are <strong><em>expensive</em></strong>, for this reason they mostly end up being about verifying some rules and transfer coins. They barely can compute complex things on chain, and even then, there is serious cost for it.</li></ul><p>You can find the full code of the smart contract <a href="https://etherscan.io/address/0x6238972611f7933C6c0919c54447e2bAc86F96E7#code"><strong>here</strong></a>.</p><p>You can test the DApp game here : <a href="https://copadelcrypto.com/">https://copadelcrypto.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-s0C-_RzFmQFhhpojjnCQ.png" /><figcaption><a href="https://copadelcrypto.com/">https://copadelcrypto.com</a></figcaption></figure><p><strong>DISCLAIMER</strong>: Remember to use ETH Test Net Money and not real ETH if gambling is restricted in your country.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba566f28336" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/three-lessons-learned-from-building-a-dapp-world-cup-game-on-ethereum-blockchain-ba566f28336">Three lessons learned from building a DApp World Cup game on Ethereum Blockchain</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Développer une DApp en deux semaines : retour d’expérience]]></title>
            <link>https://medium.com/belem-blockchain/d%C3%A9velopper-une-dapp-en-deux-semaines-retour-dexp%C3%A9rience-1add25e2abd?source=rss-ee4a39b93112------2</link>
            <guid isPermaLink="false">https://medium.com/p/1add25e2abd</guid>
            <category><![CDATA[world-cup]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Jeremy Serror]]></dc:creator>
            <pubDate>Thu, 07 Jun 2018 09:06:10 GMT</pubDate>
            <atom:updated>2018-06-07T09:06:10.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*Gj5IvTOeQVdyO8ghR6XpWA.png" /><figcaption><a href="https://copadelcrypto.com/">https://copadelcrypto.com</a></figcaption></figure><p>BELEM développe depuis 2015 des solutions blockchain dans des domaines comme la finance, l’assurance, ou encore le notariat. Ces solutions s’appuient sur la blockchain pour permettre une délégation en toute confiance (vérification de règles, horodatage).</p><p>Avec la Coupe du monde de football 2018 en ligne de mire, nous nous sommes lancés un défi : développer en moins de deux semaines une application décentralisée de prédiction des résultats de la Coupe du monde.</p><p>Ethereum est une plate-forme blockchain qui permet d’héberger des applications décentralisées (DApp), aussi appelées “smart contracts” (des programmes informatiques qui s’exécutent sur la blockchain). Ces applications sont dites décentralisées dans la mesure où elles permettent de s’affranchir de la supervision d’un opérateur centralisé (type App Store ou Google Play).</p><p>Les applications décentralisées permettent de mettre en relation directe, sans intermédiaire, développeurs et utilisateurs, afin d’offrir un service plus transparent, équitable, et robuste que les modèles traditionnels. L’écosystème des applications décentralisées se développe rapidement. Il existe déjà des DApp sociales, qui rémunèrent les producteurs de contenu (les versions décentralisées de Twitter, Medium, YouTube, etc.), des DApp financières (plate-formes de prêt-emprunt ou de trading de pair-à-pair), ou encore des DApp de “collectibles”, des objets digitaux émis en série limitée, qui s’appuient sur une propriété essentielle de la blockchain : la possibilité de créer de la rareté numérique. CryptoKitties, l’application décentralisée qui permet de collectionner et d’élever des chatons à l’ADN unique, a ainsi récemment connu un succès retentissant (la propriété de certains chatons digitaux s’échangeant pour des montants supérieurs à 100 000$..).</p><p>Nous avons souhaité développer une application simple, ludique, qui puisse permettre au plus grand nombre de tester ce nouveau type d’applications. Avec la Coupe du monde de football 2018 en ligne de mire, nous avons ainsi décidé de dépoussiérer le traditionnel fichier Excel de pronostics en développant une application décentralisée de prédiction des résultats de la Coupe du monde, qui permet :</p><ul><li>l’enregistrement irrévocable des grilles de prédictions dans la blockchain Ethereum</li><li>l’encodage du calcul des scores de chacun des participants, vérifiable par tous</li><li>la sécurisation des fonds et le versement des gains aux vainqueurs</li></ul><p>C’est ainsi qu’est née notre DApp : Copa Del Crypto (<a href="https://copadelcrypto.com/">https://copadelcrypto.com/</a>). Une application gratuite qui distribue le rôle tiers de confiance, et ne stocke aucune donnée sur ses utilisateurs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-VoE2GNmDBtUNTpf_xMWaA.png" /></figure><p>Nous vous proposons ici un retour d’expérience sur les promesses des applications décentralisées comme la transparence, leur fonctionnement, et ce en quoi elles se différencient des applications traditionnelles.</p><blockquote>À la différence d’une application centralisée, une DApp ne vous demande pas de lui faire confiance, mais doit prouver sa validité à travers une logique informatique vérifiable par n’importe qui.</blockquote><h3>Transparence</h3><p>Une DApp n’est pas soumise à la validation d’un tiers (par exemple Apple Store ou Android Play) pour fonctionner. On peut ainsi voir Copa Del Crypto comme une application résistante à la censure, dans le sens où elle s’appuie sur une infrastructure décentralisée (ici Ethereum) pour fonctionner.</p><p>Sur cette infrastructure, l’ensemble des transactions et des contrats déployés sont publics. N’importe qui peut donc vérifier en temps réel, en téléchargeant l’ensemble du registre ou via à un explorateur de blockchain, l’ensemble des transactions réalisées pour une application donnée. Le code du “smart contrat” est également auditable. A la différence d’une application centralisée, une DApp ne vous demande pas de lui faire confiance, mais doit prouver sa validité à travers une logique informatique vérifiable par n’importe qui.</p><p>Le code du contrat développé pour Copa Del Crypto est accessible sur Etherscan. Le service effectue une vérification indépendante du code et garantit que le code source publié correspond bien au smart contrat officiellement déployé sur la blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OlTX39mPjoXiIO0uY3j1FQ.png" /><figcaption>Le code du smart contract publié et vérifié sur Etherscan</figcaption></figure><p>Il n’en reste pas moins que cette transparence a également un coût. Comme de nombreux bugs (certains aux conséquences lourdes) l’ont montré, auditer la sécurité d’un “smart contract” n’est pas une chose aisée. Même dans le cas d’une application simple comme Copa Del Crypto, notre contrat fait près de 400 lignes. Comprendre sa logique métier nécessite des compétences et un investissement conséquent.</p><h3>Barrières à l’entrée</h3><p>Pour tous ceux qui ne sont pas familiers du monde des blockchains, qui ne possèdent pas de crypto-actifs comme l’Ether, et qui n’ont jamais manipulé de “wallet” (la grande majorité d’entre nous), le parcours utilisateur d’une application décentralisée n’est pas forcément linéaire..</p><p>La participation à une application décentralisée passe en effet par l’envoi de transactions vers le “smart contract” qui encode ses règles. Pour participer à Copa Del Crypto, les participants doivent enregistrer leurs prédictions, via une transaction Ethereum, dans le “smart contract” qui gère les règles du jeu.</p><p>Nous avons choisi d’utiliser Metamask, une extension qui s’intègre facilement à certains navigateurs comme Chrome, pour permettre aux participants d’interagir avec la blockchain Ethereum. Concrètement, Metamask est un wallet (un portefeuille digital) Ethereum, qui va permettre aux participants d’enregistrer leurs prédictions, et de récupérer leurs gains à l’issue de la Coupe du monde.</p><p>Pour participer à une application décentralisée, les participants doivent donc :</p><ul><li>Posséder ou se procurer de l’Ether</li><li>Installer Metamask sur leur navigateur</li><li>Transférer une certaine quantitée d’Ether de leur wallet vers Metamask</li></ul><p>Si ces étapes peuvent sembler naturelles aux personnes déjà familières des DApp, ce parcours reste loin d’être limpide pour un utilisateur néophyte. Un des objectifs de Copa Del Crypto est de permettre au plus grand nombre de se familiariser avec le maniement des applications décentralisées. Nous avons donc cherché à simplifier au maximum ce parcours.</p><p>Les participants se connectent sur un environnement de test (Rinkeby test network), une blockchain alternative sur laquelle les jetons utilisés n’ont aucune valeur. Une fois leur prédiction remplie, ils peuvent nous communiquer l’adresse de leur wallet Metamask, et nous leur envoyons directement des jetons qui leur permettront d’enregistrer leur prédictions et de participer au concours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7G8JYP-uDWrYO62C44Wcaw.png" /><figcaption>Envoi de la transaction vers Ethereum par l’extension Metamask</figcaption></figure><p>Un réel effort de pédagogie est donc nécessaire pour accompagner ceux qui souhaitent découvrir les applications décentralisées. Mais une fois ces étapes préliminaires passées, les DApp offrent de nouvelles possibilités intéressantes.</p><h3>Un nouveau type d’applications</h3><p>Les applications décentralisées offrent de nouvelles perspectives par rapport aux applications traditionnelles, au-delà de leur caractère inarrêtable.</p><p>Tout d’abord, un utilisateur n’a plus besoin de s’authentifier pour chaque application. En effet, au lieu d’un système traditionnel identifiant / mot de passe, l’authentification se fait grâce aux clés stockées dans le wallet Metamask. Les utilisateurs ont ainsi un contrôle total sur leurs données. Et une fois leur wallet Metamask configuré, ils peuvent très simplement utiliser une grande variété d’applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-s0C-_RzFmQFhhpojjnCQ.png" /><figcaption>Les derniers pronotostics enregistrés sur la blockchain</figcaption></figure><p>Par ailleurs, la solution de paiement d’une application décentralisée est directement intégrée, puisque les échanges se font par le jeton intrinsèque à la blockchain, l’Ether dans le cas de la blockchain Ethereum.</p><p>Enfin, la blockchain permet de développer des applications sans se préoccuper du back-end. En effet, pour Copa Del Crypto, nous avons simplement développé un front-end, la page web qui permet de remplir ses prédictions et d’interagir avec la blockchain Ethereum, et un “smart contract” qui implémente la logique métier du concours de prédiction. Ce type d’architecture est beaucoup plus léger et transparent qu’une application traditionnelle.</p><blockquote><em>Aucune triche n’est possible car tous les échanges de valeur sont conditionnés à des règles prédéfinies et vérifiables.</em></blockquote><h3>Retour d’expérience</h3><p>L’expérience utilisateur des applications décentralisées doit encore s’améliorer pour toucher un public plus large que celui des convertis.</p><p>Une fois les barrières à l’entrée levées, les applications décentralisées séduisent par leur fluidité d’utilisation et la réelle possibilité de sécurisation des échanges qu’elles représentent.</p><p>Copa Del Crypto apporte par exemple à ses utilisateurs la garantie qu’aucune triche n’est possible car tous les échanges de valeur sont conditionnés à des règles prédéfinies et vérifiables.</p><p>Nous vous invitons à faire l’expérience par vous-même en participant au concours Copa Del Crypto : <a href="https://copadelcrypto.com/">https://copadelcrypto.com/</a>, vos retours seront plus que bienvenus !</p><blockquote><strong><em>Avertissement</em></strong><em> : la participation au pari mutuel avec des crypto-monnaies réelles (ayant une valeur) est soumis à réglementation. Pour Copa Del Crypto, nous utilisons le Test</em><strong><em> </em></strong><em>Network d’Ethereum où les Ether échangés sont sans valeur.</em></blockquote><p><strong>BELEM</strong> (<a href="https://belem.io/">https://belem.io/</a>) permet aux entreprises de capitaliser sur la technologie Blockchain à travers une offre verticale qui inclut formation, idéation, développement de prototypes et industrialisation de projets innovants. Nos partenaires incluent Société Générale, Crédit Agricole, BNPP, Natixis, Amundi, la Caisse des Dépôts et Consignations, Vinci, CNP Assurances, etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1add25e2abd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belem-blockchain/d%C3%A9velopper-une-dapp-en-deux-semaines-retour-dexp%C3%A9rience-1add25e2abd">Développer une DApp en deux semaines : retour d’expérience</a> was originally published in <a href="https://medium.com/belem-blockchain">BELEM BLOCKCHAIN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>