How to extend default Party interface?

Hi everyone,

I am new to DAML. I am experimenting DAML for lifecycle management for financial instruments use case. One question comes to my mind is how do we extend the default Party interface? Currently I see that a Party can only have a name and id.

A lender/borrower can have its own properties like legal entity id, legal account number and corp id etc… How can we associate those details to a Party in this case lender or borrower?

I am not sure if I am thinking this in the right way so any answer are appreciated! Thanks!

If you want to associate data with a Party, define a template containing that party and whatever data you want associated with the party. Then, you will probably want the key of that template to be the party, so you can lookup by key in order to fetch the data when you need it.

Intuitively, it is best not to think of these kinds of things as “properties of the Party”. I am not born with a bank account number, but I have one by virtue of contracts into which I’ve entered, and that account number is properly part of those contracts, not intrinsic to my being.

The big remaining question is, what party or parties are the signatory and observers of this template. Is the party itself responsible for the associated values, able to revoke or update that data at any time? What parties can access the associated data? These are all highly dependent on your use case. Even if the answer is “everyone should be able to access it”, other discussions here break down the nuances even further.

1 Like

Thanks for your answer Stephen, I think I understand part of your answer but not fully. Do you have any ref links or examples that you can share by any chance?

@Eric
I just posted a quick & dirty example in response to the same question you asked on Stackoverflow.
In my example the signatories on the Borrower role contract are the borrower party and the system operator. The latter represents the authority that operates the marketplace being modeled, which is responsible for ensuring the integrity of the system, performing KYC etc. E.g. if we’re modeling a loan management system for a loan servicing company, the system operator is the loan servicing company. I hope that my example together with the answer provided by @Stephen will help you understand the concepts a little better.

@a_putkov Yeah it definitely does. If you can follow up the thread on stack overflow, it would be nice. Thank you!

@Eric
FYI, I posted the response to your comments on Stackoverflow. Let us know if you have further questions or need further clarification.

1 Like