I am reading the doc chapter on composability and that made me wonder about how contracts and domains are associated. Other parts of the docs sometimes mention “contracts created on different Canton domains” and “transferring contracts between domains” (which I understand are not yet fully supported) and it’s not really clear to me what that means. Technically a domain has no visibility on which contracts transit through the sequencer/mediator - it only knows the informees/confirmers involved. Therefore in practice a sequencer would only refuse to process a transaction if it cannot resolve some of its recipients (e.g. if the corresponding party is not connected to the domain), but not because of the contracts involved. Is the association between a contract and the domain that facilitated its creation explicitly stored anywhere on the ledger(s)? The composability example (which I understand might also be outdated) uses the workflowId
as a hint to specify the target domain - but I am wondering what technically prevents the House Owner from transacting with the paint offer (created in the “Paint” domain) through the “IOU” domain - since the home owner is connected to both? I guess it all boils down to the rationale behind “contracts [can] reside on at most one domain at a time”?
Hi Davide,
Excellent question! Let me try to clarify what contracts [can] reside on at most one domain at a time means.
A domain serves as a synchronization point for a contract, which means state changes to the contract will be synchronized using that domain. The signatories of a contract agree on which domain is used for a contract, which is initially the domain where the contract is created. However that agreement is stored only within the participant nodes of the signatories, the domain does not know for which specific contracts it serves as a synchronization point.
The agreement which domain is used as a synchronization point can be changed between the signatories using the transfer protocol, whereby all signatories must explicitly agree to change the used synchronization domain. Contracts are not actually transferred between domains, but only the agreement is changed.
The submitting participant node decides which domain is used to submit a transaction. There are a few constraints that the submitter has to observe in deciding which domain to pick (which domains the input contracts are associated with, available parties and packages on the domains, etc.). In case the input contracts of the transaction are associated with different domains, we do have the preview feature that those input contracts are automatically transferred to a single domain, to which the transaction will then be submitted.
I hope this clear things up a bit. Please do let me know if you have further questions.