Let’s break it down. First off, some of these concepts apply to a contract, whereas others apply to an action, where an action is a “ledger event”, i.e. “things that happen”.
For example, a signatory of a contract is a “static” property of the contract, as it stands registered on the ledger. On the other hand, an actor is a “dynamic” property: you are only an actor “during” a transaction, while things are happening.
The concept of a stakeholder is defined in the glossary as:
Stakeholder is not a term used within the Daml language, but the concept refers to the signatories and observers collectively. That is, it means all of the parties that are interested in a contract.
This includes all of the observers, which in turn includes choice observers. So “stakeholders” is defined based on the data on a contract (“static”) and includes all of the parties that are explicitly included in signatory
, all of the parties that are explicitly included in observer
, and all of the parties that are implicitly observers by virtue of being controllers on a controller can
-syntax choice (which is deprecated, but still valid; those are called “choice observers”, and, in addition to being observers on the contract itself, they will be informed of all the consequences of the choice).
Informee, witness and actor are properties of a transaction rather than a contract; they are “dynamic” properties.
An actor is a party exercising a choice. Note that with multi-party submission, there may be multiple actors for a single choice being exercised through the API.
Based on the privacy link you gave, we know that:
a party p is an informee of an action A if one of the following holds:
- A is a Create on a contract c and p is a stakeholder of c.
- A is a consuming Exercise on a contract c, and p is a stakeholder of c or an actor on A. Note that a Daml “flexible controller” can be an exercise actor without being a contract stakeholder.
- A is a non-consuming Exercise on a contract c, and p is a signatory of c or an actor on A.
- A is an Exercise action and p is a choice observer on A.
- A is a Fetch on a contract c, and p is a signatory of c or an actor on A.
- A is a NoSuchKey k assertion and p is a maintainer of k.
Note that in all of these, “A
” is an action, not a contract.
Which leaves witnesses. From the same page:
More precisely, every action act on c is shown to all informees of all ancestor actions of act. These informees are called the witnesses of act. If one of the witnesses W is not a stakeholder on c, then act and c are said to be divulged to W. Note that only Exercise actions can be ancestors of other actions.
So, for a given action, the witnesses are the informees of that action and the informees of all of the ancestors of that action. There may be cases where the informees of the ancestor actions are not stakeholders of the contract, and thus need to be divulged the contract. In most cases where the term witness
is used, it is referring specifically to these non-stakeholder informees.