readAs delegation

Subject: Clarification on readAs Across Participants and the Role of Party Replication

Hi Canton Team,

I would appreciate some clarification regarding readAs authorization across participants.

Consider the following template:

template Data
  with
    creator: Party
    public : Party
    data   : Text
  where
    signatory creator
    observer public

And I want to allow users to view this contract.

So, let’s say I have userA party that I would like to allow him to view this Data contract.

Normally, I will grant readAs permission to userA as public.

My problem with this approach is that it does not work for parties hosted on different participants.

So, is party replication the right solution for it?

If so, what are the implications for this action that I need to consider?

hey @cohen.avraham

readAs grants are local to a participant so If userA is on Participant B and the Data contract is on Participant A, granting userA readAs public on Participant B does nothing so Participant B doesn’t receive the contract because public isn’t hosted there as a stakeholder.

Canton’s privacy model means a participant only receives contracts where at least one of its hosted parties is a stakeholder as signatory or observer on that contract.

but on que if party replication the right solution? I’d say it’s one valid solution but in this u essentially host publicon both Participant A (where contracts are created) and Participant B (where userA lives) with Participant B then receives all Data contracts where public is observer anduserA can readAs public on Participant B and see them

Another thing I was thinking is If selective per contract visibility is needed, use a separate disclosure observer party per user rather than a shared public party. Each user gets their own observer party hosted only on their participant, and the creator explicitly adds them as observer on contracts they should see. More surgical, but more management overhead.