<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by The R3 Team on Medium]]></title>
        <description><![CDATA[Stories by The R3 Team on Medium]]></description>
        <link>https://medium.com/@r3?source=rss-309e832dbd94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NaRTn4ohWazlIA4rDOJewA.png</url>
            <title>Stories by The R3 Team on Medium</title>
            <link>https://medium.com/@r3?source=rss-309e832dbd94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 11:58:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@r3/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Notaries in Corda 5: Archiving]]></title>
            <link>https://medium.com/corda/notaries-in-corda-5-archiving-7edf4afdb77d?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/7edf4afdb77d</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Wed, 01 Nov 2023 13:40:03 GMT</pubDate>
            <atom:updated>2023-11-01T13:40:03.445Z</atom:updated>
            <content:encoded><![CDATA[<p>November 01, 2023</p><p><em>This is the final of a series of blog posts relating to Notaries in Corda 5.</em></p><p>Archiving of notary data has been a long-standing challenge within Corda due to the presence of state data determining whether a state is considered to be spent. In previous versions of Corda, this results in ever-growing data sets that limit the scalability of notary services. Corda 5 solves this problem through the novel application of some of the foundational technology that underpins Corda’s transaction model by enabling double-spend prevention even in the absence of state data. In this blog post, we will outline how this is possible, and how we can build on this to support safe archiving of state data.</p><h3>Double spend prevention</h3><p>Let’s quickly recap how repeated spending of the same state, otherwise known as a double-spend is prevented within Corda. From the perspective of Corda’s uniqueness checking functionality, states are defined by the <a href="https://docs.r3.com/en/platform/corda/4.10/enterprise/key-concepts-tearoffs.html#merkle-trees-on-corda">root hash of the Merkle Tree</a> representing the transaction that created the state as a transaction output, and an index representing the position of the output state within the transaction. For example, :0 for the first output state, :1 for the second, and so on.</p><p>Transactions which wish to spend a state as an input make a request to the notary service the state is associated with. In previous versions of Corda, the transaction is only accepted if the state does not exist in the uniqueness database, as the existence of the state in the database implies the state is already spent. Corda 5 takes this a step further by tracking both unspent and spent states, and additionally ensures that any states being spent by a transaction are known to the notary, rejecting any unknown states. This is an important piece in solving the archiving puzzle which we will come back to later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PY9CNwGNcAlVgtPGAZ7oQQ.png" /></figure><p>This logic is very simple, however given Corda’s ability to parallelize flow operations, it is entirely possible that multiple transactions requesting notarization may be in-flight at the same time, and these may try to spend the same state at the same time. To protect against this, we rely on the <a href="https://en.wikipedia.org/wiki/ACID">ACID</a> properties of the underlying uniqueness database. This is why all notary virtual nodes representing a notary service must share the same uniqueness database, and why the database must be strongly consistent.</p><h3>Merkle Trees and notarization</h3><p>We previously mentioned that states are identified by the root hash of a transaction Merkle Tree. We will not delve into all the details of Merkle Trees here, though <a href="https://www.baeldung.com/cs/merkle-trees">this article</a> provides a good overview if you wish to learn more. For the purposes of this discussion, it is sufficient to understand that Merkle Trees are a type of binary tree that store hashes of data components in leaf nodes of the tree, with each parent node storing a hash of its children. This is repeated all the way up to the root node, with the root node hash used as the transaction id in our ledger implementation. The crucial traits of a Merkle Tree for our purposes are:</p><ul><li>It is possible to verify the integrity of certain data components that the tree represents without revealing all data components. This is important from a privacy perspective.</li><li>Changing any data component in the tree changes its hash, and by extension, the hash of all parent nodes all the way up to the root node. This means that changing any data component fundamentally changes the transaction id stored in the ledger and would be considered an entirely different transaction.</li></ul><p>The non-validating notary protocol implemented in Corda 5 receives what is known as a filtered transaction, which hides some of the data components of the transaction constructed by the other parties to the transaction, revealing only the information the notary needs in order to perform its uniqueness checking and basic validation. This aids privacy by ensuring that we do not leak data unnecessarily to the notary.</p><p>One of these pieces of information is a time window, which indicates a time before and / or after which the notary must have signed the transaction. A notary will refuse to notarize a transaction that is presented outside of these specified time bounds. This means that if a notary has signed a transaction with a time window, you can assume the signature, and hence confirmation of the transaction happened within the time bounds of the transaction. The full transaction also includes a list of signatories who must provide valid signatures over the transaction in order for the transaction to be considered valid. These are visible to Alice and Bob, but not in the filtered transaction sent to the notary, in order to maintain privacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FaXGdFF-ORsyOdV4oU-NVQ.png" /></figure><p>The above diagram shows a very simplified representation of a filtered transaction Merkle Tree, where Alice and Bob are participants (and signatories) to the transaction, and it has now been sent to the notary to be confirmed. The notary is provided with the time window data and the necessary Merkle Tree hash information. The notary can check:</p><ul><li>The current time window is valid.</li><li>The Merkle Tree is validated by re-computing up to the root hash using the known information and supplied hashes for the hidden data, and ensuring the computed hash matches the specified transaction id.</li></ul><p>Assuming these checks pass, and any input states are present in the notary’s database and are unspent, the notary provides a signature over the transaction, meaning it can now be considered confirmed. It also updates its records of unspent and spent states based on any supplied input states and / or number of output states specified in the transaction (these are also part of the Merkle Tree and provided to the notary but are excluded from the diagram for simplicity). The other participants on the network (Alice and Bob in this case) with full transaction visibility can now also verify that each party in the transaction signatories list have signed the transaction.</p><h3>Note on validity vs confirmation</h3><p>There is a subtle but important difference between transaction validity and confirmation, which is important to understand as we delve into the details of archiving. As specified in the Corda 5 <a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/ledger/transactions.html#validity">ledger documentation</a>, for a transaction to be committed to the ledger, it must both be valid, meaning that it is <a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/ledger/smart-contracts.html#contractual-validity">contractually valid</a>, and also unique, which means that if the transaction is presented to the notary, it will return a notary signature indicating the notary’s confirmation of the transaction, and by implication, confirming the status of the transaction on the ledger as the unique consumer of the input states it references.</p><p>The notary keeps records of transactions it has seen previously, which means that if a transaction is replayed to the notary, it will return the original result (a signature in the case of a successful transaction, and an error message otherwise). This is true even if the result of time window validation would be different now to when the transaction was originally submitted — the original result is returned regardless.</p><p>Once data is archived, the original result can no longer be returned, as there is no longer a record of the transaction. However, transactions that were successfully notarized, even those that have been archived by the notary, continue to be valid. This is a key point because even after data is archived on the notary, transactions may still need to be exchanged between, and verified by Corda nodes as part of <a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/ledger/transactions.html#transaction-backchains">backchain verification</a>. These transactions will continue to verify, because there will be a valid notary signature stored with these transactions. However, a notary would refuse to confirm the transaction if it were presented again to the notary after the transaction has been archived, because the historic copy of the original result no longer exists, and the current time means it would fail time window checks when attempting to notarize the transaction again.</p><h3>Safe data archiving</h3><p>What does any of this have to do with archiving? There are two small but crucial changes in Corda 5 that enable us to safely delete historic state data:</p><ul><li>It is now mandatory to specify a time window upper bound on a transaction. This means that from the notary perspective, all transactions now have a finite point at which they can no longer be confirmed.</li><li>As mentioned earlier, the notary now tracks unspent (output) states of transactions, in addition to spent states that were consumed as inputs by subsequent transactions. This allows it to reject any attempts to spend states that the notary is not already aware of.</li></ul><p>Putting these points together, we can now delete states that have been consumed, but only once we have passed the time window upper bound of the transaction that initially created the state. This works because we can rely on the above additional checks to prevent replay of historic transactions. This insight may not be immediately obvious, but is crucial to our solution, so lets explore how this works by example. Consider the following scenario:</p><ol><li>An initial transaction is created by Alice to create a token, which is assigned to Bob. Bob can redeem this token for some item of value in future. For arguments sake, lets say this transaction has hash 8A42. This creates a single new output state, 8A42:0 which is marked as unspent in the notary.</li><li>A subsequent redemption transaction is created by Bob to redeem the token. This consumes state 8A42:0 which is now marked as spent in the notary.</li></ol><h3>Buy one, get one free?</h3><p>It turns out Bob likes a bargain and decides to try and bag himself a buy one get one free deal by redeeming the token again. Of course, the notary sees that this state is already spent in its uniqueness database, and immediately rejects the action.</p><p>Some time passes, and we pass the time window upper bound for the initial transaction, so the notary proceeds to delete the state data. Bob gets wind of this and tries to redeem this state again.</p><p>In previous versions of Corda, this action would be successful, because the notary has no record of the spent state, so it allows the state to be consumed again. This is why we cannot delete historic states in previous Corda versions. Unfortunately for Bob, Corda 5 is smarter. The notary receives the transaction request, however this time, it has no record of the <em>unspent</em> state for 8A42:0, so rejects the transaction with an unknown state error.</p><h3>Bob the (transaction) builder</h3><p>Not one to be defeated easily, Bob now raises the stakes. If the notary doesn’t know about the state, then all he needs to do is replay the original transaction that created the state, right? Bob is thwarted again, because this is where our time window validation comes in. The current time is now beyond the time window upper bound of the original transaction and is therefore rejected by the notary again. The transaction, while valid, will no longer be confirmed by the notary.</p><p>Finally, in desperation, Bob resorts to tampering with the transaction itself. He generates a new transaction which is a clone of the old transaction, but with the time window set to a point beyond the current time. Bob signs this transaction, and maliciously adds Alice’s signature from the original transaction, before presenting this to the notary. The notary confirms the transaction, because from its perspective, the transaction is now valid with respect to its time window data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sR_Kf-o18olHjVj-gfMtJw.png" /></figure><p>However, all of this is for naught, because as we said earlier, changing any component of the Merkle Tree fundamentally changes the hash of its root. So from the perspective of the notary and ledger, this is a unique transaction that has generated entirely new states, and does not constitute a replay of the original transaction and state creation. Ultimately, any legitimate party subsequently interrogating the transaction and inspecting the signatures would find that Alice did not in fact sign this new transaction, and therefore these newly created states are useless. It may also fail CorDapp specific verification; in our example, it could be that only Alice is allowed to issue new states, and therefore any transactions proposed by Bob that create new states would fail transaction verification.</p><h3>e</h3><p>Corda 5.0 does not provide archiving functionality; however, the notary captures all the necessary information and performs the validation mentioned earlier to make safe archiving of data straightforward. The rules for archiving data within the uniqueness database are simple:</p><ul><li>States can be archived when they are spent, and the transaction that originally created the states time window upper bound has passed.</li><li>Transaction related data can be archived when there are no longer any output states associated with it in the uniqueness database, i.e., all states that the transaction created have themselves been archived.</li></ul><p>This approach does rely on CorDapp developers to set sensible time window upper bounds on transactions. If this is set years in the future, then it means that any output states of that transaction cannot be archived until that point.</p><p>A rudimentary solution can be implemented as desired via SQL query. However, a more sophisticated background archiving solution will be implemented in a future release.</p><h3>In conclusion</h3><p>What we have demonstrated above is a specific application of a general and powerful solution; the ability to store arbitrary time-limited data in a tamper-evident way by leveraging the ability to distill the data down to a hash that can be used as a unique database key, which can then be verified against an expected set of signers that act as gatekeepers to the integrity of the data.</p><p>This is just one application of Distributed Ledger Technology, and herein lies its true power; it provides the same guarantees that society relies on to secure the internet in the form of digital certificates to data, such that the data can be moved freely between different parties and its contents trusted, without relying on a fully centralized system. I believe this technology will be transformative in the years and decades ahead.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7edf4afdb77d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/notaries-in-corda-5-archiving-7edf4afdb77d">Notaries in Corda 5: Archiving</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Next-Gen Corda’s Application Networks]]></title>
            <link>https://medium.com/corda/exploring-next-gen-cordas-application-networks-20eba98c5860?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/20eba98c5860</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[digital-asset]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Mon, 25 Sep 2023 16:35:57 GMT</pubDate>
            <atom:updated>2023-09-25T16:35:57.240Z</atom:updated>
            <content:encoded><![CDATA[<p>By Charlie Crean, Staff Software Engineer at R3</p><p><a href="https://r3.com/products/corda/">Next-Gen Corda</a> introduces a fresh network model designed to enhance privacy, control, and operational efficiency. This comes in the form of <em>application networks</em>, which have been designed to make creating, managing, and participating in Corda networks simpler and more efficient. In this article, we’ll explore the practical features of application networks and how they empower you to easily set up and manage your own networks.</p><h3>Getting to Know Application Networks</h3><p>Before we delve into the features, let’s take a closer look at what an application network is exactly. Simply put, an application network is a permissioned network of virtual nodes that all agree to the same set of network terms, and are all running one or more compatible applications. Admission to the network is managed by an entity (or entities) known as the network operator. The rules determining whether a party can join the network are defined by the network operator, and can range anywhere from allowing anyone to join unchallenged, to performing a full Know Your Customer (KYC) process on each member.</p><p>These networks can span one or more Corda clusters and consist of a network manager (also known as the Membership Group Manager (MGM), which we will cover shortly) and one or more network participants. This network manager is operated by the previously mentioned network operator entity. A single Corda cluster can host multiple virtual nodes in the same or different application networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dSYVI2PrzegZWDvj.png" /></figure><p>Each application network is self contained in terms of network visibility. Parties who have been permitted to join network A, for example, do not have visibility over parties who have been granted access to network B (and vice versa). Though parties may choose to run multiple virtual nodes and join multiple different application networks (as shown for Alice in the above diagram), which would allow them the option of interoperability between these networks.</p><p>Application networks aim to enhance the network models from previous Corda iterations by allowing management through tooling native to a Corda cluster (accessible via REST APIs), by moving away from the use of bespoke software in the CENM stack, and by allowing the network operator to select the certificate authorities to serve as the network trust root(s). The privacy provided by application networks also means that only parties approved to join a network have visibility over that network — meaning it’s not visible to a party running on the same or different cluster unless they get approval for that specific application network.</p><p>In regulated markets, customers have stringent privacy and governance requirements. These requirements often differ between different applications. As a result, the majority of CorDapps have been launched as private business networks. Application networks embrace this reality by reducing the scope of each network to a single bundle of applications, all governed by the same rules.</p><p>As network scope is reduced to a select number of applications, network rules are limited to a much more reduced set of participants. In previous Corda network models, all network participants shared the same network rules regardless of which CorDapps they were running. Application-scoped networks allow a more fine-grained control over network properties such as the available notaries, and maximum transaction sizes.</p><h3>Feature Spotlight</h3><p>Let’s now explore the key features of application networks.</p><h3><strong>Embrace Industry Standards</strong></h3><p>Bringing industry-standard Public Key Infrastructure (PKI) and tapping into third-party Certificate Authorities (CAs) adds an extra layer of security and trust to your application network. The network operator can select a specific set of CAs as trust roots for the TLS PKI of the network and require all participants to get certificates issues from one of those in order to transact successfully within the network. This means solid encryption, secure identity management, and a simpler authentication process for all participants across your network. The result? A more resilient and reliable network infrastructure that aligns with established security best practices.</p><p>But that’s not all — managing your network becomes a breeze with the power of REST APIs. The magic of REST APIs lies in their user-friendly approach. They offer clear-cut instructions, making the administration of your network a walk in the park. What’s even better, they seamlessly integrate with your current tools and systems, adding a touch of automation to smooth your operations.</p><h3><strong>Explore Multiple Network Models</strong></h3><p>Corda’s application networks offer multiple network models tailored to different stages of development and testing. Currently, two models are available, but the overall structure of the network models allows for pluggability meaning as Corda evolves, the network models can evolve with it without a major restructure.</p><p>Here’s an overview of the existing models:</p><p><strong>Static networks:</strong> Ideal for local testing, with predetermined virtual nodes, operating within a single cluster.</p><p><strong>Dynamic networks:</strong> Suited for real-world scenarios, including production networks, cross-cluster testing, and adaptable scenarios with varying member counts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0uWxEZl__lu4K_R5.png" /></figure><p>Notably, dynamic networks feature the MGM, a central component for dynamic participant registration, data distribution across clusters, and advanced network management. While these are the current models, there is the potential for additional models in the future.</p><p>Static networks are named as such because the network participant list is predetermined. This is allows networks to be created without an MGM. The lack of an MGM limits the network feature set but allows for quicker network setup which is why this model is only for testing purposes.</p><p>While these are the two network models currently available, we have plans to extend this in the future to cover a wide array of business needs. The pluggable nature of the network models will allow us to meet specific needs easier than ever before.</p><p>Below you can find out about some of the extra capabilities available in dynamic networks.</p><h3><strong>Meet the MGM</strong></h3><p>Within an application network, the <em>Membership Group Manager</em> (MGM) assumes the crucial role of network administration. By operating as a virtual node with network administration permissions within a Corda cluster, the MGM significantly reduces the operational overhead associated with network creation and management compared to previous Corda iterations. Importantly, integrating an MGM into any Corda cluster is streamlined and resource-efficient, as it requires no additional infrastructure.</p><p>An application network can contain a single MGM which is responsible for onboarding virtual nodes to the network, distribution of network data, and managing the network. The party responsible for network management can use Corda’s REST API to act as the MGM and administer the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*setXRyDdZE75I0in.png" /></figure><h3>Onboard with Ease</h3><p>As application networks function as private, permissioned networks, the challenge lies in striking a balance between robustly securing network access and data while maintaining a seamless onboarding experience. To tackle this, let’s have a look at the network onboarding process.</p><p>Network onboarding offers flexibility and enables seamless integration into business-specific workflows external to Corda which must be executed before allowing permission to join a network. On the side of the network operator, this gives a fine-grained level of control over which virtual nodes are approved to join a network. And on the applying virtual node’s side, all the information required to join a network comes as part of the installed CPI so network onboarding can be requested via a simple REST API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vkb7sdwsonpw8qC8.png" /></figure><p>One facet of this functionality is the automatic handling of onboarding requests. When a virtual node initiates the onboarding process and successfully passes automated validations, it swiftly gains entry to the application network.</p><p>Moreover, this feature includes the ability to pause registrations for manual review. This empowers administrators to assess registration requests, establishing a tailored onboarding workflow. Through the network manager REST API, pending registrations can be queried, allowing for personalised attestations (for example, KYC checks or verification of subscription fees). Once the personalised workflow has completed, these paused registrations can be approved or declined through the REST API.</p><p>Certain networks may require strict onboarding validation for registering parties, but wish to fast-track a selected number of entities into the network (for example, if the entities are already known and trusted). For these entities, a further layer of expedited onboarding is achievable through token issuance. These tokens grant parties the advantage of bypassing manual reviews, expediting the process while retaining the option to halt specific registrations which do not include a registration token.</p><p>This comprehensive suite of options transforms network onboarding into a dynamic and adaptable process, accommodating a spectrum of needs and scenarios.</p><h3>Network Suspension</h3><p>The suspension feature presents a tool for managing network dynamics within an application network. By suspending virtual nodes, their ability to engage in transactions with other network participants is temporarily halted. Suspended virtual nodes become undiscoverable in the network participant list, preventing other parties from accessing their information. This blockage applies not only at the CorDapp API level but also at the peer-to-peer layer on both ends of an attempt at communication. If either party involved is suspended, messages are dropped, effectively preventing interactions involving suspended parties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_xcKblkcLv3wi0Tj.png" /></figure><p>Suspended parties do not receive any network updates during the period of time in which they are suspended. Similarly, non-suspended network parties receive no updates about about suspended members.</p><p>This functionality grants administrators control over network interactions. When the timing is optimal, the network manager can elect to reactivate the suspended virtual node, promptly restoring its full network functionality. Unlike more definitive actions such as certificate revocation, this approach provides a flexible solution for temporarily taking parties offline within the application network.</p><h3>Wrapping It Up</h3><p>And that’s a wrap — a friendly introduction to the world of Next-Gen Corda’s application networks. We’ve taken a stroll through some neat features that redefine how Corda networks work. From the MGM to the smooth network onboarding, network suspensions, and the integration of industry-standard PKI and third-party CAs.</p><p>But wait, there’s more to explore! While we’ve scratched the surface of what application networks can do, there’s a lot more to uncover. So, for all the curious minds out there, it’s time to dive into Corda’s documentation, join community chats, and gear up to learn about all the ins and outs of application networks in Next-Gen Corda.</p><p>Thank you for taking the time to delve into the world of Corda’s application networks with us. I hope this blog serves as inspiration to start playing with application networks, and exploring their possibilities. We wish you all the best as you embark on this exciting adventure.</p><h3>Ready to Dive In?</h3><p>Excited to get hands-on with Corda’s application networks? There’s a world of exploration waiting for you! To take your journey to the next level, check out the <a href="https://corda.net/blog/next-gen-corda-is-here/">official announcement</a> of Next-Gen Corda’s release.</p><p>For a deeper dive into the application network vision, <a href="https://corda.net/blog/corda-5-the-road-ahead-part-6-application-networks/">this early blog post</a> unveils the grand plan behind it all. Or you can check out a <a href="https://r3.com/blog/agreeing-to-disagree-interoperability-in-a-world-without-compromise/#:~:text=I%20made%20a%20mistake%20when,run%20its%20own%20separate%20network.">blog post by our CTO, Richard Brown</a>, which provides some background on why we moved from global networks to application-scoped networks.</p><p>Feeling adventurous and want to start building your own network? Look no further than the <a href="https://docs.r3.com/en/platform/corda/5.0/application-networks.html">step-by-step documentation</a> that walks you through creating your very own application network.</p><p>And if you’re hungry for more, the <a href="https://docs.r3.com/en/platform/corda/5.0.html">complete Corda 5 documentation</a> is your one-stop shop for all things Corda 5, including further information on <a href="https://docs.r3.com/en/platform/corda/5.0/key-concepts/fundamentals/application-networks.html">application networks</a>.</p><p>So what are you waiting for? Your journey into the world of Corda’s application networks awaits. Dive in and explore!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20eba98c5860" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/exploring-next-gen-cordas-application-networks-20eba98c5860">Exploring Next-Gen Corda’s Application Networks</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Developer Experience on Corda 5: Empowering Efficient & Productive CorDapp Development]]></title>
            <link>https://medium.com/corda/enhancing-developer-experience-on-corda-5-empowering-efficient-productive-cordapp-development-f922b27fda54?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/f922b27fda54</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 08:10:50 GMT</pubDate>
            <atom:updated>2023-08-11T08:10:50.628Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Ido Katz, Product Manager — Developer Experience at R3</p><p>The <a href="https://r3.com/products/corda/">next generation of Corda</a> represents a new era for R3 and its flagship distributed application platform Corda. R3’s Developer Experience (DevEx) team understands the importance of providing the best journey for CorDapp developers — a productive and efficient process including designing, coding, and testing. In this blog post, we will share what the DevEx team learned from Corda 4 user and customer feedback and give insights on team objectives and key deliverables.</p><figure><img alt="People working on user journey map" src="https://cdn-images-1.medium.com/max/1024/1*Vttcv91asw8EGypuT6-r1g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@uxindo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">UX Indonesia</a> on <a href="https://unsplash.com/photos/w00FkE6e8zE?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Developing on Corda 4 — Lessons Learnt</h3><p>Product feedback is essential to product development to meet your user’s and customer’s needs. At R3, we have built a Corda 5 developer journey based on lessons learnt from our developer community, clients, and internal application development teams. Here are the main insights from Corda 4 developers:</p><ul><li>Faster unit testing modification and automation capabilities</li><li>Easier and faster build process for bootstrapping local network with every change of code</li><li>Lower computing resources for flow testing on the local network</li><li>Higher compatibility for testing mid-flows (tests must start by issuing a new state)</li></ul><p>Corda 5 is significantly different (and better) from Corda 4. Therefore, based on clients’ feedback and experience developing on Corda 4, R3’s DevEx team is building new set of tools and feature to improve CorDapp development process and environment.</p><h3>R3’s DevEx — North Star</h3><p>R3’s DevEx team is building a Corda 5 Developer Journey with a focus on three main pillars: Productivity, Ease-of-use, and Quality.</p><ul><li><strong>Productivity — Simplified Development process:</strong> Corda simplifies the development process with its Java-based API, java and Kotlin smart contract languages support, and CorDapp development training materials. We reduce the learning curve and enables developers to write secure and efficient code. Corda’s comprehensive documentation and tutorials facilitate quick onboarding, ensuring developers can easily start building DLT solutions from day one.</li><li><strong>User Experience — Extensive Tooling Support:</strong> Corda provides various development tools, including <em>Corda Standard Development Environment</em> (CSDE), Gradle plugins, command-line interfaces, and debugging utilities. These tools streamline the development process and offer developers a seamless experience while working on Corda-based projects.</li><li><strong>Quality — Local CorDapp Testing :</strong> Corda provides a robust testing framework that enables developers to write comprehensive unit, integration, and end-to-end (E2E) tests. This ensures reliability and resilience of developed CorDapps, reducing potential bugs and enhancing the overall quality of the codebase.</li><li><strong>Productivity — Faster Release Cycles: </strong>Corda’s developer tooling and capabilities are being designed in faster timeframes than Corda Core Platform/APIs. Therefore, the DevEx team is publishing its tools and features in multiple release iterations (beta/ GA), with some content decoupled from the main releases (e.g., v5.0, v5.1, v5.2).</li></ul><h3>Corda 5 — what’s ready and what’s still in the oven?</h3><ul><li><strong>CSDE </strong>provides a modular local development and deployment to easily build and test your CorDapp. R3’s CSDE comes in two supported templates — Java and Kotlin, Gradle plugins for local deployment automation, and <em>Combined Worker</em> to emulate/mock Corda 5 microservices management.<br>– To be improved: Combined Worker is slower than the real operational network. DevEx team is redesigning a new Combined Worker with improved throughput and higher architectural resembles to operative network. The new CSDE will be released with v5.1</li><li><strong>Contracts Testing:</strong> A comprehensive suite of test APIs which implements the UTXO ledger, providing the ability to construct a transaction and assert that it verifies, or fails for a specific reason.<br>– Release date: The Contracts Testing will be available for beta on GitHub by September 2023</li><li><strong>Flows Testing: </strong>The ‘<em>Driver</em>’ is<strong> </strong>a local, in-memory version of Corda that can be launched using JUnit 5. The Flow Testing Tool allows developers to upload their CPBs (Corda Package Bundles) and debug their flows within Corda’s flow framework. The driver contains Corda functionality from the main codebase without needing either Kafka or REST.<br>– Release date: The Driver has passed a PoC phase and is currently under development. A beta will be available in November 2023</li><li><strong>CorDapp E2E Testing:</strong> Using the CSDE, Gradle plugins, and Rest API Swagger, a CorDapp developer can write E2E tests for their CorDapps.</li></ul><h3>Summary</h3><p>Corda’s developer-friendly features, such as simplified development process, robust testing framework, modular architecture, seamless integration capabilities, collaborative eco-system, and extensive tooling support, make it an ideal platform for building private distributed ledger applications. By prioritizing developer experience, R3 empowers developers to focus on creating innovative solutions without unnecessary complexities, ultimately accelerating the adoption of blockchain technology across industries.</p><p>We are very excited about the<a href="https://corda.net/blog/next-gen-corda-is-here/"> general availability of Next-Gen Corda</a>. It is a work in progress and DevEx team will continue to build tools and features to support our developer community.</p><p>To make Corda even better, we need your feedback to help us identify and resolve issues. Corda is freely available. So why not give it a try?</p><ul><li>Visit our new <a href="https://docs.r3.com/en/platform/corda/5.0-beta.html">Next-Gen Corda doc site</a></li><li><a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/tooling.html">Download Next-Gen Corda</a> (including required prerequisites)</li><li>Discover our new <a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/getting-started.html">CSDE</a></li><li>Learn more with our new “<a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/basic-cordapp/setup.html">Apples Tutorial</a>”</li><li>Share comments/feedback or ask our experts any questions on our <a href="https://cordaledger.slack.com/join/shared_invite/zt-1t1dsbs9z-23dPsnZGJZaDMK1gLyXxDQ#/shared-invite/email">Slack channe</a>l or <a href="https://developer.r3.com/forum/">Dev Forum</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f922b27fda54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/enhancing-developer-experience-on-corda-5-empowering-efficient-productive-cordapp-development-f922b27fda54">Enhancing Developer Experience on Corda 5: Empowering Efficient &amp; Productive CorDapp Development</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next-Gen Corda is Here!]]></title>
            <link>https://medium.com/corda/next-gen-corda-is-here-e812ec8f1eca?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e812ec8f1eca</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 12:28:28 GMT</pubDate>
            <atom:updated>2023-07-31T08:24:31.446Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Dries Samyn, Principal Software Engineer at R3</p><figure><img alt="Next-Gen Corda is here" src="https://cdn-images-1.medium.com/max/1024/1*bJgUOLckUhrusFhKHJPJEg.jpeg" /></figure><h3>Next-Gen Corda in Numbers</h3><ul><li>3 years in the making</li><li>2 open-source repositories</li><li>Nearly 100 contributors</li><li>At least 3 R3 engineering babies conceived and successfully delivered (we take nurturing in-house talent very seriously!)</li><li>Over 1,500,000 lines of code added, deleted, or changed</li><li>Over 4000 pull requests</li><li>Over 5000 merged commits</li><li>Over 70,000 Jenkins builds</li><li>Over 500,000,000 test executions</li><li>2 alpha releases</li><li>4 beta releases</li><li>Exactly 3.56 liters of blood, sweat, and tears</li></ul><p>These are just some of the statistics to give an indication of the scale of the work that has gone into building the next generation of the best Distributed Ledger Technology (DLT) platform in the world. All while continuing the development of Corda 4, with four releases during this period, to maintain its status as “the go-to DLT platform”.<br>In this blog, we will reflect on the journey from the perspective of an engineer.</p><h3>Why Did We Do This?</h3><p>I would like to say that it was for the love of solving really complex engineering problems, but it wasn’t. Of course we loved solving these complex problems, often getting things wrong a couple of times before we got it right, but there were more solid reasons that we undertook what has been the largest technical transformation of the Corda platform to date.</p><p>R3 has been working with customers using Corda from the early days of DLT adoption. We have seen innovative use cases and organizations solving real world problems, sometimes using Corda in ways we hadn’t originally envisaged. Some of those cases hit limitations that could not be facilitated by modifying the original architecture of Corda 4.</p><p>Along came “Project Starfish” and with it, the product team presented a vision for what the next generation of Corda needed to be. This vision would ensure that Corda was fit for the next generation of financial market infrastructure, digital assets, and digital currency applications, as well as the many other innovative use-cases of private, permissioned blockchain technology.</p><h3>What Does Next-Gen Corda Look Like?</h3><h4>It’s still the Corda we know and love</h4><figure><img alt="Car getting engine replaced" src="https://cdn-images-1.medium.com/max/480/1*VYDqcrbYgr5dU6gEv9X6fg.png" /></figure><p>Before describing what is new and how this has changed Corda, we want to establish that Next-Gen doesn’t mean it’s a different thing. We made some improvements to the CorDapp API that will hopefully help developers to write cleaner, more testable code, but this should not feel like a big change to existing CorDapp developers. We’re keeping the Corda Flow programming model that we know and love, the UTXO ledger is what we’re familiar with, and smart contracts still look pretty much like they did before.</p><p>The big technical transformation that has happened has been all about the internals. We’ve taken Corda and given it a big engine transplant.</p><h4>Highly available (HA) and scalable</h4><p>“Highly Available” was the leading requirement for Project Starfish. The types of applications that we now know are being built on the Corda platform have challenging requirements around uptime and scalability. This was probably the biggest driver behind the need to re-imagining some of Corda’s foundations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*1ZxMDK9fCClvLws8u-8CNw.png" /></figure><p>Previously, a Corda node was supported by a monolithic JVM process. This means that it’s quite easy to manage and it <a href="https://docs.r3.com/en/platform/corda/4.8/enterprise/performance-testing/performance-results.html">performs well</a>. However, there are limits to how much it can scale. As one node was one process, scaling a Corda node meant finding a bigger JVM/Host.<br>This also means that achieving a highly available configuration was difficult, as only one process can support a node at any time. There is limited support for a hot or warm topology where you can have a second instance on standby to take over in case of failure.</p><p>Next-Gen Corda has taken on a distributed architecture designed around stateless worker processes that can scale up or down and provide redundancy.</p><h4>Multi-Tenancy</h4><figure><img alt="Diagram showing multiple Corda clusters" src="https://cdn-images-1.medium.com/max/458/1*rBSEU_eFAfpcTWhdHffgTA.png" /></figure><p>Of course, Corda is still a distributed system, however, what we see is that users often operate multiple Corda nodes. Either because have multiple segregated identities on a network, or because it is part of a progressive decentralization model where multiple nodes are operated on behalf of others until they are ready to manage their own.</p><p>This is the reason that we separated the concept of the Corda node from the compute resource. In Next-Gen Corda, we call them Virtual Nodes and they are simply execution contexts in which worker processes within a Corda cluster can operate.</p><p>To see this in action, you can <a href="https://r3.com/cordacon/2022/show-dont-tell-corda-5-demonstration/">easily set up a Corda network</a> with dozens or even hundreds of nodes on your laptop, or local development environment.</p><h4>Network of networks</h4><p>We believe in the value of private, permissioned, networks, but that doesn’t mean that we don’t believe in interoperability between these networks. Being able to complete an atomic Delivery vs Payment (DvP) transaction across Corda networks, or even between Corda and other blockchains such as Ethereum, is something that our customers and partners in the ecosystem want to do. This is why Interoperability was such an important requirement for Next-Gen Corda. We have already announced and launched <a href="https://www.hyperledger.org/blog/2023/06/14/introducing-hyperledger-lab-harmonia-unlocking-interoperability-for-regulated-financial-networks">Hyperledger Lab Harmonia</a> — watch this space for more announcements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aObexNxy_wb1f2t2aprrBQ.png" /></figure><h4>REST API</h4><p>You interact with the Next-Gen Corda using a standard REST interface over https. This makes it straight forward to integrate into any kind of application or workflow. Corda no longer takes any opinion of what language or framework that you use to write your client app.</p><h4>Manage network membership through the new Membership Group Manager (MGM)</h4><p>Next-Gen Corda introduces the Membership Group Manager (MGM). Its role is to register and manage members of the network. This registration process can be automatic, or custom registration logic can be integrated with your own workflow through integration with the REST API.</p><h4>New peer-to-peer communications layer</h4><p>P2P (peer-to-peer) communications in Next-Gen Corda uses a standard HTTP transport, making it easier for people to connect their Corda installations to others in the network. The layer was designed and built as an independent component, which was <a href="https://corda.net/blog/corda-5-unveiling-the-p2p-preview/">released as an open source preview</a> just over a year ago.</p><h4>Pluggable ledger / pluggable notary</h4><p>The UTXO ledger and notary in Next-Gen Corda will be familiar to those who are already familiar with Corda. However, similar to the P2P layer, the ledger and notary are designed and built as layers on the top of the stack. They are independent of the Corda flow model and this enables adding alternative ledger models in the future, or in the case of the notary, <a href="https://corda.net/blog/notaries-in-corda-5-pluggable-notary-protocols/">custom implementations can be supported by Network Operators</a>.</p><h4>Operator Experience</h4><p>We recognized that most of our customers wanted to host Corda in a containerized environment, typically in the cloud. We also recognized that Kubernetes is a good match for the new Corda architecture.</p><p>You don’t have to operate Next-Gen Corda in Kubernetes or the Cloud, but when you do, we’ll make your life as a platform operator easy, since Corda is designed to be operated in such environments.</p><h3>Developers Developers Developers</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FI14b-C67EXY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DI14b-C67EXY&amp;image=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FI14b-C67EXY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/654d9dbbc4a86461f57bca3bcc9201b3/href">https://medium.com/media/654d9dbbc4a86461f57bca3bcc9201b3/href</a></iframe><p>Engineers of my vintage will probably remember the day in the early 2000s, when Steve Ballmer turned into a meme, but wasn’t he right about developers? He thought that the success of Microsoft was dependent on a large ecosystem of applications, supported by developers developing for the platform.</p><p>We want CorDapp developers to love the platform as much as we do and the “CorDapp Developer” persona has featured high in the Next-Gen Corda user stories. This means that we’ve introduced a REST API for easy integration and we’ve improved the CorDapp API so that it is now cleaner and more testable. We’re also giving CorDapp developers a way of running an entire Corda Network in a single process, easily runnable from a local development environment.</p><p>And this is just the start, because we have some very exciting developments in the pipeline — so watch this space!</p><h3>What’s Next?</h3><figure><img alt="Road with the word START written on it" src="https://cdn-images-1.medium.com/max/1024/1*CrLOMIsXyjqiQ4rzHQ1HJQ.png" /></figure><p>After reflecting over the journey of the last couple of years, it feels like we’ve reached a destination, but as my colleague and great mentor @Katelyn Baker reminded me numerous times over the last 2 years, releasing Corda 5.0 is just the start of the road. We have built the foundations for a Corda that is ready to support the next generation of distributed applications at scale.</p><p>Yes, we will be improving and fine-tuning those foundations in the next few months, but mostly, we’ll be building on top of those foundations to help our customers and users to innovate.</p><p>For now though, we’re due a moment to reflect and recharge, but we hope that you will be busy testing the new platform and <a href="https://developer.r3.com/forums/forum/corda-feedback-requests-and-issues/">giving us the feedback</a> that we need to make Corda even better.</p><p>Next-Gen Corda is available today. Download the Corda <a href="https://developer.r3.com/next-gen-corda/#get-corda">artifacts</a>, learn more <a href="https://docs.r3.com/en/platform/corda/5.0.html">in the Corda docs</a>, and start building for free.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e812ec8f1eca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/next-gen-corda-is-here-e812ec8f1eca">Next-Gen Corda is Here!</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notaries in Corda 5: Pluggable Notary Protocols]]></title>
            <link>https://medium.com/corda/notaries-in-corda-5-pluggable-notary-protocols-a8e73da9ed82?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8e73da9ed82</guid>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Wed, 12 Jul 2023 11:38:46 GMT</pubDate>
            <atom:updated>2023-07-12T11:38:46.728Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Ramzi El-Yafi, Staff Software Engineer at R3</p><p>In a previous blog post, we looked at the <a href="https://corda.net/blog/notaries-in-corda-5-architecture/">Notary Architecture in Corda 5</a> as a whole. As part of this, we briefly mentioned that notary functionality is provided in the form of “plugin” CorDapps. Since then, we have added <a href="https://docs.r3.com/en/platform/corda/5.0/developing-applications/notaries/notary-plugin-cordapps.html">official documentation</a> to explain the implications of this architecture on CorDapp Developers and <a href="https://docs.r3.com/en/platform/corda/5.0/key-concepts/fundamentals/application-networks.html">Network Operators</a>. This blog post provides some more background as to why we have adopted this model. It also poses some questions that both CorDapp Developers and Network Operators need to ask as part of the development and operational lifecycle.</p><figure><img alt="Photo by Emre Turkan on Unsplash" src="https://cdn-images-1.medium.com/max/1024/1*Lr-rRSqESpWu35vNAwSiIg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@emreturkan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Emre Turkan</a> on <a href="https://unsplash.com/photos/KULAXcZZ22U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Plugin Philosophy</p><p>In Corda 4, notary functionality is fixed function. When specifying a notary in the configuration, a single setting (the validating flag) indicates whether the notary supports the non-validating or validating notarization protocol. Under the hood, these are both sub-flows that execute as part of transaction finality. They share much of the same code, specifically around uniqueness checking. The non-validating notary plugin performs only minimal additional checks beyond uniqueness checking, whilst the validating notary plugin performs full contract validation against states in a transaction and all of the relevant back-chain.</p><p>Ultimately, the distinctiveness between these protocols is entirely within flow logic. This led to the realization that we had implemented fixed-function logic, whereas a solution that implemented the flows in CorDapps would provide superior flexibility. As a result of this, the decision was taken to implement notarization flows in CorDapps, whilst making a separate “uniqueness service” available to these flows to perform fixed-function double-spend prevention checks. This provides flexibility to add additional notary protocols in future, either provided by R3, or a third-party developer.</p><p>Structure</p><p>Notary plugin CorDapps must provide an initiator and corresponding responder flow. These flows are slightly special, in that they are not directly invokable from the flow REST API. Instead, they are intended to be invoked as sub-flows, as part of transaction finality. Each notary service on the network will have a named protocol that it supports, defined in its Membership Group Manager (MGM) metadata. This corresponds to the protocol name of an initiating flow within the notary plugin, which is automatically invoked as a sub-flow during transaction finality. Whilst not required, it is recommended that a notary plugin is split into three distinct Corda Packages (CPKs):</p><ul><li>A client CPK, which is included as part of an “application” Corda Package Bundle (CPB), installed on standard virtual nodes on the network. This contains the initiating flow.</li><li>A server CPK, which is included as part of a “notary” CPB, installed on notary virtual nodes on the network. This contains the responder flow.</li><li>An API CPK, which is included on both sides and is used to define the message payload between the initiator and responder flow.</li></ul><p>This diagram outlines the structure of the non-validating notary plugin, which is shipped as part of the Corda 5.0 release:</p><figure><img alt="Diagram outlining the structure of the non-validating notary plugin" src="https://cdn-images-1.medium.com/max/1024/1*1lvhM_Fs4k_u49RLUen1og.jpeg" /><figcaption>Diagram outlining the structure of the non-validating notary plugin</figcaption></figure><p>This structure allows for the proper separation of responsibilities. Only notary virtual nodes have the responder flow installed and with it, the ability to respond to notarization requests. Similarly, only application virtual nodes have the ability to initiate notarization requests.</p><p>Implications</p><p>Lets now consider the implications of this architecture from the perspective of different personas.</p><p>CorDapp Developers</p><p>The biggest impact of this architecture is arguably on CorDapp Developers. Since application CPBs are produced by CorDapp Developers, they decide which notary protocols that their CorDapp will support and it is they who ensure the relevant notary plugin CPKs are bundled as part of their application CPB. Right now, this decision is trivial since R3 only provides a non-validating notary plugin, so the decision comes down to whether their CorDapp utilizes the <a href="https://corda.net/blog/rationale-for-and-tradeoffs-in-adopting-a-utxo-style-model/">UTXO ledger</a>. If it does, this requires notarization and therefore the relevant non-validating notary CPKs must be included. Alternatively, if their CorDapp does not utilize the UTXO ledger (for example if the CorDapp only uses flows and not a ledger), then there is no need to include any notary protocol.</p><p>Things may get more interesting in future as more notary protocols are added. The CorDapp Developer does not know anything about the network that their CorDapp will be deployed on, so they must bundle all appropriate plugins that are supported by their CorDapp. Conversely, it may be that their CorDapp needs a specialized notary protocol, written either by themselves or by another entity. In this scenario, they may forgo bundling the “standard” notarization protocols and only bundle the specialized protocol.</p><p>Notary Plugin Developers</p><p>The packaging decisions for Notary Plugin Developers are not so clear. One or more CPKs must be produced to support a custom notarization protocol. It’s also clear that there should be a separate notary CPB produced for installation on notary virtual nodes.</p><p>For the non-validating notary protocol, R3 produces and distributes a standard notary server CPB for this purpose. We are able to do this because the protocol is simple and requires no third-party CPKs to operate. However, we can imagine a situation where this is not possible. For example, if we were to re-implement the validating notary protocol from Corda 4, which performs validation against the contracts of states in a transaction during notarization, this would require the notary server CPB to contain a CPK from the “application”, because it would need a custom set of contracts to verify against. In this situation, the Plugin Developer could only produce CPKs, and would require the CorDapp Developer to build a notary and an application CPB.</p><p>Network Operators</p><p>Network Operators must decide which notarization protocols that their network will support and build one or more notary server Corda Package Installers (CPIs) from provided CPBs. These CPIs must then be installed on the relevant notary virtual nodes. Again, this is trivial whilst there is a single supported notary protocol, but this may become more involved if the network supports multiple notary protocols (and by extension, supports multiple notary services).</p><p>Conclusion</p><p>Whilst the changes to notarization protocols in Corda 5 require CorDapp Developers and Network Operators to think about which protocols that they will support, the Corda 5.0 release represents the beginning of a journey to develop the functional capabilities of the notary. This approach provides an extensible framework that allows us to easily add additional notarization capabilities throughout the life of the Corda 5 platform.</p><p>Corda 5 Beta 4 is available today. Download the Corda <a href="https://developer.r3.com/next-gen-corda/#get-corda">artifacts</a>, learn more <a href="https://docs.r3.com/en/platform/corda/5.0.html">in the Corda docs</a>, and start building for free.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8e73da9ed82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/notaries-in-corda-5-pluggable-notary-protocols-a8e73da9ed82">Notaries in Corda 5: Pluggable Notary Protocols</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Kafka Was Selected for Next-Gen Corda]]></title>
            <link>https://medium.com/corda/why-kafka-was-selected-for-next-gen-corda-b04c563b80a9?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/b04c563b80a9</guid>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 08:49:14 GMT</pubDate>
            <atom:updated>2023-06-28T08:49:14.977Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Divya Taori — Senior Developer Evangelist at R3</p><blockquote><em>A distributed ledger made up of mutually distrusting nodes would allow for a single global database that records the state of deals, obligations, and other agreements between institutions and people. This would eliminate much of the manual, time-consuming effort currently required to keep disparate ledgers synchronized with each other. It would also allow for greater levels of code sharing than is currently typical in the financial and other industries, reducing transaction costs for everyone.</em></blockquote><blockquote><em>— Richard Gendal Brown, August 2016</em></blockquote><p>These are the foundational principles set forth by Richard Brown, the Chief Technology Officer of R3. Seven years later, as the <a href="https://corda.net/">Next Generation of Corda</a> is introduced, these principles remain steadfast. Our vision for Corda is to create an ecosystem that fosters digital trust at its core, enabling mutually distrustful parties to seamlessly engage in transactions using the Corda platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfmRP9NPFMS4EdT7k8WcAw.png" /></figure><h3>Introducing Next-Gen Corda</h3><p>With Corda 5, the Corda platform has undergone significant enhancements to meet the needs of our customers. It builds upon the trust, consistency, and security assurances provided by the previous Corda version, while also enabling high availability (HA), horizontal scalability, and reducing the overall total cost of ownership. Corda 5 represents a rebuilt and completely fresh implementation of the architecture, while still retaining the important features of distributed ledger technology (DLT) such as native smart contracts, distributed ledger, immutability, privacy, composability, and more.</p><p>The Next-Gen Corda platform embraces an event-driven worker architecture at its core, emphasizing reliability and scalability. This approach involves two key steps. Firstly, it separates the attested identity from a single compute instance, and secondly, it strategically divides the functionality among distinct components to optimize the total cost of ownership. Let’s understand each of these steps in further detail.</p><p>The first step simply means that now a single Corda compute instance does not have to be necessarily linked to one and only one identity. Through the means of <a href="https://corda.net/blog/corda-5-sandboxes/">sandboxing</a>, the architecture allows you to host multiple identities on a single compute instance. These are referred to as <a href="https://corda.net/blog/a-virtual-node-by-any-other-name-would-compute-as-sweetly/">virtual nodes.</a></p><p>The second step entails dividing operations into multiple processes, referred to as ”workers”. Workers handle specific elements of a distributed ledger technology (DLT) system, such as RESTful user interaction, cryptographic operations, and execution of user code (flows). The workers are designed to be stateless, thus, enabling them to be used with different identities hosted on the same compute instance.</p><p>These workers seamlessly communicate with each other through <a href="https://kafka.apache.org/">Apache Kafka</a>. Apache Kafka is a distributed event store and stream-processing platform. It is an open-source system developed by the Apache Software Foundation and is written in Java and Scala. Workers are optimally hosted in a Kubernetes (K8s) environment. This enables a cluster administrator to leverage the innate capabilities of K8s for automatic scaling and failover of the workers deployed into it. It is through this scaling that Corda achieves its HA guarantees — enabling Corda to be deployed in a <strong>Hot-Hot/Active-Active </strong>configuration, departing from the Hot-Warm/Active-Passive strategy of Corda 4. The below diagram represents a single cluster, on which multiple identities (virtual nodes) can be hosted. A network (application network) may comprise of multiple identities hosted on the same or different clusters. To learn more about these concepts, refer to the <a href="https://docs.r3.com/en/platform/corda/5.0/key-concepts/fundamentals.html">documentation</a>.</p><figure><img alt="A diagram of a single cluster on which multiple identities (virtual nodes) can be hosted." src="https://cdn-images-1.medium.com/max/1024/1*HklE-ze2AAd4n8t8Mt9nDg.png" /><figcaption>A single cluster on which multiple identities (virtual nodes) can be hosted.</figcaption></figure><h3>The Role of Kafka in Next-Gen Corda</h3><p>In Corda 5, the message bus no longer forms part of the Corda protocol itself. Instead, it serves as a reliable, fault-tolerant message delivery system within a single cluster. By introducing a bus abstraction layer, future alternatives to Kafka can be explored. However, currently, Next-Gen Corda utilizes Kafka at the heart of its cluster.</p><h3>Reasoning Behind the Selection of Kafka</h3><p>When designing the runtime infrastructure for Next-Gen Corda, the primary goal was to achieve a hot-hot, high-availability configuration, with automatic work sharding, maximizing throughput and reducing costs. This immediately mandated a structure with multiple worker processes communicating together and locally distributed algorithms to elect the work items handled by any individual worker. Several options were considered:</p><ul><li>Picking a message bus and implementing the work distribution by hand.</li><li>Considering Flink, which shares a similar streaming architecture with Corda flows but lacks the same level of industry adoption as Kafka.</li><li>Utilizing Akka cluster and implementing everything through algorithms within it, although this approach can be challenging to maintain.</li><li>Choosing Kafka, which already implements all the required functionality and is widely used in production at scale.</li></ul><p>The selection process led to the conclusion that Kafka, combined with the Corda processor framework, offered the best approach. Moreover, Kafka’s industry-standard status for high availability and low latency messaging further solidified its suitability for Next-Gen Corda.</p><h3>Benefits of Kafka</h3><p>The following are some reasons why Kafka has become the de facto standard for messaging in various applications, counting over 35% of Fortune 500 companies as its users:</p><ul><li>Storage Capabilities: Unlike most message queues that remove messages immediately after receipt, Kafka can store data for as long as required, providing durability and persistence.</li><li>Stream Processing: Kafka enables dynamic computation of derived streams and datasets, going beyond simple message batching.</li><li>Message Replay: Kafka supports the replay of messages, although it does incur a storage overhead.</li></ul><h3>Conclusion</h3><p>Apache Kafka emerged as the clear choice for Next-Gen Corda due to its maturity, scalability, and widespread adoption. By leveraging Kafka as the backbone of Corda’s communication infrastructure, Corda 5 achieves the desired high availability, horizontal scalability, and reduced total cost of ownership, ultimately delivering on the rigorous needs of our customers.</p><p>All of this is available <strong>today!</strong> Try out Next-Gen Corda for free <a href="https://developer.r3.com/next-gen-corda/#get-corda">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b04c563b80a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/why-kafka-was-selected-for-next-gen-corda-b04c563b80a9">Why Kafka Was Selected for Next-Gen Corda</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build/DevOps @ R3 — Operation Automation]]></title>
            <link>https://medium.com/corda/build-devops-r3-operation-automation-587290bb985?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/587290bb985</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[distributed-ledgers]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 10:58:46 GMT</pubDate>
            <atom:updated>2023-03-16T10:58:46.122Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build/DevOps @ R3 — Operation Automation</h3><p>By: Maciej Swierad — DevOps Engineer at R3</p><blockquote><strong>I, for one, welcome our new robot overlords. For they are the future, and the future is automated.</strong></blockquote><blockquote>George Devol</blockquote><p>Have you ever wondered how software <em>actually </em>makes its way into the real world? How it’s published and distributed? How it’s built and secured? Have you thought about how the sysAdmin role has been retired and moulded into DevOps and what that means? Well have I got the post for you!</p><p>Settle down, take a cup of tea, and bear with me as I talk you through build engineering and DevOps while tossing in my grad perspective at what it all is. However, if you’re a savvy build engineer already, or simply like seeing real world examples, just jump ahead to the heading “Real World example — GitHub repo creation automation”.</p><figure><img alt="Pile of Lego bricks" src="https://cdn-images-1.medium.com/max/1024/1*U1-R54TrsO7jiBTWOieDSw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@xavi_cabrera?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Xavi Cabrera</a> on <a href="https://unsplash.com/photos/kn-UmDZQDjM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Why We Automate</h3><p>Automation helps reduce the time and effort required to build and deploy software, which improves the overall efficiency of the software development process. This saves time and resources and allows teams to focus on other important tasks. In an ideal world, a software release is just one click away!</p><p>Automation helps ensure that the build and deployment process is consistent and repeatable, which improves the reliability and stability of the software. This is especially important in a cloud native environment, where the software may be deployed across multiple cloud environments or services. This is often a security requirement too. Think about it: what happens if you’re a financial entity using a product which has been sent to you, but the sender does not have a reliable and repeatable build system, and therefore the product you received is not the exact same as what was tested by QA and signed? Suddenly, you’re looking at a costly mistake. Fret not however; good build automation will save you from such an endeavour.</p><p>We employ the use of infrastructure as code (IAC) and configuration as code (CasC) to manage and deploy the infrastructure and configuration of the software in a consistent, automated way. This ensures that the environments used to build, test, and deploy the software are replicable, meaning that they can be deployed consistently and reliably in any other environment with the same configuration and settings.</p><h3>What is build engineering/DevOps in Build?</h3><p>One of the most common problems in software engineering is how to ensure your software is delivered in a reliable manner. You want to prevent issues as described above, to take the weight of building and deploying away from your engineers, and to adhere to best security practices.</p><p>That’s where build engineers step in! Build engineers are responsible for creating and maintaining the processes and tools that are used to build, test, and deploy software applications. This involves writing scripts and automation tools to automate the build and deployment process, setting up and configuring continuous integration and continuous delivery (CI/CD) systems, and working with other teams to ensure that the software build process is efficient and reliable. DevOps engineers within the build team at R3 are also responsible for the smooth deployment and maintenance of the services used by developers such as Artifactory, Jenkins instances, and whatever else may be needed.</p><p>One of the most common areas of attack of a company is the build pipeline, the CI/CD system. If we look at the recent incident where a American government’s no-fly list was leaked, this was done through a vulnerable Jenkins instance. Someone at a major US airline was running a Jenkins instance with anonymous admin access;, all the malicious actor had to do was scrape the credentials and then they had all they needed to access the no-fly list.</p><p>One of the jobs we are tasked with as DevOps engineers in <a href="https://r3.com/">R3</a> is to make sure that can’t happen. We need to make sure our pipelines are secure, locked behind VPNs, credentials obfuscated, amongst other security practices. We must do this while also still focusing on continuous development. In my eyes, having become a DevOps engineer relatively recently, our greatest strength is versatility.</p><h3>Infrastructure/Configuration as code</h3><p>In build engineering and DevOps, automation is the key to improving the reliability and efficiency of the build and deployment process. There are a variety of tools and techniques used to automate various aspects of the process, such as provisioning infrastructure, configuring applications, and deploying code. Some common tools and techniques for automating build and DevOps processes include:</p><ul><li>Infrastructure as code (IaC) tools, such as <a href="https://www.terraform.io/">Terraform</a>, are used to define and manage your cloud infrastructure in a declarative and version-controlled configuration file.</li><li>Configuration management tools, such as <a href="https://www.ansible.com/">Ansible</a> and <a href="https://www.puppet.com/">Puppet</a>, are used to define and manage the configuration of your applications and services in a declarative and version-controlled playbook.</li><li>Container orchestration tools, such as <a href="https://kubernetes.io/">Kubernetes</a>, are used to define and manage your containerized applications and their dependencies in a declarative and version-controlled configuration file.</li></ul><p>By using these tools and techniques, build and DevOps engineers can automate many of the repetitive and error-prone tasks involved in building and deploying applications, and can focus on delivering value to their users.</p><h3>Real World example — GitHub repo creation automation</h3><p>When I came into R3, I had an idea of an ideal world where repositories are created automatically based on service desk tickets and managed automatically with Terraform.</p><p>In my mind this would ensure proper etiquette; such as branch protection, required reviewers, CODEOWNERS, PR gates etc, is kept everywhere. When I brought this idea forward to my manager, it turned out it was something they had thought of but never implemented company-wide. And so, it ended up being one of the cooler projects I’ve recently worked on.</p><p>With the use of Terraform, Atlantis, and Jenkins, we implemented a system where once a user enters a ticket to request a new repository, the user responding to the ticket kicks off a Jenkins pipeline that creates a JSON file with the repo details, pushes this file to GitHub and opens a pull request. Atlantis then picks up the pull request and runs its plan; essentially just a Terraform plan. If we are happy with the proposed outcome of the plan, then the plan is applied, and the repository is created.</p><p>With this approach we can create template files with the github_repository_file resource.</p><pre>resource &quot;github_repository_file&quot; &quot;github_repositories&quot; { <br>  for_each = { <br>    for item in flatten([ <br>      for repo in github_repository.github_repositories : [ <br>        for key, value in local.standard_github_repository_files : { <br>          repository : repo.name <br>          branch : repo.default_branch <br>          file : value.file <br>          content : value.content <br>          commit_message : &quot;Adding basic ${key}&quot; <br>        } <br>      ] if !repo.archived <br>    ]) : &quot;${item.repository}:${item.file}&quot; =&gt; item <br>  } <br>  repository          = each.value.repository <br>  branch              = each.value.branch <br>  file                = each.value.file <br>  content             = file(each.value.content) <br>  commit_message      = each.value.commit_message <br>  overwrite_on_create = false <br>  lifecycle { ignore_changes = all } <br>}</pre><figure><img alt="Diagram of GitHub Automation workflow" src="https://cdn-images-1.medium.com/max/1024/1*67v1kAYS0r02KbFboo_HsQ.png" /><figcaption>GitHub Automation workflow</figcaption></figure><p>To create these files, define their location in the local.tf file. The process iterates through each referenced file, copying its content and creating the file in the repository.</p><p>For the keen-eyed out there, you may have noticed in the above code that lifecycle is set to ignore all changes. When we first implemented this automation, we not only created repositories but also tried to manage repositories. This proved problematic to say the least. The unknown factor that is “human interaction” proved to be detrimental to managing repositories! People would make changes that may have seemed trivial such as changing the default branch name. However, when terraform checked its state, suddenly, the branch protection seemed to be gone, the branch seemed to have been deleted, or other problems occurred. In short, Terraform couldn’t handle changes made outside of the state. (And for anyone who has had the displeasure of manually fixing Terraform state manually you have my condolences.)</p><p>After much deliberation, we decided, for all resources in the Terraform deployment, to ignore changes. Unfortunately, managing is not something that should be done automatically — yet! Instead, we now focus on creating repositories based on a template as described above.</p><p>My future work on this project will include creating a coherent set of security levels per repository and enforcing management through a non-automated repository. Pro-tip: if you manage more than a small number of repositories with a system like this, it ends up taking quite a while to check each repository’s state.</p><h3>Conclusion</h3><p>In conclusion, in this new world of DevOps and continuous development and integration not only are build engineers and DevOps engineers a necessity but so is automation! The more human error that can be removed from day-to-day tasks the better the development lifecycle becomes.</p><p>I look forward to continuing my journey down this path, and hope to see you back for my next appearance!</p><p>Learn more about the deployment of Corda <a href="https://corda.net/blog/corda-5-cloud-native-deployment/">in this blog post</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=587290bb985" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/build-devops-r3-operation-automation-587290bb985">Build/DevOps @ R3 — Operation Automation</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sandboxes in Corda 5 — Java Security Manager]]></title>
            <link>https://medium.com/corda/sandboxes-in-corda-5-java-security-manager-55dc95078fae?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/55dc95078fae</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Thu, 09 Mar 2023 11:05:34 GMT</pubDate>
            <atom:updated>2023-03-09T14:25:16.298Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sandboxes in Corda 5 — Java Security Manager</h3><p><em>By: Miljenko Brkic, Principal Software Engineer at R3</em></p><p>This article is a follow-up to the <a href="https://corda.net/blog/corda-5-sandboxes/">Corda 5 Sandboxes</a> blog post. It will explore in more detail how Corda 5 uses Java Security Manager to secure sandboxes.</p><p>Corda 5 supports multiple virtual nodes sharing a single Corda installation and multiple CorDapps (Corda distributed applications) running within the same Corda (JVM) process. This introduces the risk of one CorDapp interacting with another or with the Corda platform. That interaction could be unintended, like a simple dependency clash, but it could also be malicious. Sandbox is an execution environment within a JVM process that provides isolation for a CorDapp. It shields it from outside threats but it also restricts what it can do so that running potentially dangerous code cannot harm others.</p><figure><img alt="Tractor in Sandbox. Photo by Markus Spiske https://unsplash.com/photos/KU3lOAiP-tQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditShareLink" src="https://cdn-images-1.medium.com/max/1024/1*RnIdcy0m5U5-dPsMi9P3tg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/sandbox-kid?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>What is Java Security Manager?</h3><p><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityManager.html">Java Security Manager</a> protects applications against threats posed by running untrusted code. It was originally designed to protect users from potentially malicious Java applets downloaded from websites, which was similar to the threat that web browsers face today running JavaScript. While CorDapp writers trust their own code, they can’t trust CorDapps written by others, so Corda, as an application hosting platform, needs to treat CorDapps as untrusted code that could be malicious.</p><p>Security Manager acts as a gatekeeper, controlling access to sensitive resources (for example, accessing your local disk or local network) and ensuring that malicious code cannot compromise the security of the system. It enables administrators to define and enforce security policies within the JVM hosting Java applications. Administrators can specify exactly which resources an application can access and which actions it’s permitted to perform. For example, an application might be granted permission to read a file, but not to write to it or delete it.</p><h3>Security Manager key concepts</h3><p><strong>Security Manager</strong> permits access to sensitive resources. It is not enabled by default; instead, it has to be explicitly enabled (for example, using the −Djava.security.manager option). There can be only one global instance of Security Manager and it’s accessible using System.getSecurityManager(). When some running code calls a method on the Java API, requesting an operation be performed, the JVM will check with the security manager if this is allowed. An example of this would be the ability for a Java application to open an external connection over HTTP (such as connecting to a web host). If the administrator of the JVM has denied that ability, the application will receive an error. This introduces a separation between what an application is allowed to do at runtime vs at compile time, meaning an application may work within a less constrained environment and fail in a more constrained one.</p><p><strong>Access controller</strong> provides the basis of the default implementation of the Security manager.</p><p><strong>Code source</strong> is the location from which the class was obtained (for example, a web URL or JAR file).</p><p><strong>Permission </strong>represents access to a protected resource.</p><p><strong>Protection domain</strong> encapsulates the characteristics of a domain, which encloses a code source and a set of permissions granted to it.</p><p><strong>Security policy</strong> provides management of permissions in a configurable way. The default implementation uses text files, where each text block in a policy file defines a Protection Domain:</p><pre>grant signedBy &quot;r3&quot;, codeBase &quot;http://www.r3.com/&quot; {                // Code Source<br>    permission java.io.FilePermission &quot;/tmp&quot;, &quot;read&quot;;               // Permissions<br>    permission java.net.SocketPermission &quot;*:1024−&quot;, &quot;connect&quot;;<br>};</pre><h3>How Security Manager checks permissions</h3><p>Let’s take an example and see how Security Manager checks permissions. Consider a CorDapp that wants to read a file from a filesystem:</p><pre>// CorDapp<br><br>public readFile(String fileName) {<br>    InputStream inStream = new FileInputStream(fileName);<br>    ...<br>}</pre><p>It does this by executing the readFile() method that creates a Java API’s FileInputStream for reading. The constructor of FileInputStream will first check if there is a Security Manager; if there is, it will call its checkReadmethod:</p><pre>// FileInputStream<br><br>public FileInputStream(File file) throws FileNotFoundException {<br>    String name = (file != null ? file.getPath() : null);<br>    SecurityManager security = System.getSecurityManager();<br>    if (security != null) {<br>        security.checkRead(name);<br>    }<br>    if (name == null) {<br>        throw new NullPointerException();<br>    }<br>    ...<br>}</pre><p>Security Manager will then delegate permission checking to method checkPermission of the Access Controller:</p><pre>// SecurityManager<br><br>public void checkRead(String file) {<br>    checkPermission(new FilePermission(file,<br>        SecurityConstants.FILE_READ_ACTION));<br>}<br><br>public void checkPermission(Permission perm) {<br>    java.security.AccessController.checkPermission(perm);<br>}</pre><p>The diagram below shows all these methods on the call stack (on the left) and also related Protection Domains (on the right):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vRgdXPqOkD5JzcRLsAibA.png" /></figure><p>In order to determine whether this sensitive operation is allowed, Access Controller collects all Protection Domains related to the classes on the call stack. The operation is allowed only if all protection domains have the permission to perform it; otherwise, a SecurityException is thrown. System Domain has all permissions and permissions of other domains are defined via Security Policy.</p><p>There is an exception to this, which will be explained using another example. As an application platform, Corda also provides a number of injectable services to CorDapps. One of them is the JSON Marshalling Service, which depends on a third-party library that uses reflection. This means that a CorDapp should have reflection permission in order to use it. However, we want untrusted CorDapps to be able to use trusted platform services without the need to have special permissions.</p><p>That can be accomplished with a <em>privileged caller</em> that can perform a sensitive operation on behalf of class that doesn’t have the required permission. Access Controller provides the doPrivileged() method and when this method is found on the stack, it stops the further checking of protection domains.</p><p>The snippet below shows how the Corda JSON Marshalling Service uses doPrivileged() to enable CorDapps to serialize classes to JSON, without the need to have the required reflection permissions:</p><pre>// JsonMarshallingServiceImpl<br><br>override fun format(data: Any): String {<br>      return try {<br>          AccessController.doPrivileged(PrivilegedExceptionAction {<br>              mapper.writeValueAsString(data)<br>          })<br>      } catch (e: PrivilegedActionException) {<br>          throw e.exception<br>      }<br>  }</pre><h3>Security Manager and OSGi</h3><p>CorDapps running within sandboxes need to be isolated from each other. Classes used in specific CorDapps shouldn’t be visible to others. This is achieved using the OSGi (Open Service Gateway Initiative), which is a framework for developing and deploying modular Java applications. A unit of modularization” is called a <em>bundle </em>and is a Java archive file (JAR) that additionally contains a manifest that describes it and its dependencies.</p><p>The OSGi Security Layer is based on Java security architecture. In OSGi, Protection Domain is mapped to a bundle. A bundle’s permissions are handled through <strong>Conditional Permission Admin</strong>. OSGi adds several features to the Java security, including:</p><ul><li>OSGi specific permissions</li><li>Conditional permission management</li><li>Deny-access decisions</li></ul><h3>The Corda Security Manager</h3><p>Corda’s Security Manager adds permissions to Conditional Permissions Admin’s permission table using the bundle location as a condition. Bundles loaded for the specific sandbox type share the same location prefix, so this enables the application of different sets of permissions to different types of sandboxes.</p><h3>Disabling access to internal platform classes</h3><p>CorDapps have access to platform services via interfaces. Granting them reflection permissions could lead to various malicious exploits of platform classes that implement those services and compromise a sandbox. However, a CorDapp may depend on some public libraries that use reflection, and unfortunately, most public libraries don’t use reflection in a privileged call. That means that it’s not enough to grant reflection permissions only to the library: the CorDapp needs it as well. So the desired solution is to allow reflection but not over Corda internal packages.</p><p>That goal is achieved by allowing reflection but denying access to internal packages by using the <em>accessClassInPackage</em> permission. The Security Manager will check this permission only if a package name starts with a prefix defined for a security property <em>package.access</em>. This property is defined in the <em>java.security</em> file distributed with JVM (which can be replaced or overridden with a custom file) and can also be set with Security.setProperty().</p><h3>Configuring security permissions</h3><p>One of the best security practices is the principle of <em>least privilege</em>. It is a security concept of providing no more permissions than is necessary to perform the required job. Corda follows this principle, which means that CorDapps won’t have any permission granted by default.</p><p>However, some CorDapps might need certain permissions granted in order to do their job; for example, make HTTP requests to external services. Configuring permissions can be complex and requires a good understanding of Java security concepts. It’s also a very delicate task since granting permissions lowers sandbox security. For this reason, Corda security permissions are managed by Corda administrators via the configuration of security policy.</p><h3>Corda security policies</h3><p>Corda comes with a few predefined security profiles that can be used as provided or customized for specific needs. The strictest policy is applied by default, but a Corda administrator can override this policy if required.</p><p>Policies can have “allow” and “deny” access blocks. Each block starts with a condition that needs to be satisfied in order to apply that block. After that is a list of permissions that are either “allowed” or “denied” based on the block type.</p><p>Snippet below shows one deny-access block for Flow sandbox:</p><pre>DENY {<br>[org.osgi.service.condpermadmin.BundleLocationCondition &quot;FLOW/*&quot;]<br><br>(java.io.FilePermission &quot;&lt;&lt;ALL FILES&gt;&gt;&quot; &quot;read,write,delete,execute,readLink&quot;)<br>(java.lang.RuntimePermission &quot;getFileSystemAttributes&quot; &quot;&quot;)<br>(java.lang.RuntimePermission &quot;readFileDescriptor&quot; &quot;&quot;)<br>(java.lang.RuntimePermission &quot;writeFileDescriptor&quot; &quot;&quot;)<br>(java.net.SocketPermission &quot;*:1−&quot; &quot;accept,listen,connect,resolve&quot;)<br>(java.net.URLPermission &quot;http://*:*&quot; &quot;*:*&quot;)<br>(java.net.URLPermission &quot;https://*:*&quot; &quot;*:*&quot;)<br>(java.lang.RuntimePermission &quot;accessDeclaredMembers&quot; &quot;&quot;)<br>(java.lang.reflect.ReflectPermission &quot;suppressAccessChecks&quot; &quot;&quot;)<br>(java.lang.reflect.ReflectPermission &quot;newProxyInPackage.*&quot; &quot;&quot;)<br>...<br><br>} &quot;High security profile for FLOW Sandbox&quot;</pre><h3>Summary</h3><p>This article provided more details about Security Manager and how it is used in Corda 5 to securely run user code within sandboxes. Security of sandboxes also relies on OSGi that is used to load bundles and control visibility between them. We will follow up with another article about how we use OSGi in Corda 5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55dc95078fae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/sandboxes-in-corda-5-java-security-manager-55dc95078fae">Sandboxes in Corda 5 — Java Security Manager</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Being Non-Technical in a Technical Department]]></title>
            <link>https://medium.com/corda/being-non-technical-in-a-technical-department-3819f89305b7?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/3819f89305b7</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 13:57:48 GMT</pubDate>
            <atom:updated>2023-02-27T13:57:48.033Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By: Steph Paine, Corda Business Unit Operations Coordinator at R3</em></p><p>The opportunity of moving to a new department is often an exciting thought for many, but for me it came with a level of doubt. Business Resources, the central admin and support team to the Engineering team is like going from a small, fun outgoing team to what is seen by many from the outside, a large super smart, tech focused introverted closed division of the business.</p><figure><img alt="Top view of group of people sitting together at table." src="https://cdn-images-1.medium.com/max/1024/1*tXlZdFxkGs9PHV71GX5H0g.jpeg" /></figure><h3>How to make a difference</h3><p>The Engineering team is made up of over 150 people but unfortunately a less than 20% female representation, a department full of extremely intelligent and gifted people, what did I have to offer this team? I know very little of coding, nodes, Kubernetes, clusters; but I am a practical, organized individual, I understand people, and this is what I was told that I could bring to the role and the department. This was an exciting opportunity to grow, to learn but also to make a tangible difference.</p><p>Looking at the job description was a bit daunting — the importance of the need to drive and improve engagement and development of teams and people was evident. The <a href="https://corda.net/">Corda</a> business unit (BU) had recently been a victim of the ‘tech boom’, lots of people had left to explore new ventures and opportunities and those remaining were feeling the pressure.</p><h3>Overcoming challenges and knowing how to contribute</h3><p>Six months in and I really don’t know what I was worried about. I have had to overcome some challenges, the biggest one was creating myself work. In my previous role the work had always come to me, I was dealing with requests and reacting to situations. In this role there was of course tasks that end up in your lap but a lot of it has been seeing an issue and creating yourself a project and executing a solution. This is a different way of working for me but something that I think I have excelled at.</p><p>Yes, sometimes I sit in on meetings, and I can get lost but it’s okay, there is no better way to learn than be emersed in the conversations. My role isn’t to understand the technical stuff it’s to drive processes and find ways of working that can be improved. To gap fill where we are perhaps missing some guidelines and bring a different view.</p><p>Being a workplace Mental Health First Aider (MHFA) has allowed me to bring soft skills to the role. I feel I can use my instincts to know what kind of initiatives will bring about positive reactions and outcomes for my team. I have been described as a ‘consistent champion for team building and for the promotion of wellbeing in the team’. Something that can often overlooked as important but as someone who was worked in management and business a lot longer than me once said “software is a people business”.</p><h3>Leveraging soft skills to improve a technical department</h3><p>The biggest task I was set when I came to the role was look at the BU’s results from the mid-year engagement survey and look at the areas where we scored low and find some ways to improve what was being done (or not being done). I quickly identified three areas where we were struggling to meet expectations and those were: Engagement, Communication and Career Paths. This is where I was to bring my soft skills, previous role experience and new ideas to the table, working with others I knew I could influence some real change.</p><p>The first thing I identified that we needed to do was implement structure to our communications. We now have a regular monthly All Hands for the entire BU, a successful blog pipeline and several interesting Tech Talks that we host on a Thursday when we know we will have the most amount of people in the office to attend in person. Regular and reliable communication drives engagement.</p><p>Career progression was a much harder issue to address, mostly because everyone sees their pathway differently. Learning isn’t always work or fact based it can be personal development and R3 has always made it clear we support both. In the end the Leadership team agreed to implement a dedicated learning day for the BU. Now every third Friday of the month its booked in everyone’s calendar to remind them to utilize the learning platforms to undertake the courses/talks/exams that they want to in order to improve their knowledge.</p><p>We have seen definitive improvement in these areas in the feedback we have received recently and that is personally very gratifying. There is still a long way to go and other areas of focus going forwards, but I can honestly say that this improvement wouldn’t have been seen without someone whose dedicated role encompasses these tasks.</p><p>Some people might think this would be a solitary job but far from it. I am in the office most days; it wasn’t a requirement of the role, but I think there is a benefit to being present for the department. I am not part of any specific team (I am literally a lone branch on our BU org chart) but I literally get to float around teams constantly. If I organize a lunch for one small team or an after work social for another I am normally invited along, perks of the job 💁🏼‍♀️.</p><h3>Grab the opportunity and make an impact</h3><p>Looking back on when this chance was first offered to me nearly a year ago now the fear I had at that time has long gone, time really does fly when you are having fun and engrossed in making an impact. You aren’t offered opportunities if people don’t think you are the right person for it. Sometimes it takes a little pushing, but it will all be worth it in the end.</p><p>I hope that I have proved that there is a need for all types of workers in a software company. R3 is brilliant, and I would highly recommend it as a place where you will enjoy and feel proud to work. If this sounds like a bit of you check out our website with a variety of open roles: <a href="https://www.r3.com/careers/#job-openings">Job postings</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3819f89305b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/being-non-technical-in-a-technical-department-3819f89305b7">Being Non-Technical in a Technical Department</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notaries in Corda 5: Architecture]]></title>
            <link>https://medium.com/corda/notaries-in-corda-5-architecture-51737332474f?source=rss-309e832dbd94------2</link>
            <guid isPermaLink="false">https://medium.com/p/51737332474f</guid>
            <category><![CDATA[distributed-ledgers]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[The R3 Team]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 10:24:08 GMT</pubDate>
            <atom:updated>2023-01-19T11:02:47.436Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Ramzi El-Yafi, Staff Software Engineer at R3.</em></p><p>In our <a href="https://www.corda.net/blog/notaries-in-corda-5-an-overview/">previous blog post</a>, we discussed what a notary is, and why it plays a fundamental role in securing Corda’s UTXO ledger. In this blog post, we delve into the details of the notary architecture in Corda 5, delivering a solution which allows new notarization protocols to be introduced with ease, whilst also allowing finer-grained scaling of notarization resources, reducing total cost of ownership.</p><h3>Key concepts</h3><p>To begin with, let’s explain some key notary concepts in Corda 5, which are fundamental to understanding how a notary operates.</p><h4>Notarization and uniqueness checking</h4><p>Broadly speaking, notarization in Corda is formed of two parts. The first part is a flow protocol, in which a client virtual node requesting notarization establishes a session with a notary virtual node, which then performs protocol specific validation. The second part is uniqueness checking, which is fixed function logic that guarantees the integrity of the UTXO ledger by preventing double spends. The second part of the logic is invoked as part of the flow protocol.</p><p>This split can be observed in the notarization protocols of previous Corda versions. The non-validating and validating notary protocols differ in terms of the validation performed by the flow protocol, with the non-validating protocol performing only minimal checks to ensure that a transaction’s structure is correct, whilst the validating protocol performs contract validation against the full transaction back-chain. What these protocols have in common is that they both invoke the same uniqueness checking logic to prevent double spends.</p><p>This functional separation is retained in Corda 5, but is now better reflected in our underlying architecture, leading to a clear separation of responsibilities. We will explore this in more detail later.</p><h4>Notary protocols</h4><p>Corda 4 supports two notarization protocols — validating and non-validating. The choice of protocol is made on a per-notary service basis by a network operator, and is done by specifying a Boolean flag as part of the notary definition in configuration. These protocols are hard-wired into the Corda 4 runtime, and it is not possible to define a different protocol.</p><p>Corda 5 takes a different approach, by defining notarization protocols as “plugin” CorDapps. These plugins take the form of a “client” component, which is bundled as part of “application” CorDapps, and contain an initiating flow to make a notarization request to a notary. A “server” component is installed as part of a notary CorDapp, which lives on notary virtual nodes, and contains a responder flow to process the notarization requests. This process means that unlike in Corda 4, CorDapp developers and notary operators need to make decisions about which notary protocol(s) they wish to support. However, the network operator still has the final say in these decisions, as they must decide which virtual nodes and notary services they will allow on the network. We will cover these topics in more detail in a subsequent blog post.</p><p>As previously mentioned, the MGM maintains information that links a notary service to a specific notarization protocol. This information is signed by the network operator, and then distributed to network members. This allows the appropriate protocol to be selected by virtual nodes at notarization time.</p><h4>Notary services and notary virtual nodes</h4><p>It is worth explaining what a notary service is, and how this differs from the notary virtual nodes that represent the service. The Corda 5 model for notaries is similar to the <a href="https://docs.r3.com/en/platform/corda/4.9/enterprise/notary/ha-notary-service-overview.html#notary-high-availability-mode">High Availability Notary mode</a> available in Corda 4, with a few differences.</p><p>In Corda 5, notaries are always referenced using a <em>notary service</em> x500 name. Effectively, all notaries are treated as though they were high availability notaries in Corda 4. This means that CorDapps request notarization by specifying a notary service x500 name. The Membership Group Manager (MGM) defines the notary services that are available on a network by broadcasting each notary service’s x500 name, as well as the notary protocol supported by the service, and the notary virtual nodes that act as representatives for the notary service.</p><p>Notary virtual nodes are similar to regular, “application” virtual nodes; they are registered on the network, run flows, have their own databases, keys, x500 name, and holding identity. The only difference is that these virtual nodes run a special notary-specific <a href="https://corda.net/blog/introduction-to-corda5s-cordapp-packaging-model/">Corda Package Installer</a> (CPI) that contains a different set of flows to the application (non-notary) virtual nodes, allowing these virtual nodes to respond to notarization requests. We will go into more detail about notary application packaging in a subsequent blog post.</p><p><strong><em>NOTE: For clarity, we will continue to refer to non-notary virtual nodes as “application” virtual nodes throughout this blog post.</em></strong></p><p>Imagine a network with three application virtual nodes — Alice, Bob, and Charlie. There is also a single notary service on the network, with two notary virtual nodes representing the service. Such a network may appear as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZirpuDhuamN5Yd8CBTFug.png" /></figure><p>We will cover how messages are resolved from a notary service to a representative later on.</p><h4>Multiple virtual nodes in a high availability world</h4><p>If you have read the blog post on <a href="https://www.corda.net/blog/high-availability-in-corda-5/">High Availability in Corda 5</a>, one may ask why we continue to use a notary service abstraction to allow multiple virtual nodes to represent a notary service, given that a single virtual node is itself highly available in Corda 5. Typically, we may expect that there will be a single virtual node representing a notary service, and indeed this will be the only option for the Corda 5.0 release. However, maintaining this abstraction allows for a notary service to be provided by multiple Corda clusters in different geographical regions, providing even greater resiliency.</p><h3>The life of a notary</h3><p>Now that we have explained the key notary concepts in Corda 5, let’s take a look at the lifecycle of the notary. This can be broadly split into the following stages:</p><ul><li>Creation of virtual nodes that will represent a notary service</li><li>Network registration</li><li>Servicing of notarization requests</li></ul><p>Let’s look at each of these in turn.</p><h4>Virtual node creation</h4><p>As previously mentioned, notary virtual nodes behave in much the same way as application virtual nodes. The mechanism for creating a notary virtual node is the same as that of an application virtual node, with only two minor differences:</p><ol><li>They are associated with a notary CPI instead of the application CorDapp CPI.</li><li>They have an additional “uniqueness” database, which stores data relating to unspent and spent states on the network. Unlike other virtual node databases, this database is shared across all notary virtual nodes representing a notary service, to ensure they have a consistent view of states on the network.</li></ol><p>Returning to the example network setup we discussed earlier, this network would appear as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*DJxBRWV0il_2jrO1ygdIWw.png" /><figcaption>The relationship between our example network virtual nodes, CPIs and databases</figcaption></figure><p>Each database listed above may not necessarily be a different physical database; they may be different schemas within the same physical database.</p><p>Note that at this point, we have only talked about notary virtual node creation, not notary services. Notary services come into play as part of network registration.</p><h4>Network registration</h4><p>Registering a notary virtual node follows the same process as that of an application virtual node. However, several additional pieces of information are provided in the context of the registration request:</p><ul><li>&quot;corda.roles.0&quot; : &quot;notary&quot; - This flags the virtual node as taking the role of a notary on the network.</li><li>&quot;corda.notary.service.name&quot; : &lt;x500 name&gt; - This is a user-specified x500 name for the notary service that this virtual node will represent. This is the name that will be used by CorDapps when specifying which notary to use for notarization.</li><li>&quot;corda.notary.service.plugin&quot; : &lt;protocol name&gt; - This is the name of the notary protocol that the service supports. This effectively replaces the validating Boolean flag in Corda 4, and allows flexibility in writing new notary protocols going forward. We will discuss this in more detail in a future blog post.</li></ul><p>Effectively, the notary service is a concept that exists only in network metadata; the notary service springs into life once the first notary virtual node representing a notary service has its membership request approved. At this point, the notary service appears in network membership information, and can be used by the application CorDapp in notarization requests.</p><h4>Requesting notarization</h4><p>Once a notary service is visible to the network, an application requests notarization in much the same way as it did in Corda 4; when invoking finality logic, the CorDapp specifies the notary <em>service</em> it wishes to use for notarization. At this point, the Corda flow framework has two decisions to make:</p><ol><li>Which notary protocol to use.</li><li>Which virtual node to send the request to, given that the messaging layer (P2P) only understands virtual nodes, and not notary services.</li></ol><p>Both of these decisions are handled transparently by Corda, and require no intervention by a CorDapp developer. Selecting the notary protocol is straightforward; the application CPI will contain notary client CPKs for the protocols the application supports. When notarization is requested, the client node looks up the MGM metadata for the notary service, and searches for the notary client CPK that matches the specified protocol, which is then invoked.</p><p>Virtual node selection is similarly straightforward. The MGM metadata also contains the list of notary virtual node representatives for the notary service. These are selected in a round-robin fashion, with the initiating node requesting notarization sending flows to the selected notary virtual node, which will then start its corresponding responder flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzYCcZ-3_sZk-xw2tcQNuw.png" /><figcaption>A summary of the workflow for requesting notarization, through to the request being accepted or rejected</figcaption></figure><h4>Request processing</h4><p>The responder flow which runs on the notary virtual node does not initially do anything special; it can perform whatever logic it likes, as a normal responder flow would. In the case of the non-validating notary protocol, this logic is minimal and simply performs sanity checking of the integrity of the transaction that was received. Once this logic has been performed, the flow then invokes uniqueness checking functionality, which amongst other things, checks to ensure no input states on a transaction have already been spent, and will only spend them if all uniqueness checks pass.</p><p>In Corda 4, uniqueness checking is performed against batches of transactions in a separate thread to flow processing, in order to improve performance by reducing the number of round trips to the database. This batched approach remains in Corda 5, but the implementation is somewhat different. Rather than running a separate thread, uniqueness checking is handled by a dedicated <em>uniqueness processor</em>, which lives as part of the database worker. A notarization flow requests uniqueness checking by invoking a service which places messages on the Corda message bus, which are then picked up by a uniqueness processor.</p><p>A uniqueness processor will pull a batch of requests from the message bus. Unlike Corda 4, these requests may be from different notary virtual nodes, representing different notary services. To cope with this, the uniqueness processor will partition each batch of requests into sub-batches based on the notary virtual node that made the request, ensuring that the correct uniqueness database is used for each notary virtual node, and that there is appropriate data segregation between different services. The responses are placed back on the message bus to be picked up by the flow. The flow will then sign successful notarization requests with its notary key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*ZeG-lNrfRzvRD-gyUxba7A.png" /><figcaption>How requests for different notary services are partitioned. Each color represents requests for a different service.</figcaption></figure><p>This approach has a couple of benefits. Firstly, it ensures proper separation of responsibilities; the uniqueness processor has exclusive access to a notary virtual node’s uniqueness database, but no keys or access to the other databases. Secondly, this allows flow and uniqueness resources to be scaled independently; if we are running a heavyweight notary flow protocol that is resource intensive, we can scale up the number of flow workers whilst running a modest number of database workers. If the reverse is true, we can instead scale up the number of database workers. We may even choose to separate out the uniqueness processor into its own worker if such a setup would be beneficial to performance. In the diagram above, we see an example of a single uniqueness processor handling requests from multiple flow processors.</p><h3>Summary</h3><p>In this post, we have explained the new notary architecture in Corda 5, and provided a rationale for the changes that have been made. In the next blog post in this series, we will go into more detail on the notary plugin CorDapp architecture, and discuss what this means for CorDapp developers and network operators.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51737332474f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/notaries-in-corda-5-architecture-51737332474f">Notaries in Corda 5: Architecture</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>