<?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[Parity Technologies - Medium]]></title>
        <description><![CDATA[powering the decentralised web - Medium]]></description>
        <link>https://medium.com/paritytech?source=rss----2045160d20c6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Parity Technologies - Medium</title>
            <link>https://medium.com/paritytech?source=rss----2045160d20c6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:17:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/paritytech" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[So Long, Medium!]]></title>
            <link>https://medium.com/paritytech/so-long-medium-99fdcd78cc3e?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/99fdcd78cc3e</guid>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[parity-technologies]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Parity Technologies]]></dc:creator>
            <pubDate>Wed, 06 Nov 2019 08:38:51 GMT</pubDate>
            <atom:updated>2019-11-06T08:38:51.818Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-roS4GuSZCNq8zHdTYqVQ.jpeg" /></figure><p><strong><em>TL;DR: The official Parity Technologies blog will no longer be replicated on Medium. Visit </em></strong><a href="https://parity.io/blog"><strong><em>parity.io/blog</em></strong></a><strong><em> for all future updates.</em></strong></p><p>In the interest of data sovereignty, privacy, and open-source values, we’ve decided to only host our blog at <a href="https://parity.io/blog">parity.io/blog</a>.</p><p>We’re committed to building the future of Web3 — an open and decentralized internet — and our choice of publication platforms should reflect this <em>as much as possible</em>. With this in mind, we’d like to begin moving away from centralized intermediaries whose incentives and practices may not always align with our own.</p><p>Going forward, the Parity blog will only be live at <a href="https://www.parity.io/blog">parity.io/blog</a>, which is powered by the open-source blogging platform <a href="https://ghost.org/">Ghost</a>. This will allow us to maintain complete control over our own content and data, avoid potential censorship, and make sure our posts can be seen by the entire community.</p><p>Want to keep up to date on all the latest Parity news?</p><ul><li><a href="https://www.parity.io/blog/">Visit our blog</a> [for RSS and news aggregators like Feedly, <a href="https://www.parity.io/blog/rss/">use this link</a>]</li><li><a href="https://www.parity.io/newsletter/">Sign up for our newsletter</a></li><li><a href="https://twitter.com/ParityTech">Follow us on Twitter</a> and <a href="https://t.me/parity_technologies">Telegram</a></li><li>Subscribe to the <a href="https://relaychain.fm/">Relay Chain podcast</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99fdcd78cc3e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/so-long-medium-99fdcd78cc3e">So Long, Medium!</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UTXO on Substrate]]></title>
            <link>https://medium.com/paritytech/utxo-on-substrate-7f0e0576768e?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/7f0e0576768e</guid>
            <category><![CDATA[proof-of-concept]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[utxo]]></category>
            <category><![CDATA[substrate]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Dmitriy Kashitsyn]]></dc:creator>
            <pubDate>Tue, 18 Jun 2019 19:18:03 GMT</pubDate>
            <atom:updated>2019-06-18T19:18:03.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6KVqc9Ug9VSiCgmj4xdsEw.png" /></figure><p>Some time ago, Gavin Wood asked me to investigate the possibility of implementing a UTXO chain based on <a href="https://www.parity.io/substrate/">Substrate</a>, a new promising blockchain framework made by Parity Technologies that is now used as a foundation for <a href="https://polkadot.network/">Polkadot</a>.</p><p>We wanted to estimate how flexible Substrate is, and a UTXO chain seemed a good choice to test it out since it’s very different from what we’re used to thinking about when implementing Substrate. If it works, then it goes to show that Substrate is indeed pretty flexible and generic; we can be more confident that it would suit almost any other blockchain application.</p><p>Similarly to Ethereum, Substrate maintains an amount of available funds as numbers. In some sense, it’s similar to an ordinary banking system where account balances are represented by numbers and stored somewhere in a database or in a computer memory. This works OK, but it is not necessarily the best or the only possible way to represent such value.</p><p>Historically, the first successful cryptocurrency was Bitcoin, which uses an entirely different approach. In Bitcoin, there are no accounts per se, and the balance is not stored as a single number. Instead, available funds are defined based on a set of so-called Unspent Transaction Outputs, abbreviated as UTXO — a fancy name for a rather simple idea.</p><h3>UTXO in a nutshell</h3><p>In a nutshell, UTXO is very similar to cash money, or rather, to <a href="https://en.wikipedia.org/wiki/Traveler%27s_cheque">traveler’s checks</a>.</p><p>When paying someone in cash you typically think about the total value to be paid, but you use a set of unique and indivisible units (coins or banknotes) to represent that value. For example, if Alice wishes to pay Bob $250 she may do that by giving Bob two notes worth $100 and one note worth $50; or five notes of $50, or any other combination that sums to the desired value.</p><p>Each banknote truly is unique. Although there are millions of them with the same value, every banknote is physically unique and has a serial number imprinted on its surface. Usually we do not pay much attention to it and just treat two $100 banknotes as equal when it comes to paying stuff, but this number is essential for banks to control money movement and authenticity checks.</p><p>So, each banknote represents a unique and indivisible asset with predefined and fixed value that may be spent only as a whole, i.e., you can’t tear $100 banknote apart to get two $50 ones. Of course, it is possible to divide the value into smaller units by asking someone for a change, but still, you’d need to spend your original $100 banknote. In the same manner, when buying a coffee, you fully spend your $10 note, and in return, you get your coffee and some change.</p><p>UTXO work in a similar way. To pay someone using Bitcoin, you should already have some unspent assets in your wallet. As with fiat currency, you may combine several UTXO to get a larger value.</p><p>Unlike cash money, each UTXO has its owner inscribed. In that sense, it’s similar to a traveler’s check because only the check owner is allowed to spend it. This is done by having the unit augmented by the owner signature. The difference is that traveler’s checks are signed by the owner’s hand, whereas UTXO uses the asymmetric cryptography and contains a public key of the recipient, not the sender. Finally, banknotes are printed by the government whereas UTXO are created by the sender.</p><p>Let’s recap: a UTXO is a unique and indivisible entity that is associated with its owner by a cryptographic key, has some inherent value, and may be spent only as a whole.</p><h3>The goal</h3><p>In our research, we will be trying to model a blockchain that uses the same principles as Bitcoin to move funds from one owner to another.</p><p>However, when reading through the article, please keep in mind that our primary goal is to evaluate Substrate’s flexibility, not to port Bitcoin in every possible detail. In some cases, the implementation will almost be identical to that of <a href="https://www.parity.io/bitcoin/">Parity Bitcoin</a>, in others — not so much. For example, current implementation does <em>not</em> support mining and coinbase transactions; it just redistributes the value from a “premined” set of UTXO that was initialized in the genesis block.</p><p>Also, please note that the provided implementation is not at all production-ready. It wasn’t formally verified and probably has some security or stability issues, so I definitely <em>do</em> <em>not</em> recommend using it for any critical infrastructure without proper research. However, I would be more than happy if someone were to make this prototype into a working solution.</p><p>That being said, let’s move on to the code.</p><h3>Digging in!</h3><p>First of all, let’s talk about how Substrate allows you to customize it. As an application programmer, you’re expected to provide a <em>runtime</em> — a bunch of logic that tells Substrate how to handle the chain and what the business logic should be.</p><p>All of this revolves around the idea of a <em>State Transition Function</em>, or STF for short. You can read more of that <a href="https://medium.com/paritytech/substrate-in-a-nutshell-a54cd34c7863">in my other article</a>, but for now let’s just say that every blockchain can be represented as a function that accepts the current state and a pending transaction, and then yields another state that reflects the changes made after the transaction is applied.</p><p>So let’s say both Alice and Bob have 10 tokens, and then Alice sends 5 tokens to Bob. After this transaction is applied, we expect Alice will now have 5 tokens and Bob will have 15 tokens. If Bob then tries to pay 20 tokens to Claire, that transaction must be considered invalid because, according to the latest chain state, Bob only has 15 tokens.</p><p>That’s exactly what the runtime is meant to do — it defines all entities and their relations, validates incoming transactions and alters the state accordingly.</p><p>Let’s start by specifying the data types we’ll use to define the business logic of our UTXO chain. The Transaction type comes first. It represents a single UTXO transaction to be dispatched:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9e7a5a7b04f170ce75f7addf33e8ef9/href">https://medium.com/media/c9e7a5a7b04f170ce75f7addf33e8ef9/href</a></iframe><p>Nothing extraordinary here, just a plain definition that the Transaction is just a bunch of inputs and outputs. If you’re curious, you can <a href="https://github.com/paritytech/parity-bitcoin/blob/dadfefe0a47ba79102f5050b81ccbab276261831/chain/src/transaction.rs#L94">compare it</a> with the version from Parity Bitcoin to see some similarity. All #[...] weirdness above is called <a href="https://doc.rust-lang.org/reference/attributes.html">attributes</a>, and it tells the Rust compiler to implement various things for us, like the comparison operators, hash functions, and serialization routines. You may safely ignore them for now.</p><p>I’ve intentionally left all the comments and attributes to show that even with them being included, the code remains compact and may be written on a few napkins. I think this is a considerable achievement of Substrate, even when compared to Parity Bitcoin that does “the same thing” in tens of thousands of lines. Much like when writing in JavaScript for the web, you’re not thinking about the overwhelming complexity of a browser engine or anything beneath, down to the OS level. Instead, you just formulate your business logic in a high-level form and allow the system to do the rest.</p><p>Okay, but what about TransactionInput?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96e7ff670457f81331d5e9dee6b96ecc/href">https://medium.com/media/96e7ff670457f81331d5e9dee6b96ecc/href</a></iframe><p>TransactionInput aggregates all data needed to spend a single UTXO. First of all, we need a way to refer to some existing UTXO to spend. The easiest way to do so is to use its hash as an identifier. This is a common practice in the world of distributed systems, and it works really well as long as the probability of a hash collision is negligible. For that, we use 256 bit Blake2. The parent_output field contains such a hash.</p><p>As previously mentioned, to spend a UTXO the owner must sign it with a secret key that matches the public key stored in that particular UTXO. This is safe as long as the only person knowing the secret key is the owner. Such proof is stored in the signature field.</p><p>The difference between our implementation and Bitcoin is that we refer to parent_output directly by its hash, whereas <a href="https://github.com/paritytech/parity-bitcoin/blob/dadfefe0a47ba79102f5050b81ccbab276261831/chain/src/transaction.rs#L19-L44">Bitcoin uses</a> the hash of a <em>transaction</em> that produced the UTXO coupled with an index to select a particular entry from the list of transaction’s outputs. The reason is that Bitcoin is defined in terms of transactions and blocks, whereas we speak in terms of business logic and state transitions. In our case, Substrate transactions are just supplementary entities that facilitate the process and are mostly out of the scope of the business logic. More on that later.</p><p>Next goes the TransactionOutput structure that essentially defines the UTXO:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4062b5e4bfcc28081a38f1e11fb9f60/href">https://medium.com/media/d4062b5e4bfcc28081a38f1e11fb9f60/href</a></iframe><p>The purpose of value and pubkey fields should already be clear. The only field worth explaining is salt. This field provides extra entropy to make each UTXO and its hash truly unique.</p><p>Imagine a situation where we have a bot that sends 10 tokens to the same recipient every day. For the sake of simplicity, it may use the same destination address, i.e., a recipient’s public key. Because both value and pubkey fields would contain the same data, all UTXO created by the bot will look exactly the same and therefore have the same hash.</p><p>Without the salt field, an attacker would be able to remember the signature of the first UTXO spent by the owner and then steal the money by spending all subsequent UTXO before the owner even notices. This is called a <a href="https://en.wikipedia.org/wiki/Replay_attack">replay attack</a>. Also, there is another possibility of a replay attack that is not yet addressed in the source code.</p><p>Note, that since the Bitcoin implementation <a href="https://github.com/paritytech/parity-bitcoin/blob/dadfefe0a47ba79102f5050b81ccbab276261831/chain/src/transaction.rs#L19-L44">relies on a transaction hash</a> to pinpoint the UTXO, it does not suffer from this issue and, hence, does not need salt. However, that does not mean that replay attacks are not possible in Bitcoin. That’s why it’s critical to generate a new Bitcoin address for every incoming transaction.</p><h3>The state</h3><p>So far we have defined all data structures needed to represent a single transaction in memory. But we also need to tell Substrate <em>what</em> to store in its state database to support the business logic of the chain by persisting this information over time.</p><p>This is done by defining the module storage using decl_storage! macro:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f10e4f4180f0c7a8a9709a7b01f4eb7c/href">https://medium.com/media/f10e4f4180f0c7a8a9709a7b01f4eb7c/href</a></iframe><p>It seems to be a large chunk of text, but essentially it defines only three things: a list of unspent outputs, a current amount of leftover value and a list of outputs that are locked and could not be spent unless unlocked. Aside from that, it defines how to populate the chain with an initial set of UTXO during the bootstrap process.</p><p>It is important to note that the state storage is very different from block storage.</p><p>Block storage is an essential part of every blockchain node and is used to store blocks of that chain. Nowadays, only dedicated archive nodes store the whole chain locally, whereas normal nodes only manage a temporary subset of recent blocks.</p><p>On the other hand, state storage is all about business logic. It contains all data needed to reflect the current state of business entities and their relations. In order to validate incoming transactions, the only thing you need to know is the state of all affected parties and amounts of their funds. That’s why even <a href="https://www.parity.io/what-is-a-light-client/">light clients</a> are able to validate transactions.</p><h3>The logic</h3><p>When we say that Alice receives some funds from Bob, we mean that, according to the rules, a set of UTXO that Bob used to pay Alice must be marked as spent (to prevent Bob from double-spending them later). Then, a new set of UTXO that Bob created for Alice must now be remembered as valid so Alice would be able to spend them afterward.</p><p>These rules are the essence of business logic and need to be considered when validating and dispatching incoming transactions.</p><p>Let’s have a look at the entry point to the whole UTXO module:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cc3994ac2052c52ba34f4352d4d55d5/href">https://medium.com/media/5cc3994ac2052c52ba34f4352d4d55d5/href</a></iframe><p>We have two functions defined: execute and on_finalize.</p><p>The execute function is key to the whole UTXO logic. It accepts a single transaction, checks it, and, if valid, applies the transaction by updating the storage. Finally, it deposits an event signaling that a transaction has just been processed.</p><p>The on_finalize event handler is called when a single block full of transactions is just formed. By firing that event handler, Substrate allows the runtime to take some action, if needed. We use this handler to redistribute combined leftover value from all transactions among validators that participated in the creation of this block as a reward for their work.</p><h4>Transaction checking</h4><p>In order to validate an incoming transaction, we need to ensure that:</p><ul><li>Inputs and outputs are not empty</li><li>All inputs match to existing, unspent and unlocked outputs</li><li>Each input is used exactly once</li><li>Each output is defined exactly once and has a nonzero value</li><li>Total output value must not exceed total input value</li><li>New outputs must not collide with existing ones</li><li>Sum of input and output values must not overflow</li><li>Provided signatures are valid</li></ul><p>Violation of any of these checks may lead to chain security issues, so it’s critical to implement them correctly. Luckily, the logic is quite simple and straightforward:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e62181e37c547d53604e1ff10867832/href">https://medium.com/media/5e62181e37c547d53604e1ff10867832/href</a></iframe><p>As you probably noticed, aside from the transaction checking, this function collects some information. Let’s see its definition:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4943de1396f539eed456d0c80806509/href">https://medium.com/media/e4943de1396f539eed456d0c80806509/href</a></iframe><p>Later it would be shown that we use total inputs and outputs to calculate the priority of the transaction and an amount of leftover value to be redistributed among validators as a block reward.</p><p>However, it makes absolutely no sense to talk about such values if the transaction had failed its verification. Otherwise, an attacker would be able to intentionally craft transactions that would have maximum priority and DoS the chain by flooding the transaction pool and preventing normal transactions from being dispatched. Or it could produce a huge amount of leftover value “out of thin air” to exploit the reward system.</p><p>By organizing this data as Rust enums, we prevent accidental misuse since values are available only if a transaction is valid. And vice versa, a list of missing inputs is available only if it was discovered that a transaction refers to some UTXO that are not (yet?) present in the state database. That way it’s impossible to misuse the API, which is good for readability and chain security.</p><h4>State update</h4><p>If a transaction was verified and proven to be correct then all we need to do is alter the chain state to reflect the changes made by the transaction:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c176d0fb7d745198e5adff4bc599fe9/href">https://medium.com/media/5c176d0fb7d745198e5adff4bc599fe9/href</a></iframe><p>Basically, we remove all inputs that are now considered spent and add all new outputs to mark them as available. We also accumulate the leftover value in a temporary storage variable LeftoverTotal that will be used during block finalization.</p><h4>Block rewards</h4><p>When a block gets finalized, it is time to reward the nodes that authored the block. This is done by redistributing leftover value collected from all transactions that were included in this block:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/063cab234e2571ea1ce0e57b145062a2/href">https://medium.com/media/063cab234e2571ea1ce0e57b145062a2/href</a></iframe><p>The logic is pretty simple: we accept a list of authorities and calculate a share_value by dividing total leftover value by the number of authorities evenly. Then we create one UTXO per author and insert it into UnspentOutputs. We use current block number as a salt value to prevent potential replay attacks that were mentioned above.</p><p>We also check that by inserting the reward UTXO to UnspentOutputs we do not accidentally overwrite some existing UTXO that happened to have the same hash. Such a scenario is extremely rare in practice, but nevertheless, it would be unfortunate if someone would lose his or her UTXO worth of millions just because it was overwritten by a routine reward UTXO.</p><p>At first it may look like we’re creating value out of thin air here, but on second thought, one may realize that the global amount of value would not be increased, since transaction owners explicitly abandoned part of their funds in exchange for priority.</p><p>Finally, since every block author knows all the details like the block number, the session key used in that particular era, and, of course, the secret key that matches that session key, the block author will always be able to reconstruct the UTXO, calculate its hash, and claim its reward even without storing that UTXO anywhere.</p><h4>UTXO locking</h4><p>This is where things get different from Bitcoin.</p><p>To my knowledge, the Bitcoin specification does not prescribe what information needs to be stored on the disk and how to do that. The only stuff that matters is the Bitcoin protocol itself that is formulated in terms of transactions and blocks. So, each node has to build its own understanding of which UTXO are valid at any given point in blockchain history.</p><p>In contrast, our UTXO implementation has the global state database that is agreed upon by <em>all</em> participating nodes, by definition. As we already know, it is used to store UTXO status and a temporary amount of leftover value. Since the state database is a part of the consensus, we may rely on its contents in our business logic and be sure that all other nodes will do the same.</p><p>But nothing prevents us from storing anything extra. For example, we may add a mapping from a hash of an existing UTXO to a structure that defines the lock status of that UTXO. If UTXO is locked, then it is not allowed to spend it in the usual way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be741ad340e47d7b6e2c35d8ff6271a2/href">https://medium.com/media/be741ad340e47d7b6e2c35d8ff6271a2/href</a></iframe><p>Much like the cash that is locked in the safe: you may use it eventually, but no sooner than when you open the safe. It’s available, just locked.</p><p>You may be wondering, why on earth would one need that? You see, in the world of cryptocurrency, there’s a tendency to replace the old proof-of-waste algorithms with something less greedy and more effective. One possibility is to use the funds themselves as a guarantee that a peer will behave properly.</p><p>Basically, one would say: “I swear that I will act according to the rules. Here’s my money. Please lock it in a safe place. And if someone will prove that I misbehaved, then my money must be either slashed or distributed among honest participants.” Of course, if such a person will then wish to get his or her funds back, the network will check that no malicious actions were taken within the last period, and then unlock the funds. Usually, the more funds were locked, the more abilities, vote weight, or income you get. Such systems are generally referred to as a proof-of-stake or PoS for short.</p><p>This will work as long as more than two-thirds of the nodes in the network are not malicious and operate according to the protocol. Aside from doing their regular duties, these nodes will also support PoS.</p><p>In Ethereum-like blockchains, it may be quite complicated to reason about available funds when dispatching the transactions: every node must ensure that there are enough free funds available, especially, since there may be complex time-dependent contracts.</p><p>Interestingly, our UTXO implementation does this in a couple of lines of code. In contrast to Ethereum-like chains, Bitcoin-like chains have their funds already divided in a natural way. We may easily lock a single UTXO and prevent it from being spent until some unlocking condition is met.</p><p>It’s difficult to do the same in Bitcoin because the state database is not part of its original specification; hence, it’s much harder to reason about which UTXO are locked at any given point in time, not to mention the client compatibility issues.</p><h4>Transaction ordering</h4><p>When talking about business logic of the chain, we mentioned that Substrate does all the dirty work for us, like handling the block storage, performing network interaction and conducting consensus voting. But this is not always the case. We have said that our runtime atomically dispatches one transaction at a time. So, if that transaction were valid, the state would be altered accordingly.</p><p>But what happens if two dependent transactions would arrive at the same node in a short period? Real networks are complex and unpredictable. Connectivity issues and sudden topology changes may cause all sorts of effects on the data being transmitted. Notably, messages could be lost, delayed or reordered. The latter fact is especially important for us.</p><p>Imagine a situation where we have two transactions, <strong>A</strong> and <strong>B</strong>, and <strong>B</strong> depends on <strong>A</strong>. In the case of UTXO that means that <strong>B</strong> consumes a UTXO that was created by <strong>A</strong>. If <strong>B</strong> would arrive prior to <strong>A</strong>, we may get a situation where node runtime would not be able to check the validity of a transaction because it refers to a seemingly nonexistent UTXO. Of course, we do know that it exists, it just wasn’t delivered yet, but the node does not know that. Essentially, it has two options:</p><ul><li>Just discard the transaction <strong>B</strong> as invalid. If the original sender would then re-broadcast the transaction, it would still have a chance to be applied, but no sooner than <strong>A </strong>gets dispatched. This solution may work, but it is dirty and ineffective. Moreover, some severe networking issues may lead to a situation where <strong>B</strong> would never be dispatched rendering the whole system useless. We can do better.</li><li>Defer the dispatching of the transaction <strong>B</strong> to a point when it would make sense. In our case, we need to wait somehow for <strong>A</strong> to be dispatched.</li></ul><p>The second option seems to be much more interesting, but how do we do that in practice? By its very design, Substrate knows nothing about runtime internals or the chain’s business logic. In fact, from its point of view, Substrate “sees” our transactions just as opaque byte arrays.</p><p>The solution here is to “explain” to Substrate how to deal with our transactions and how to order them correctly. This is done using dedicated TaggedTransactionQueue API exposed by a transaction pool to the runtime.</p><p>In Substrate, every transaction is associated with two sets of<em> </em>tags: requires and provides. A <em>tag</em> is just an arbitrary vector of bytes representing some unique value. The first set describes what tags are required by this transaction, whereas the second set defines tags that are provided by this transaction.</p><p>In the case above, we need to link transactions <strong>A</strong> and <strong>B</strong> together by stating that <strong>A</strong> provides some tag and <strong>B</strong> consumes the same tag as its requirement. For the sake of simplicity, we may use UTXO hashes as tags.</p><p>By traversing transactions and querying for their tags, the transaction pool organizes them in such an order that every transaction will have its requirements met. Those familiar with computer science may realize that this resembles the <a href="https://en.wikipedia.org/wiki/Topological_sorting">topological ordering</a>.</p><p>Sometimes two transactions do not depend on each other but in turn depend on a third transaction. For example, we may have transaction <strong>A</strong> that produces two outputs, and transactions <strong>B</strong> and <strong>C</strong> that spend these two outputs respectively. This will result in having both <strong>B</strong> and <strong>C</strong> depend on <strong>A</strong>. Topological ordering states that <strong>A</strong> must be dispatched before <strong>B</strong> and <strong>C</strong>, but<strong> </strong>the order in which to dispatch <strong>B</strong> and <strong>C</strong> is not defined. In this case, the transaction pool uses other criteria to prioritize transactions.</p><p>The classical solution is to use the amount of leftover value as the priority. The more funds were intentionally left by a transaction owner for authorities, the higher transaction priority will be. Win-win.</p><p>Let’s see how it’s implemented in our chain:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68803e3b996dae8ca4e5d0d9a0705111/href">https://medium.com/media/68803e3b996dae8ca4e5d0d9a0705111/href</a></iframe><p>TaggedTransactionQueue API handles all incoming extrinsics, not just our custom UTXO transactions. This gives a runtime a fine-grained control over the process of extrinsic validation. For example, runtime may perform additional checks, assign custom priority, or simply discard unwanted extrinsics.</p><p>Upon its completion, validate_transaction function yields the TransactionValidity structure that contains hints for the transaction pool to order and prioritize the extrinsic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8ff8f8d67cc767b11cb9acd1925f070/href">https://medium.com/media/e8ff8f8d67cc767b11cb9acd1925f070/href</a></iframe><p>In order to implement our logic we need to select only the extrinsics that correspond to UTXO transactions. This is done using the “magic” call to the IsSubType::is_aux_sub_type(&amp;tx.function) function parametrized by the module name utxo::Module&lt;Runtime&gt;. Upon success, this function returns a type that contains a deserialized call to our execute method along with a Transaction instance — everything we need to reason about transaction tags and priority.</p><p>The rest is just a logic that assigns tags and priority depending on check_transaction result:</p><ul><li>If transaction was fully verified, i.e., all incoming UTXO were found in the storage and all signatures were proven to be correct, then we populate provides tags only, while keeping requires list empty. That way we tell the transaction pool that the transaction does not depend on anything and is ready for immediate dispatch with the priority calculated as a difference between its input and output values.</li><li>If transaction was verified, but has some of its inputs missing, then we populate the requires and provides lists, allowing the transaction pool to order the transaction. Later, the transaction pool will call us again to re-validate the transaction, when its requirements would be met.</li><li>If verification was failed (for example, if one of the signatures happened to be invalid), then we abort the transaction dispatch by returning TransactionValidity::Invalid. The transaction pool will discard the extrinsic and remember our decision, so that all subsequent copies that may be received from other peers will be discarded as well.</li></ul><p><strong>Note:</strong> current implementation assigns maximum value to the longevity field. That way transaction pool will hold pending transactions in its queue indefinitely. This is OK for a proof-of-concept implementation, but the proper solution must assign something more clever.</p><p>For example, we may wait for several block periods for a transaction to have its requirements met. If, after all this time, the transaction still wasn’t dispatched, then we treat it as malformed and invalid, and discard as usual.</p><p>Without such a timeout, a malicious person may flood our node with transactions that depend on random non-existing inputs. Since we have no sane way to discard such transactions early, this may effectively DoS our node by filling its transaction pool with garbage.</p><h3>The result</h3><p>This article already grew too large to cover everything related to initial chain configuration and bootstrap process. So let’s just see what will happen if we’d try executing our chain.</p><p>If you like, you may try implementing the UTXO chain yourself. Based on my <a href="https://github.com/0x7CFE/substrate-node-template/tree/utxo">prototype implementation</a>, Nicole Zhu together with Amar Singh prepared a <a href="https://github.com/nczhu/utxo-workshop">UTXO workshop repository</a> where you may find everything needed from code stubs to detailed instructions. Also check out <a href="https://docs.substrate.dev/">the Substrate developer hub</a>.</p><p>First of all, we need to build our Substrate node with the UTXO runtime. I am assuming you are already familiar with the Rust ecosystem and know how to build stuff. If you’re unfamiliar with Rust, I suggest you have a look at the <a href="https://www.rust-lang.org/">Rust language site</a>.</p><p>Next, we need to <a href="https://polkadot.js.org/apps/#/settings">configure the UI</a> to connect to Local Node instead of the default. We also need to <a href="https://polkadot.js.org/apps/#/settings/developer">tell the UI</a> how to read into our custom UTXO types. This is done by providing a JSON file that has a mapping from our custom types to the core types that the UI is already familiar with:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4bce7ef913a879e66a07efff5921540/href">https://medium.com/media/a4bce7ef913a879e66a07efff5921540/href</a></iframe><p>The rest of the setup instructions may be found in <a href="https://github.com/nczhu/utxo-workshop/blob/master/README.md">the workshop’s Readme file</a>.</p><p>Dev chain has its genesis block compiled-in. In our case it contains the only UTXO that gives Alice a ridiculously huge amount of 0xff...f tokens.</p><p>Let’s check that Alice indeed own that funds. To do that we need to calculate the hash of the UTXO which happens to be 0xf414d3…2393b2. If the chain was initialized correctly we should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88sPZW9aaFRT35aCNB2h4w.png" /></figure><p>Let’s now ask Alice to spend part of that value and send, say, 100 tokens to Bob. We do that by submitting an inherent extrinsic via the UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VhF1qvi-xcMeUF2tVKd7Q.png" /></figure><p>We submit the extrinsic by providing its serialized hex-encoded version. When we’re ready, we click the “Submit Inherent” button and verify that it was parsed by the system correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnzT9GEVDymaf99ayXSESQ.png" /></figure><p>Note the transaction contents. We see that the transaction mentions 0xf414d3…2393b2 as its parent_output and 100 tokes as desired.</p><p>If all goes well we should see the popups appearing in the upper right corner that will notify us about transaction progress:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGQ5H0XAjMnRxyzHC0HjXQ.png" /></figure><p>Finally, we can check that the transaction was indeed included to the block:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEMEv9lgxNu5s2va8TWBBQ.png" /></figure><p>Apparently it worked!</p><p>Please note that during our research we said nothing about how to find peers and do network communication, how to author and store blocks, how to reach consensus with other peers, etc. We only said what <em>we</em> want to have in terms of <em>our</em> business logic. The rest was automagically done by Substrate.</p><h3>Conclusion</h3><p>In the world of software engineering, there is a difference between libraries and frameworks.</p><p>A library is a rather independent piece of code that deals with a limited problem set and is usually not enough to support the solution on its own. As a developer, you typically need to combine several libraries and write your own glue code to get things working.</p><p>Frameworks, on the other hand, are much more complex and usually cover all aspects of the software development process from the start to the end. By providing ready solutions and suggesting effective design patterns, frameworks allow you to deliver your project with a minimum time investment.</p><p>Frameworks give you great power but can become burdensome if your project stops fitting into a framework’s philosophy. You can test the quality and flexibility of a framework’s design by seeing how hard it is to “bend the rules” of the framework and do things that seem to be “out of scope”. Usually, the more out-of-scope your solution is, the harder it is to match the framework’s “flow”.</p><p>In that sense, Substrate looks very promising. As we’ve seen with this UTXO implementation, we were able to use Substrate to implement a solution that wasn’t originally anticipated by the Substrate’s design. But still, the implementation was mostly seamless which is a good sign.</p><p>The most interesting thing is that all that flexibility didn’t affect our experience in a negative way. Implementing the UTXO chain wasn’t terribly different from other demo projects like <a href="https://shawntabrizi.com/substrate-collectables-workshop/#/README">Shawn’s Collectables</a> or <a href="https://substrate.dev/docs/en/tutorials/creating-your-first-substrate-chain">Gavin’s coin flip game</a>. All that makes me optimistic about the future of Substrate as a framework and as an ecosystem. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f0e0576768e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/utxo-on-substrate-7f0e0576768e">UTXO on Substrate</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[People of Parity — Jaco Greeff]]></title>
            <link>https://medium.com/paritytech/people-of-parity-jaco-greeff-ece32c116c5f?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/ece32c116c5f</guid>
            <category><![CDATA[parity-technologies]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[polkadot-network]]></category>
            <category><![CDATA[parity]]></category>
            <category><![CDATA[polkadot]]></category>
            <dc:creator><![CDATA[Alexandra Heller]]></dc:creator>
            <pubDate>Thu, 23 May 2019 09:38:01 GMT</pubDate>
            <atom:updated>2019-05-23T09:38:01.712Z</atom:updated>
            <content:encoded><![CDATA[<h3>People of Parity — Jaco Greeff</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EZ9r9JG7V_BVhOte.jpg" /></figure><p>“It was a string of numbers they gave me. It will never work,” Jaco Greeff ( <a href="https://github.com/jacogr">GitHub</a>, <a href="https://twitter.com/jacogr">Twitter</a>) recalls about his first impressions of Bitcoin. An electrical engineer by training, Jaco wrote embedded systems, C++, C, and was CTO at a few companies. His interest in Bitcoin and Ethereum drew him to Parity, where he says he’s having the most fun ever.</p><p>The story of how Jaco came to work at Parity is pretty endearing: One of <a href="https://parity.io/ethereum">Parity Ethereum</a> ‘s first users, he downloaded the 1.0 version of the client. He was disappointed to discover it didn’t have any RPCs but, “They moved really fast. Soon version 1.1 came out with RPCs and I could start playing with it.” He started making contributions, especially to the UI. When Jaco’s daughter was born to his German girlfriend, they didn’t know if they wanted to be in South Africa or Germany. “But once I held the little kid in my hands, I said ‘Oh yes, I want to be in Germany.’ So when I looked to get a job in Germany, I said, ‘Well I know someone.’”</p><p>Jaco is passionate and animated in conversation, which you wouldn’t necessarily know from observing him at the office. There he sits on a couch for hours on end, silent except for the occasional sigh or mumbled curse. (When rearranging the office, the joke was that it would be necessary to move Jaco with the couch in order to move the couch to another room.)</p><p>Aside from his permanent couch residence, Jaco’s other easily-observable quirk is he almost exclusively wears the toed Vibram shoes. When I bring up the shoes, he shares a story about how a former colleague convinced a restaurant manager to pull Jaco aside and tell him that he could not be seated with “those monkey shoes.” But Jaco’s thoughts on Polkadot and Substrate are more interesting than his quirks, which we discussed in addition to work-family balance and blockchain’s potential.</p><p><strong>You’re the primary author of </strong><a href="https://github.com/polkadot-js/"><strong>Polkadot-js</strong></a><strong>, which resides in a separate GitHub repo and not Parity’s. How did Polkadot-js come about?</strong><br>When the Polkadot spec was written, I implemented a JavaScript API in my free time. There was nothing for the API to talk to, but I had some code. I said to Gav, “What I actually want to do is create a Polkadot runtime environment in Javascript.” Gav said, “Cool, not sure how this fits in, but it helps the Polkadot ecosystem, so go on.”</p><p>Polkadot-js is three things: the UI, the API, and the client. When we got to Polkadot PoC-1, external people started using the <a href="https://polkadot.js.org/apps/#/explorer">Polkadot-js UI</a>. We didn’t explicitly plan to have a UI for PoC-1. It started as a developer tool, then a lot of people started using it and it has been growing ever since. It’s great seeing the community grow from that. There have been users such as validators who know JavaScript and they add features to make their own lives easier. When I see an external PR come in, it really makes my day.</p><p><strong>I talked to two different parties at </strong><a href="https://sub0.parity.io/"><strong>Sub0</strong></a><strong> about how responsive and helpful you are.</strong><br>I want to make whatever I’m involved in the best I possibly can. We’ve got users of the API and UI that sit all over the world. There’s some guys in NZ, there’s some guys somewhere in the US. It’s not just a Europe-based thing. You can’t come in at 8am and then switch off at 6pm and let everyone wait. There are people who are building on top of Polkadot and Substrate and they want to be successful; when they’ve got a misunderstanding on the APIs or the UI and you don’t respond quickly, you’re wasting the developers’ time.</p><p>So the way I internally prioritize things is that the API takes a slightly higher priority because there are developers out there using it. Next I try to focus on what people are using on a daily basis and prioritize those issues. And in the chats, as well. As things progress, there’s more people that can help and everybody’s lives become easier. But the short version is that I hate any open issues. I don’t want to waste anybody’s time. The priority always goes to making a user’s life easier and better. And that’s issues, questions, whatever it might be.</p><p><strong>What’s the coolest feature of the Polkadot-js UI?</strong><br>It’s a <a href="https://parity.io/substrate">Substrate</a> feature, not a UI feature-the fact that you can add new runtime modules and it will show up in the UI. So yes, the UI does some magic, but Substrate makes it possible. So when you add <a href="https://shawntabrizi.com/substrate-collectables-workshop/#/">Substrate Collectables</a>, it will show up on the UI and will show you what’s in storage. If I connect to <a href="https://edgewa.re/">Edgeware</a>, it shows the modules on the chain, you can query the transactions-that’s without the UI understanding what the chain does. That’s Substrate magic.</p><p><strong>What are some big opportunities on Substrate and Polkadot?</strong><br>We just started adding bounties to issues on the <a href="https://github.com/polkadot-js/">Polkadot-js repos</a>, sponsored by the <a href="https://web3.foundation/">Web3 Foundation</a>. So lately we’ve been trying to describe the issues better, especially with an eye towards external contributors.</p><p>Other than that, the things I’d like to see more of in the ecosystem are:</p><ol><li>Browser extensions, which I’d like to see integrated with the UI.</li><li>Mobile apps like the <a href="https://www.parity.io/signer/">Parity Signer</a> and wallets.</li><li>Explorers. I’m really rooting for the <a href="https://polkascan.io/">Polkascan</a> guys to get their stuff out there, I think that’s a critical piece.</li></ol><p>But there’s so many opportunities to build cool chains with Substrate. A lot of guys are starting to build chains on Substrate, some of them without making much noise until launch. It’s a great environment to be in.</p><p><strong>What makes you most excited about </strong><a href="https://polkadot.network/"><strong>Polkadot</strong></a><strong>?</strong><br>Any blockchain always needs to solve a specific problem. Bitcoin proved that you can do distributed consensus this way and everyone was blown away. Ethereum introduced smart contracts which is wow, I can fire up an editor and a couple minutes later I can deploy a contract. Polkadot is really about enabling all these different chains to talk to each other. For me it’s so exciting to take these disparate things and bring them together.</p><p>Getting to the point where we can finally have something like Bitcoin Cash and Ethereum connected and by some mechanism they can exchange information-for me, that would be magic. And Polkadot is exactly that magic.</p><p>For the technology stack, I got the most excited about the on-chain Wasm. You can code your chain, have the runtime information exposed via metadata and anybody using an API can interact with your chain. When an upgrade is deployed, the code is available on all nodes at the same time, including any new features that you added.</p><p><strong>Do you find it hard to balance work and family?</strong><br>I’m a really simple person. I always try to break down things into buckets. My life breaks down into two buckets: family and blockchain. If it doesn’t fit in those two buckets, then I’m probably not interested. Having an understanding girlfriend and kids with crypto saving accounts helps bridge the gap.</p><p><strong>What interests you about blockchain?</strong><br>When I look at blockchains that are exciting, it’s because there’s really exciting value contributions. It’s not a value proposition to just change the parameter decreasing the block time. At the end of the day, even with it being cool technology, we’ve got to get to a point where it solves real problems.</p><p>That’s why I was so excited when we did the <a href="https://www.parity.io/un-world-food-programme-uses-parity-ethereum-to-aid-100-000-refugees/">UN World Food Programme</a>. When you’re really making an impact, then it becomes real. Just writing code and getting people to use that code-it’s almost real, but not quite. Impacting lives, solving problems out there-that’s what it’s about.</p><p><strong>What’s your experience of working at Parity?</strong><br>Parity’s completely different. One of my best friends visited a short while ago. We hadn’t seen each other in three years and, he said, “You know, you look the happiest I’ve ever seen you.” And we’ve known each other since 1998 and we’ve worked together at 3–4 companies. So between the work and the kid, I suppose I’m doing something right. I’m being paid to make an impact in something I really like, no wonder I’m happy.</p><p><em>Originally published at </em><a href="https://www.parity.io/people-of-parity-jaco-greeff/"><em>https://www.parity.io</em></a><em> on May 15, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ece32c116c5f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/people-of-parity-jaco-greeff-ece32c116c5f">People of Parity — Jaco Greeff</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parity’s Checklist for Secure Smart Contract Development]]></title>
            <link>https://medium.com/paritytech/paritys-checklist-for-secure-smart-contract-development-f7981046801b?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/f7981046801b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[checklist]]></category>
            <dc:creator><![CDATA[Kirill Pimenov]]></dc:creator>
            <pubDate>Thu, 16 May 2019 14:19:50 GMT</pubDate>
            <atom:updated>2019-05-16T14:19:50.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ls5zJEUADalcLQ-ARYj5_w.png" /></figure><p>As introduced in a <a href="https://www.parity.io/new-smart-contract-development-processes/">previous post</a>, we have developed a fourteen-point checklist for secure smart contract development. We are happy to provide this checklist as a resource to help the greater smart contract development community develop securely. We’ve incorporated the feedback from our auditing partner, <a href="https://www.parity.io/parity-completes-trail-of-bits-security-review/">Trail of Bits</a>, in this process, and we welcome feedback on anything that can be further improved. Our policy is to implement these procedures 100% for all new smart contracts we develop. On existing contracts, we have opted out of changes touching the API in order to avoid any redeployment issues.</p><p>The secure smart contract development checklist:</p><p><strong>1. Create a new GitHub organisation</strong> to exclusively house production-related contracts. For example, our repo is <a href="https://github.com/parity-contracts">parity-contracts</a>. All contracts in this dedicated repo should be actively maintained or in use, or be under active development for production. There should be no obsolete or legacy projects in this repo.</p><p><strong>2. Put every contract in a separate repo</strong> in your new dedicated organisation. (“Every contract” can also mean a “logical unit” of a few tightly coupled contracts — for example Operations.sol and OperationsProxy.sol, which clearly go together and cannot be reasonably expected to be used separately.)</p><p><strong>3. Embed dependencies</strong> to make the code coverage metric more meaningful and make it easier to programmatically reason about the contract’s entire codebase. All duplicated sources should be explicitly listed as such (with cross-links!) in every repo’s README they’re copied into.</p><p><strong>4. Ensure each contract in the repo meets the following code quality criteria:</strong></p><p>a. <strong>The actual deployed state of each contract should live in a protected `master` branch.</strong> The latest master should always reflect the code deployed to all relevant chains. No one should be able to commit directly to the master. Address fixes for all dependent code should be submitted right after this deployment, in the same Pull Request. The `master` branch should be made the default for the repo, so navigating there on GitHub shows you the latest deployed contract (and its addresses) right away.</p><p>It can be helpful to also have a `development` branch to accumulate not-yet-deployed changes to the contract, under the conditions that:</p><ul><li>`development` is also a protected branch, with all the checks from this section (tests, reviews, linting, and so on) required</li><li>there’s an established process, with a responsible person and an agreed-upon timeframe, for this contract to be merged into `master` and deployed.</li></ul><p>b. <strong>Tests should be written in a language other than Solidity</strong> (most likely JavaScript + Truffle) to make sure that bugs related to syntax quirks and misunderstandings are discoverable with tests, not just replicated there.</p><p>c. <strong>Tests are covered by CI.</strong> If your contracts are publicly available, running tests in <a href="https://travis-ci.org/">Travis</a> or <a href="https://circleci.com/">CircleCI</a> shouldn’t be a problem (and is recommended, since you’ll need less maintenance for CI machines this way). Having all tests passing is mandatory for a PR to be merged, and it should be enforced for everyone in the GitHub settings.</p><p>d. <strong>Coverage should be set up for the tests</strong> from the point above. It should be mandatory that a PR is only able to be merged if the code coverage won’t drop.</p><p>e. <strong>Linting should be enabled for all the contract source files</strong> in the contract repo, dependencies included. The linter should be included in the test run on CI, and failing to lint should make merging impossible. Linter line-specific exceptions are allowed, provided that the reason to do so (and some safety explanation) is described in the same comment.</p><p>f. <strong>Each repo should have at least two code owners defined</strong>, as described <a href="https://help.github.com/articles/about-codeowners/">here</a>. It is best practice to define repo-wide (aka ‘wildcard’) code owners to cover any contracts where Code Owners are not defined.</p><p>g. <strong>Reviews should be required for Pull Requests. </strong>Two reviewers should approve the PR at its latest revision in order for the PR to be merged, and at least one reviewer should be a Code Owner (enforced by GitHub). You can use <a href="http://reviewable.io/">reviewable.io</a> to simplify this tracking of “who reviewed what.” It is OK for the submitter of the PR to deploy the “greenlit” version of the PR to the blockchain to obtain its address and modify the mapping in the README in the same PR. It is the <strong>submitter</strong>’s responsibility to make sure their PR is getting proper reviews; calling for attention in developers’ chatrooms is a good way of getting reviews to happen.</p><p>h. <strong>Rebasing to the latest `master` should be mandatory</strong> so that no PR can be merged without tests passing after a clean ff-merge with `master`.</p><p><strong>5. Ensure every contract repo has its up-to-date bytecode and API in `master` branch.</strong> It is the duty of the PR <strong>submitter</strong> to ensure that API and bytecode are updated appropriately.</p><p><strong>6. Every contract should have a README that lists its deployment addresses in all networks.</strong> Where applicable, that address should link to a blockchain-exploring service (e.g., Etherscan), which should contain a “verified code” tab for this address and contract source.</p><p><strong>7. Ensure the README contains a separate “Update Strategy” section.</strong> In that section, enumerate what needs to be done to properly do a (possibly security-critical) update to the contract. Example questions to cover in the Update Strategy section:</p><ul><li>Is there a proxy contract?</li><li>Which other systems need to be updated?</li><li>How to move data from contract to contract?</li></ul><p><strong>8. At the top of the README, put a clear indication of the “production readiness” state of the contract</strong> (like a badge):</p><ul><li><strong>alpha</strong> — contracts which are under active development and may not yet be in proper shape.</li><li><strong>beta</strong> — contracts which are feature-ready and possibly ready for testnet use, but are not yet audited. These SHOULD NOT be used on the mainnet.</li><li><strong>stable</strong> — contracts that are properly audited, deployed to mainnet, and are in active use.</li><li><strong>deprecated</strong> — contracts no longer supported and used, but you want to keep around for some reason. (Avoid keeping these around! Deleting a repository is almost always a better idea, if only to discourage other parties from repeating your possible mistakes.)</li></ul><p><strong>9. Incorporate all the applicable points into a </strong><a href="https://help.github.com/articles/creating-a-pull-request-template-for-your-repository/"><strong>PULL_REQUEST_TEMPLATE.md</strong></a><strong> file in the repo.</strong> Format this file as a checklist. It is the <strong>submitter</strong>’s duty to ensure all checkboxes are checked prior to merging.</p><p><strong>10. Ensure every contract’s main file has its URL in the comment header section.</strong> This is to make it possible for anyone to trace the code back to the repo, even when copying or rehosting the code.</p><p><strong>11. Ensure contracts have view or pure functions</strong> (or just public constant definitions, which would create corresponding getters automatically) with contract_name and contract_version defined. Those functions should have the following properties:</p><p>a. <strong>contract_name</strong> should correspond to the &lt;organization&gt;/&lt;repository&gt; part of the repository. Because we’re following a “one contract per repo” policy, this identifier should be unique enough.</p><p>b. <strong>contract_version</strong> should contain monotonically increasing integer versions. It’s mandatory to bump this version in every PR to master.</p><p><strong>12. Ensure deployed versions on master have matching versioned git tags</strong> (gpg-signed if possible). These tags should be created/uploaded <em>only after</em> the actual deployment happened in order to not wipe out tags during possible redeployment cycles (especially possible in complicated migration cases).</p><p><strong>13. Ensure each contract repo has a clearly defined license.</strong></p><p><strong>14. Only allow addresses from the READMEs of `master` versions to be referenced from production code/configs</strong>, so you know that those contracts are tested, maintained, and have their deployments documented properly. Referencing an address should on every occasion be accompanied with a permalink (with a commit hash included) to the corresponding contract repo. Reviewers of such PRs should verify that:</p><p>a. The deployed address from the README is correct.</p><p>b. It is the latest merged and deployed version.</p><p>c. The contract usage from other code corresponds to its declared goal.</p><p>d. The APIs are correct.</p><p>We hope this checklist helps the smart contract community develop securely. Feel free to <a href="https://riot.im/app/#/room/#watercooler:matrix.parity.io">post in the Parity watercooler chat</a> if you have any questions about the checklist.</p><p><strong>Further resources: </strong><br><a href="https://www.parity.io/new-smart-contract-development-processes/">Secure from scratch: our new smart contract development processes</a></p><p><a href="https://consensys.github.io/smart-contract-best-practices/">ConsenSys Ethereum Smart Contracts Best Practices</a></p><p><a href="https://guidelines.secureth.org/">SecurEth Guidelines</a></p><p><em>Originally published at </em><a href="https://www.parity.io/paritys-checklist-for-secure-smart-contract-development/"><em>www.parity.io</em></a><em> on April 2, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7981046801b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/paritys-checklist-for-secure-smart-contract-development-f7981046801b">Parity’s Checklist for Secure Smart Contract Development</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing the end of Parity support for Kovan]]></title>
            <link>https://medium.com/paritytech/announcing-the-end-of-parity-support-for-kovan-9bdf815c807?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/9bdf815c807</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[kovan]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Fredrik]]></dc:creator>
            <pubDate>Tue, 23 Apr 2019 13:11:20 GMT</pubDate>
            <atom:updated>2019-05-16T10:36:32.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*39RC4npLxEt537uJ.jpg" /></figure><p>The Kovan testnet has a long and <a href="https://github.com/kovan-testnet/proposal">interesting history</a>. Born out of the necessity to get away from a trivially attackable Ethereum PoW testnet, Kovan was one of the first public PoA networks.</p><p>While serving as a testbed for many application developers to quickly iterate and experiment, over time it also became a testbed for new Parity technologies like <a href="https://wiki.parity.io/WebAssembly-Links.html">Wasm smart contracts</a>, <a href="https://wiki.parity.io/Aura">Aura-specific features</a> and other things that are easier to test when you have a single-client network.</p><p>It was always our hope that eventually we would get more and more validators and community members to take an interest and start participating in the network. Over the last year however, we have unfortunately lost more validators than we have gained. We have found that more and more people spin up their own application-specific testnets to test things like Wasm.</p><p>We’re entering a new era of cross-client PoA testnets. With efforts to spawn more temporary hard-fork testnets to replicate mainnet as well as efforts like the <a href="https://goerli.net/">Görli Testnet</a> to create a proper cross-client PoA testnet, we live in a different world than when Kovan started.</p><p>Parity has reached out to multiple former validators and new parties that may be interested in running a validator node and taking stewardship of the testnet and we hope that someone will step up and take the network forward in an interesting way. While there are currently other participants supporting the testnet, Parity itself will stop running its validator node on April 26th, 2019. If you would like to become a validator on Kovan, please <a href="https://matrix.to/#/!YWaJgYmAkBCFLyMSec:matrix.parity.io?via=matrix.parity.io">reach out on the Kovan chat on Riot</a>.</p><p>We thank everyone who played a part in the history of this network, and hope that it finds a good future with new leadership.</p><p><em>Update 15–5–19: Kovan has successfully switched over to a community-maintained validator set. Update to 2.5.1 or 2.4.6 to get the new chainspec for Kovan.</em></p><p><em>Originally published at </em><a href="https://www.parity.io/people-of-parity-erin-grasmick-devops-engineer/"><em>www.parity.io</em></a><em> on April 1, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bdf815c807" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/announcing-the-end-of-parity-support-for-kovan-9bdf815c807">Announcing the end of Parity support for Kovan</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[People of Parity: Erin Grasmick, DevOps Engineer]]></title>
            <link>https://medium.com/paritytech/people-of-parity-erin-grasmick-devops-engineer-837e89065c96?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/837e89065c96</guid>
            <category><![CDATA[parity]]></category>
            <category><![CDATA[people-of-parity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[parity-technologies]]></category>
            <dc:creator><![CDATA[Alexandra Heller]]></dc:creator>
            <pubDate>Fri, 05 Apr 2019 11:07:54 GMT</pubDate>
            <atom:updated>2019-04-05T11:07:54.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nOEAlhT4j4Wqs9Wq.jpg" /></figure><p>Provisioning systems and tracking down bugs isn’t everyone’s idea of fun, but it is Erin Grasmick’s. With a degree in computer science, Erin always assumed she would be a programmer. But after over a decade of administering Linux systems, Erin realised that making systems work well is more fun, and she made the decision to stay in DevOps engineering. Her original interest was in distributed systems (her academic job was administering a large cluster of nodes), so she joined Parity to get into the bleeding edge of distributed systems.</p><p>Erin has a warmth characteristic of her Wisconsin roots, and I happily chatted with her to learn about what it’s like doing DevOps at Parity, making things “observable,” and her tech conference crew.</p><p><strong>What are you working on at Parity?</strong><br>At Parity, DevOps is a little different because there’s a wide spectrum of potential tasks. So you’re working on goals you choose — for example, I’ve been working on getting logging more centralised for <a href="https://polkadot.network/">Polkadot</a> and <a href="https://parity.io/substrate">Substrate</a> to make it easier for devs to analyse issues — but then there are also things that happen that you have to react to. For instance, we’ll have issues with some service like <a href="https://matrix.org/">matrix</a> and we have to debug it and figure out what’s wrong. Overall I’m making sure that everything is looking good, systems are looking healthy, updates don’t break things, and security looks good.</p><p><strong>What are your favorite things to work on?</strong><br>I really like monitoring and metrics. There’s something really satisfying about looking at a really useful graph, something you can use to debug — where you look at it and you know what’s wrong. By using the net usage graph of the <a href="https://kovan-testnet.github.io/website/">Kovan</a> mainnet, we realised that one of the new releases was sending a ton of traffic because there were messages spamming the network. We would have never known if we didn’t have a network monitoring graph and notifications set up. The monitoring buzzword is “observability” — the goal is to make system happenings observable.</p><p><strong>You joined Parity not too long ago. What was onboarding like?</strong><br>I was assigned a mentor, but by the time I was hired I already attended <a href="https://web3summit.com/">Web3 Summit</a> and chatted with DevOps colleagues, so I kind of knew what the infrastructure was like and what was going on. It helps being in the office for onboarding because you can just sit down with someone and they can go over things and you can look at each other’s screens. I think the toughest part was not knowing what questions to ask. I knew some stuff, but there were things I didn’t know to ask to be debriefed on. But it was a good cultural fit. I had lunch with Gabriel and Felix (other DevOps engineers) before I started. It was an interview, kind of, but it was also just lunch. We got along and that made things easier.</p><p><strong>What’s different about Parity than what you expected?</strong><br>I’m not sure what I expected. I wanted to work for a company that was open-source, that was really important to me. But I didn’t know how private companies worked because I had only worked for universities. Before I had mostly worked with on-site instead of cloud systems, and that makes a surprising amount of difference — cloud has a totally different set of tools. The biggest difference has been knowing how to use different cloud providers tools and how to leverage them in the best way.</p><p><strong>If someone is looking to learn DevOps, where do you recommend they start?</strong><br>Install a minimal Linux distribution, it will teach you how to start configuring a system very quickly. Even just following a guide on the internet forces you to learn these tools, how to get into your system, and what makes up an operating system. Doing operating system-level stuff is also important. Having an understanding of things like heaps and stacks is not required, but it’s definitely useful. Read the <a href="https://wiki.archlinux.org/">Arch wiki</a>, it’s the most useful resource in the world. And join IRC, join <a href="https://freenode.net/">Freenode</a>, and ask questions.</p><p><strong>How did you get into Linux?</strong><br>My dad bought a family computer in 1996. It wasn’t Linux, it was a Mac, but I just sort of took to it. Being a computer person, Linux is the next step. I think I first installed Linux at 15 years old. You make friends on the internet whom you spend time chatting with on IRC. That was all Linux people. When you think of Linux users, you imagine them shut in the closet. But there’s definitely a social aspect to it. The most fun thing I do is hang out at Linux conferences with my friends, most of whom I’ve met on IRC.</p><p><strong>I’ve heard that you have a tech conference crew. How did that happen?</strong><br>We came together for <a href="https://www.ccc.de/">CCC</a>. The first one I attended was in 2016 and it was really nice to see in person all these people that I chatted with. After that, we kind of made a thing out of it, a group called “Freeside.” It’s really just a group of internet friends who are in communication all the time. But it’s fun to be in person and hack on stuff. We made our own stickers for our group, but it’s just completely invented — a lighthearted group of people that get along.</p><p>Stay tuned for more “People of Parity.” <a href="https://www.parity.io/newsletter/">Join the newsletter</a> to be informed of new articles, tech releases, and events.</p><p><em>Originally published at </em><a href="https://www.parity.io/people-of-parity-erin-grasmick-devops-engineer/"><em>www.parity.io</em></a><em> on March 29, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=837e89065c96" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/people-of-parity-erin-grasmick-devops-engineer-837e89065c96">People of Parity: Erin Grasmick, DevOps Engineer</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[People of Parity — Tomasz Drwięga]]></title>
            <link>https://medium.com/paritytech/people-of-parity-tomasz-drwi%C4%99ga-26cc5f0f2fe4?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/26cc5f0f2fe4</guid>
            <category><![CDATA[people-of-parity]]></category>
            <category><![CDATA[parity]]></category>
            <category><![CDATA[parity-technologies]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Alexandra Heller]]></dc:creator>
            <pubDate>Thu, 14 Mar 2019 12:27:20 GMT</pubDate>
            <atom:updated>2019-04-05T11:08:57.202Z</atom:updated>
            <content:encoded><![CDATA[<h3>People of Parity — Tomasz Drwięga</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NOmrDwzg1IZOH4Gg.jpg" /></figure><p>A Parity OG, core developer Tomasz Drwięga (<a href="https://github.com/tomusdrw">GitHub</a>, <a href="https://twitter.com/tomusdrw">Twitter</a>) joined Parity as employee number seven (or <em>007</em>, as he points out) in January 2016 and watched the company quickly grow from four developers hacking in Airbnbs to the 78-person, multi-office company it is today.</p><p>Tomasz initially worked on the EVM implementation and later focused on the JSON-RPC interface — in his words, “the part that glues together the core client and the dapps and external developers.” He is also responsible for <a href="https://parity.io/ethereum">Parity Ethereum</a>’s transaction pool and large parts of its block-producing code. He’s now currently mentoring new Parity Ethereum contributors and coding <a href="https://parity.io/substrate">Substrate</a>, including implementing RPCs, the transaction pool, and off-chain workers.</p><p>Tomasz has always struck me as an exceptionally good-willed and helpful person, so I was happy to chat with him and learn more about his story.</p><p><strong>How did you end up joining Parity?</strong></p><p>I met Marek Kotewicz in a Wrocław coworking space when a mutual friend introduced us both to Bitcoin. Marek asked me to join the initial dev team, which was Gav, Arkadiy and him. It was a perfect moment for me to make a change in my life and coding blockchains in Rust sounded like an amazing opportunity. We didn’t have an office, so the work happened in random cafes or during retreats, which was also a very new experience to me. It was fun times.</p><p><strong>How has the company evolved?</strong></p><p>It grew. A lot and pretty fast. From a team of four developers working in some random Airbnbs on the Ethereum client, we are now a 75-person company with amazing offices working on a multitude of blockchain projects. However (positively surprisingly for me, quite frankly) the culture stayed similar — we are still a bunch of hackers that are free to work in an unmanaged fashion on whatever sounds interesting. The quality and level of expertise of people that got attracted to the company is also something that I haven’t seen.</p><p><strong>You use a Clint Eastwood photo as </strong><a href="https://github.com/tomusdrw"><strong>your avatar</strong></a><strong>. Any story to that?</strong></p><p>Well, I like the trilogy and the actor. But also the character is aligned with my life philosophy. I don’t talk that much, prefer to take actions and I don’t have a big ego. I’m completely fine with being “The Man with No Name,” but still try to be “The Good” guy. :)</p><p><strong>You learned </strong><a href="https://www.parity.io/why-rust/"><strong>Rust</strong></a><strong> at Parity after coming from a JavaScript background, right? What was the transition like?</strong></p><p>Hard. Even though I had experience with other languages and paradigms (I did some Prolog and Erlang during my studies along with C++ and started my professional career as a Java developer), learning Rust was pretty tough. Initially my tasks didn’t require that many Rust-specific features, so I felt quite productive. However when I started working on some more technical issues that involved a lot of threading, I had my moment of crisis. I remember spending three weeks working on the first multi-threaded version of transaction pool for Parity Ethereum and having the Rust compiler teach me to code parallel programs. While it was extremely frustrating because I felt unproductive, it was a really good experience when put into perspective.</p><p><strong>You discussed Parity Ethereum’s new transaction queue on </strong><a href="https://www.zeroknowledge.fm/44"><strong>Zero Knowledge</strong></a><strong>. Can you briefly explain how it works?</strong></p><p>Sure, the transaction queue (or pool) was one of my first tasks in Parity Ethereum codebase and I was very surprised how complicated it is and how many dark edge cases need to be handled.</p><p>Let’s define the problem first: we have a cloud of transactions that are floating in the network and a block with limited capacity. The task is to decide what transactions from the cloud should end up in the block, and in what order. That sounds pretty simple, but we also have additional objectives and constraints: we want to maximise the total fee of transactions in the block while preserving ordering of transactions from single sender (nonce) and avoiding DoS vectors. The professional term for such problem is “Multiple Constraint Knapsack Problem,” and it’s known to be hard to find an optimal solution. Luckily we are fine with some simplistic heuristics, but there are still many caveats.</p><p>How it currently works in Parity Ethereum:</p><ol><li>We maintain a nonce-ordered list of pre-validated transactions per-sender (so we know the best and worst from each sender)</li><li>We maintain a gas price-ordered list of best transactions from each sender.</li><li>Every time we want to compute the ordering of transactions in a block, we construct it by taking the best transaction from the list (2) and adding a second-best transaction from the same sender to the list.</li></ol><p>This dynamic construction gives us a good trade-off between insertion time (pretty much constant) and pending set construction (logarithmic of number of senders).</p><p>These new properties of the pool have become especially important given the growth of Ethereum network and the huge numbers of transactions that we’ve observed in the past.</p><p><strong>What’s one thing you wish more people knew about Parity Ethereum?</strong></p><p>I wish people knew which logging to enable to report with an issue :) Most of the time reproducing an issue is really hard and time consuming and bug reports with (at least partial) logs are a tremendous help to identify the problems. <em>(Logging guidelines are posted in the </em><a href="https://github.com/paritytech/parity-ethereum/issues/new"><em>new issue template</em></a><em>.)</em></p><p><strong>What is it like working remotely at Parity?</strong></p><p>Working remotely might be hard, especially if most of the team is in one place and you’re treated as a second-class citizen. Also, if the communication is poor, a remote worker can have a constant feeling of underachieving, which can be really frustrating and demotivating if sustained over a long period of time.</p><p>That’s not the case for Parity, however. Since we have many people working remotely, remote work is basically the default. Even people in Berlin work from home or from cafes instead of going to the office if they like. I have everything I need to work at the tip of my fingers wherever I am: the Rust compiler, GitHub and Riot.</p><p><strong>What is the remote culture like and how does communication work when you’re not in the office?</strong></p><p>All communication at Parity happens either in the repositories (issues, pull requests) or on Riot (both on public and internal channels). For longer discussions we prefer an internal discussion forum, and sometimes we do short calls to quickly chat about some topics. I work from Wrocław and it’s pretty close to Berlin, so I also try to visit the office at least once a month for a few days. When I’m at the Berlin office I always have this feeling: “Oh, now I’m going to catch up with all the information that definitely people must be spreading in f2f conversations in the office,” but it always turns out that there is nothing more than what I already know. Actually sometimes I know even more than others because I’m more used to carefully reading the chats. It’s still nice to hang out with colleagues in person, though. :)</p><p><strong>Anything else you want to share with people?</strong></p><p>If you’re a developer — learn <a href="https://www.parity.io/why-rust/">Rust</a>. It’s going to make you a better programmer in every other language. If you are not a developer then Rust might be a hard but good start. :)</p><p><em>Originally published at </em><a href="https://www.parity.io/people-of-parity-tomasz-drwiega/"><em>www.parity.io</em></a><em> on March 7, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26cc5f0f2fe4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/people-of-parity-tomasz-drwi%C4%99ga-26cc5f0f2fe4">People of Parity — Tomasz Drwięga</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UN World Food Programme uses Parity Ethereum to aid 100,000 refugees]]></title>
            <link>https://medium.com/paritytech/un-world-food-programme-uses-parity-ethereum-to-aid-100-000-refugees-35d20a51d37?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/35d20a51d37</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[humanitarian]]></category>
            <category><![CDATA[world-food-programme]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[parity]]></category>
            <dc:creator><![CDATA[Gautam Dhameja]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 14:56:19 GMT</pubDate>
            <atom:updated>2019-02-20T14:56:18.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8tUmJTtzUx1wdcBq.jpg" /><figcaption><em>Photo Credits: WFP/Marco Frattini. Source: </em><a href="https://www1.wfp.org/news/conflict-driven-hunger-worsens"><em>https://www1.wfp.org/news/conflict-driven-hunger-worsens</em></a></figcaption></figure><p>Every year the United Nations’ World Food Program (WFP) helps feed millions around the world. A major part of this food assistance program is <a href="https://www1.wfp.org/cash-transfers">direct cash transfer to the beneficiaries</a>.</p><p>Cash transfers provide a much faster and flexible way to aid people in need. To make the delivery of funds more efficient and secure, Parity Technologies worked with the WFP to create a private blockchain network for processing cash transfers. Part of the UN WFP’s <a href="https://innovation.wfp.org/project/building-blocks">Building Blocks project</a>, the private blockchain is built using <a href="https://parity.io/ethereum">Parity Ethereum</a>. The blockchain allows the WFP to account for balances without the need for a third-party financial service provider to act as an intermediary; eventually reducing bank fees and other administrative costs.</p><p>We’ve been involved in the WFP Building Blocks project for almost two years now. What started as a pilot project with 10,000 users in 2017 has grown more than ten-fold in the last year. With the help of the Building Blocks blockchain, the WFP has been distributing aid more securely and efficiently to Syrian refugees in Azraq Refugee camp in Jordan.</p><p>In <a href="https://www.parity.io/fighting-hunger-with-blockchain/">our previous update on the project</a>, we described how the blockchain-based system started as part of the WFP Innovation Accelerator and paved the way to a model aid program. Here’s what we helped the WFP achieve with the project during 2018.</p><h3>The journey so far</h3><p>In the <a href="https://www.coindesk.com/un-food-program-to-expand-blockchain-testing-to-african-supply-chain">last year, the Building Blocks project</a> has had the following impact:</p><ol><li>More than<strong> 100,000 refugees</strong> have been served on a <strong>monthly</strong> basis.</li><li>The UN <strong>saved more than 40,000 USD per month</strong> in bank transfer costs.</li><li>Tens of millions of USD of aid has been delivered through the blockchain.</li></ol><p>In addition, the system has helped create blockchain-based immutable identities for refugees. Having a permanent digital identity helps refugees apply for and receive other aid and facilities.</p><p>The system also utilizes cutting-edge upgradable smart contracts, making it easy to update the business logic and rules when needed. This allows us to incorporate updated policies and rules on cash transfers without facing any downtime.</p><p>Since its initial deployment, the network and the system as a whole have had excellent uptime, ensuring that the refugees receive their aid in time.</p><h3>The next steps</h3><p>The UN WFP Building Blocks project is now going into the next phase of development and we are working with the WFP team in further upgrading the system with new capabilities.</p><p>The blockchain network is being upgraded and scaled to serve more requests and transactions so more people can benefit from it.</p><p>While the system started as a private <a href="https://wiki.parity.io/Proof-of-Authority-Chains">PoA (Proof-of-Authority) blockchain network</a> with a single authority, it paved the way for other UN agencies and partners to join and share the data in a secure way. The Building Blocks blockchain network is being joined by other UN agencies (the first one being UN Women).</p><p>As mentioned in a recent <a href="http://www.unwomen.org/en/news/stories/2018/9/press-release-un-women-and-wfp-harness-innovation-for-economic-empowerment-in-crisis">press release from UN Women</a>, here’s how both the UN agencies will collaborate on using the Building Blocks network to help women receive aid:</p><blockquote>A Syrian woman will scan her eye to request cash back at WFP-contracted supermarkets. This will link to her account on the blockchain, and the amount of the cash distribution is automatically sent to Building Blocks. The fact that UN Women and WFP validate each other’s transaction through a common blockchain network, results in improved security and accountability. There are also opportunities for cost and risk reduction, as well as increased harmonization of aid efforts.</blockquote><p>Parity Technologies’ mission is to provide open-source core infrastructure to support Web3 ecosystems, drive blockchain technology forward as a whole, and empower developers and organisations to disrupt centralised, trust-based services. We are proud to partner with the UN WFP team in the Building Blocks project and we look forward to supporting them in helping more and more people across the globe.</p><p><em>Originally published at </em><a href="https://www.parity.io/un-world-food-programme-uses-parity-ethereum-to-aid-100-000-refugees/"><em>www.parity.io</em></a><em> on February 18, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35d20a51d37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/un-world-food-programme-uses-parity-ethereum-to-aid-100-000-refugees-35d20a51d37">UN World Food Programme uses Parity Ethereum to aid 100,000 refugees</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[People of Parity: Jack Fransham, Core Developer]]></title>
            <link>https://medium.com/paritytech/people-of-parity-jack-fransham-core-developer-67a6a9f4c362?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/67a6a9f4c362</guid>
            <category><![CDATA[wasm]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[substrate]]></category>
            <category><![CDATA[people-of-parity]]></category>
            <category><![CDATA[webassembly]]></category>
            <dc:creator><![CDATA[Alexandra Heller]]></dc:creator>
            <pubDate>Fri, 15 Feb 2019 11:23:15 GMT</pubDate>
            <atom:updated>2019-02-15T11:24:33.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpmRntTRRdfOUeIsgiPnDQ.jpeg" /></figure><p>Parity Technologies is made up of a large number of talented developers who are often as passionate about the technologies they build with as those they build. Jack Fransham falls into this category, being able to talk at length about the merits of the Rust programming language, WebAssembly (Wasm), and <a href="https://parity.io/substrate">Substrate</a>.</p><p>In the year and a half Jack has worked at Parity, he has worked on a number of projects, including <a href="https://github.com/paritytech/wasmi">Wasmi</a>, Parity’s Wasm interpreter; the <a href="https://github.com/paritytech/fleetwood">“Fleetwood” eDSL library</a> for writing safe smart contracts in Rust; EVM optimisation; hashing algorithms; and now the <a href="https://github.com/CraneStation/lightbeam">Lightbeam Wasm compiler</a>.</p><p>Jack’s offbeat and occasionally morbid sense of humour can be witnessed in his writing. For example, when explaining Substrate’s forkless upgrades, he <a href="https://medium.com/polkadot-network/never-fork-again-438c5e985cd8">likens blockchain forks to replacing a family dog</a>:</p><blockquote>There’s no way to actually “upgrade” a blockchain in the traditional sense, only create a new blockchain that retains the old one’s history. Like if you replace your dead dog with another of the same breed and you call it the same name for the sake of the kids. Except in this case the original dog isn’t dead, and also I guess the new dog has all the memories of the original dog surgically implanted into its brain somehow.</blockquote><p>I sat down with Jack to chat about writing smart contracts in Rust, what’s remarkable about WebAssembly, what it’s like working at Parity, and life in Berlin.</p><p><strong>Like most Parity developers, you’re a big </strong><a href="https://parity.io/why-rust"><strong>Rust</strong></a><strong> fan. What made you fall in love with the programming language?</strong></p><p>The fact that, for the first time, I could write code that looked like what I was used to in a language like Python or C# but with the ability to visualise the assembly that it compiles down to. Maybe not the exact instructions, but you can at least work out the flow and use that to optimise your program effectively without resorting to memory-unsafe languages or constructs. C++ has this ability too, but I didn’t have a spare decade to learn it.</p><p><strong>You’ve made the case for </strong><a href="http://troubles.md/posts/why-write-smart-contracts-in-rust/"><strong>writing smart contracts in Rust</strong></a><strong>. Why should someone consider writing smart contracts in Rust?</strong></p><p>Well, my first answer will always be because Rust is a fantastic language in general, but it’s also very well-tailored to blockchain use-cases specifically. Many of the constraints that you get on the blockchain are identical to those found in high-reliability embedded systems — small code-size, excellent security, high reliability, and minimal resource use. One of Rust’s design goals is to target high-reliability embedded systems and we can piggyback off that work to have a well-designed language that is also designed for the blockchain as a side effect. This isn’t to mention the fact that it already has a world-class optimising compiler that produces Wasm, which as mentioned is an excellent VM ISA for the blockchain.</p><p><strong>You write a lot about WebAssembly (Wasm) </strong><a href="http://troubles.md/"><strong>on your blog</strong></a><strong>. What interests you about Wasm?</strong></p><p>I’ve always been fascinated by virtual machines and language design, but WebAssembly is truly something new. It’s the first virtual machine that’s designed to be as easily-compilable to assembly as possible while also having the kind of deterministic, safe and well-defined semantics you’d expect from a higher-level VM ISA. It’s certainly got problems, but even if in ten years no one’s using Wasm, the ideas that it brought to the table are still a real turning point in application security and virtual machine design.</p><p><strong>You seem to also be a </strong><a href="https://parity.io/substrate"><strong>Substrate</strong></a><strong> fan. What’s your favourite aspect of Substrate?</strong></p><p>Without a doubt the runtime upgrade mechanism. No blockchain to my knowledge had ever been upgraded before the first Polkadot runtime upgrade — they were always simply forked. There’s probably a computer in a cupboard somewhere still mining Bitcoin v0.1; that simply can’t be true with Substrate’s upgrade mechanism as long as the network doesn’t get partitioned. This means that the design of Polkadot and other Substrate chains can be iterated a lot faster without every update being a huge deal like in Ethereum.</p><p><strong>What are you working on right now?</strong></p><p>An <a href="https://github.com/CraneStation/lightbeam">optimising linear-time compiler for WebAssembly</a>. We want to be able to produce native code for Wasm so we can get maximum performance, but traditional compilers are basically impossible to write without allowing so-called “compiler bombs” — pieces of code that you can send to the compiler that cause it to take an extremely long amount of time. I’m building a compiler that produces high-quality native code while also being immune to compiler bombs.</p><p><strong>What do you like about working at Parity?</strong></p><p>The fact that many of the projects that Parity needs people to work on are projects that I totally would have worked on in my spare time anyway. There’s such a wide variety of work that needs to be done and a large amount of it is interesting and enjoyable. Also, the freedom to work from home when I want to — I like working in an office but no office can compete with the ability to play my own music over my speaker system.</p><p><strong>Like many Parity developers, you live in Berlin. What do you enjoy about the city?</strong></p><p>The feeling of being part of a community that the nightlife here gives you. When you go on a night out, for the most part people are respectful and friendly and when they’re not, people do actually call them out. You see many of the same faces if you go out a lot. Even if you’re not friends with all of them, you at least recognise them. The techno scene is small enough that you feel like a part of something but big enough that there’s always something to do.</p><p>Stay tuned for more “People of Parity.” <a href="https://www.parity.io/newsletter/">Join the newsletter</a> to be informed of new articles, tech releases, and events.</p><p><em>Originally published at </em><a href="https://www.parity.io/people-of-parity-jack-fransham-core-developer/"><em>www.parity.io</em></a><em> on February 15, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67a6a9f4c362" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/people-of-parity-jack-fransham-core-developer-67a6a9f4c362">People of Parity: Jack Fransham, Core Developer</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Parity Ethereum update fixes several RPC vulnerabilities]]></title>
            <link>https://medium.com/paritytech/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities-fe030e6f489f?source=rss----2045160d20c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/fe030e6f489f</guid>
            <category><![CDATA[ethereum-parity]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Parity Technologies]]></dc:creator>
            <pubDate>Wed, 13 Feb 2019 14:51:46 GMT</pubDate>
            <atom:updated>2019-02-15T17:38:44.179Z</atom:updated>
            <content:encoded><![CDATA[<h3>New Parity Ethereum update fixes several vulnerabilities</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwHhvyGd7HSqAqh9cmcOMA.png" /></figure><p><strong>Update 15/2/2019: </strong>It has come to our attention that the scope of the fixed Parity Ethereum vulnerability is wider than we originally thought, and it could be exploited from a regular node-to-node connection without RPC access. While the previously released 2.2.10-stable and 2.3.3-beta protect against this wider scope, the wider scope means that <em>everyone</em> who runs Parity Ethereum, not just those who serve JSON-RPC publicly, should update as soon as possible. <a href="https://github.com/paritytech/parity-ethereum/releases">Download the update here.</a></p><p>The 2.2.10-stable and 2.3.3-beta releases protect Parity Ethereum nodes from potentially being able to be crashed by a targeted attack. Thanks everyone for updating and keeping the network protected.</p><p>Thanks to the security researchers from <a href="https://srlabs.de/">SRLabs</a> for their vigilance.</p><p><em>Original post:</em></p><p>Last week we <a href="https://www.parity.io/security-alert-parity-ethereum-03-02/">released a Parity Ethereum update</a> that protects nodes from being crashed by a specially-crafted RPC request. Since then we, in collaboration with external researchers, have been carefully exploring any potential for similar issues.</p><p>Today we released a new update that is the result of that research, 2.2.10-stable and 2.3.3-beta, which fixes many similar RPC attack vectors. <a href="https://github.com/paritytech/parity-ethereum/releases">Download the update here.</a></p><p>As with the previous update, only Parity Ethereum nodes that serve JSON-RPC as a public service should be affected. The default setting for Parity Ethereum nodes is to not serve JSON-RPC, but nonetheless we encourage everyone running Parity Ethereum nodes to update.</p><p>If you’re a security researcher and want to contribute to the safety and security of the Parity codebase, please see our <a href="https://www.parity.io/bug-bounty/">Bug Bounty program</a>.</p><p><em>Originally published at </em><a href="https://www.parity.io/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities/"><em>www.parity.io</em></a><em> on February 13, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe030e6f489f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paritytech/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities-fe030e6f489f">New Parity Ethereum update fixes several RPC vulnerabilities</a> was originally published in <a href="https://medium.com/paritytech">Parity Technologies</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>