At R3, we have been working hard to build the next generation of DLT, and these design choices have informed every step of our work on Corda 5. We have just released the Corda 5 Developer Preview I (Corda 5 DP1). This blog will tell you what is available in it, why we have made these changes and a high-level overview of the various functionalities we are adding in the subsequent previews leading up to the release of Corda 5 General Availability (GA). We also want to tell you why we have made these changes.
Why are we releasing Developer Preview?
We want your feedback. We heard you, and are building Corda 5 to address your concerns. Corda 5 is a complete redesign of Corda 4 – and we are building it for you. Tell us what you think, and we will make sure we are on the right track. To ensure we are acting on all your feedback, we have created a Corda 5 feedback channel where our developer relations, product, and engineering teams will address all questions from our dedicated Corda 5 community platforms. Your feedback will be considered in later developer releases. You have a chance to contribute to building Corda 5.
Compatibility of Corda 5 DP with Corda 4.x
In the current versions of Corda 4.x, we use Java 8 and Kotlin 1.2, which run to the end of its support. In Corda 5, we are doing a major upgrade of third-party dependencies (Java 11 and Kotlin 1.4). Therefore, Corda 5 releases are not compatible with Corda 4.x, which means you cannot have CorDapps 4.x and CorDapps 5 on one network. You need to have two separate networks, one with CorDapps 4.x and the other with CorDapps 5. We will promise APIs stability after Corda 5 General Release is out, but during the Developer Previews releases, we reserve the right to change them. Our new APIs are not completely stable, and we are hoping you will try them out and provide us with valuable feedback.
This Developer Preview is not open source because the code base will completely change in the production-ready release Corda 5.0 (you can download artifacts here). But the Confidential Identities and Tokens SDK will be open source. The Developer Preview has been designed as an opportunity to review the APIs and build the CorDapp POC. We don’t advise going to production with it.
What’s in the Box?
The following are the main features and functionalities that are coming up in Corda 5 DP1:
A new set of APIs
With Corda 5, we are moving to the layer cake approach of Corda development, APIs are split into layers, so developers deal with the complexity they need in their CorDapps.
With Corda 5, the APIs are modular allowing Corda development to be built in layers. This allows Cordapp developers to test applications more effectively and build Cordapp suited for their use case more appropriately – watch out for more on this topic in some upcoming blogs.
And for this, we are introducing a new set of modular APIs, with the primary aim to speed up the process of writing and testing CorDapps for our developers. The modularity aspect gives flexibility for choosing components.
The main advantage is that interface-based APIs and implementations are separate. In the “New Modular APIs” post, we will tell you why we made these design decisions and the implications.
HTTP RPC API
In Corda 4.x, developers needed to build their own HTTP RPC clients to connect to external systems written in other languages. In Corda 5, the HTTP RPC API allows language-agnostic interactions with a Corda instance ( or node in Corda 4.x), so developers no longer need to introduce a middleman into their applications. It replaces the Artemis RPC client that we had in Corda 4.x., and it supports OpenAPI and single sign-on features. Learn more about how to use this API, start flows, get their results and list out available flows in the blog: https://www.corda.net/blog/corda-5s-new-http-rpc-api-for-node-interaction/
Why do we need different packaging? To allow CorDapp isolation and distribution, and further down the line to enable multitenancy. We want to make running a Cordapp as easy as possible. This is why we have changed Corda to be a hot loadable host for the packages that automate the onboarding to a network. The packaging will also allow isolation, and further down the line to enable multitenancy.
In Corda 4.x, to get into the network, you have to run the certificate authority, have your own custom PKI, and run CENM. We are simplifying permissions in Corda 5. You can run CorDapp as a peer network, use third-party Certificate Authority and roll out your certificates. Corda 4.x custom x509 PKI is no longer needed. You can also define your own rules for your application network.
In order to simplify permission, we put Applications first. We moved away from nodes towards identity agnostic clusters, where you can install your CorDapps. We redefined what a CorDapp is and its components. We are introducing a new 3-layer packaging format: CPI, CPK, and CPB:
- Corda Package Installer, CPI – is a set of meta-information about the rules of the application. CPI contains information to get into a network map (CPI is not released in Developer preview).
- Corda Package, CPK – are .jar files that encapsulate the uniqueness of the software. CPK eliminates dependency clashing that was Corda 4.x – each CPK is a unique sandbox.
- Corda Package Bundle, CPB – is a way to package a CorDapp in Corda 5. CPB is a deployable, unit-testable, and network-agnostic entity with context and meaning.
CorDapp 5 walkthrough
In this blog, we will walk you through the Solar system corDapp written in Corda 5. You will learn how effortless and intuitive it is to build transactions and write tests using new modular APIs. You learn how fast and efficient it is to issue tokens using the updated Tokens SDK.
Tooling: Corda CLI, Node CLI, Swagger UI
We want to increase developer productivity by releasing utility tools and continue enhancing them in later releases.
From the Corda CLI – solve multiple problems using one solution | Corda blog, you will learn about
- The corda-cli – a utility tool to deploy and manage networks, you will learn its commands and subcommands and how to configure a network via .yaml files.
- Corda node-cli – a way to interact with a node
- In Corda 5 DP1, instead of .jar files, we deploy CPK files. We have written a gradle cpk utility to package CPK files and gradle cpb utility, to repackage CPK files into CPB.
In future releases, we will unify these three tools into one with a common syntax and add support of Kubernetes for remote deployments.
Corda 5 will be a hosting environment that has worker clusters that host a series of virtual nodes. A virtual node is an on-demand compute sandbox.Corda 5 will be multitenant. We are moving away from the Corda 4.x node, representing a single identity with a ledger key. In Corda 5, you will be able to create any number of identities that are reachable by RPC; each identity is associated with a CPI, meaning it has joined the network.
Corda 5 architecture will be made up of multiple worker clusters. It provides horizontal scaling for flow processing – processing evenly (in theory) among workers, which can be hosted by independent hosts, or VM or cloud. The Kafka event streaming platform handles work distribution, which provides High Availability (HA) deployments. The new name for the Corda instance in Corda 5 is the worker cluster. Each worker processes some proportion of a load,
which is dynamically distributed. This means we meet hot-hot processing requirements and allow us to use cloud technologies for resizing on demand. And in periods of idle time, you can scale back on workers.
In Corda 5, we have a new peer-to-peer gateway based on HTTPS. It replaces the Corda firewall from Corda 4.x. This solution was actioned due to the feedback we received from security and deployments teams about peer-to-peer connectivity and the Corda firewall in Corda 4.x.. We use TLS 1.3 encryption and standard web certificates. On top of that, there is an end-to-end authentication layer using published security protocols.
Corda 5 Architecture
Kafka Broker clusters will be at the center of Corda 5. Kafka is an industry standard, and all cloud providers support Kafka to some extent. Kafka is the basis for horizontal scaling and hot-hot availability.
There will be subsequent Developer Previews. Production-facing features will be in the following previews: high availability, multitenancy, dynamic configuration, and administration. In Corda 5 DP1 you get new APIs, CPB/CPK support, new HTTP RPC, and sandboxing. We will be offering more information on what is coming next. Be sure you contribute to Corda 5 by leaving your feedback.
Where to leave feedback?
The community forum: community.r3.com is a great place to communicate with us and other fellow developers.
Our docs.r3.com has the “leave feedback” button.