Reference Application: KYC Data Service
Overview
This application demonstrates the lifecycle of KYC (Know Your Customer) data subscriptions. Financial institutions can acquire licenses to subscribe to data streams, periodically receiving tailored research on their customer. The research is configurable, and the institution can select the components of interest to include in the research. Until the license expires, they can observe live data streaming or report issues such as performance outage or stale data streams.
Getting Started
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
Be sure you have the following installed:
- DAML SDK
- Java
- Maven
- Make
- Python Pipenv
Build the App
Type:
make build
Note: If you change the DAML models locally, you need to re-run this command before starting the application.
Starting the App
Note: Make sure you have built the application (see: Build the App).
These commands start the application with wall clock time. Note that Navigator's time widget won't work in this mode as one cannot modify the time.
- Start the DAML Sandbox and Navigator. Type:
The navigator will automatically open in new browser tab at http://localhost:7500.
launchers/sandbox+navigator
- Start the automation logic (triggers). Type:
launchers/populate+automation
Stopping the App
- Stop the triggers by typing Ctrl+C.
- Stop the Sandbox and the Navigator by typing Ctrl+C in the DAML assistant.
Resetting the Prototype
Reset the application by following these steps:
- Stop the app by following the steps in Stopping the App section.
- Start the app by following the steps in Starting the App section.
Working with DAML Hub
- As a first step, build the whole project:
make clean build
-
Start a new project at DAML Hub. Upload the DARs to DAML Hub (in your new project, Deployments tab / Upload file, two files
target/know-your-customer*.dar
), deploy the model (know-your-customer.dar, Deploy Instance). -
Add the parties to the DAML Hub project:
- CIP_Provider
- CDD_Provider
- ScreeningProvider
- KYC_Analyst
- Bank1
- Bank2
- Operator
-
Download the following files:
participants.json
(Ledger settings tab)parties.json
(Users tab)
-
Run the market setup:
daml script \
--participant-config participants.json \
--json-api \
--dar target/know-your-customer.dar \
--script-name DA.RefApps.KnowYourCustomer.MarketSetupScript:setupMarketWithDablParties \
--input-file parties.json
- Run the triggers from the DAML Hub UI:
CIP_Provider:
DA.RefApps.KnowYourCustomer.Triggers.AutoProposeAndAccept:autoProposeTrigger
DA.RefApps.KnowYourCustomer.Triggers.AutoRegisterLicense:automaticLicenseRegistrarTrigger
DA.RefApps.KnowYourCustomer.Triggers.Publisher:cipTrigger
CDD_Provider:
DA.RefApps.KnowYourCustomer.Triggers.AutoProposeAndAccept:autoProposeTrigger
DA.RefApps.KnowYourCustomer.Triggers.AutoRegisterLicense:automaticLicenseRegistrarTrigger
DA.RefApps.KnowYourCustomer.Triggers.Publisher:cddTrigger
ScreeningProvider:
DA.RefApps.KnowYourCustomer.Triggers.AutoProposeAndAccept:autoProposeTrigger
DA.RefApps.KnowYourCustomer.Triggers.AutoRegisterLicense:automaticLicenseRegistrarTrigger
DA.RefApps.KnowYourCustomer.Triggers.Publisher:screeningTrigger
KYC_Analyst:
DA.RefApps.KnowYourCustomer.Triggers.AutoProposeAndAccept:autoAcceptTrigger
DA.RefApps.KnowYourCustomer.Triggers.AutoStartResearch:autoStartResearchProcessTrigger
DA.RefApps.KnowYourCustomer.Triggers.MergeAndPublishResearch:mergeAndPublishResearchDataTrigger
Operator:
DA.RefApps.KnowYourCustomer.Triggers.TimeUpdater:timeUpdaterTrigger
User Guide
This User Guide will take you step-by-step through the process of subscribing to data streamed by publishers. It will lead you through all the major Navigator screens and data fields that you will need to use.
After working through these steps, you can use the Navigator interface to explore other functionality that is available in the application.
Note: This demo is designed to show a successful conclusion of the workflow without exceptions or error conditions. A full production implementation would include additional features, handle errors and exceptions, and incorporate appropriate security controls.
Workflow
Roles and Responsibilities
There are two fundamental role categories in the data streaming model: publisher and consumer. The publisher streams some data, observable by its consumers via their licenses. The diagram below shows the publisher-consumer relationships created by the market setup.
Role | Responsibilities |
---|---|
Bank | Financial institution buying research on their customers. There are two banks: Bank1 and Bank2. |
Provider | Provides raw customer data, initially read from a CSV file. There are three parties in this role: CDD_Provider, CIP_Provider, and ScreeningProvider. |
Analyst | Collates raw research data streams and publishes the results for the banks. |
Operator | Represents the infrastructure. Operates model clock, builds relationships between parties, etc. |
Running the Application
Choosing and Changing Roles
When you launch KYC Data Service application, you will see the Navigator screen with the option to choose your role.
To log in:
- On the home screen, select the party from the list.
To switch users:
- Click the name of the current party at the top of the screen.
- On the home screen, select a different party.
Note: A convenient way to switch between parties is to open separate browsers, e.g., using a private browsing or incognito window.
Setting the Model Time
For better interoperability and demo experience, the model time is emulated by contracts on the ledger. Therefore, the system time (coming from your operating system) and the model time (mainly used to make time-based decisions in the model) are separate concepts, including their speed. You can observe the model time as any party on the CurrentTime contract. You will also need to continue/stop/set time as the Operator to follow the demo workflow as described in the steps below.
Market Setup
The participants listed above in Roles and Responsibilities are added automatically at market setup along with other required reference data. The publisher-consumer relationships are also set up to ease license issuance.
Workflow 1: Observation of Preloaded Data Streams
Enabling Model Time Progressing
- Log in as Operator.
- Select the Time Management tab.
- Select the Time Manager contract.
- Select the choice Continue.
Observing Data Forwarded by KYC_Analyst
- Log in as KYC_Analyst.
- Select the Received KYC data tab (or the Provided KYC streams tab).
- Review the incoming (or outgoing) data that is displayed.
- Wait 5 seconds.
- Observe the updated data.
- (Optional) Check Include archived to see previously published data.
Observing Data Received by Bank1
- Log in as Bank1.
- Select the Received KYC data tab.
- Review the incoming data that is displayed.
- Wait 5 seconds.
- Observe the updated data.
Workflow 2: New Data Stream Subscription
Requesting Subscription for Bank2
- Log in as Bank2.
- Select the Relationships tab.
- Select the contract where My Role is KYC data consumer.
- Select the choice RequestStandardAnnualStream.
- Fill the customer name: ACME.
- Select all inclusion: includeCIP, includeCDD, and includeScreening.
Replying to Subscription with a Proposal
- Log in as KYC_Analyst.
- Select the KYC Requests tab.
- Select the Received DataStreamRequest contract.
- Select the choice DataStreamRequest_Propose.
- Fill the price, e.g.: 100
Accepting the Proposal
- Log in as Bank2.
- Select the KYC Price Proposals tab.
- Select the Received DataLicenseProposal contract.
- Select the choice DataLicenseProposal_Accept.
The KYC Licenses tab shows that the license automatically goes live as does the data stream (Received KYC data tab).
Enabling Model Time Progressing
- Log in as Operator.
- Select the Time Management tab.
- Select the Time Manager contract.
- Select the choice Continue.
Observing Data Received by Bank2
- Log in as Bank2.
- Select the Received KYC data tab.
- Review the incoming data showed.
- Wait 5 seconds.
- Observe the updated data.
Workflow 3: Disputing Data Quality
Disabling Model Time Progressing
- Log in as Operator.
- Select the Time Management tab.
- Select the Time Manager contract.
- Select the choice Stop.
Recording Data Quality Issue by Bank1
- Log in as Bank1.
- Select the Received KYC data tab.
- Select the disputed Publication contract.
- Select the choice DisputeQuality.
- Fill the description, e.g.: The data seems to have issues
Observing Disputes
- Log in as KYC_Analyst or stay logged in as Bank1.
- Select the Complaints: Data Quality tab.
- Review the created complaints.
Additional Exploration
After completing the workflow, you can explore the application to try other paths or restart with a custom CSV, etc.
CONFIDENTIAL © 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. Any unauthorized use, duplication or distribution is strictly prohibited.