Caching data from ledger: data visibility rules?

Assuming a source was processing each transaction or was to receive all contracts from the ACS:

is there a documented rule-set for visibility of these contracts by party based on how the contracts are returned through the api?


For flat transactions & the ACS the rule is pretty straightforward:

A CreatedEvent is visible to a party p iff p is a member of the stakeholders set.

If you care about transaction trees then things get more difficult. You can look at the witness_parties but keep in mind that those depend on the parties you subscribed to. So this works well if your set of parties is static but is more difficult if the parties change because for events you consumed in the past using a more restricted set of parties you don’t know if they’re visible to new parties.


Thank you