But in order to know that, one would have to look at the transactions leading to a given T, (ie find the fetch node ?) as opposed to looking at the code for T.
Imagine
template T
with
player: Party
sponsor: Party
limit: Int
observers: [Party]
where
signatory player, sponsor
onCreation do
(_, funds) <- fetchByKey @Funds sponsor
assert $ funds.amount > limit
Thatâs definitely not any concern of the language or runtime. The language and runtime should only provide a means to assign and remove roles to / from parties. What happens if a role is retracted? thatâs regulation. Business logic. Up to the application to deal with.
A couple of weeks back they discuvered somebody in France who was illegally practicing medicine after illegally obtaining a Medical Doctor license. In reaction, the âOrdre des Medecinsâ has retracted the license (retracted the role) and they are working with every patient currently ongoing treatment to check if everything is fine and compensate. And itâs similar in every other domain. Thatâs how real world works.
Who administers parties today ? external systems who get access to the admin API. If those external systems have the authority to define parties in the first place, maybe they could also do that in a more precise way, by adding and removing roles.
I do not know DAML internals well enough to answer that. Itâs obviously some work. I do not pretend to have the answer, I merely dare suggest a feature that would make DAML easier to use in certain use cases and more secure.
Fully understand and appreciate your suggestion. My questions were purely rhetoric in order to explain where we see challenges with offering externally administered role-based auth. Itâs a topic that does come up regularly and one I take very seriously. Really my whole post was just meant to lay out where my current thinking on the matter is.
The problem I see with this kind of approach - is that anyone, not just the giver, should be able to assert the partyâs attributes (roles), and thatâs literally everyone, every party on the system. And thatâs beyond cumbersome. It could work if the contract could be made public (everyone can be an observer) but to my knowledge, thatâs not possible.
Those attributes indeed fall into the realm of distributed network governance and should be administered by contracts. This is especially important as, hopefully, networks will be interconnected.
well yes in theory it works, in practice, as I said, itâs beyond cumbersome. think about it, every pharmacy, every insurance company any other doctor, any patient, basically anyone who will ever want to make sure another party is a doctor, will have to be an observer of every doctor contract in the world. And as you add new parties to the system in the future, youâll have to add them as obsevers as well.
Thatâs not just a huge waste of storage and compute, it also make the the entire code base more complex and error prone.
If the role is an attribute of the party, all this goes away.
Also being able to create public contracts (where everyone is an observer by default) would an acceptable solution because it eliminates the complexity of having to store the entire world as an observer on each âroleâ contract, and apparently thatâs on its way.