# Public Party and reference data

**URL:** <https://forum.canton.network/t/public-party-and-reference-data/1802>\
**Category:** App Development\
**Tags:** daml\
**Created:** [December 15, 2020, 12:18pm UTC](https://forum.canton.network/t/public-party-and-reference-data/1802 "2020-12-15T12:18:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frankie](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/frankie/32/646_2.png) [@Frankie](https://forum.canton.network/u/Frankie)\
**Post date:** [December 15, 2020, 12:18pm UTC](https://forum.canton.network/t/public-party-and-reference-data/1802/1 "2020-12-15T12:18:55Z")

</div>

The concept of public party on DABL can make a contract visible to all parties on that ledger. Is there a similar concept on DAML level? Something that everyone on the ledger can lookup and fetch without been given permission explicitly. It can be a useful thing when one wants to store the reference data on the ledger but doesn’t want to go through the hassles to manage them when other party joins or quits. Things like a legend or a holiday calendar.

---

<div class="post-metadata">

**Author:** ![bernhard](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bernhard/32/356_2.png) [@bernhard](https://forum.canton.network/u/bernhard)\
**Post date:** [December 15, 2020, 1:26pm UTC](https://forum.canton.network/t/public-party-and-reference-data/1802/2 "2020-12-15T13:26:41Z")

</div>

There’s no such feature in DAML the smart contract language. The problem is data availability:

Imagine a DAML ledger with full sub-transaction privacy. There is no central place where all data is stored. If `Alice` creates a contract visible to “all”, and later a new node joins the network, there is no place for that node to “pick up” that data.

We therefore decided to handle “public” data through parties. There’s a discussion on the solution in [Query and Create Exercise as multiple parties](https://discuss.daml.com/t/query-and-create-exercise-as-multiple-parties/409/6). That feature should be rolled out in one of the releases early next year.

TL;DR: You’ll be able to use more than one party at a time during submission. So you can model `public` as a party and issue everyone tokens that allow them to read as that party. You still have the data availability problem, meaning the `public` party has to be hosted on every node where you want that data to be available. If you are on a multi-node network that means hosting the `public` party on all participants. If that’s not possible, the workaround is to have a public party per node, and then essentially make each node an observer on “public” contracts.

---

<div class="post-metadata">

**Author:** ![dd00](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dd00](https://forum.canton.network/u/dd00)\
**Post date:** [March 25, 2022, 11:33am UTC](https://forum.canton.network/t/public-party-and-reference-data/1802/3 "2022-03-25T11:33:31Z")

</div>

> If you are on a multi-node network that means hosting the `public` party on all participants

@bernhard can you elaborate on how this can be achieved in a Canton multi-node setup? Assuming you create the public party on Node A, how do you ‘host’ it on Node B and ensure the identifier remains the same?

---

<div class="post-metadata">

**Author:** ![bernhard](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bernhard/32/356_2.png) [@bernhard](https://forum.canton.network/u/bernhard)\
**Post date:** [March 30, 2022, 10:02am UTC](https://forum.canton.network/t/public-party-and-reference-data/1802/4 "2022-03-30T10:02:52Z")

</div>

You do this via the Canton Shell using the command [topology.party\_to\_participant\_mappings.authorize](https://docs.daml.com/canton/usermanual/console.html#topology-party-to-participant-mappings-authorize). You’ll need to run this on both the delegating and the receiving participants with opposing sides “From” and “To”. You can see that in action [in this example](https://docs.daml.com/canton/tutorials/composability.html#preparation-using-the-existing-workflows).

```haskell
def authorizePartyParticipant(partyId: PartyId, createdAt: ParticipantReference, to: ParticipantReference): Unit = {
  val createdAtP = createdAt.id
  val toP = to.id
  createdAt.topology.party_to_participant_mappings.authorize(TopologyChangeOp.Add, partyId, toP, RequestSide.From)
  to.topology.party_to_participant_mappings.authorize(TopologyChangeOp.Add, partyId, toP, RequestSide.To)
}

```

To make the delegation read-only, you need to add the parameter `ParticipantPermission.Observation` to the arguments of `authorize`.
