CBDC Sandbox Testing Case Study
Central bank digital currencies (CBDC) represent a digital form of a country's fiat currency issued by central banks or monetary authorities. As a digital version of bank notes, they provide a risk-free alternative to private bank deposits.
R3, a leading provider of enterprise technology and services (https://www.r3.com/), has developed the R3 Sandbox for Digital Currencies – the platform that combines distributed ledger technology (DLT), guided learning paths from industry experts, and a ready-made digital currency network in a single environment to enable the issuance, management and distribution of CBDCs (Central Bank Digital Currencies).
The Digital Currency Sandbox is an R3-managed SaaS offering powered by Corda.
The first release of the R3 Sandbox for Digital Currencies provides an environment for users to explore the possibilities of a distributed ledger technology solution for Central Bank Digital Currencies in a wholesale setting.
The Sandbox provides the power and security needed for transactions between central banks, wholesale banks, and other financial institutions.
Exactpro provides independent software testing services for mission-critical technology that underpins global financial markets. The firm is experienced with trading, clearing and settlement platforms, risk management systems, central data warehouses, accounting and treasury systems, regulatory reporting. Exactpro’s area of expertise spans functional and non-functional testing, as well as testing at the confluence of functional and non-functional requirements. Exactpro’s DLT-related projects include large-scale initiatives in Australia, Switzerland, UK and US.
In this case study, we will focus on the approaches for functional testing of the CBDC solution. Please note that whilst the first release of the Sandbox does not allow for complete Non-Functional Testing (NFT), Exactpro are happy to discuss our recommendations for testing in this area. If you are also interested in our Non-Functional Testing approach, you may visit our website or contact us at firstname.lastname@example.org.
CBDC Sandbox Test Requirements
In the Sandbox, a user can deploy their own private network to act as a central bank or any of the three wholesale banks. This preconfigured network contains 6 nodes. One node for the Central Bank, one for each wholesale bank, and two notary (consensus) nodes that are governed by the central bank.
As a Central Bank, you can define and issue assets to Wholesale Banks on your network. You control access to the assets you create using Member Access States. You can also approve or deny requests from Wholesale Banks to exchange bonds for CBDC.
As a Wholesale Bank, you can request to exchange bonds for CBDC if you have the correct Member Access State. Once you have the CBDC asset, you can execute push transactions, pull transactions, redemption requests, and DvP and PvP transactions.
Exactpro Test Automation Approach
To connect to the R3 Sandbox in order to send requests and process the corresponding responses, Exactpro used its bespoke test tool – th2.
th2 has evolved out of the Exactpro test tool suite that – over the past 11 years – has established itself as a go-to toolkit across half of the top 20 global systemically important financial market infrastructures.
Test Automation Framework
- Delivers end-to-end automated functional and non-functional testing of complex financial systems
- Enables intelligent interaction with many widely adopted network protocols as well as API, UI, DLT and cloud endpoints
- Executes sophisticated test algorithms
- Collects and processes distributed test data (for machine learning and other purposes)
- Performs model-based testing and analyses the behavior of systems under test
- Integrates with a variety of widely adopted test tools and frameworks via its open interface
- Is an open-source solution; th2 source code is available on GitHub
th2 represents the next generation of automated testing platforms. We believe its usage will eventually transform the way firms approach their functional and non-functional testing processes. The framework is successfully implemented on the majority of our projects, and we continue developing further use cases with our clients and partners.
Platform and Technology Agnostic
Customised for Financial Systems
Unified Data Warehouse
Deliberate Practice of Software Testing
Strategic Data Acquisition
Pervasive Automation Opportunities
Case study – Functional Testing for the R3 CBDC Sandbox
th2 enables the testing of the entire message flow between the central bank and wholesale banks, including positive (production-like) data testing.
th2 also made it possible to automate and execute test scenarios covering a complete business end-to-end cycle via initiating necessary flows, such as:
- define a new digital currency token
- issue an amount of token to themselves or another party
- move an amount of token to another party
- redeem an amount of token
The above is implemented via sending/receiving REST API requests.
Each request that a user initiates via a test script goes through the following steps inside the th2 test framework:
- th2 takes data (action and necessary parameters) from the corresponding step from a test script and sends it to the internal th2 component where a message will be constructed.
- This message then goes to a component which encodes it to an http request in the REST API format.
- This request will be sent through the defined connection to the test system. th2 captures the response from a test system in order to verify that in a separate component (check1), where the actual received response will be compared to the expected result pre-defined in a test script.
Case study – CBDC Sandbox Business Flows
Exactpro successfully automated and tested the following business flows:
1. Issue and Redeem CBDC asset (token)
2. Request Member Access and CBDC token
3. Cross Chain Atomic Swap (PVP – Payment Versus Payment)
4. Transfer CBDC Token between Two Banks (DVP – Delivery Versus Payment)
5. Double Issuance of CBDC Token (Negative Scenario)
Automated Test Library Components and Structure
R3-Corda-CBDC.py (Test library)
- Test scripts written in Python
- QA works with a local repo on their Workstation
- Run tests via IntelliJ IDEA
- Generate Custom reports
Test Case structure
- import th2 Python libraries
- import support functions
- import script_builder
- define scenario
- Call step1
- Call step2
- Call stepN
- define step1...N
- send request
- verify response
- сall scenario