Skip to content
CCPEDIAby Unity Nodes
App Development

Example when Canton User's primaryParty makes a difference?

2 posts93 viewsLast activity Aug 2025

  1. WallaceKellyOP

    I’m trying to assemble a simple example in which a Canton User’s primaryParty makes a difference.

    For example, in the following script, all three commands are submitted by an admin user with None primary party. The primaryParty (or lack thereof) makes no difference here:

      alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
      bob <- allocatePartyWithHint "Bob" (PartyIdHint "Bob")
    
      adminId <- validateUserId "admin"
      createUser (User adminId None) [CanActAs alice, CanActAs bob]
    
      aliceTV <- submitUser adminId do
        createCmd Asset with
          issuer = alice
          owner = alice
          name = "TV"
    
      bobTV <- submitUser adminId do
        exerciseCmd aliceTV Give with newOwner = bob
    
      submitUser adminId do
        exerciseCmd bobTV Give with newOwner = alice
    

    The docs say:

    • “indicates which party to use by default when submitting a Ledger API command request as this user” 1.
    • “Navigator… you will interact with the ledger as the primary party of that user.” 2.

    Maybe I’m beginning to realize that primaryParty is metadata for tooling to use, not the Ledger API itself. Is that correct? Aside from Navigator, do you know of any other time that primaryParty is used?

  2. WallaceKelly

    @cocreature responded to a similar question in the GSF Slack:

    primaryParty doesn’t imply anything. it doesn’t grant any rights but it is often used by tooling to interpret which party the user intends to use. E.g., the splice wallet UI always shows you the wallet for that party.