<?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[Interstellar - Medium]]></title>
        <description><![CDATA[Introducing Interstellar: making building and operating on Stellar even easier. - Medium]]></description>
        <link>https://medium.com/interstellar?source=rss----11e213982ac4---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Interstellar - Medium</title>
            <link>https://medium.com/interstellar?source=rss----11e213982ac4---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 21:25:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/interstellar" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[The Interstellar Update]]></title>
            <link>https://medium.com/interstellar/the-interstellar-update-1c4228d3f28b?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/1c4228d3f28b</guid>
            <category><![CDATA[interstellar]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[stellar]]></category>
            <dc:creator><![CDATA[Interstellar]]></dc:creator>
            <pubDate>Thu, 12 Sep 2019 19:04:10 GMT</pubDate>
            <atom:updated>2019-09-12T19:04:10.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZTOAEBsYsckiVzMBYNF6Q.png" /></figure><h4>We have two big pieces of news to share.</h4><p>First, we’re spinning-out a new app-focused company, called <a href="https://pogofin.com/">Pogo</a>, targeting interoperability between mobile wallets around the world. Pogo has been in stealth development here for some time, and, as a natural extension of that process, Adam Ludwin will lead this spin-out. As you’ll see when the service goes live, Pogo is the kind of application that Stellar is uniquely positioned to enable, thanks to the network’s ability to create low-friction, high-liquidity, real-time corridors for FX settlement between financial entities.</p><p>Second, and most exciting, Mike Kennedy, founder of <a href="https://www.zellepay.com/">Zelle</a>, is joining Interstellar as our new CEO. Mike’s success with Zelle speaks for itself — it’s a payment system used by Chase, Citi, and Bank of America, among <a href="https://www.zellepay.com/get-started?">many others</a>. His history of innovation in mobile payments, FX and banking, coupled with his track record as a high-impact advisor to Stellar make him the perfect fit to lead Interstellar.</p><p>We expect that Mike and the team he’s bringing in will build powerful new services for Stellar, just as he scaled and built Zelle. Below are a few words from Mike about why he is joining Interstellar and the future we’ll be working toward:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_imdyUGVGteHYoydAQ5RA.jpeg" /></figure><blockquote>“I am excited to be taking on the role of CEO at <strong>Interstellar</strong>. I have always been interested in working on making things easier for individuals and companies, and I believe we have the opportunity to help make international payments more efficient, lower cost, and faster.</blockquote><blockquote>This was my mindset when founding and running <strong>Zelle</strong>. We realized that no one wanted to carry or pay with paper — cash and checks — and rather wanted to pay and move money digitally and securely. We therefore created a digital network of banks in the US to allow for this. We were able to scale this to over $50 billion in transaction volumes from over 25 million users. Our success was because we were solving a real-world problem.</blockquote><blockquote>With <strong>Interstellar</strong> I see another opportunity to solve a real-world problem. Today, international payments are inefficient, expensive, and slow. Millions of individuals and businesses would benefit from solving these problems. The <strong>Stellar Development Foundation</strong> (SDF) has developed what I believe is the best blockchain based payments network, enabling fast and inexpensive international payments. However there are still parts of the ecosystem that are not optimally solved for, and ones that a non-profit like <strong>SDF</strong> is not best suited to solve. This is where Interstellar comes in. We will deliver these missing pieces of the puzzle to allow the Stellar network to achieve its potential. We will solve the remaining problems, turbocharging adoption and growth — making international payments better for millions and millions of companies and end users.</blockquote><blockquote>It is solving these real-world problems — making payments easier, faster and cheaper for end users — that gets me excited! I look forward to the growth ahead, leading <strong>Interstellar</strong>.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c4228d3f28b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/the-interstellar-update-1c4228d3f28b">The Interstellar Update</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Stellar Consensus Protocol]]></title>
            <link>https://medium.com/interstellar/understanding-the-stellar-consensus-protocol-423409aad32e?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/423409aad32e</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[consensus-algorithm]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[stellar]]></category>
            <dc:creator><![CDATA[Bob Glickstein]]></dc:creator>
            <pubDate>Wed, 13 Mar 2019 18:08:25 GMT</pubDate>
            <atom:updated>2019-03-13T18:08:25.428Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NqbFmS7qUKfZKmUWFOOKdw.gif" /></figure><p>The Stellar Consensus Protocol was first described in <a href="https://www.stellar.org/papers/stellar-consensus-protocol.pdf">a whitepaper</a> by David Mazières in 2015. It is a “federated Byzantine agreement system” that allows decentralized, leaderless computing networks efficiently to reach a consensus outcome on some decision. The Stellar payment network uses SCP to provide a consistent view of the network’s transaction history to all participants.</p><p>Consensus protocols have a reputation for being difficult to understand. SCP is simpler than most but still shares that reputation — due in part to the mistaken idea that “federated voting,” which the whitepaper spends its first half describing, <em>is</em> SCP. But it’s not! Instead, it’s an essential building block used by the second half of the whitepaper to construct the <em>actual</em> Stellar Consensus Protocol.</p><p>In this article, we’ll give some brief background about what an “agreement system” even is, what can make one “Byzantine,” and why you’d want to make a Byzantine one “federated.” We’ll then explain the federated voting procedure described by the SCP whitepaper, and finally explain SCP itself.</p><h3>Agreement systems</h3><p>An agreement system allows a group of participants to reach the same decision about something — for example, what to order for lunch.</p><p>At the offices of Interstellar, we have implemented our own lunch-agreement system: we order whatever our operations manager, John, says. It’s a simple and effective agreement system. We all trust John to order something interesting and nutritious each day.</p><p>But what if John were to abuse that trust? He could unilaterally decide we must all become vegans. After a week or two of that we’d probably depose him and give his authority to Elizabeth, but maybe she’s on an avocado-and-anchovy-sandwich kick and thinks we all should be too. Power corrupts, we might decide, and so we would seek some more democratic method: some way to make sure different preferences are heard while still reaching a timely, unambiguous outcome, so that we don’t end up with no one ordering lunch, or five of us placing competing lunch orders, or no decision about what to order until 4pm.</p><p>It might seem that the solution is simple: just conduct a vote! But this is deceptive. Who gets to collect ballots and report the results? And why should the rest of us trust what they say? Perhaps we could <em>first</em> vote on a leader whom we all trust to run the vote — but then who gets to run <em>that</em> vote? What if we can’t agree on a single leader? Or, what if we can agree, but then that leader gets stuck in a meeting, or goes home sick?</p><p>Similar problems are common in distributed computing networks. All the participants, or <em>nodes</em>, must agree on some decision, such as whose turn it is to update a shared file or pull a task from a processing queue. In a cryptocurrency network, nodes repeatedly must decide what the complete history of the shared ledger looks like, from among multiple possible versions that occasionally conflict. This network-wide agreement allows the recipient of a crypto coin to have faith that the coin is both (a) valid (not counterfeit) and (b) not already spent elsewhere. It also assures them that they’ll be able to spend it in the future, because the new recipient will have the same faith in it, for the same reasons.</p><p>Any agreement system in a distributed computing network needs to be fault-tolerant: it must produce consistent results despite errors like slow communication links, unresponsive nodes, and misordered messages. A <em>Byzantine</em> agreement system is additionally tolerant of “Byzantine” faults: nodes that give false information, whether due to error or in a deliberate attempt to subvert the system or gain some advantage.¹ Consider the owner, Alice, of a crypto coin, who has to choose between buying a delicious gelato with it from Bob, or paying it to Carol to settle a debt. Alice might like to have it both ways by fraudulently paying the same coin to both Bob <em>and</em> Carol. To do so she must convince Bob’s computer that the coin was never paid to Carol, and she must convince Carol’s computer that the coin was never paid to Bob. A Byzantine agreement system can make this effectively impossible using a form of majority rule called a <em>quorum</em>. A node in such a network refuses to commit to a particular version of history until it sees that enough of its peers — a quorum — are also prepared to commit. Once that happens, they’ve formed a voting bloc large enough to force the remaining nodes in the network to agree with their decision. Alice might be able to cause some nodes to lie on her behalf, but if the network’s large enough, her attempt will be overwhelmed by the votes of honest nodes.</p><p>How many nodes does it take to form a quorum? At least a majority and more typically a supermajority to combat errors and fraud. But knowing when you have a majority means knowing how many total participants you have. In the Interstellar office, or in a county election, those numbers are easy to know. But if your collection of participants is a loosely defined network that members can join and leave at will, without needing to coordinate with any central authority, then you need a <em>federated</em> Byzantine agreement system: one that can determine quorums not from some predetermined roster of nodes, but dynamically, from an ever-changing and inevitably incomplete snapshot of membership at a point in time.</p><p>It might not seem possible to construct a quorum from only the limited perspective of a single node in a sprawling network, but it is. This quorum can even create confidence in the outcome of a decentralized vote. The SCP whitepaper shows how to do this using a procedure called <em>federated voting</em>.</p><h3>For the impatient</h3><p>The rest of this article describes federated voting and the Stellar Consensus Protocol in some detail. To serve as a guide to what follows — or if you don’t care about the detail and just want the tl;dr — here’s an overview of the process.</p><ol><li>Nodes conduct rounds of federated voting on “nominees.” A round of federated voting means:<br>• A node casts a vote for some statement, such as “I nominate value V”;<br>• The node listens to votes from its peers until it finds one it can “accept”;<br>• The node seeks a “quorum” that also accepts the statement. This “confirms” the statement.</li><li>As soon as a node can confirm one or more nominees, it starts trying to “prepare” a “ballot” via more rounds of federated voting.</li><li>As soon as a node can verify that a ballot is prepared, it starts trying to “commit” the ballot via still more rounds of federated voting.</li><li>Once a node can confirm that a ballot is committed, it can “externalize” the value in that ballot, using it as the outcome of consensus.</li></ol><p>These steps involve multiple rounds of federated voting that collectively form a single round of SCP. To understand what each step means, why so many are needed, how it all works, and what can go wrong, read on!</p><h3>Federated voting</h3><p>Federated voting is a procedure for discovering whether a network of participants can agree on a proposal. In a round of federated voting, each node must choose one of potentially many possible values as the outcome of that round. It cannot do so until it is sure that the other nodes in the network won’t choose any different outcome. To be sure of that, the nodes exchange a flurry of messages back and forth allowing each of them to <em>confirm</em> that a <em>quorum</em> of nodes <em>accepts</em> the same <em>vote</em>. The rest of this section explains the terms in that sentence and how such a confirmation can be achieved.</p><h3>Quorums and quorum slices</h3><p>Let’s start with identifying a quorum. As we discussed above, in a decentralized network with dynamic membership, it’s impossible to know ahead of time how many nodes there are, and therefore how many make up a majority. Federated voting solves this by introducing the novel idea of a <em>quorum slice</em>: a small collection of peers that a node trusts to convey information about the state of voting in the rest of the network. Every node defines its own quorum slice (of which it is also <em>ipso facto</em> a member).</p><p>To form a quorum, start with a quorum slice. For each member, add the members of its quorum slice. Then add the members of <em>those members’</em> slices, and so on. As you continue you’ll encounter more and more nodes that you can’t add because they’re already included. When there are no more new nodes to add, stop: you have formed a quorum from a “transitive closure” of the starting node’s quorum slice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*PpOgeLUv5oksyPLbM9084Q@2x.png" /><figcaption>To find a quorum from a given node…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*43Rxi6OdRkPPCtAUlOaJ7A@2x.png" /><figcaption>…add the members of its quorum slice…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*QTdtgPqVkAfGBG72r5Bj-Q@2x.png" /><figcaption>…then add the members of those nodes’ slices.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*3_VqJKijGTOBVkh-isRNnQ@2x.png" /><figcaption>Continue until there are no nodes to add.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*_n_FppFfnO7dXP57NwTkiw@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*R6Sl09-p0s0Y8FohB0DTHg@2x.png" /><figcaption>No remaining nodes to add. This is a quorum.</figcaption></figure><p>In fact each node may have more than one quorum slice. To form a quorum, choose just one of the slices and add the members; then choose any one slice for each of the members and add <em>those</em> members, and so on. This means that each node is a member of many possible quorums.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*Lmq3YMNAobwvtSt62YbORg@2x.png" /><figcaption>Choose just one quorum slice at each step.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*C1Ub_ESvsy_VyS50XFJ1eA@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*mIfjv90GHRQ-30VTmhHnXg@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*aqpq_zPvGv3BxMaj3ve3cA@2x.png" /><figcaption>One possible quorum. Alternatively…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*9UDdgr9s5B2lyQKnIDyWSA@2x.png" /><figcaption>…choosing different slices…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*_eYBA1r3NdiYraKN1mK51g@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*mIfjv90GHRQ-30VTmhHnXg@2x.png" /><figcaption>…(when possible)…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*SSOOtvvqHH9TcYsMV1v-eA@2x.png" /><figcaption>…produces a different quorum.</figcaption></figure><p>How does a node know the membership of another node’s quorum slices? The same way it knows anything else about other nodes: from the broadcasts that each node sends to the network whenever its voting state changes. Each broadcast includes the details of the sending node’s slices.²</p><p>Recall that in a non-federated Byzantine agreement system, a quorum is defined as a majority of all nodes.³ Once a proposal passes the quorum threshold, the rest of the network members are convinced that any competing proposals will fail. This is how the network converges on an outcome.</p><p>But in a federated Byzantine agreement system, not only can there be no majority (because no one knows the total size of the network), but the concept of majority is not even useful! If membership in the system is open, then someone could gain a majority simply by conducting a so-called Sybil attack: joining the network many times using multiple nodes. So what is it about the transitive closure of a node’s quorum <em>slice</em> that makes it into a <em>quorum</em>, and what makes that able to overwhelm competing proposals?</p><p>Technically, nothing! Imagine a network containing Alice, Bob, Carol, Dave, Elsie, and Frank. Alice has Bob and Carol in her quorum slice. Bob has Alice and Carol, Carol has Alice and Bob. Meanwhile, Dave, Elsie, and Frank all have one another in their respective quorum slices. The Alice-Bob-Carol subgroup can reach a decision that the Dave-Elsie-Frank group will never hear about, and vice versa. There is no way for this network to achieve consensus (except by accident).</p><p>So SCP requires that, in order for federated voting to work (and for the paper’s important theorems to apply), the network must enjoy a property called <em>quorum intersection</em>. In a network with this property, any two quorums you can construct always overlap in at least one node. For determining the prevailing sentiment of the network, this is as good as having a majority. Intuitively, it means that if any quorum agrees to statement X, no other quorum can ever agree to not-X, because it will necessarily include some node from the first quorum that has already voted for X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*K3H-a4wDk3PkxCtsci8_BA@2x.png" /><figcaption>If the network has “quorum intersection”…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*9pPwVRcElcVw-hxswrMwSg@2x.png" /><figcaption>…then any two quorums you might construct…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*JSHSwO1SP8onwnDWdzTHVA@2x.png" /><figcaption>…will always overlap.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*LTtxrFHX0DIMty5EcXcv2w@2x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*G7Mly-vlzQbpYIsLl6xTmA@2x.png" /></figure><p>(Of course it could be that the overlapping nodes are all Byzantine — lying or otherwise misbehaving. In that case, having quorum intersection doesn’t help the network agree at all. For that reason, many of the results in the SCP whitepaper rely on explicitly stated assumptions, such as that the network enjoys quorum intersection <em>even if misbehaving nodes are removed from the network</em>. For the sake of clarity we’ll leave those assumptions <em>implicit</em> for the remainder of this article.)</p><p>It might seem unreasonable to expect a collection of independent nodes to organize their slices in such a way that the network will reliably enjoy quorum intersection. But there are two reasons why this isn’t so far-fetched.</p><p>The first reason is the existence of the Internet itself. The Internet is the perfect example of a network of independent nodes with quorum intersection. Most nodes on the Internet connect to just a few other local nodes, but those small sets overlap enough that every node is reachable from every other node by one route or another.</p><p>The second reason is specific to the Stellar payment network (the most widespread application of SCP). Each asset type in the Stellar network has an <em>issuer</em>, and Stellar best practices require each issuer to designate one or more nodes in the network for handling redemption requests. It’s in your interest to include those nodes in your quorum slices, directly or indirectly, for each asset you care about. The quorums for all nodes interested in a given asset will then overlap in at least those redemption nodes. Nodes interested in multiple assets will include in its quorum slices all the relevant issuers’ redemption nodes, and these will tend to bridge all assets together. Further, any assets that are not connected in this way to others on the network <em>don’t need to be</em> — it’s OK for the network to lack quorum intersection there. (Think of the way that banks operating in dollars sometimes want to trade with banks operating in euros and banks operating in pesos, so they are on a network together, but none of them care about the separate network of kids trading baseball cards.)</p><p>Of course, <em>expecting</em> that the network <em>should</em> enjoy quorum intersection is not the same as a guarantee. Other Byzantine agreement systems owe much of their complexity to making guarantees about quorums. An important innovation of SCP is that it removes the responsibility for making quorums from the consensus algorithm itself and pushes it into the application layer. This suggests that, although federated voting is general enough to work with any kind of value being voted on, in fact its robustness depends critically on the broader meaning of those values. Some hypothetical uses might not lend themselves as readily to producing well-connected networks as others.</p><h3>Voting, accepting, and confirming</h3><p>In a round of federated voting, a node optionally begins by casting a vote for some value V. This means broadcasting a message to the network saying, “I am node N, my quorum slices are Q, and I vote V.” When a node votes in this way, it promises that it has never voted against V and never will.</p><p>A node can see how its peers are voting from their broadcast messages. Once the node collects enough such messages, it can traverse the quorum slices in them to find quorums. If it can see a quorum of peers that all vote for V also, then it can move to <em>accepting</em> V, and it broadcasts this new message to the network. (“I am node N, my quorum slices are Q, and I <em>accept</em> V.”) Accepting provides a stronger guarantee than mere voting. When a node votes for V, it can never vote for not-V. But when a node accepts V, <em>no</em> node in the network will ever accept not-V. (Theorem 8 in the SCP whitepaper proves this.)</p><p>Of course, there’s a good chance that N won’t see a quorum of nodes agreeing with its V vote right off the bat. Other nodes may vote for other values. But there is another way for a node to advance from mere voting to accepting. N can accept a different value, W, even if N didn’t vote for it, and even if it doesn’t see a quorum voting for it, as long as it sees a <em>blocking set</em> accepting it. A blocking set is just one node chosen from each of N’s quorum slices. As its name suggests, it is capable of <em>blocking </em>any other value. If all nodes in such a set accept W, then (by Theorem 8) it will never be possible to form a quorum accepting not-W, and so it’s safe for N to accept W too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HVqIDIQsIlRVb3mK" /><figcaption>A node, N, with three quorum slices.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yDGmSqdpzaj_t3sq" /><figcaption>B-D-F is a blocking set for N: it includes one node from each of N’s slices.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*qjHmPSSLQC23GFyLQBBcIA@2x.png" /><figcaption>B-E is also a blocking set for N, because E appears in two of N’s slices.</figcaption></figure><p>But a blocking set is not a quorum. It would be too easy for someone to fool node N into accepting a value when it shouldn’t, if they can just subvert one node in each of N’s slices. So accepting a value is not the end of voting. Instead, N must <em>confirm</em> the value, meaning it sees a quorum of nodes all accepting it. If it gets this far, then as the SCP whitepaper proves (in Theorem 11), the rest of the network will also eventually confirm the same value, and so N has reached the end of federated voting with the value as its outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*iVCcbNBZVFIwksO0tAGFuw@2x.png" /><figcaption>Federated voting.</figcaption></figure><p>The process of voting, accepting, and confirming makes up one complete round of federated voting. The Stellar Consensus Protocol combines many such rounds to create a complete consensus system.</p><h3>The Stellar Consensus Protocol</h3><p>The two most important properties of a consensus system are <em>safety</em> and <em>liveness</em>. A consensus algorithm is “safe” if it can never produce different results for different participants. (Bob’s copy of history will never disagree with Carol’s.) Meanwhile, “liveness” means the algorithm will never fail to produce a result — i.e., that it won’t get stuck.</p><p>The federated voting procedure just described is <em>safe</em> in the sense that if a node confirms value V, no other node will confirm a different value. But “won’t confirm different things” is not the same as “will confirm something.” There may be so many different values being voted on that nothing even reaches the “accept” threshold. This means that federated voting lacks <em>liveness</em>.</p><p>The Stellar Consensus Protocol uses federated voting in a way that guarantees safety <em>and</em> liveness.⁴ The idea, in a nutshell, is to conduct <em>multiple</em> federated votes on multiple values until one makes it all the way through SCP’s various voting phases, described below.</p><p>The values on which SCP seeks consensus may be Stellar ledgers or lunch orders or anything else, but it’s important to note that these are <em>not</em> the values that SCP’s federated-voting rounds vote on or accept or confirm. Instead, federated voting happens on <em>statements about</em> those values.</p><p>The first rounds of federated voting happen in the <em>nomination phase</em>, on a family of statements of the form, “I nominate V,” for possibly many different values of V. The goal of nomination is to find one or more such statements that can make it all the way through acceptance and confirmation.</p><p>After finding confirmable nominees, SCP moves to the <em>balloting phase</em>, where the goal is to find some <em>ballot</em> (which is a container for a nominated value) and a quorum that can <em>commit</em> to it. If a quorum commits to this ballot, its value is the outcome of this round of consensus. But before a node can vote to commit to a ballot, it must first confirm that all lesser ballots are <em>aborted</em>. These steps — aborting ballots in order to find one that can be confirmed committed — involve multiple rounds of federated voting on multiple statements about ballots.</p><p>The following sections describe nomination and balloting in more detail.</p><h3>Nomination</h3><p>At the start of the nomination phase, each node may spontaneously choose a value V and vote for the statement “I nominate V.” The goal at this stage is to confirm the nomination of some value, via federated voting.</p><p>It’s possible that enough nodes vote for enough different “I nominate” statements that it’s a free-for-all — no nomination can ever reach the “accept” threshold. So in addition to casting their own nomination votes, nodes “echo” the nominations of their peers. Echoing means that a node voting “I nominate V,” upon seeing a message from a peer nominating W, now votes both “I nominate V” and “I nominate W.”⁵ Conceptually these are separate federated votes happening in parallel, each separately able to reach acceptance or confirmation. In practice SCP protocol messages batch these separate votes together.</p><p>Although a vote to nominate V is a promise never to vote against nominating V, the application layer above federated voting — SCP in this case — gets to define what “against” means. SCP defines no statement that contradicts an “I nominate X” vote — there is no “I reject the nomination of X” — so a node can vote to nominate as many values as it likes. Many of those nominations may go nowhere, but eventually there will be one or more that a node can accept or confirm. Once a nominee is confirmed, it is called a <em>candidate</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TuanK-MsA2mmHSeHZoNDg@2x.png" /><figcaption>SCP nomination using federated voting. There may be many values “B” nominated by peers and “echoed” by the node.</figcaption></figure><p>Nomination may produce multiple confirmable candidates, so SCP requires the application layer to supply some method for combining candidates into a single <em>composite</em>. The combining method can be anything the application layer calls for, as long as that method is deterministic, meaning that every node combining the same two candidates produces the same composite. In a lunch-ordering system, “combining” might simply mean discarding one of the two candidates. (Deterministically, though: every node must choose the same value to discard. The alphabetically earlier choice, for example.) In the Stellar payment network, where nominees are ledgers, combining two proposed nominees involves taking the union of the transactions they contain, and the later of their two timestamps.</p><p>The SCP whitepaper proves (Theorem 12) that nomination causes the network eventually to converge on a single composite candidate by the time nomination ends. But there’s a problem: federated voting is an <em>asynchronous</em> protocol. (So is SCP.) In other words, nodes are not coordinated by time, only by the messages they send. From a node’s point of view it’s not clear when nomination <em>has</em> ended. And although all nodes will eventually arrive at the same composite candidate, they may take different routes to get there, producing different, valid composite candidates along the way, never able to tell which is the final one.</p><p>This is OK though. Nomination is only about producing — and limiting the number of — candidates for consensus. The rest of consensus is handled by a process called <em>balloting</em>.</p><h3>Balloting</h3><p>A ballot is a pair: &lt;counter,value&gt;, where counter is an integer starting at 1 and value is a candidate from the nomination phase. It could be the node’s own candidate, or some peer’s candidate that the node comes to accept. Roughly speaking, balloting makes repeated attempts to get the network to reach consensus on <em>some</em> candidate in <em>some</em> ballot by conducting potentially many federated votes on statements about ballots. The counters in ballots track the attempts made, and ballots with higher counters take precedence over ballots with lower counters. If ballot &lt;counter,value&gt; appears to be getting stuck, a new vote begins, now on ballot &lt;counter+1,value&gt;.</p><p>It’s important to distinguish between <em>values</em> (e.g., what the lunch order should be, such as pizza or salads), <em>ballots</em> (a counter-value pair), and statements <em>about</em> ballots. A round of SCP includes multiple rounds of federated voting on such statements, specifically these:</p><ul><li>“I am prepared to commit to ballot B,” and</li><li>“I commit to ballot B.”</li></ul><p>From the point of view of a given node, consensus is reached when it finds a ballot B for which it is able to confirm (find a quorum accepting) the statement “I commit to ballot B.” At this point it is safe to act on the value in B— e.g., to place that lunch order. This is called <em>externalizing</em> the value. Once a ballot is confirmed committed, a node can be sure that every other node has externalized, or inevitably will externalize, the same value.</p><p>Although conceptually many federated votes take place on statements about many different ballots, far fewer actual protocol messages are exchanged, because each one encapsulates a <em>range</em> of ballots. A single message thus advances the state of many federated votes at once, e.g.: “I accept that ballots in the range &lt;min,V&gt; to &lt;max,V&gt; are committed.”</p><p>So what do “prepared” and “committed” mean?</p><p>A node votes to commit to a ballot when it is convinced that other nodes won’t commit to ballots with different values. Becoming convinced of this is the purpose of the prepare statement. A vote that says “I am prepared to commit to ballot B” is a promise never to commit to any ballot less than B — i.e., one with a smaller counter.⁶ Those lesser ballots are said to be “aborted” by the prepare vote, while B is “prepared.”</p><p>Why does “I am prepared to commit to ballot B” mean “I promise never to commit to ballots less than B”? It’s because SCP defines “abort” to be the opposite of “commit.” A vote to prepare a ballot is implicitly also a vote to abort some other ballots, and as we discussed earlier, voting <em>for</em> something is a promise never to vote against it.</p><p>Before ever casting a “commit” vote, a node must first find a ballot that it can confirm is prepared. In other words, it conducts federated voting on “I am prepared to commit to ballot B” for possibly many different ballots until it finds one that a quorum accepts.</p><p>Where do ballots come from for the prepare votes? The first prepare vote that a node casts is for &lt;1,C&gt;, where C is the composite candidate produced by the nomination phase. However, even after prepare votes begin, nomination may produce additional candidates, so these become new ballots. Meanwhile, peers may have different candidates, and they could form a blocking set that accepts “I am prepared to commit to ballot B2,” which would convince the node to accept it too. Finally, there’s a timeout mechanism that causes new rounds of federated voting to begin on new ballots with higher counters if the current ballots seem to be stuck.</p><p>Once a node finds a ballot B that it can confirm is prepared, it casts a new vote for “I commit to ballot B.” This vote tells peers that the node will never abort B. In fact, if B is the ballot &lt;N,C&gt;, then “I commit to ballot &lt;N,C&gt;” is implicitly also a vote to <em>prepare</em> every ballot from &lt;N,C&gt; through &lt;∞,C&gt;. This extra meaning helps other nodes receiving this message to catch up, if they’re still in earlier phases of the protocol.</p><p>It’s worth re-emphasizing at this point that these are asynchronous protocols. Just because one node is sending commit votes doesn’t mean that its peers are, too. Some might still be voting on prepare statements, others might already have externalized a value. SCP explains how a node should handle each type of peer message no matter what phase it’s in.</p><p>If “I commit to &lt;N,C&gt;” can’t be accepted or confirmed, perhaps &lt;N+1,C&gt; can, or &lt;N+2,C&gt; — or, in any case, some ballot with C in it and not any other value, since the node has now promised never to abort &lt;N,C&gt;. By the time a node is casting commit votes, it’s C or bust as far as consensus goes. However, this isn’t enough for the node to externalize C yet. Some Byzantine peers (amounting to less than a quorum, based on our safety assumptions) could be lying to the node. Accepting and then confirming some ballot (or range of ballots) is what gives the node the confidence finally to externalize C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUkKjgkbXGgEB9ddPH8-8g@2x.png" /><figcaption>SCP balloting using federated voting. Not depicted: a timer may fire at any point to increment the counter in the ballot (and perhaps produce a new composite from additional nomination candidates).</figcaption></figure><p>And that’s it! Once the network has come to consensus, it’s ready to do it all over again. In the Stellar payment network, this happens roughly once every 5 seconds: a feat that requires both the safety and liveness guaranteed by SCP.</p><p>SCP is able to accomplish this by relying on multiple rounds of federated voting. Federated voting is made possible by the concept of quorum slices: sets of peers that each node has chosen to trust as part of its own (subjective) quorum. This configuration means that it’s possible to come to consensus, even in a network with open membership and Byzantine failures.</p><h3>Further reading</h3><ul><li>The original SCP whitepaper can be found <a href="https://www.stellar.org/papers/stellar-consensus-protocol.pdf">here</a>. A draft specification for implementers is <a href="https://datatracker.ietf.org/doc/draft-mazieres-dinrg-scp/">here</a>.</li><li>SCP’s original author, David Mazières, has a simplified (but still technical) explanation of it <a href="http://www.scs.stanford.edu/~dm/blog/simplified-scp.html">here</a>.</li><li>You may have been surprised not to find the terms “mining” or “proof of work” in this article. SCP doesn’t use those techniques, but some other consensus algorithms do. Zane Witherspoon has written an accessible <a href="https://hackernoon.com/a-hitchhikers-guide-to-consensus-algorithms-d81aae3eb0e3">survey of consensus algorithms</a>.</li><li>A step-by-step description of a simple network coming to consensus via one complete round of SCP can be seen at <a href="https://github.com/bobg/scp/blob/master/Lunch.md">A round of lunch</a>.</li><li>For readers interested in implementations of SCP, see <a href="https://github.com/stellar/stellar-core/tree/master/src/scp">the C++ code used by the Stellar payment network</a> or <a href="https://github.com/bobg/scp">the Go code</a> that this author wrote in order to better understand SCP.</li></ul><h3>Endnotes</h3><ol><li>“Byzantine” fault tolerance — the ability to trust a group decision even when some members of the group might be lying or otherwise not following the decision-making rules — is so named because of a parable about generals of the Byzantine Empire trying to coordinate an attack. Anthony Stevens has written <a href="https://medium.com/coinmonks/a-note-from-anthony-if-you-havent-already-please-read-the-article-gaining-clarity-on-key-787989107969">a good description of it</a>.</li><li>The SCP whitepaper does not specify a communication mechanism. Implementations will typically use <a href="https://en.wikipedia.org/wiki/Gossip_protocol">a gossip protocol</a> to ensure that messages propagate throughout the network.</li><li>A Byzantine agreement system is designed in terms of the question: How many misbehaving nodes should the system survive? In a system of N nodes intended to survive f failures, a node must be able to make progress after hearing from N−f peers, since f of them may have crashed. However, after hearing from N−f peers, it’s possible that all the remaining f peers (that the node hasn’t heard from) are honest, and up to f out of the N−f peers (that the node has heard from) are malicious. To ensure nodes all reach the same conclusion, then, a majority of the N−f nodes one hears from must be honest, meaning we need N−f &gt; 2f, or N &gt; 3f. So typically a system designed to survive f failures will have a total of N=3f+1 nodes and a quorum size of 2f+1.</li><li>The safety and liveness guarantees of SCP are subject to theoretical limits. The design of SCP trades a very strong safety guarantee for a slightly weaker liveness guarantee: given a sufficient time bound, consensus will be reached with high probability.</li><li>Not all votes from peers get echoed by a node during nomination, because this could lead to an explosion of different nominees. SCP includes a mechanism for throttling these echoed votes. In short, there is a formula for determining the “priority” of a peer from a node’s point of view, and only high-priority nodes get their votes echoed. The longer nomination takes, the lower the threshold gets, so a node expands the set of peers whose votes it will echo. The priority formula includes the slot number as one of its inputs, so a high-priority peer for one slot may be low-priority for the next, and vice versa.</li><li>SCP requires that the values in ballots have some order defined on them. So ballot &lt;N1,V1&gt; is less than &lt;N2,V2&gt; if N1&lt;N2, but also if N1=N2 and V1&lt;V2.</li></ol><h3>Acknowledgments</h3><p>Many thanks to those who contributed feedback about, suggestions for, and content to this document: David Mazières; Tess Rinearson; Oleg Andreev; Vicki Niu; Cathie Yun; Adam Diehl; Lindsay Lin; Suzanne Glickstein.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=423409aad32e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/understanding-the-stellar-consensus-protocol-423409aad32e">Understanding the Stellar Consensus Protocol</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programmable Constraint Systems for Bulletproofs]]></title>
            <link>https://medium.com/interstellar/programmable-constraint-systems-for-bulletproofs-365b9feb92f7?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/365b9feb92f7</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <dc:creator><![CDATA[Cathie Yun]]></dc:creator>
            <pubDate>Mon, 19 Nov 2018 21:13:31 GMT</pubDate>
            <atom:updated>2019-02-04T19:48:31.208Z</atom:updated>
            <content:encoded><![CDATA[<p>We are excited to share our progress on extending our <a href="http://github.com/dalek-cryptography/bulletproofs/">Bulletproofs implementation</a> with a constraint system API which enables zero-knowledge proofs of arbitrary statements.</p><p>In our <a href="https://medium.com/interstellar/bulletproofs-pre-release-fcb1feb36d4b">previous article</a>, we announced a pre-release of Bulletproofs 1.0, the Rust implementation of range proofs. We (Cathie Yun, Henry de Valence and Oleg Andreev) have been working on extending it to support proving arbitrary statements in zero knowledge using a constraint system, which we would like to share with you today. We are also excited to publish our work on the next generation of Chain’s Confidential Assets protocol called Cloak, which builds directly on top of these Bulletproofs constraint system proofs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2vywDx8F_AHHJEk1ndJVw.png" /></figure><h3>Constraint System</h3><p>Bulletproofs are an optimization to an <a href="https://eprint.iacr.org/2016/263.pdf">earlier paper</a> by Bootle, Cerulli, Chaidos, Groth, and Petit, which showed that it was possible to prove arithmetic circuit satisfiability in the discrete log setting. Their paper introduced the logarithmic-sized inner-product argument, as well as a technique to convert an arithmetic circuit into a rank-1 constraint system (R1CS). The <a href="https://eprint.iacr.org/2017/1066.pdf">Bulletproofs paper</a> optimizes the inner-product argument by a constant factor, and shows how to use Pedersen commitments as inputs to the constraint system.</p><p>R1CS expresses linear combinations of various variables and their multiplications. The Bulletproofs paper uses the following format for the constraint system: an array of n multiplications that gives 3*n low-level variables: left, right and output “wires” of each multiplication “gate”, and an array of q linear constraints between these variables and additional m high-level variables that represent external facts.</p><p>We realized that it is more efficient to bypass arithmetic circuits altogether and provide the API for building a constraint system directly. This way we do not have to construct the graph or arithmetic expressions and then transform them into constraints: higher-level protocols can often keep that graph represented statically by their source code and build constraints on the fly.</p><p>Moreover, since the matrices representing the constraints are usually very sparse, we only store the non-zero terms. The only operation that needs to be done on the constraints is flattening with a challenge variable, and the result is defined solely by the non-zero terms.</p><h3>Variables</h3><p>The constraint system has three kinds of variables: high-level witness variables, low-level witness variables, and instance variables.</p><p><strong>Instance variables</strong> are public parameters, known to both the prover and the verifier. In other proving systems that require a setup for each constraint system, this allows public inputs to the circuit. In Bulletproofs, no setup is required, so there’s no difference between a constraint system with public inputs and a family of constraint systems parameterized by those inputs. This means we can internally fold all instance variables into a single constant parameter.</p><p><strong>High-level witness variables</strong> are known only to the prover, and represent external inputs to the constraint system. In Bulletproofs, these are represented as individual Pedersen commitments to the external variables, for which we construct and prove some relation. For instance, in the Cloak protocol (described below), the transacted amounts are represented as commitments to high-level variables.</p><p><strong>Low-level witness variables</strong> are known only to the prover, and are internal to the constraint system, representing the inputs and outputs of the multiplication gates. For instance, in Cloak these represent bits inside a range proof or intermediate amounts as they are passed through shuffle, merge and split stages. Low-level variables are computed per-proof and committed using a single vector Pedersen commitment.</p><h3>Challenges</h3><p>As noted above, instance variables can select the constraint system out of a family for each proof. This enables a novel approach: by generating some of them as a challenge from a verifier to a prover, <strong>the constraint system itself can be thought of as a challenge</strong> from a verifier to a prover, where some constraints are generated randomly in response to the prover’s commitments.</p><p>The use of challenges to parametrize constraint systems can enable significantly fewer multipliers, which makes the resulting proof smaller. For instance, a verifiable shuffle may require O(n²) multiplications in a static constraint system, but by using challenges we reduce the overhead to O(n) multiplications — inputs and outputs can be used as permuted roots of the polynomials that are randomly sampled at a challenge point and constrained to be equal:</p><pre>{a,b} = {c,d} ⟺ (a−x)⋅(b−x)=(c−x)⋅(d−x)</pre><p>Our implementation performs the Fiat-Shamir transform using <a href="https://doc.dalek.rs/merlin/index.html">Merlin</a> transcripts to generate such challenges. The challenges are bound to the high-level variable commitments which are added to the transcript before any of the constraints are created. Then, the prover and verifier can compute weights for some constraints with the use of the challenges.</p><p>The use of challenges comes with an important caveat: the challenges are bound only to the high-level witness variables (the external inputs to the constraint system), not the low-level ones, so it requires careful analysis to ensure that the construction is safe. That said, we are working on an improvement to the protocol that would allow challenges to be bound to a subset of the low-level witness variables, and have a safer API using features of Rust’s type system.</p><h3>Gadgets</h3><p>The resulting API is largely inspired by the <a href="https://z.cash/blog/bellman-zksnarks-in-rust/">Bellman API</a> used in Zcash: there is a single code path used by both the prover and verifier to allocate variables and define constraints, organized into a hierarchy of task-specific “gadgets”. This way the allocation, assignment and constraints on the variables all happen in one place, providing assurance that variables are not accidentally left unconstrained. In other words, each gadget can be verified independently, without having to analyze correctness of the entire constraint system as a whole (see also the caveat about challenges in the previous section).</p><p>Each gadget is a function that interacts with a mutable “constraint system” object represented by a trait. The prover and verifier use their specific implementations of this trait respectively. The gadget receives secret variables and public parameters, allocates and assigns variables, generates challenges and adds constraints to the constraint system object.</p><p>Gadgets can be composed. For instance, in the Cloak protocol, a “merge” gadget takes M inputs and M outputs and calls a sequence of M-1 “mix” gadgets that operate on pairs of values. Then, the whole collection of gadgets in Cloak is abstracted away with a single “transaction” gadget that takes all input and output values, which could be used either directly or as a part of a higher-level protocol.</p><p>The Bulletproofs library does not provide any standard gadgets, but only an API for the constraint system. It is the job of each protocol on top of it to create a collection of gadgets for its use and build a complete constraint system out of them. For an example of a protocol built using a collection of gadgets, see our Cloak implementation (described below).</p><h3>Cloak</h3><p>Cloak is the redesign of the Chain’s <a href="https://blog.chain.com/hidden-in-plain-sight-transacting-privately-on-a-blockchain-835ab75c01cb">Confidential Assets</a> scheme using Bulletproofs. We are making its implementation open source and calling it <a href="https://github.com/interstellar/spacesuit">Spacesuit</a> as in <em>interstellar cloak</em>.</p><p><strong>Cloak is focused on one thing: proving that some number of values with different asset types is correctly transferred from inputs to outputs.</strong> Cloak ensures that values are balanced per asset type (so that one type is not transmuted to any other), that quantities do not overflow the group order (in other words, negative quantities are forbidden) and that both quantities and asset types are kept secret. Cloak does not specify how the transfers are authenticated or what kind of ledger represents those transfers: these are left to be defined in a protocol built around Cloak.</p><p>Cloak builds a constraint system using a collection of gadgets like “shuffle”, “merge”, “split” and “range proof” all combined together under a single gadget called a “cloaked transaction”. The layout of all the gadgets is determined only by the number of inputs and outputs and not affected by actual values of the assets. This way, all transactions of the same size are indistinguishable.</p><p>Bulletproofs constraint system turns out surprisingly efficient: compared to a single-asset transaction (such as the Confidential Transactions proposal for Bitcoin) where only range proofs are necessary, the additional constraints and gadgets needed to support the issued assets add less than 20% of the multipliers. And thanks to the inner product proof, the impact on the proof size is close to zero.</p><p>The work on Cloak and Spacesuit is far from complete, and now will continue in the open in our <a href="https://github.com/interstellar/spacesuit">repository</a>. To learn more about Cloak check out its <a href="https://github.com/interstellar/spacesuit/blob/main/spec.md">specification</a>.</p><h3>Next steps</h3><p>The work on constraint systems and Cloak is still ongoing. For the R1CS implementation, there are two major improvements that we will focus on:</p><p>First, we would like to extend the Bulletproofs protocol slightly, to enable committing to a portion of low-level variables using a single vector Pedersen commitment without an overhead of additional individual high-level Pedersen commitments. This will also come with a change in the API that would ensure that challenge-based variables cannot be inspected, preventing the user from accidentally breaking soundness of their gadgets.</p><p>Second, we want to enable multi-party proving of a single constraint system. This is different from the existing <a href="https://blog.chain.com/bulletproof-multi-party-computation-in-rust-with-session-types-b3da6e928d5d">aggregation MPC</a> that we’ve done for the range proofs: instead of aggregating proofs of distinct statements purely to make proofs smaller, we want to enable building a joint proof of a single constraint system by multiple parties, without sharing their secret inputs with each other. This not only makes the proofs smaller, but could also improve privacy in Cloak by enabling a zero-knowledge version of a <a href="https://bitcointalk.org/?topic=279249">CoinJoin protocol</a>.</p><h3>Further reading on constraint system proofs</h3><ul><li><a href="https://doc-internal.dalek.rs/develop/bulletproofs/notes/r1cs_proof/index.html">How to build a constraint system proof</a></li><li><a href="https://doc-internal.dalek.rs/develop/bulletproofs/r1cs/notes/index.html">Prover and verifier algorithms for a constraint system proof</a></li><li>Example: <a href="https://doc.dalek.rs/develop/bulletproofs/r1cs/index.html">a proof-of-shuffle constraint system</a></li><li>Example: <a href="https://github.com/interstellar/spacesuit/blob/master/spec.md">Cloak constraint system specs</a></li></ul><h3>Thanks</h3><p>We’d like to thank Sean Bowe, Daira Hopwood, and Jack Grigg from the Zcash team, as well as Mary Maller from University College of London, for their helpful suggestions and discussion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365b9feb92f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/programmable-constraint-systems-for-bulletproofs-365b9feb92f7">Programmable Constraint Systems for Bulletproofs</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bulletproofs pre-release]]></title>
            <link>https://medium.com/interstellar/bulletproofs-pre-release-fcb1feb36d4b?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/fcb1feb36d4b</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Henry de Valence]]></dc:creator>
            <pubDate>Thu, 08 Nov 2018 19:40:37 GMT</pubDate>
            <atom:updated>2018-11-08T19:40:37.395Z</atom:updated>
            <content:encoded><![CDATA[<p>We’re excited to announce a pre-release version of our <a href="https://doc.dalek.rs/bulletproofs">Bulletproofs implementation</a>, providing a stable interface for creating and verifying range proofs, an important building block for a range of privacy-preserving protocols. For instance, range proofs are important for confidential transaction systems, such as Confidential Transactions for Bitcoin, Chain’s Confidential Assets, and many other protocols, because a verifier can check that secret values, such as asset amounts, are nonnegative.</p><p>As we described a few months ago, our implementation is implemented in pure Rust using the <a href="https://ristretto.group">Ristretto</a> group; <a href="https://blog.chain.com/faster-bulletproofs-with-ristretto-avx2-29450b4490cd">our previous post</a> has more detail and background information. Since then, we improved performance slightly, pushing verification performance down to 1040 µs for a 64-bit range proof. For comparison, this is:</p><ul><li><strong>1.83x faster</strong> than the libsecp implementation (with endomorphisms);</li><li><strong>2.00x faster</strong> than the libsecp implementation (without endomorphisms);</li><li><strong>4.63x faster</strong> than the Monero implementation.</li></ul><p>In addition to better performance, we also provide a clean, safe, and extensible API for both single-party proving as well as multi-party computation of aggregated proofs. The single-party proving is actually implemented by self-MPC internally, to avoid code duplication.</p><p>This post shares some details of our design and says a few words about the next version of Bulletproofs, that will provide a constraint system API to allow proofs of arbitrary statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h3vI-TEmSeeWZ0PczT2tlA.png" /></figure><h3>Composable proof transcripts</h3><p>Our implementation performs the Fiat-Shamir transform using <a href="https://doc.dalek.rs/merlin/index.html">Merlin</a> transcripts. This provides per-application domain separation, since constructing a transcript requires passing a domain separation label. It also means that it’s possible for users of our API to bind the Bulletproofs to arbitrary structured data (by committing it to the transcript prior to proving), or to compose the Bulletproofs with other proof statements (by using a common transcript for both proofs), all without any changes to our implementation.</p><p>But this also has benefits in the implementation internals. To create a range proof, Bulletproofs first performs a protocol which reduces the statement about ranges to a statement about inner-products, and then performs an inner-product proof. Instead of implementing these logically distinct components together, using Merlin transcripts allows us to implement them separately internally, and compose the two parts into a single proof returned to the user. This makes the implementation significantly cleaner and easier to understand, because the software components of the implementation correspond to the conceptual components of the protocol. You can learn more about Merlin in this <a href="https://medium.com/@hdevalence/merlin-flexible-composable-transcripts-for-zero-knowledge-proofs-28d9fda22d9a">overview</a>, or in <a href="https://doc.dalek.rs/merlin/index.html">its docs</a>.</p><h3>Strongly-typed multiparty computation</h3><p>As described in our <a href="https://blog.chain.com/bulletproof-multi-party-computation-in-rust-with-session-types-b3da6e928d5d">previous post</a>, we take advantage of Rust’s type system and ownership semantics to implement the multiparty computation (MPC) protocol, by encoding each state of the MPC protocol using a different Rust type, and using ownership semantics to enforce that state transitions are not reversible.</p><p>For instance, in the MPC protocol for aggregated range proof creation, each party constructs a vector polynomial and reveals the result of its evaluation at a single challenge point to construct its proof share. However, if the party could be tricked into revealing multiple evaluations of the same polynomial at different points, it would be possible to recover the original polynomial and reveal the party’s secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4Z3eKY7XGjz1OrTRhdbsw.png" /></figure><p>But this is impossible in our implementation: evaluation is performed by the apply_challenge method of the PartyAwaitingPolyChallenge state, which consumes the state and returns a ProofShare. Because Rust’s ownership model prevents the use of moved values, it’s not possible to call apply_challenge twice, because the original PartyAwaitingPolyChallenge is already consumed. Similarly, because each state transition is performed by a method on a particular type, it’s not possible to perform the steps in the wrong order.</p><p>In other words, the type-checking and borrow-checking performed by the Rust compiler provide a compile-time proof that any instantiation of the MPC protocol components is one that performs the protocol steps correctly.</p><h3>Extensible generator chains</h3><p>The <a href="https://eprint.iacr.org/2017/1066.pdf">Bulletproofs paper</a> describes the aggregated range proof protocol for m parties proving n-bit ranges as operating on two vectors of generators, G and H, both of size m*n. But implementing the proofs in this way would mean that the generators would be tied to both the aggregation size as well as the bitsize. And this approach isn’t extensible to the constraint system case, where the number of generators required depends on the number of constraints, which might not be known in advance.</p><p>Instead, we construct generators for each aggregation party separately, feeding a per-party domain separation label into the SHAKE extendable-output function (XOF), and passing the SHAKE output into the ristretto255 hash-to-group function. This provides an arbitrarily-long chain of orthogonal generators unique to each party. Instead of viewing G and H as vectors of size m*n, we view them as concatenations of m slices of the first n generators for each party. In other words, we construct the m*n generators by taking rectangular sections of a 2D array of generators, with the vertical axis corresponding to the number of parties and the horizontal axis corresponding to the size of each party’s proof share.</p><p>This means that a single cache of pre-computed Bulletproofs generators can be used with multiple choices of aggregation size and bitsize, and it’s also future-compatible with more flexible aggregation — for instance, there’s no need for the parties to be assigned contiguous rows in the grid.</p><p>For constraint system proofs, the number of generators required depends on the number of constraints. If the constraints are programmatically defined, it may not be convenient to specify the number of constraints up-front, but this construction allows the constraint system to just pull an appropriately-sized slice of generators from a pre-computed cache. And, because the generator chain is domain-separated by a per-party label, it also means that single-party constraint system proofs can be forward-compatible with a multiparty protocol for aggregated constraint system proofs (and even compatible with aggregation of proofs of different statements).</p><p>Finally, we also took care to ensure that the generators used for the inner-product argument in Bulletproofs are handled separately from the generators used for Pedersen commitments, so that the choice of Pedersen generators can be made per-application, in order to maximize reusability.</p><h3>Next steps: arbitrary proofs via constraint systems</h3><p>The building blocks we described above now allow us to extend the proving system from range proofs to arbitrary user-defined statements.</p><p>Bulletproofs are an optimization to an <a href="https://eprint.iacr.org/2016/263.pdf">earlier paper</a> by Bootle, Cerulli, Chaidos, Groth, and Petit, which showed that it was possible to prove arithmetic circuit satisfiability in the discrete log setting. Their paper introduced the logarithmic-sized inner-product argument, as well as a technique to convert an arithmetic circuit into a constraint system. The Bulletproofs paper optimizes the inner-product argument by a constant factor, and shows how to use Pedersen commitments as inputs to the circuit.</p><p>We’ve been working on an API for building Bulletproof constraint systems directly, inspired by the <a href="https://z.cash/blog/bellman-zksnarks-in-rust/">Bellman API</a> used in Zcash, which allows both the prover and verifier to programmatically define a constraint system and then create a proof (or verification). We’ll have more to share in a future blog post, but we’d like to thank Sean Bowe, Daira Hopwood, and Jack Grigg from the Zcash team, as well as Mary Maller from University College of London, for their helpful suggestions and discussion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcb1feb36d4b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/bulletproofs-pre-release-fcb1feb36d4b">Bulletproofs pre-release</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monorepo]]></title>
            <link>https://medium.com/interstellar/monorepo-e1847cbd6800?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1847cbd6800</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Dan Croak]]></dc:creator>
            <pubDate>Thu, 01 Nov 2018 15:21:01 GMT</pubDate>
            <atom:updated>2018-11-07T21:53:28.530Z</atom:updated>
            <content:encoded><![CDATA[<p>Organizing code as a monorepo can support a nice software development workflow. The following is an example of how a monorepo could evolve, based on our experience at <a href="https://interstellar.com/">Interstellar</a> (formerly <a href="https://chain.com/">Chain</a>).</p><h3>Mentality</h3><p>Imagine we are software engineers at an organization. We expect to write software to support the organization, and for that software to take the shape of multiple programs.</p><p>We plan to work incrementally, to choose technologies suited to their tasks that we also enjoy, and to be unafraid to write bespoke software that improves our happiness and productivity.</p><h3>New repo</h3><p>We initialize a monorepo on GitHub: org/repo:</p><pre>.<br>└── README.md</pre><p>We write a README.md:</p><pre>Add to your shell profile:<br><br>  # Set environment variable to monorepo path<br>  export ORG=&quot;$GOPATH/src/org&quot;<br><br>  # Prepend monorepo scripts<br>  export PATH=&quot;$ORG/bin:$PATH&quot;<br><br>Clone:<br><br>  git clone https://github.com/org/repo.git $ORG<br>  cd $ORG</pre><p>The $ORG environment variable will be used throughout the codebase.</p><h3>Initial design</h3><p>We design an initial architecture like this:</p><ul><li>a “Dashboard” web interface for customers, written in React (TypeScript)</li><li>mobile apps for customers, written in React Native (TypeScript)</li><li>SDKs for customers, written for Go, Node (TypeScript), and Ruby</li><li>an internal HTTP API used by the web interface and SDKs, written in Go</li><li>a Postgres database backing the HTTP API</li></ul><p>We add new files and directories (old files omitted with ... for brevity):</p><pre>.<br>├── ...<br>├── cmd<br>│   └── serverd<br>│       └── main.go<br>├── dashboard<br>├── mobile<br>│   └── app<br>│       ├── android<br>│       └── ios<br>├── sdk<br>│   ├── go<br>│   ├── node<br>│   └── ruby<br>└── server<br>    └── http_handler.go</pre><h3>Commit messages</h3><p>We use <a href="https://chris.beams.io/posts/git-commit/">community conventions</a> for commit messages with the addition that the first line (“subject line”) should be prefixed:</p><pre>$ git log<br>dashboard: redirect to new project form after sign up<br>sdk/node: enable Keep-Alive in HTTP agent<br>server: document access to prod db</pre><p>The prefix refers to the module that the patch is primarily concerned with. It often, but not always, matches a filesystem directory,</p><p>If a module’s interface changes, the patch will likely touch other files to conform to the new interface, but the prefix should be where the action is.</p><p>Although we don’t worry about it much, we try to keep the subject line under 50 characters. It can be nice to <a href="https://golang.org/doc/effective_go.html#package-names">err on the side of brevity</a> for module names.</p><h3>Dependencies</h3><p>To aid local development and help onboard teammates, we might provide a setup.sh script for each project. In turn, each setup.sh script might invoke more general$ORG/bin/setup-* scripts.</p><p>Since all engineers have $ORG/bin on our $PATH, all scripts in bin/ are available everywhere at our shell without a directory prefix.</p><p>We can also use <a href="https://www.statusok.com/asdf-version-manager">ASDF</a>’s .tool-versions file to pin versions for dependencies:</p><pre>.<br>├── ...<br>├── .tool-versions<br>├── bin<br>│   ├── setup-go<br>│   ├── setup-localhost-tls<br>│   ├── setup-node<br>│   ├── setup-postgres<br>│   └── setup-ruby<br>├── dashboard<br>│   └── setup.sh<br>├── mobile<br>│   └── setup.sh<br>├── sdk<br>│  ├── go<br>│  │   └── setup.sh<br>│  ├── node<br>│  │   └── setup.sh<br>│  └── ruby<br>│      └── setup.sh<br>└── server<br>    └── setup.sh</pre><h3>Formatting</h3><p>Our Go code is already formatted with <a href="https://golang.org/cmd/gofmt/">gofmt</a> but we could be more consistent in our TypeScript and Ruby code. We add config files for <a href="https://prettier.io/">Prettier</a> and <a href="https://rubocop.readthedocs.io/en/latest/">Rubocop</a> at the top of the file hierarchy:</p><pre>.<br>├── ...<br>├── .rubocop.yml<br>└── .prettierrc.yml</pre><h3>Infrastructure</h3><p>Our software can only be fully realized once it’s in our customers’ hands.</p><p>We choose Amazon Web Services (AWS) as a host for our core software, such as EC2 for the HTTP API.</p><p>We add an infra directory for <a href="https://www.terraform.io/">Terraform</a>, systemd, bash files, etc.:</p><pre>.<br>├── ...<br>└── infra</pre><h3>CI</h3><p>To move quickly without breaking things, we write automated tests and run those tests continuously when we integrate our changes into the codebase.</p><p>We also want our Continuous Integration (CI) service to:</p><ul><li>begin running the tests in &lt; 5s after opening or editing a pull request</li><li>run the tests in an environment with <a href="https://12factor.net/dev-prod-parity">parity</a> to the production environment</li><li>run only the tests relevant to the change</li></ul><p>We observe common causes of slow-starting tests on hosted CI services are multi-tenant queues and containerization. In those environments, noisy neighbors backlog the queues and containers have cache misses.</p><p>To meet our design goals, we write our own CI service, testbot (design credit <a href="https://xph.us/">Keith Rarick</a>):</p><pre>.<br>├── ...<br>├── cmd<br>│   └── testbot<br>│       └── main.go<br>├── dashboard<br>│   └── Testfile<br>├── mobile<br>│   └── Testfile<br>├── sdk<br>│   ├── go<br>│   │   └── Testfile<br>│   ├── node<br>│   │   └── Testfile<br>│   └── ruby<br>│       └── Testfile<br>├── server<br>│   └── Testfile<br>└── testbot<br>    ├── Testfile<br>    ├── farmer<br>    │   ├── Procfile<br>    │   └── main.go<br>    └── worker<br>        └── main.go</pre><p>We open a GitHub pull request to add a new feature to the SDKs:</p><pre>sdk/go/account.go             | 10 +++++-----<br>sdk/go/account_test.go        | 10 +++++-----<br>sdk/node/src/account.ts       | 10 +++++-----<br>sdk/node/test/account.ts      | 10 +++++-----<br>sdk/ruby/lib/account.rb       | 10 +++++-----<br>sdk/ruby/spec/account_spec.rb | 10 +++++-----<br>6 files changed, 60 insertions(+), 60 deletions(-)</pre><p>A testbot farmer process on a server responds to the GitHub webhook by:</p><ul><li>identifying the directories containing files that have changed</li><li>walking up the file hierarchy to find Testfiles for changed directories</li><li>saving test jobs to its backing Postgres database</li></ul><p>Each Testfile defines test jobs for its directory. Ours might be:</p><pre>$ cat $ORG/sdk/go/Testfile<br>tests: cd $ORG/sdk &amp;&amp; go test -cover ./...<br>$ cat $ORG/sdk/node/Testfile<br>tests: cd $ORG/sdk/node &amp;&amp; npm install &amp;&amp; npm test<br>$ cat $ORG/sdk/ruby/Testfile<br>tests: $ORG/sdk/ruby/test.sh</pre><p>A single Testfile can define multiple test jobs. As test scripts become lengthier, it is convenient to extract them to their own script.</p><p>Each line contains a name and command separated by a colon. The name appears in GitHub checks. The command is run by a testbot worker, which is continuously long polling testbot farmer via HTTP over TLS, asking for jobs.</p><p>Each testbot worker runs on an EC2 instance created from the same Amazon Machine Image (AMI) used by our production server. We run more instances to increase test parallelism.</p><p>In this example, the tests for the Go, Node, and Ruby SDKs will begin to run almost simultaneously as different testbot worker processes pick them up.</p><p>Tests for dashboard and server will not run in this pull request because no files in their directories were changed.</p><h3>Testing across services</h3><p>To make it convenient to test across service boundaries, we write a with-serverd script that:</p><ul><li>installs the serverd binary</li><li>migrates the database</li><li>creates a team and credential</li><li>runs serverd serve without blocking programs passed as arguments to with-serverd</li></ul><p>We place this script in $ORG/bin to make it available on our $PATH.</p><p>This script can be used in Testfiles:</p><pre>$ cat $ORG/dashboard/Testfile<br>tests: with-serverd $ORG/dashboard/test.sh<br>$ cat $ORG/sdk/go/Testfile<br>tests: cd $ORG/sdk &amp;&amp; with-serverd go test -cover ./...</pre><p>Tests that depend on with-serverd can avoid mocking on HTTP boundaries, making actual requests to the backing service and generating observable logs.</p><p>To cover product’s surface area, we move the Go SDK’s Testfile to the top of the file hierarchy so its test jobs will run on all pull requests:</p><pre>.<br>├── ...<br>├── Testfile<br>├── bin<br>│   └── with-serverd<br>└── sdk<br>    └── go</pre><h3>Open source</h3><p>We want our SDKs to be open source on GitHub and available on registries such as <a href="https://www.npmjs.com/">NPM</a> and <a href="https://rubygems.org/">Rubygems</a> but we like the monorepo as the canonical place for our development workflow.</p><p>So, we decide to mirror the SDK code to open source repos.</p><p>This provides community access. Although the community patch workflow is a bit manual, these are SDKs tightly coupled to our product and we expect community patches to be rare.</p><p>Other kinds of projects such as general-purpose libraries might be better suited to live as standalone open source repos outside the monorepo.</p><p>We write a mirrorbot program (design credit <a href="http://www.geebobg.com/">Bob Glickstein</a>):</p><pre>.<br>├── ...<br>├── .mirrorbot.yml<br>└── cmd<br>    └── mirrorbot<br>        ├── Procfile<br>        ├── Testfile<br>        └── main.go</pre><p>mirrorbot runs as a command-line program that copies relevant changes from the $ORG monorepo to one or more target repos. It can be run on a laptop or a server.</p><p>On startup, it clones the monorepo and each target repo. Each copied commit includes an upstream:[SHA] line (<a href="https://github.com/sequence/sequence-sdk-ruby/commit/d00d15292808b7cf3c69c879ae9da781c819e658">example</a>). mirrorbot reads that SHA from the latest commit on the destination branch of each target repo to get a cursor.</p><p>Mirror then fast-forwards the local monorepo, looking for new commits.</p><p>For each target repo, a patch file is produced for each new commit. The patch file is then filtered to remove anything not applicable to that repo. If anything remains, the patch is applied and committed. Any new commits are then pushed to GitHub.</p><p>A .mirrorbot.yml file configures the program. It maps monorepo branches to target repo branches and monorepo directories and files to target repo directories and files. For example:</p><pre>github.com/org/org-sdk-node:<br>  - branch:<br>    - master: master<br>  - mirror:<br>    - sdk/node: /<br>github.com/org/org-sdk-ruby:<br>  - branch:<br>    - master: master<br>  - mirror:<br>    - sdk/ruby: /</pre><h3>Backwards compatibility</h3><p>As our customers use the software, we better understand their needs and begin to design v2.</p><p>To do this well, we add new interfaces and deprecate old interfaces in the v1.x series of the SDKs. The server continues to support the v1.x series now and for a well-communicated time period past the release of v2.0 (such as 90 days).</p><p>As we release minor versions v1.1 and v1.2, patch versions v1.2.1 and v1.2.2, and eventually v2, we want to carefully ensure backwards compatibility.</p><p>We write with-go-sdk, with-node-sdk, and with-ruby-sdk scripts (design credit <a href="https://xph.us/">Keith Rarick</a>):</p><pre>.<br>├── ...<br>└── bin<br>    ├── with-go-sdk<br>    ├── with-node-sdk<br>    └── with-ruby-sdk</pre><p>We use these scripts to run processes using a given version of our SDKs:</p><pre>with-go-sdk [version] [command]<br>with-node-sdk [version] [command]<br>with-ruby-sdk [version] [command]</pre><p>The version can be a released version to a registry such as NPM or Rubygems or a special value monorepo to use the current $ORG source code.</p><p>For example:</p><pre>with-ruby-sdk 1.0 ruby -e &quot;require &#39;org-sdk&#39;; puts OrgSDK::VERSION&quot;</pre><p>We update the Testfile at the top of the file hierarchy to test supported releases and the current source code (pre-release) on every pull request:</p><pre>$ cat $ORG/Testfile<br>gohead: with-serverd with-go-sdk monorepo go test -cover ./...<br>gov1: with-serverd with-go-sdk 1.5 go test -cover ./...<br>gov2: with-serverd with-go-sdk 2 go test -cover ./...<br># ... etc.<br>rubyv2: with-serverd with-ruby-sdk 2 $ORG/sdk/ruby/test.sh</pre><p>The SDK scripts are composable with the with-serverd script.</p><p>In addition to running on CI, they are useful for quickly testing bug reports from customers on a particular version, and hopefully providing a great customer experience for them.</p><h3>Repo integrations</h3><p>We often want to integrate tools such as <a href="https://www.netlify.com/">Netlify</a> or <a href="https://www.heroku.com/">Heroku</a> with the repo.</p><p>Usually, integrating with third-party tools involves providing a manifest like:</p><pre>cd subdir &amp;&amp; command</pre><p>For Heroku specifically, we found it helpful to write a <a href="https://github.com/croaky/heroku-buildpack-monorepo">Monorepo buildpack</a>, which involves adding a heroku.sh file to the subdirectory for Heroku-deployable projects:</p><pre>.<br>├── ...<br>├── cmd<br>│   └── mirrorbot<br>│       ├── Procfile<br>│       └── heroku.sh<br>└── testbot<br>    └── farmer<br>        ├── Procfile<br>        └── heroku.sh</pre><h3>Conclusion</h3><p>Working in a monorepo can encourage a feeling of “tight integration”, where service boundaries are well-defined and less likely to be mocked out. Some tasks are a particular pleasure, such as searching across projects for callsites of a function or RPC.</p><p>For other tasks, it can help to write custom tools. Writing those custom tools offers an opportunity to design an ideal experience for the engineering team.</p><p>In this example, the final directory structure looks something like this:</p><pre>.<br>├── .mirrorbot.yml<br>├── .prettierrc.yml<br>├── .rubocop.yml<br>├── .tool-versions<br>├── README.md<br>├── Testfile<br>├── bin<br>│   ├── setup-go<br>│   ├── setup-localhost-tls<br>│   ├── setup-node<br>│   ├── setup-postgres<br>│   ├── setup-ruby<br>│   ├── with-go-sdk<br>│   ├── with-node-sdk<br>│   ├── with-ruby-sdk<br>│   └── with-serverd<br>├── cmd<br>│   ├── mirrorbot<br>│   │   ├── Procfile<br>│   │   ├── Testfile<br>│   │   ├── heroku.sh<br>│   │   ├── main.go<br>│   │   └── setup.sh<br>│   ├── serverd<br>│   │   └── main.go<br>│   └── testbot<br>│       └── main.go<br>├── dashboard<br>│   ├── Testfile<br>│   └── setup.sh<br>├── mobile<br>│   ├── Testfile<br>│   ├── app<br>│   │   ├── android<br>│   │   └── ios<br>│   └── setup.sh<br>├── infra<br>│   └── setup.sh<br>├── sdk<br>│   ├── go<br>│   │   └── setup.sh<br>│   ├── node<br>│   │   ├── Testfile<br>│   │   └── setup.sh<br>│   └── ruby<br>│       ├── Testfile<br>│       └── setup.sh<br>├── server<br>│   ├── Testfile<br>│   ├── http_handler.go<br>│   └── setup.sh<br>└── testbot<br>    ├── Testfile<br>    ├── farmer<br>    │   ├── Procfile<br>    │   ├── heroku.sh<br>    │   └── main.go<br>    ├── setup.sh<br>    └── worker<br>        └── main.go</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1847cbd6800" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/monorepo-e1847cbd6800">Monorepo</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starlight: payment channels on Stellar]]></title>
            <link>https://medium.com/interstellar/starlight-payment-channels-on-stellar-3ff833c0d0ca?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ff833c0d0ca</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[lightning]]></category>
            <category><![CDATA[payment-channels]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Dan Robinson]]></dc:creator>
            <pubDate>Thu, 25 Oct 2018 18:29:07 GMT</pubDate>
            <atom:updated>2018-10-25T18:29:07.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>Starlight: Payment channels on Stellar</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*VWoJX57jrYGn7neBZtWBaQ@2x.png" /></figure><p>Interstellar is pleased to announce a preview release of <a href="https://github.com/interstellar/starlight">Starlight</a>, an implementation of bidirectional payment channels on <a href="https://www.stellar.org/">Stellar</a>. Payment channels allow parties to transact privately, instantly, and securely, while paying zero fees.</p><p>Normally, making a payment on a network like Stellar involves publishing details of the payment to all observers, paying a small fee, and waiting for the network to reach consensus and confirm the payment.</p><p>A payment channel, on the other hand, uses the network to “lock up” some funds for use by the channel’s participants. They may then pay each other these funds without further involving the network. Such payments are thus private, instant, and free.</p><p>The security of the channel is ensured by special information exchanged between the participants with each payment. This information includes signed Stellar transactions that are <em>not</em> published to the network until one party chooses to close the channel. When the channel is closed, these “settlement transactions” send to each party’s Stellar account their respective share of the balance, taking into account the channel’s history of payments back and forth.</p><p>Only the final settlement balances are revealed to the network when the channel closes. All other activity in the channel remains private and known only to its participants.</p><p>Starlight payment channels are analogous to the Bitcoin payment channels used in <a href="https://lightning.network/">the Lightning Network</a>. As we extend the Starlight project to support not only payment channels but also multi-hop payments <em>across</em> those channels, we plan to build in compatibility with other payment-channel networks, such as Lightning and <a href="https://interledger.org/">Interledger</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fplayer.vimeo.com%2Fvideo%2F297145195%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fvimeo.com%2F297145195&amp;image=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fi.vimeocdn.com%2Fvideo%2F734749394_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1143" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee30d38cf887db4ce5ea0f072ab056f7/href">https://medium.com/media/ee30d38cf887db4ce5ea0f072ab056f7/href</a></iframe><p>This preview release supports bilateral channels (channels with exactly two participants). It includes the Starlight payment channel software as well as a built-in wallet application. It allows transacting in lumens only (the native asset of the Stellar network). Future versions will support any asset issued on the Stellar network.</p><p>This is an early demo release, and you should expect bugs as well as frequent incompatible upgrades. Until we work out the kinks, Starlight connects only to the Stellar testnet, not the mainnet, to eliminate the risk of losing real funds to a software bug. Please do not attempt to use this application with the Stellar mainnet.</p><p>You can download the Starlight application, read the source code, and try the demo <a href="https://github.com/interstellar/starlight">here</a>. You can learn more about the Starlight payment channel protocol by reading the <a href="https://github.com/interstellar/starlight/blob/main/starlight/doc/Protocol.md">specification</a>.</p><p>Thank you to Jeremy Rubin, Jed McCaleb, Nicolas Barry, David Mazières, Akash Khosla, and others for inventing and developing the designs for payment channels on the Stellar protocol.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ff833c0d0ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/starlight-payment-channels-on-stellar-3ff833c0d0ca">Starlight: payment channels on Stellar</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Interstellar]]></title>
            <link>https://medium.com/interstellar/announcing-interstellar-24ff0bc2d89c?source=rss----11e213982ac4---4</link>
            <guid isPermaLink="false">https://medium.com/p/24ff0bc2d89c</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Interstellar]]></dc:creator>
            <pubDate>Mon, 10 Sep 2018 14:13:06 GMT</pubDate>
            <atom:updated>2018-09-10T14:13:05.878Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Lightyear has acquired Chain and is now called Interstellar</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*P203YFAM7LHfeeCxN7muRg@2x.png" /></figure><p>FOR IMMEDIATE RELEASE</p><p><strong>Chain Merges with Lightyear, Goes All-In on Stellar</strong></p><p><em>Combined company, to be called Interstellar, will help organizations build on the Stellar Network; Stellar Development Foundation to remain independent</em></p><p>SAN FRANCISCO, September 10, 2018 — Chain, Inc. (“Chain”) today announced it has been acquired by Lightyear Corporation (“Lightyear”), a Stellar-focused commercial entity formed last year with the support of the Stellar Development Foundation. The Chain and Lightyear brands will be retired and the combined company will be re-named to Interstellar.</p><p>The merger brings Chain’s enterprise products and customer base to Stellar’s global public ledger, creating an end-to-end solution that will enable organizations to issue, exchange, and manage assets on a highly-scalable public network. Chain’s cloud ledger service, Sequence, will allow organizations to easily track assets as they move between private ledgers and the Stellar network.</p><p><strong>Key facts:</strong></p><ul><li>Adam Ludwin, who is Chain’s CEO, will be Interstellar’s CEO</li><li>Jed McCaleb, who co-founded the Stellar Development Foundation and Lightyear, will be CTO of Interstellar</li><li>The Stellar Development Foundation, which develops the Stellar protocol and supports the open source community, remains independent</li></ul><p>Stellar is an open network that allows any currency or asset to be digitally issued, transferred, and exchanged over the internet. Interstellar will make it easy for developers and enterprises to leverage Stellar as a platform to build novel financial products and services.</p><p>“Chain’s team has led the market for enterprise adoption of blockchain technology, which is a critical component of building a future where money and digital assets move over open protocols,” said Jed McCaleb. “We are thrilled to be joining forces to help organizations build on Stellar.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMLaaQCB8nj5UrlUcFjDvQ.jpeg" /><figcaption>Adam Ludwin (left) and Jed McCaleb (right). Credit: Christian Peacock.</figcaption></figure><p>“Chain has admired Stellar for years, and from day one we’ve shared their goal of enabling financial assets to move seamlessly over the internet,” said Adam Ludwin. “Chain has worked from inside the enterprise while Stellar has focused on the network between organizations. As a single team we will have a complete view and set of capabilities to make value-over-IP a reality.”</p><p>Interstellar’s product portfolio will also include <a href="http://www.stellarx.com">StellarX</a>, a recently announced marketplace for trading assets on Stellar. StellarX is currently in beta and will be launching to the public soon.</p><p>At close, Interstellar will employ 60 people, with its headquarters in San Francisco and offices in New York City and Singapore.</p><p>More information is available at <a href="http://www.interstellar.com">www.interstellar.com</a>.</p><p><strong>About the Stellar Network</strong></p><p><a href="http://www.stellar.org">Stellar</a> is an open network that allows any currency or asset to be digitally issued, transferred, and exchanged over the internet. The Stellar public ledger has a built-in order book, pathfinding algorithm, and network token that together allow assets to move seamlessly between participants. The Stellar network is open source and validated by decentralized nodes that anyone can run, yet it is highly scalable and energy efficient thanks to a novel consensus system called SCP. SCP was developed by professor David Mazières, who leads the secure computer systems group at Stanford and is the Chief Scientist at the Stellar Development Foundation.</p><p><strong>About the Stellar Development Foundation and Lightyear Corporation</strong></p><p>The <a href="http://www.stellar.org">Stellar Development Foundation</a> (SDF) is a non-profit founded in 2014. It helps build and maintain the Stellar network and supports the Stellar community through education, grant programs, and technical leadership of Stellar’s open source projects. The Foundation is obligated by its charter to distribute 95% of the network’s token, lumen (XLM), to ensure the operational and economic decentralization of the network. SDF received its initial funding from payments innovator <a href="http://www.stripe.com">Stripe</a>.</p><p><a href="https://www.stellar.org/blog/lightyear-announcement/">Lightyear</a>, a for-profit entity focused on adoption of the Stellar network by enterprise, was founded by Brit Yonge and Jed McCaleb in 2017 with support from SDF. Lightyear will be re-named to Interstellar concurrent with the merger.</p><p><strong>About Chain</strong></p><p><a href="http://www.chain.com">Chain</a> was founded in 2014 by Adam Ludwin, Devon Gundry and Ryan Smith. The company builds enterprise-grade blockchain products leveraged by leading financial organizations including Visa, Nasdaq, and Citigroup. Chain’s cloud product, Sequence, will become an important component of Interstellar’s product portfolio and enable enterprises to issue, manage, and track assets as they move between private ledgers and the Stellar network. The company previously raised $44M from Khosla Ventures, RRE Ventures, Thrive Capital, and strategic partners including Visa, Nasdaq, Citi, Capital One, Fiserv, and Orange.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24ff0bc2d89c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interstellar/announcing-interstellar-24ff0bc2d89c">Announcing Interstellar</a> was originally published in <a href="https://medium.com/interstellar">Interstellar</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>