ex-cbdc
ex-cbdc copied to clipboard
Reference Application: Central Bank Digital Currency (CBDC)
- Overview
-
Getting Started with Sandbox
- Installing
- Prerequisites
- Starting the App
- Stopping the App
- Resetting the Prototype
- Resetting the Prototype with the Experimental Reset Service
- Getting Started with Daml Hub
- Getting Started with Canton
- Running the Demo
-
Notes for Developers
- Model
- Debugging with Navigator
Overview
Refer to the User Guide for details on the features shown in this application along with detailed instructions on running the demo.
The demo shows how Daml supports core features of CBDC, addressing these key requirements:
- Tracking: Daml supports auditing and tracking transactions and storing contracts along with the history of each transaction. Observers of a Daml contract can be customized to allow for more transparency and visibility.
- Controls: An authority controls who can own money at a programmatic level, for example, to comply with restricted lists (e.g., OFAC).
- Safety: For simple or complicated transactions, Daml can establish specific rules for money transfers that must be met atomically (e.g., all steps must be successful) for the transaction to occur.
- Interoperability: Daml would permit a CBDC system to bridge different ledgers and technologies.
Getting Started with Sandbox
Installing
Disclaimer: This reference application is intended to demonstrate the capabilities of Daml. We recommend that you consider other non-functional aspects, such as security, resiliency, recoverability, etc., prior to production use.
Prerequisites
- Daml SDK
- Make
- Python 3
- Node v14
Starting the App
-
To build the App, enter:
make build
Notes:
- If you change the DAML models locally, you need to re-run this command before starting the application.
- See the Makefile for other available targets.
-
Use separate terminals to launch the individual components:
launchers/sandbox launchers/jsonapi launchers/automation launchers/ui
-
Use the following script to initialize the ledger:
launchers/populate
The demo will run at http://localhost:3000
Stopping the App
- Stop the every running command by pressing Ctrl+C.
Resetting the Prototype
To reset the application:
- Stop the app by following the steps in Stopping the App section.
- Start the app by following the steps in Starting the App section.
Resetting the Prototype with the Experimental Reset Service
Note: we only provide reset instructions for Sandbox. It can easily be configured for any other infrastructure.
-
Start the reset service. Use the adequate party-participant configs. For example when working with Sandbox use the following:
launchers/resetService parties.json default_participant_config.cfg
Note: the
parties.json
file is created when the ledger is initialized. -
Click on the Reload button.
Getting Started with Daml Hub
-
Create a project and a ledger on Daml Hub
-
Add the parties to the ledger
- Alice
- BankA
- BankB
- DemoAdmin
- ECB
- Landlord
- LandlordsAssociation
- USFRB
-
Download
participants.json
from the ledger settings to the ui folder -
Download the
parties.json
from the users tab to the ui folder -
Build the DABL version of the project
make daml-hub-package LEDGER_ID=[Ledger ID]
The ledger ID can be found on the ledger settings.
-
Upload the artifacts and deploy them to the ledger
- testing/.daml/dist/testing-1.0.0.dar
- triggers/.daml/dist/triggers-1.0.0.dar
- reset/.daml/dist/reset-1.0.0.dar
- ui/cbdc-ui.zip
-
Run the ledger setup
scripts/ledger-setup.sh ui/participants.json ui/dabl-parties.json --json-api
The demo will run at the location provided by Daml Hub.
Getting Started with Canton
Make sure Canton is installed and canton
can be found in the PATH.
Launch Canton and wait until it fully starts in order to have the generated configs:
launchers/canton/ledgers
After you see the message Welcome to Canton!
, launch everything else:
launchers/canton/populate && launchers/canton/automation
launchers/canton/jsonapis
launchers/canton/ui
The demo will run in http://localhost:3000
Running the Demo
Refer to the User Guide for instructions on running the demo.
Notes for Developers
Model
For each DVP, the model creates a dedicated a settlement rule and an instruction. The DVP ID assumes that there can only be USD-EUR trades. Settlement rules also have IDs based on the master agreement. See the Daml templates for details.
Debugging with Navigator
Visualization using Navigator (development UI):
daml navigator server localhost 6865 --port 7500
Then open http://localhost:7500.
CONFIDENTIAL © 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. Any unauthorized use, duplication or distribution is strictly prohibited.