In daml-finance, when allocating/approving Instruction
s the relevant Holding
s and Account
s are disclosed to the settler
of the Batch
, so that later when exercising Settle
with a settler as the submitter we don’t run into visibility problems.
The issue is that the same isn’t done for the Holding
Factory
associated with each Account
, so it’s possible to run into problems there unless the disclosure of the factories is handled in some other way.
There is the additional problem that when we disclose the Factory
to the settlers
they will witness Holding
s being created/destroyed that are completely unrelated to this settlement process.
Is this something that might be fixed in daml-finance or do you recommend a different way of doing things?
Hi @drdo.intellecteu,
For the provided implementation of the Instruction
, it is assumed that the holding factories are indeed being explicitly disclosed.
However, it is possible to have a different Instruction
implementation that also discloses the holding factory implicitly, similar to how the relevant holdings and accounts are disclosed, without compromising privacy (about what is being created/archived).
This works because being an observer of a contract does not let you witness its non-consuming choices (unless you are specifically a choice observer for those choices).
Note that when an observer is added to a contract, the contract id changes, but since the holding factory is keyed, you can address the instances by their key.
Hope that helps,
Johan
Hey @Johan_Sjodin. Thank you for the clarification on the fact that observers don’t witness non-consuming choices.
How do you envision factories being used in practice? How many factories and with what observers?
Is the idea here to just have one factory of each type with some kind of public party as observer?
Hey @drdo.intellecteu,
In the most general case, each custodian can have its own holding factory for creating specific implementations of holdings. This is similar to the current situation where various custodians may represent assets in their unique ways.
By explicitly disclosing the holding factories to the settlers, there would be no need for observers on the holding factory. Alternatively, settlers could be added as observers, with the trade-off that they would become aware of each other. Using a public party is another option, but it scales poorly in multi-participant setups (see other forum posts for more details).