# Must controllers be signatories?

**URL:** <https://forum.canton.network/t/must-controllers-be-signatories/2816>\
**Category:** App Development\
**Created:** [July 7, 2021, 6:10pm UTC](https://forum.canton.network/t/must-controllers-be-signatories/2816 "2021-07-07T18:10:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nr185](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nr185/32/2253_2.png) [@nr185](https://forum.canton.network/u/nr185)\
**Post date:** [July 7, 2021, 6:10pm UTC](https://forum.canton.network/t/must-controllers-be-signatories/2816/1 "2021-07-07T18:10:41Z")

</div>

“the controller must be a signatory”. Is that right? Because I see on many examples that the controller usually a signatory.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![anthony](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/anthony/32/419_2.png) [@anthony](https://forum.canton.network/u/anthony)\
**Post date:** [July 7, 2021, 5:50pm UTC](https://forum.canton.network/t/must-controllers-be-signatories/2816/2 "2021-07-07T17:50:33Z")

</div>

> [@DAML syntax - composition & key maintainer](https://discuss.daml.com/t/daml-syntax-composition-key-maintainer/2805/5):
>
> By the way, I have one doubt. “the controller must be a signatory”.

Observers (and any party to a contract; see below) can also be controllers on a choice in a contract.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [July 7, 2021, 6:20pm UTC](https://forum.canton.network/t/must-controllers-be-signatories/2816/3 "2021-07-07T18:20:29Z")

</div>

They don’t need to be observers either. Any party works. However, note that the submitting party must have seen that contract before (either by virtue of being a stakeholder or via divulgence, the latter being deprecated).

It is also worth noting that the `controller … can` syntax implicitly makes a party an observer, see [What's the difference between controller first and choice first? - #2 by cocreature](https://discuss.daml.com/t/whats-the-difference-between-controller-first-and-choice-first/23/2) for details

Here is an example of exercising a choice `C` with controller `b` who is neither an observer nor a signatory:

```haskell
module Main where

import Daml.Script

template T
  with
    a : Party
    b : Party
  where
    signatory a
    choice C : ()
      controller b
      do pure ()

template Auth
  with
    a : Party
    b : Party
  where
    signatory a, b
    choice ExC : ()
      with
        cid : ContractId T
      controller a
      do exercise cid C

test = do
  a <- allocateParty "a"
  b <- allocateParty "b"
  auth <- submitMulti [a, b] [] $ createCmd (Auth a b)
  cid <- submit a $ createCmd (T a b)
  submit a $ exerciseCmd auth (ExC cid)

```

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [July 8, 2021, 8:01am UTC](https://forum.canton.network/t/must-controllers-be-signatories/2816/4 "2021-07-08T08:01:06Z")

</div>

You can even have a controller who is not mentioned on the contract at all using multiparty submissions and flexible controllers:

```haskell
module Main where

import Daml.Script

template Product
  with
    public: Party
    supplier: Party
    name: Text
  where
    signatory supplier
    observer public
    nonconsuming choice CreateReservation : ContractId Reservation
      with customer: Party
      controller customer
      do
        create Reservation with ..

template Reservation
  with
    supplier: Party
    name: Text
    customer: Party
  where
    signatory supplier, customer

setup : Script ()
setup = script do
  alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
  bob <- allocatePartyWithHint "Bob" (PartyIdHint "Bob")
  public <- allocatePartyWithHint "public" (PartyIdHint "public")
  p1 <- submit alice do
    createCmd Product with supplier = alice, public, name = "product"
  submitMulti [bob] [public] do
    exerciseCmd p1 CreateReservation with customer = bob
  return ()

```
