I want to understand the concept of canton and Daml.
My question is about the interoperability of Daml and Canton.
Let’s say that company A develops a smart contracts application. And company B develops a different smart contracts application as well.
In one point, company A wants to use the smart contracts application of company B - but for read only purposes, meaning that company A needs the information stored in B.
What company B needs to share with company A’s developers in order of that to work?
Daml/Canton provides a ledger not a database. So this concept of “read-only” or “read-write” doesn’t map over perfectly.
There are two scenarios that correspond to what you describe:
- Company A and Company B have a business relationship where A uses the Daml Application provided by B. In this case both A and B will be stakeholders in those contracts that represent their relationship. Which means that both companies will independently store copies of those contracts in their own participant nodes.
Keep in mind that the Daml/Canton ledger doesn’t exist as a single datastore anywhere. Each participant is informed of, and stores, precisely that fragment of the global ledger they are authorized to witness. The Daml/Canton ledger is a virtual thing that would only exist physically if every user of Daml/Canton came together and pooled their (overlapping) portion of the ledger.
So in case 1 there isn’t really a question of “providing access”, as Company A already possesses and stores those contracts. Company A can read them at will, and update them (ie. exercise choices) if the smart contracts authorize that.
- The second situation is similar, Company A and B both need to have some pre-existing relationship using the Daml Application provided by Company B; therefore, at least some of the contracts involved will be of type 1. However, any contracts where Company A is not the stakeholder will not be visible to Company A. In this case Company B will need to cooperate and need to provide explicit off-ledger copies of those contracts to Company A — presumably via a web-service or some other API, but once it is off-ledger a Daml contract is just another data record.
Company B can then use a facility called “explicit disclosure” to include attach these serialized contracts to their own Daml commands. They will be able to fetch
these contracts in the resulting transactions, and to exercise any choice the Daml contract authorizes them to exercise.
I recommend looking at the Daml Philosophy course* (Training & Certification), which covers everything I’ve discussed above. While there is a fee for the certification exam, the training materials are free. There are some important shifts in mindset involved in moving from more centralized platforms and something like Daml/Canton that really commits to a decentralized, distributed ledger model. It is definitely worth taking some time to review something like Daml Philosophy to help make that shift.
- Disclaimer: I am one of the authors of the DP course