Understand Daml’s authorization model - signatories, observers, and controllers
Parties and authority
Daml is designed for distributed applications involving mutually distrusting parties. In a well-constructed contract model, all parties have strong guarantees that nobody cheats or circumvents the rules laid out by templates and choices.In this section you will learn about Daml’s authorization rules and how to develop contract models that give all parties the required guarantees. In particular, you’ll learn how to:
Pass authority from one contract to another
Write advanced choices
Reason through Daml’s Authorization model
Remember that you can load all the code for this section into a folder called intro-parties by running dpm new intro-parties --template daml-intro-parties
Prevent IOU revocation
The SimpleIou contract from choices and constraints has one major problem: The contract is only signed by the issuer. The signatories are the parties with the power to create and archive contracts. If Alice gave Bob a SimpleIou for $100 in exchange for some goods, she could just archive it after receiving the goods. Bob would have a record of such actions, but would have to resort to off-ledger means to get his money back:
template SimpleIou with issuer : Party owner : Party cash : Cash where signatory issuer
simple_iou_test = do alice <- allocateParty "Alice" bob <- allocateParty "Bob" -- Alice and Bob enter into a trade. -- Alice transfers the payment as a SimpleIou. iou <- submit alice do createCmd SimpleIou with issuer = alice owner = bob cash = Cash with amount = 100.0 currency = "USD" passTime (days 1) -- Bob delivers the goods. passTime (minutes 10) -- Alice just deletes the payment. submit alice do archiveCmd iou
For a party to have any guarantees that only those transformations specified in the choices are actually followed, they either need to be a signatory themselves, or trust one of the signatories to not agree to transactions that archive and re-create contracts in unexpected ways. To make the SimpleIou safe for Bob, you need to add him as a signatory:
template Iou with issuer : Party owner : Party cash : Cash where signatory issuer, owner choice Transfer : ContractId Iou with newOwner : Party controller owner do assertMsg "newOwner cannot be equal to owner." (owner /= newOwner) create this with owner = newOwner
There’s a new problem here: There is no way for Alice to issue or transfer this Iou to Bob. To get an Iou with Bob’s signature as owner onto the ledger, his authority is needed:
iou_test = do alice <- allocateParty "Alice" bob <- allocateParty "Bob" -- Alice and Bob enter into a trade. -- Alice wants to give Bob an Iou, but she can't without Bob's authority. submitMustFail alice do createCmd Iou with issuer = alice owner = bob cash = Cash with amount = 100.0 currency = "USD" -- She can issue herself an Iou. iou <- submit alice do createCmd Iou with issuer = alice owner = alice cash = Cash with amount = 100.0 currency = "USD" -- However, she can't transfer it to Bob. submitMustFail alice do exerciseCmd iou Transfer with newOwner = bob
This may seem awkward, but notice that the ensure clause is gone from the Iou again. The above Iou can contain negative values so Bob should be glad that Alice cannot put his signature on any Iou.You’ll now learn a couple of common ways of building issuance and transfer workflows for the above Iou, before diving into the authorization model in full.
Use Propose-Accept workflow for one-off authorization
If there is no standing relationship between Alice and Bob, Alice can propose the issuance of an Iou to Bob, giving him the choice to accept. You can do so by introducing a proposal contract IouProposal:
template IouProposal with iou : Iou where signatory iou.issuer observer iou.owner choice IouProposal_Accept : ContractId Iou controller iou.owner do create iou
Note how we have used the fact that templates are records here to store the Iou in a single field:
iouProposal <- submit alice do createCmd IouProposal with iou = Iou with issuer = alice owner = bob cash = Cash with amount = 100.0 currency = "USD" submit bob do exerciseCmd iouProposal IouProposal_Accept
The IouProposal contract carries the authority of iou.issuer by virtue of them being a signatory. By exercising the IouProposal_Accept choice, Bob adds his authority to that of Alice, which is why an Iou with both signatories can be created in the context of that choice.The choice is called IouProposal_Accept, not Accept, because propose-accept patterns are very common. In fact, you’ll see another one just below. As each choice defines a record type, you cannot have two choices of the same name in scope. It’s a good idea to qualify choice names to ensure uniqueness.The above solves issuance, but not transfers. You can solve transfers exactly the same way, though, by creating a TransferProposal:
template IouTransferProposal with iou : Iou newOwner : Party where signatory (signatory iou) observer (observer iou), newOwner choice IouTransferProposal_Cancel : ContractId Iou controller iou.owner do create iou choice IouTransferProposal_Reject : ContractId Iou controller newOwner do create iou choice IouTransferProposal_Accept : ContractId Iou controller newOwner do create iou with owner = newOwner
In addition to defining the signatories of a contract, signatory can also be used to extract the signatories from another contract. Instead of writing signatory (signatory iou), you could write signatory iou.issuer, iou.owner.The IouProposal had a single signatory so it could be cancelled easily by archiving it. Without a Cancel choice, the newOwner could abuse an open TransferProposal as an option. The triple Accept, Reject, Cancel is common to most proposal templates.To allow an iou.owner to create such a proposal, you need to give them the choice to propose a transfer on the Iou contract. The choice looks just like the above Transfer choice, except that a IouTransferProposal is created instead of an Iou:
choice ProposeTransfer : ContractId IouTransferProposal with newOwner : Party controller owner do assertMsg "newOwner cannot be equal to owner." (owner /= newOwner) create IouTransferProposal with iou = this newOwner
Bob can now transfer his Iou. The transfer workflow can even be used for issuance:
charlie <- allocateParty "Charlie" -- Alice issues an Iou using a transfer proposal. tpab <- submit alice do createCmd IouTransferProposal with newOwner = bob iou = Iou with issuer = alice owner = alice cash = Cash with amount = 100.0 currency = "USD" -- Bob accepts the transfer from Alice. iou2 <- submit bob do exerciseCmd tpab IouTransferProposal_Accept -- Bob offers Charlie a transfer. tpbc <- submit bob do exerciseCmd iou2 ProposeTransfer with newOwner = charlie -- Charlie accepts the transfer from Bob. submit charlie do exerciseCmd tpbc IouTransferProposal_Accept
Use role contracts for ongoing authorization
Many actions, like the issuance of assets or their transfer, can be pre-agreed. You can represent this succinctly in Daml through relationship or role contracts.Jointly, an owner and newOwner can transfer an asset, as demonstrated in the script above. In compose, you will see how to compose the ProposeTransfer and IouTransferProposal_Accept choices into a single new choice, but for now, here is a different way. You can give them the joint right to transfer an IOU:
choice Mutual_Transfer : ContractId Iou with newOwner : Party controller owner, newOwner do create this with owner = newOwner
Up to now, the controllers of choices were known from the current contract. Here, the newOwner variable is part of the choice arguments, not the Iou.This is also the first time we have shown a choice with more than one controller. If multiple controllers are specified, the authority of all the controllers is needed. Here, neither owner, nor newOwner can execute a transfer unilaterally, hence the name Mutual_Transfer.
template IouSender with sender : Party receiver : Party where signatory receiver observer sender nonconsuming choice Send_Iou : ContractId Iou with iouCid : ContractId Iou controller sender do iou <- fetch iouCid assert (iou.cash.amount > 0.0) assert (sender == iou.owner) exercise iouCid Mutual_Transfer with newOwner = receiver
The above IouSender contract now gives one party, the sender the right to send Iou contracts with positive amounts to a receiver. The nonconsuming keyword on the choice Send_Iou changes the behaviour of the choice so that the contract it’s exercised on does not get archived when the choice is exercised. That way the sender can use the contract to send multiple Ious.Here it is in action:
-- Bob allows Alice to send him Ious. sab <- submit bob do createCmd IouSender with sender = alice receiver = bob -- Charlie allows Bob to send him Ious. sbc <- submit charlie do createCmd IouSender with sender = bob receiver = charlie -- Alice can now send the Iou she issued herself earlier. iou4 <- submit alice do exerciseCmd sab Send_Iou with iouCid = iou -- Bob sends it on to Charlie. submit bob do exerciseCmd sbc Send_Iou with iouCid = iou4
Daml’s authorization model
Hopefully, the above will have given you a good intuition for how authority is passed around in Daml. In this section you’ll learn about the formal authorization model to allow you to reason through your contract models. This will allow you to construct them in such a way that you don’t run into authorization errors at runtime, or, worse still, allow malicious transactions.In choices you learned that a transaction is, equivalently, a tree of transactions, or a forest of actions, where each transaction is a list of actions, and each action has a child-transaction called its consequences.Each action has a set of required authorizers — the parties that must authorize that action — and each transaction has a set of authorizers — the parties that did actually authorize the transaction.The authorization rule is that the required authorizers of every action are a subset of the authorizers of the parent transaction.The required authorizers of actions are:
The required authorizers of an exercise action are the controllers on the corresponding choice. Remember that Archive and archive are just an implicit choice with the signatories as controllers.
The required authorizers of a create action are the signatories of the contract.
The required authorizers of a fetch action (which also includes fetchByKey) are somewhat dynamic and covered later.
The authorizers of transactions are:
The root transaction of a commit is authorized by the submitting party.
The consequences of an exercise action are authorized by the actors of that action plus the signatories of the contract on which the action was taken.
An authorization example
Consider the transaction from the script above where Bob sends an Iou to Charlie using a Send_Iou contract. It is authorized as follows, ignoring fetches:
Bob submits the transaction so he’s the authorizer on the root transaction.
The root transaction has a single action, which is to exercise Send_Iou on a IouSender contract with Bob as sender and Charlie as receiver. Since the controller of that choice is the sender, Bob is the required authorizer.
The consequences of the Send_Iou action are authorized by its actors, Bob, as well as signatories of the contract on which the action was taken. That’s Charlie in this case, so the consequences are authorized by both Bob and Charlie.
The consequences contain a single action, which is a Mutual_Transfer with Charlie as newOwner on an Iou with issuer Alice and owner Bob. The required authorizers of the action are the owner, Bob, and the newOwner, Charlie, which matches the parent’s authorizers.
The consequences of Mutual_Transfer are authorized by the actors (Bob and Charlie), as well as the signatories on the Iou (Alice and Bob).
The single action on the consequences, the creation of an Iou with issuer Alice and owner Charlie has required authorizers Alice and Charlie, which is a proper subset of the parent’s authorizers.
You can see the graph of this transaction in the transaction view of the IDE:
TX 12 1970-01-01T00:00:00Z (Parties:276:3)#12:0│ disclosed to (since): 'Bob' (12), 'Charlie' (12)└─> 'Bob' exercises Send_Iou on #10:0 (Parties:IouSender) with iouCid = #11:3 children: #12:1 │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12) └─> 'Alice' and 'Bob' fetch #11:3 (Parties:Iou) #12:2 │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12) └─> 'Bob' and 'Charlie' exercise Mutual_Transfer on #11:3 (Parties:Iou) with newOwner = 'Charlie' children: #12:3 │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12) └─> 'Alice' and 'Charlie' create Parties:Iou with issuer = 'Alice'; owner = 'Charlie'; cash = (Parties:Cash with currency = "USD"; amount = 100.0000000000)
Note that authority is not automatically transferred transitively.
template NonTransitive with partyA : Party partyB : Party where signatory partyA observer partyB choice TryA : ContractId NonTransitive controller partyA do create NonTransitive with partyA = partyB partyB = partyA choice TryB : ContractId NonTransitive with other : ContractId NonTransitive controller partyB do exercise other TryA
nt1 <- submit alice do createCmd NonTransitive with partyA = alice partyB = bob nt2 <- submit alice do createCmd NonTransitive with partyA = alice partyB = bob submitMustFail bob do exerciseCmd nt1 TryB with other = nt2
The consequences of TryB are authorized by both Alice and Bob, but the action TryA only has Alice as an actor and Alice is the only signatory on the contract.Therefore, the consequences of TryA are only authorized by Alice. Bob’s authority is now missing to create the flipped NonTransitive so the transaction fails.
Next up
In compose you will put everything you have learned together to build a simple asset holding and trading model akin to that in the /app-dev/bindings-java/quickstart. In that context you’ll learn a bit more about the Update action and how to use it to compose transactions, as well as about privacy on Daml ledgers.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Canton Network Docs","colors":{"primary":"#734BE2","light":"#A985FF","dark":"#7B59E8"},"logo":{"light":"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026auto=format\u0026n=OOy41G-b8QJx6Gkr\u0026q=85\u0026s=d5d59c10fc4ca9be021afb188db72e2f","dark":"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-white.svg?fit=max\u0026auto=format\u0026n=OOy41G-b8QJx6Gkr\u0026q=85\u0026s=820871bab1b1be90578959e03e4a3001","href":"/"},"favicon":"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026auto=format\u0026n=OOy41G-b8QJx6Gkr\u0026q=85\u0026s=d5d59c10fc4ca9be021afb188db72e2f","appearance":{"default":"system"},"footer":{"socials":{"x":"https://x.com/CantonNetwork","github":"https://github.com/canton-network","linkedin":"https://www.linkedin.com/company/canton-network","discord":"https://discord.gg/canton","telegram":"https://t.me/CantonNetwork1"},"links":[{"header":"Legal","items":[{"label":"Documentation License (CC-BY-4.0)","href":"https://creativecommons.org/licenses/by/4.0"},{"label":"Code License (Apache-2.0)","href":"https://www.apache.org/licenses/LICENSE-2.0"}]}]},"fonts":{"heading":{"family":"Inter","weight":700},"body":{"family":"Inter","weight":400}},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":true},"integrations":{"ga4":{"measurementId":"G-F2G1L137JX"},"cookies":{}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"markdown":{"instructions":"If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md."},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cantonfoundation","hasAudioNarration":false,"actualSubdomain":"cantonfoundation","customDomains":["docs.canton.network"],"gitSource":{"type":"github","owner":"canton-network","repo":"cf-docs","deployBranch":"main","contentDirectory":"docs-main","isPrivate":false,"mountPath":"","label":""},"feedback":{"contextualFeedback":{"allowEmail":true},"edits":true,"issues":true,"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0ea6118007c388aa2daf7a","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API Reference","count":1006},{"language":"default","tag":"Packages","count":503},{"language":"default","tag":"Ledger API","count":449},{"language":"default","tag":"Services","count":283},{"language":"default","tag":"Splice APIs","count":272},{"language":"default","tag":"gRPC API","count":234},{"language":"default","tag":"Java Bindings","count":196},{"language":"default","tag":"Admin API","count":157},{"language":"default","tag":"com.daml.ledger.javaapi.data","count":151},{"language":"default","tag":"Release Notes","count":130}],"searchSettings":{"isFiltersEnabled":false,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"link","url":"https://forum.canton.network/"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":false}},"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":":root{--canton-highlight: #734BE2;--canton-highlight-rgb: 115, 75, 226;--canton-selected-bg: rgba(115, 75, 226, 0.10);--canton-hover-bg: rgba(115, 75, 226, 0.05);--canton-inline-highlight-bg: rgba(115, 75, 226, 0.14);--canton-inline-highlight-border: rgba(115, 75, 226, 0.26);--canton-product-selector-line: rgba(115, 75, 226, 0.70);--canton-product-selector-line-active: #734BE2;--canton-product-selector-divider: rgba(75, 85, 99, 0.16);--x2mdx-ref-canvas: #F6F8FB;--x2mdx-ref-sidebar: #FBFCFD;--x2mdx-ref-surface: #FFFFFF;--x2mdx-ref-text-strong: #11131A;--x2mdx-ref-text: #252937;--x2mdx-ref-text-muted: #6B7280;--x2mdx-ref-border: rgba(17, 19, 26, 0.08);--x2mdx-ref-accent-soft: #F3EEFF;--x2mdx-ref-neutral-soft: #F4F5F7;--x2mdx-ref-info: #1D4ED8;--x2mdx-ref-info-soft: #EDF5FF;--x2mdx-ref-success: #15803D;--x2mdx-ref-success-soft: #ECFBF0;--x2mdx-ref-danger: #B91C1C;--x2mdx-ref-danger-soft: #FFF1F1;--x2mdx-ref-warning: #B16305;--x2mdx-ref-warning-soft: #FFF8E4;--canton-font-family: 'Inter', system-ui, -apple-system, sans-serif}[data-theme=\"dark\"],:root.dark{--canton-highlight: #A985FF;--canton-highlight-rgb: 169, 133, 255;--canton-selected-bg: rgba(169, 133, 255, 0.25);--canton-hover-bg: rgba(169, 133, 255, 0.05);--canton-inline-highlight-bg: rgba(169, 133, 255, 0.22);--canton-inline-highlight-border: rgba(169, 133, 255, 0.34);--canton-product-selector-line: rgba(169, 133, 255, 0.70);--canton-product-selector-line-active: #A985FF;--canton-product-selector-divider: rgba(255, 255, 255, 0.10);--x2mdx-ref-canvas: #111115;--x2mdx-ref-sidebar: #111115;--x2mdx-ref-surface: rgba(17, 24, 39, 0.78);--x2mdx-ref-text-strong: #F3F4F6;--x2mdx-ref-text: #E5E7EB;--x2mdx-ref-text-muted: #D1D5DB;--x2mdx-ref-border: rgba(255, 255, 255, 0.08);--x2mdx-ref-accent-soft: rgba(169, 133, 255, 0.16);--x2mdx-ref-neutral-soft: rgba(156, 163, 175, 0.12);--x2mdx-ref-info: #93C5FD;--x2mdx-ref-info-soft: rgba(29, 78, 216, 0.22);--x2mdx-ref-success: #86EFAC;--x2mdx-ref-success-soft: rgba(21, 128, 61, 0.22);--x2mdx-ref-danger: #FCA5A5;--x2mdx-ref-danger-soft: rgba(185, 28, 28, 0.22);--x2mdx-ref-warning: #FCD34D;--x2mdx-ref-warning-soft: rgba(177, 99, 5, 0.22)}::selection{background-color:var(--canton-selected-bg);color:inherit}::-moz-selection{background-color:var(--canton-selected-bg);color:inherit}mark{background-color:var(--canton-inline-highlight-bg);color:inherit;border-radius:0.25rem;box-shadow:inset 0 0 0 1px var(--canton-inline-highlight-border);padding:0.08em 0.18em}[class*=\"sidebar\"] a:hover,nav a:hover{background-color:var(--canton-hover-bg)}#navigation-items .sidebar-group-header{margin-bottom:0.25rem;line-height:1.25}#navigation-items .sidebar-group li a,#navigation-items .sidebar-group li button{padding-top:0.25rem;padding-bottom:0.25rem;line-height:1.5}:root a[class*=\"bg-primary\"],:root a.text-primary{background-color:rgba(115, 75, 226, 0.08)!important;color:#734BE2!important}[data-theme=\"dark\"] a[class*=\"bg-primary\"],[data-theme=\"dark\"] a.text-primary{background-color:rgba(169, 133, 255, 0.10)!important;color:#A985FF!important}.nav-dropdown-products-selector-trigger{box-shadow:inset 0 0 0 1.5px var(--canton-product-selector-line)!important}.nav-dropdown-products-selector-trigger:hover,.nav-dropdown-products-selector-trigger[aria-expanded=\"true\"]{background-color:var(--canton-hover-bg)!important;box-shadow:inset 0 0 0 2px var(--canton-product-selector-line-active)!important}.nav-dropdown-products-selector-content>a[href=\"/api-reference\"]{border-top:1px solid var(--canton-product-selector-divider);box-sizing:border-box;margin-top:0.35rem;padding-top:0.35rem;width:100%}[class*=\"toc\"] a[class*=\"active\"],[class*=\"toc\"] a[aria-current],[class*=\"TableOfContents\"] a[class*=\"active\"],[class*=\"tableofcontents\"] a[class*=\"active\"],aside[class*=\"right\"] a[class*=\"active\"],[class*=\"on-this-page\"] a[class*=\"active\"]{background-color:transparent!important;color:var(--canton-highlight)!important;font-weight:500}[class*=\"toc\"] a:not([class*=\"active\"]),[class*=\"TableOfContents\"] a:not([class*=\"active\"]),[class*=\"tableofcontents\"] a:not([class*=\"active\"]),aside[class*=\"right\"] a:not([class*=\"active\"]),[class*=\"on-this-page\"] a:not([class*=\"active\"]){background-color:transparent!important}[class*=\"toc\"] a:hover,[class*=\"TableOfContents\"] a:hover,[class*=\"tableofcontents\"] a:hover,aside[class*=\"right\"] a:hover,[class*=\"on-this-page\"] a:hover{background-color:transparent!important;color:var(--canton-highlight)!important}#footer.advanced-footer>div{gap:1.25rem!important;padding-top:2rem!important;padding-bottom:2rem!important}@media (max-width: 767px){#footer.advanced-footer>div{gap:1rem!important;padding-top:1.5rem!important;padding-bottom:1.5rem!important}}a:not([class]){color:var(--canton-highlight)}.prose strong,.prose b,strong,b{font-weight:600!important}:root.dark .prose strong,:root.dark .prose b,[data-theme=\"dark\"] .prose strong,[data-theme=\"dark\"] .prose b,:root.dark strong,:root.dark b,[data-theme=\"dark\"] strong,[data-theme=\"dark\"] b{font-weight:400!important}a:not([class]):hover{color:var(--canton-highlight);opacity:0.8}:not(pre)>code{background-color:rgba(115, 75, 226, 0.10);border-radius:4px;padding:0.125em 0.25em}:root.dark :not(pre)>code,[data-theme=\"dark\"] :not(pre)>code{background-color:rgba(169, 133, 255, 0.20)}pre code::selection,pre code::-moz-selection{background-color:var(--canton-selected-bg)}[class*=\"card\"]:hover{border-color:var(--canton-highlight)}button[class*=\"bg-primary\"],a[class*=\"bg-primary\"]:not([class~=\"card\"]){background-color:var(--canton-highlight)}button[class*=\"bg-primary\"]:hover,a[class*=\"bg-primary\"]:not([class~=\"card\"]):hover{opacity:0.9}table tbody tr:hover{background-color:var(--canton-hover-bg)}[data-component=\"network-variables\"] [role=\"tablist\"]{gap:0.35rem!important;padding:0.35rem!important}[data-component=\"network-variables\"] [role=\"tab\"]{border:1px solid transparent!important;border-radius:0.5rem!important}[data-component=\"network-variables\"] [role=\"tab\"][aria-selected=\"false\"]{border-color:var(--canton-product-selector-divider)!important}[data-component=\"network-variables\"] [role=\"tab\"][aria-selected=\"true\"]{border-color:var(--canton-highlight)!important;box-shadow:inset 0 0 0 1px var(--canton-highlight)!important;color:var(--canton-highlight)!important}table:has(pre){display:block;overflow-x:visible}table:has(pre)>colgroup{display:none}table:has(pre)>tbody,table:has(pre)>thead{display:block}table:has(pre)>tbody>tr,table:has(pre)>thead>tr{display:block}table:has(pre) td,table:has(pre) th{display:block;width:100%!important;max-width:100%}table:has(pre) td>pre,table:has(pre) th>pre{max-width:100%;overflow-x:auto}[data-component-part=\"search-item\"][data-highlighted]{background-color:var(--canton-inline-highlight-bg);color:inherit}[data-component-part=\"search-item-content\"]{white-space:normal;overflow:visible;text-overflow:unset}[data-component-part=\"search-item-breadcrumbs\"]{font-size:10px;line-height:1.25}[data-component-part=\"search-item-breadcrumbs\"] svg{stroke-width:4}[data-component-part=\"search-item-breadcrumbs\"] svg path{stroke-width:4}:focus-visible{outline:2px solid var(--canton-highlight);outline-offset:2px}::-webkit-scrollbar-thumb:hover{background-color:var(--canton-highlight)}[data-theme=\"dark\"]{--canton-text-primary: #F5F5F5;--canton-text-secondary: #B0B0B0}button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *){background-color:transparent!important;border:1px solid rgba(209, 213, 219, 0.7)!important;border-radius:0.85rem!important;padding:0.375rem 0.875rem!important}button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *):hover{background-color:rgba(75, 85, 99, 0.05)!important}[data-theme=\"dark\"] button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *){border-color:rgba(255, 255, 255, 0.07)!important}button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *) svg{color:rgb(156, 163, 175)!important;stroke:rgb(156, 163, 175)!important}button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *):hover svg{color:rgb(75, 85, 99)!important;stroke:rgb(75, 85, 99)!important}[data-theme=\"dark\"] button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *) svg{color:rgb(75, 85, 99)!important;stroke:rgb(75, 85, 99)!important}[data-theme=\"dark\"] button[aria-haspopup=\"menu\"]:not(.nav-dropdown-trigger):not(#page-context-menu *):hover svg{color:rgb(156, 163, 175)!important;stroke:rgb(156, 163, 175)!important}.mermaid{--mermaid-primary-color: var(--canton-highlight)}div.group.relative.overflow-hidden:has(svg)>div.absolute.bottom-2.right-2{opacity:0.1;transition:opacity 200ms ease-in-out}div.group.relative.overflow-hidden:has(svg):hover>div.absolute.bottom-2.right-2,div.group.relative.overflow-hidden:has(svg):focus-within>div.absolute.bottom-2.right-2{opacity:1}div.todo{display:none}body:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #background-color{background-color:var(--x2mdx-ref-canvas)!important}body:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #navbar{border-bottom:1px solid var(--x2mdx-ref-border);background-color:var(--x2mdx-ref-surface)}body:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #sidebar{background-color:var(--x2mdx-ref-sidebar)}body:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #content-container{color:var(--x2mdx-ref-text-muted)}body:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #content-container :is(h1,h2,h3,h4,h5,h6){color:var(--x2mdx-ref-text-strong)}.x2mdx-ref-back{margin:0 0 0.75rem;font-size:0.9rem}.x2mdx-ref-back a{color:var(--canton-highlight);text-decoration:none}.x2mdx-ref-hero{display:grid;min-width:0;max-width:100%;gap:0.75rem;margin:0 0 1.4rem}.x2mdx-ref-hero>*{min-width:0;max-width:100%;overflow-wrap:anywhere}#content-container:has(.x2mdx-ref-page):not(:has(.x2mdx-ref-page--manual-api)) #page-title{display:none!important}#content-container:has(.x2mdx-ref-page) #header>.mt-2.text-lg.prose{display:none!important}.x2mdx-ref-breadcrumbs{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin:0 0 0.75rem;color:var(--x2mdx-ref-text-muted);font-size:0.9rem;line-height:1.35}.x2mdx-ref-breadcrumbs a{color:var(--canton-highlight);text-decoration:none}.x2mdx-ref-breadcrumbs a:hover{text-decoration:underline}.x2mdx-ref-breadcrumb-separator{color:rgb(156, 163, 175)}.x2mdx-ref-eyebrow{min-width:0;max-width:100%;margin:0;overflow-wrap:anywhere;font-size:0.78rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:var(--x2mdx-ref-text-muted)}:root.dark .x2mdx-ref-eyebrow,[data-theme=\"dark\"] .x2mdx-ref-eyebrow{color:rgb(156, 163, 175)}.x2mdx-ref-title{min-width:0;max-width:100%;margin:0;overflow-wrap:anywhere;color:var(--x2mdx-ref-text-strong);font-size:clamp(2rem, 3vw, 2.7rem);line-height:1.05}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-title{max-width:100%;overflow:hidden;font-size:clamp(1.7rem, 2.2vw, 2.25rem);line-height:1.08;text-overflow:ellipsis;white-space:nowrap;word-break:normal;overflow-wrap:normal}#content-container:has(.x2mdx-ref-page--manual-api) .x2mdx-ref-title{overflow:visible;text-overflow:clip;white-space:normal}#content-container:has(.x2mdx-ref-page--manual-api) #page-title{font-size:2.25rem!important;font-weight:600!important;line-height:2.5rem!important}#content-container:has(.x2mdx-ref-page--manual-api) .mdx-content h2{margin-top:1.8rem!important;margin-bottom:0!important;font-size:1.125rem!important;font-weight:600!important;line-height:1.6875rem!important}@media (max-width: 1023px){#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-title{white-space:normal;overflow:visible;text-overflow:clip}}@media (max-width: 639px){#content-container:has(.x2mdx-ref-page--manual-api) #page-title{font-size:1.875rem!important;line-height:2.25rem!important}body:has(.x2mdx-ref-page) .breadcrumb-list{min-width:0;max-width:100%;flex-wrap:wrap}body:has(.x2mdx-ref-page) .breadcrumb-item,body:has(.x2mdx-ref-page) .breadcrumb-item a{min-width:0;max-width:100%;overflow-wrap:anywhere}body:has(.x2mdx-ref-page) .mdx-content>div.table{display:block!important;box-sizing:border-box;width:100%!important;max-width:100%!important;overflow-x:auto}#content-container:has(.x2mdx-ref-page) #pagination{align-items:stretch;flex-direction:column;gap:0.75rem;min-width:0;max-width:100%}#content-container:has(.x2mdx-ref-page) #pagination>a{width:100%;min-width:0;max-width:100%;margin-left:0!important}#content-container:has(.x2mdx-ref-page) #pagination>a span{min-width:0;overflow-wrap:anywhere}}.x2mdx-ref-summary{margin:0;max-width:58rem;color:var(--x2mdx-ref-text-muted);font-size:1.02rem}#content-container:has(.x2mdx-ref-page--manual-api) #content-area #header>div:has(>p){display:block!important}body:has(.x2mdx-ref-page--manual-api):has(#header p) .x2mdx-ref-page--manual-api+.x2mdx-ref-hero .x2mdx-ref-summary{display:none}.x2mdx-ref-api-header-badges{margin-top:0.75rem}body:has(#x2mdx-ref-api-header-badges) .x2mdx-ref-page--manual-api+.x2mdx-ref-hero .x2mdx-ref-badges{display:none}:root.dark .x2mdx-ref-summary,[data-theme=\"dark\"] .x2mdx-ref-summary{color:rgb(209, 213, 219)}.x2mdx-ref-page--operation{display:none}#content-container:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)){max-width:92rem!important}body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) #table-of-contents-content,body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) #content-side-layout,body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) #table-of-contents-layout,body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) #table-of-contents,body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) aside:has(#table-of-contents-content),body:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) [aria-label=\"Table of contents\"]{display:none!important}#content-container:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) #content-area{width:100%!important}.x2mdx-ref-operation-shell{display:grid;grid-template-columns:minmax(0, 1fr) minmax(22rem, 26rem);gap:clamp(2rem, 4vw, 4rem);align-items:start;width:100%}.x2mdx-ref-operation-main{min-width:0}.x2mdx-ref-operation-shell:not(:has(.x2mdx-ref-right-rail)){grid-template-columns:minmax(0, 1fr)}.x2mdx-ref-right-rail{display:grid;position:sticky;top:6rem;z-index:1;width:100%;margin:0;gap:1rem}.x2mdx-ref-rail-panel{min-width:0}@media (max-width: 1180px){.x2mdx-ref-operation-shell{grid-template-columns:minmax(0, 1fr)}.x2mdx-ref-right-rail{position:static;width:100%;margin:0 0 2rem}}.x2mdx-ref-rail-code :is(.code-group,[class*=\"code-group\"]){margin:0}.x2mdx-ref-rail-code{display:grid;gap:0.65rem;min-width:0}.x2mdx-ref-rail-head{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-width:0}.x2mdx-ref-rail-heading{min-width:0;max-width:13rem;overflow:hidden;color:rgb(31, 41, 55);font-family:ui-monospace, SFMono-Regular, SFMono-RegularFallback, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;font-size:0.82rem;font-weight:500;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}:root.dark .x2mdx-ref-rail-heading,[data-theme=\"dark\"] .x2mdx-ref-rail-heading{color:rgb(229, 231, 235)}.x2mdx-ref-operation-bar{display:flex;align-items:center;gap:0.75rem;width:100%;min-height:3.75rem;margin:0 0 3.25rem;padding:0.55rem 0.75rem;overflow:hidden;border:1px solid var(--x2mdx-ref-border);border-radius:1rem;background:var(--x2mdx-ref-surface);box-shadow:0 1px 2px rgba(13, 12, 17, 0.04)}:root.dark .x2mdx-ref-operation-bar,[data-theme=\"dark\"] .x2mdx-ref-operation-bar{border-color:rgba(255, 255, 255, 0.08);background:rgba(17, 17, 21, 0.6)}.x2mdx-ref-operation-method{flex:0 0 auto;padding:0.32rem 0.55rem;border-radius:0.55rem;background:rgba(22, 163, 74, 0.12);color:rgb(22, 163, 74);font-size:0.86rem;font-weight:700;line-height:1}.x2mdx-ref-operation-method--post,.x2mdx-ref-operation-method--json-rpc{background:rgba(37, 99, 235, 0.12);color:rgb(37, 99, 235)}.x2mdx-ref-operation-method--publish,.x2mdx-ref-operation-method--subscribe{background:rgba(124, 58, 237, 0.12);color:rgb(124, 58, 237)}.x2mdx-ref-operation-bar code{flex:1 1 auto;min-width:0;overflow:hidden;background:transparent;color:inherit;font-size:0.98rem;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}#content-container:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) h2{margin-top:2.5rem!important;margin-bottom:1rem!important;font-size:1.35rem!important;font-weight:700!important;line-height:1.25!important}#content-container:has(.x2mdx-ref-page--operation):not(:has(.x2mdx-ref-page--manual-api)) h3{font-size:1rem!important;line-height:1.35!important}#content-container :is(a[id^=\"interface-\"],a[id^=\"type-alias-\"],a[id^=\"variable-\"],a[id^=\"function-\"])+h4:not(:first-of-type),#content-container :is(a[id^=\"class-\"],a[id^=\"constr-\"],a[id^=\"function-\"],a[id^=\"type-\"])+h3:not(:first-of-type){margin-top:2rem!important;padding-top:1.35rem!important;border-top:1px solid rgba(var(--canton-highlight-rgb), 0.54)}.x2mdx-ref-rail-code--response{position:relative}.x2mdx-ref-response-label{flex:0 1 auto;max-width:11rem;overflow:hidden;color:rgb(115, 114, 118);font-family:ui-monospace, SFMono-Regular, SFMono-RegularFallback, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;font-size:0.75rem;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}:root.dark .x2mdx-ref-response-label,[data-theme=\"dark\"] .x2mdx-ref-response-label{color:rgb(162, 160, 165)}.x2mdx-ref-badges{display:flex;flex-wrap:wrap;gap:0.5rem}.x2mdx-ref-badge{display:inline-flex;align-items:center;min-height:1.55rem;padding:0.14rem 0.52rem;border:1px solid rgba(var(--canton-highlight-rgb), 0.16);border-radius:999px;background:var(--x2mdx-ref-accent-soft);color:var(--canton-highlight);font-size:0.76rem;font-weight:600;line-height:1.1;text-decoration:none}a.x2mdx-ref-badge:hover{filter:brightness(0.96);text-decoration:underline;text-underline-offset:0.16rem}a.x2mdx-ref-badge:focus-visible{outline:2px solid var(--canton-highlight);outline-offset:2px}.x2mdx-ref-badge--neutral{background:var(--x2mdx-ref-neutral-soft);border-color:rgba(107, 114, 128, 0.18);color:var(--x2mdx-ref-text-muted)}:root.dark .x2mdx-ref-badge--neutral,[data-theme=\"dark\"] .x2mdx-ref-badge--neutral{background:rgba(156, 163, 175, 0.12);border-color:rgba(156, 163, 175, 0.16);color:rgb(229, 231, 235)}.x2mdx-ref-badge--added{background:var(--x2mdx-ref-success-soft);border-color:rgba(21, 128, 61, 0.18);color:var(--x2mdx-ref-success)}.x2mdx-ref-badge--changed{background:var(--x2mdx-ref-info-soft);border-color:rgba(29, 78, 216, 0.18);color:var(--x2mdx-ref-info)}.x2mdx-ref-badge--removed{background:var(--x2mdx-ref-danger-soft);border-color:rgba(185, 28, 28, 0.18);color:var(--x2mdx-ref-danger)}.x2mdx-ref-meta-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(12rem, 1fr));gap:0.75rem;margin:0}.x2mdx-ref-meta-item{min-width:0;padding:0.85rem 0.95rem;border:1px solid var(--x2mdx-ref-border);border-radius:0.7rem;background:var(--x2mdx-ref-surface)}:root.dark .x2mdx-ref-meta-item,[data-theme=\"dark\"] .x2mdx-ref-meta-item{border-color:rgba(255, 255, 255, 0.08);background:rgba(17, 24, 39, 0.7)}.x2mdx-ref-meta-label{display:block;margin:0 0 0.3rem;font-size:0.77rem;font-weight:600;text-transform:uppercase;color:var(--x2mdx-ref-text-muted)}.x2mdx-ref-meta-value{display:block;margin:0;overflow-wrap:anywhere;font-size:0.96rem;font-weight:500;color:var(--x2mdx-ref-text)}.x2mdx-ref-card-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(16rem, 1fr));gap:1rem}.x2mdx-ref-card{display:grid;align-content:start;gap:0.8rem;min-height:100%;min-width:0;padding:1rem;border:1px solid var(--x2mdx-ref-border);border-radius:0.7rem;background:var(--x2mdx-ref-surface);color:inherit;text-decoration:none;transition:border-color 160ms ease, transform 160ms ease, background-color 160ms ease}.x2mdx-ref-card>*{min-width:0}:root.dark .x2mdx-ref-card,[data-theme=\"dark\"] .x2mdx-ref-card{border-color:rgba(255, 255, 255, 0.08);background:rgba(17, 24, 39, 0.78)}.x2mdx-ref-card:hover{border-color:rgba(var(--canton-highlight-rgb), 0.42);transform:translateY(-1px)}.x2mdx-ref-card-head{display:contents}.x2mdx-ref-card-title{order:0;margin:0;font-size:1rem;font-weight:700;line-height:1.3;color:var(--x2mdx-ref-text-strong);text-decoration:none;overflow-wrap:anywhere}.x2mdx-ref-card-title:hover{color:rgb(var(--canton-highlight-rgb))}.x2mdx-ref-card .x2mdx-ref-badges{order:2}.x2mdx-ref-card-summary{order:1;margin:0;color:var(--x2mdx-ref-text-muted);overflow-wrap:anywhere}.x2mdx-ref-card .x2mdx-ref-meta-grid{order:3}.x2mdx-ref-history{display:grid;gap:0.75rem;margin:0 0 2rem}.x2mdx-ref-history,.x2mdx-ref-history-event,.x2mdx-ref-history-event-head,.x2mdx-ref-history-event-detail{min-width:0;max-width:100%}.x2mdx-ref-history-event{display:grid;gap:0.5rem;padding:0.9rem 1rem;border:0;border-left:3px solid var(--x2mdx-ref-text-muted);border-radius:0.7rem;background:var(--x2mdx-ref-neutral-soft);scroll-margin-top:6rem}:root.dark .x2mdx-ref-history-event,[data-theme=\"dark\"] .x2mdx-ref-history-event{color:var(--x2mdx-ref-text)}.x2mdx-ref-history-event--introduced{border-left-color:var(--x2mdx-ref-success);background:var(--x2mdx-ref-success-soft)}.x2mdx-ref-history-event--changed,.x2mdx-ref-history-event--replacement{border-left-color:var(--x2mdx-ref-info);background:var(--x2mdx-ref-info-soft)}.x2mdx-ref-history-event--removed,.x2mdx-ref-history-event--deprecated,.x2mdx-ref-history-event--remove-as-of{border-left-color:var(--x2mdx-ref-danger);background:var(--x2mdx-ref-danger-soft)}.x2mdx-ref-history-event-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}.x2mdx-ref-history-event-label{color:var(--x2mdx-ref-text-strong);font-size:0.92rem;font-weight:700;line-height:1.3}.x2mdx-ref-history-event-version{flex:0 0 auto;background:transparent;color:var(--x2mdx-ref-text-muted);font-size:0.82rem}:root.dark .x2mdx-ref-history-event-version,[data-theme=\"dark\"] .x2mdx-ref-history-event-version{color:rgb(209, 213, 219)}.x2mdx-ref-history-event-detail{margin:0;overflow-wrap:anywhere;color:var(--x2mdx-ref-text-muted);font-size:0.92rem;line-height:1.5}:root.dark .x2mdx-ref-history-event-detail,[data-theme=\"dark\"] .x2mdx-ref-history-event-detail{color:rgb(209, 213, 219)}@media (max-width: 640px){.x2mdx-ref-history-event-head{align-items:flex-start;flex-direction:column;gap:0.35rem}}:root.dark .x2mdx-ref-card-summary,[data-theme=\"dark\"] .x2mdx-ref-card-summary{color:rgb(209, 213, 219)}.x2mdx-ref-panel,.x2mdx-ref-schema{margin:0 0 1rem;padding:1rem;border:1px solid rgba(15, 23, 42, 0.08);border-radius:0.7rem;background:rgba(255, 255, 255, 0.82)}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-panel,#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-schema{margin:0 0 1.9rem;padding:0;border:0;border-radius:0;background:transparent}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-panel-head,#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-schema-head{margin-bottom:0.65rem}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-grid{display:flex;flex-wrap:wrap;gap:0.45rem 1.1rem;padding:0.8rem 0;border-top:1px solid rgba(15, 23, 42, 0.08);border-bottom:1px solid rgba(15, 23, 42, 0.08)}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-item{display:flex;align-items:baseline;gap:0.35rem;min-width:0;padding:0;border:0;border-radius:0;background:transparent}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-label{margin:0;font-size:0.72rem;letter-spacing:0;text-transform:none}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-label::after{content:\":\"}#content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-value{max-width:32rem;font-size:0.86rem;font-weight:500}:root.dark #content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-grid,[data-theme=\"dark\"] #content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-grid,:root.dark #content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-item,[data-theme=\"dark\"] #content-container:has(.x2mdx-ref-page--operation) .x2mdx-ref-meta-item{border-color:rgba(255, 255, 255, 0.08);background:transparent}:root.dark .x2mdx-ref-panel,:root.dark .x2mdx-ref-schema,[data-theme=\"dark\"] .x2mdx-ref-panel,[data-theme=\"dark\"] .x2mdx-ref-schema{border-color:rgba(255, 255, 255, 0.08);background:rgba(17, 24, 39, 0.78)}.x2mdx-ref-panel-head,.x2mdx-ref-schema-head{display:grid;gap:0.3rem;margin-bottom:0.9rem}.x2mdx-ref-panel-head h3,.x2mdx-ref-schema-head h3{margin:0;font-size:1rem;line-height:1.3;overflow-wrap:anywhere}.x2mdx-ref-schema-variants{display:grid;gap:0.8rem;margin-top:0.9rem}.x2mdx-ref-schema-variant-label{font-size:0.77rem;font-weight:700;text-transform:uppercase;color:rgb(107, 114, 128)}.x2mdx-ref-schema-variant{display:grid;gap:0.65rem;min-width:0;padding:0.85rem;border:1px solid rgba(15, 23, 42, 0.08);border-radius:0.65rem;background:rgba(248, 250, 252, 0.72)}:root.dark .x2mdx-ref-schema-variant,[data-theme=\"dark\"] .x2mdx-ref-schema-variant{border-color:rgba(255, 255, 255, 0.08);background:rgba(17, 24, 39, 0.58)}.x2mdx-ref-schema-variant-head{display:grid;gap:0.25rem}.x2mdx-ref-schema-variant-head h4{margin:0;font-size:0.94rem;line-height:1.3;overflow-wrap:anywhere}body:has(.x2mdx-ref-hero) #table-of-contents-content a,body:has(.x2mdx-ref-hero) [aria-label=\"Table of contents\"] a{overflow-wrap:anywhere;word-break:normal}.x2mdx-ref-panel-summary,.x2mdx-ref-schema-summary,.x2mdx-ref-schema-description{margin:0;color:rgb(75, 85, 99)}:root.dark .x2mdx-ref-panel-summary,:root.dark .x2mdx-ref-schema-summary,:root.dark .x2mdx-ref-schema-description,[data-theme=\"dark\"] .x2mdx-ref-panel-summary,[data-theme=\"dark\"] .x2mdx-ref-schema-summary,[data-theme=\"dark\"] .x2mdx-ref-schema-description{color:rgb(209, 213, 219)}.x2mdx-ref-fields{display:grid;margin-top:0.75rem;border-top:1px solid rgba(15, 23, 42, 0.08);border-bottom:1px solid rgba(15, 23, 42, 0.08);border-radius:0;overflow:hidden}:root.dark .x2mdx-ref-fields,[data-theme=\"dark\"] .x2mdx-ref-fields{border-color:rgba(255, 255, 255, 0.08)}.x2mdx-ref-field-row{display:grid;gap:0.35rem;padding:0.75rem 0;background:transparent}.x2mdx-ref-field-row+.x2mdx-ref-field-row{border-top:1px solid rgba(15, 23, 42, 0.08)}:root.dark .x2mdx-ref-field-row+.x2mdx-ref-field-row,[data-theme=\"dark\"] .x2mdx-ref-field-row+.x2mdx-ref-field-row{border-top-color:rgba(255, 255, 255, 0.08)}.x2mdx-ref-field-main{display:flex;flex-wrap:wrap;align-items:center;gap:0.45rem;min-width:0}.x2mdx-ref-field-name{background:transparent;color:var(--canton-highlight);font-size:0.94rem;font-weight:600}.x2mdx-ref-type-badge,.x2mdx-ref-required-badge{display:inline-flex;align-items:center;min-height:1.45rem;padding:0.1rem 0.45rem;border-radius:0.42rem;font-family:ui-monospace, SFMono-Regular, SFMono-RegularFallback, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;font-size:0.76rem;line-height:1}.x2mdx-ref-type-badge{background:rgba(107, 114, 128, 0.12);color:rgb(55, 65, 81)}.x2mdx-ref-required-badge{background:rgba(220, 38, 38, 0.1);color:rgb(153, 27, 27)}.x2mdx-ref-field-description{color:rgb(75, 85, 99);font-size:0.9rem;line-height:1.45;white-space:pre-wrap}@media (max-width: 900px){.x2mdx-ref-field-row{padding:0.7rem 0}}.x2mdx-ref-example-heading{margin:1rem 0 0.45rem;font-size:0.88rem;font-weight:600;text-transform:uppercase;color:rgb(107, 114, 128)}.x2mdx-ref-change-list{display:grid;gap:0.7rem}.x2mdx-ref-change-item{display:grid;gap:0.35rem;padding:0.9rem 1rem;border-left:3px solid var(--canton-highlight);border-radius:0.6rem;background:rgba(var(--canton-highlight-rgb), 0.06)}.x2mdx-ref-change-version{font-size:0.82rem;font-weight:700;text-transform:uppercase;color:var(--canton-highlight)}.x2mdx-ref-enum-list{margin:0.8rem 0 0;padding-left:1rem}"}]}
{"page":{"pagePath":"appdev/modules/m3-authorization","slug":"/appdev/modules/m3-authorization","pageMetadata":{"title":"Authorization Model","description":"Understand Daml's authorization model - signatories, observers, and controllers","href":"/appdev/modules/m3-authorization"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Understand Daml’s authorization model - signatories, observers, and controllers\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`parties-and-authority`,children:`Parties and authority`}),`\n`,_jsx(_components.p,{children:`Daml is designed for distributed applications involving mutually distrusting parties. In a well-constructed contract model, all parties have strong guarantees that nobody cheats or circumvents the rules laid out by templates and choices.`}),`\n`,_jsx(_components.p,{children:`In this section you will learn about Daml’s authorization rules and how to develop contract models that give all parties the required guarantees. In particular, you’ll learn how to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Pass authority from one contract to another`}),`\n`,_jsx(_components.li,{children:`Write advanced choices`}),`\n`,_jsx(_components.li,{children:`Reason through Daml’s Authorization model`}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Remember that you can load all the code for this section into a folder called `,_jsx(_components.code,{children:`intro-parties`}),` by running `,_jsx(_components.code,{children:`dpm new intro-parties --template daml-intro-parties`})]})}),`\n`,_jsx(Heading,{level:`2`,id:`prevent-iou-revocation`,children:`Prevent IOU revocation`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`SimpleIou`}),` contract from `,_jsx(_components.code,{children:`choices`}),` and `,_jsx(_components.code,{children:`constraints`}),` has one major problem: The contract is only signed by the `,_jsx(_components.code,{children:`issuer`}),`. The signatories are the parties with the power to create and archive contracts. If Alice gave Bob a `,_jsx(_components.code,{children:`SimpleIou`}),` for $100 in exchange for some goods, she could just archive it after receiving the goods. Bob would have a record of such actions, but would have to resort to off-ledger means to get his money back:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`SimpleIou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory issuer`})}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`simple_iou_test `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` allocateParty `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Alice\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` allocateParty `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Bob\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice and Bob enter into a trade.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice transfers the payment as a SimpleIou.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`SimpleIou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 100.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` currency `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"USD\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` passTime (days `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Bob delivers the goods.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` passTime (minutes `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`10`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice just deletes the payment.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` archiveCmd iou`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For a party to have any guarantees that only those transformations specified in the choices are actually followed, they either need to be a signatory themselves, or trust one of the signatories to not agree to transactions that archive and re-create contracts in unexpected ways. To make the `,_jsx(_components.code,{children:`SimpleIou`}),` safe for Bob, you need to add him as a signatory:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory issuer, owner`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Transfer`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller owner`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` assertMsg `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"newOwner cannot be equal to owner.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`/=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create this with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`There’s a new problem here: There is no way for Alice to issue or transfer this `,_jsx(_components.code,{children:`Iou`}),` to Bob. To get an `,_jsx(_components.code,{children:`Iou`}),` with Bob’s signature as `,_jsx(_components.code,{children:`owner`}),` onto the ledger, his authority is needed:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`iou_test `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` allocateParty `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Alice\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` allocateParty `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Bob\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice and Bob enter into a trade.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice wants to give Bob an Iou, but she can't without Bob's authority.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submitMustFail alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 100.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` currency `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"USD\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- She can issue herself an Iou.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 100.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` currency `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"USD\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- However, she can't transfer it to Bob.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submitMustFail alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd iou `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Transfer`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This may seem awkward, but notice that the `,_jsx(_components.code,{children:`ensure`}),` clause is gone from the `,_jsx(_components.code,{children:`Iou`}),` again. The above `,_jsx(_components.code,{children:`Iou`}),` can contain negative values so Bob should be glad that `,_jsx(_components.code,{children:`Alice`}),` cannot put his signature on any `,_jsx(_components.code,{children:`Iou`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`You’ll now learn a couple of common ways of building issuance and transfer workflows for the above `,_jsx(_components.code,{children:`Iou`}),`, before diving into the authorization model in full.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-propose-accept-workflow-for-one-off-authorization`,children:`Use Propose-Accept workflow for one-off authorization`}),`\n`,_jsxs(_components.p,{children:[`If there is no standing relationship between Alice and Bob, Alice can propose the issuance of an Iou to Bob, giving him the choice to accept. You can do so by introducing a proposal contract `,_jsx(_components.code,{children:`IouProposal`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouProposal`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`issuer`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` observer iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`owner`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouProposal_Accept`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`owner`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create iou`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Note how we have used the fact that templates are records here to store the `,_jsx(_components.code,{children:`Iou`}),` in a single field:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`iouProposal `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouProposal`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 100.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` currency `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"USD\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd iouProposal `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouProposal_Accept`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`IouProposal`}),` contract carries the authority of `,_jsx(_components.code,{children:`iou.issuer`}),` by virtue of them being a signatory. By exercising the `,_jsx(_components.code,{children:`IouProposal_Accept`}),` choice, Bob adds his authority to that of Alice, which is why an `,_jsx(_components.code,{children:`Iou`}),` with both signatories can be created in the context of that choice.`]}),`\n`,_jsxs(_components.p,{children:[`The choice is called `,_jsx(_components.code,{children:`IouProposal_Accept`}),`, not `,_jsx(_components.code,{children:`Accept`}),`, because propose-accept patterns are very common. In fact, you’ll see another one just below. As each choice defines a record type, you cannot have two choices of the same name in scope. It’s a good idea to qualify choice names to ensure uniqueness.`]}),`\n`,_jsxs(_components.p,{children:[`The above solves issuance, but not transfers. You can solve transfers exactly the same way, though, by creating a `,_jsx(_components.code,{children:`TransferProposal`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`26`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory (signatory iou)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` observer (observer iou), newOwner`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal_Cancel`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`owner`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create iou`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal_Reject`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller newOwner`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create iou`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal_Accept`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller newOwner`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create iou with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In addition to defining the signatories of a contract, `,_jsx(_components.code,{children:`signatory`}),` can also be used to extract the signatories from another contract. Instead of writing `,_jsx(_components.code,{children:`signatory (signatory iou)`}),`, you could write `,_jsx(_components.code,{children:`signatory iou.issuer, iou.owner`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`IouProposal`}),` had a single signatory so it could be cancelled easily by archiving it. Without a `,_jsx(_components.code,{children:`Cancel`}),` choice, the `,_jsx(_components.code,{children:`newOwner`}),` could abuse an open TransferProposal as an option. The triple `,_jsx(_components.code,{children:`Accept`}),`, `,_jsx(_components.code,{children:`Reject`}),`, `,_jsx(_components.code,{children:`Cancel`}),` is common to most proposal templates.`]}),`\n`,_jsxs(_components.p,{children:[`To allow an `,_jsx(_components.code,{children:`iou.owner`}),` to create such a proposal, you need to give them the choice to propose a transfer on the `,_jsx(_components.code,{children:`Iou`}),` contract. The choice looks just like the above `,_jsx(_components.code,{children:`Transfer`}),` choice, except that a `,_jsx(_components.code,{children:`IouTransferProposal`}),` is created instead of an `,_jsx(_components.code,{children:`Iou`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`ProposeTransfer`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` IouTransferProposal`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller owner`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` assertMsg `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"newOwner cannot be equal to owner.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` (owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`/=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` this`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Bob can now transfer his `,_jsx(_components.code,{children:`Iou`}),`. The transfer workflow can even be used for issuance:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`25`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`charlie `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` allocateParty `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Charlie\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice issues an Iou using a transfer proposal.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` tpab `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` issuer `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` cash `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Cash`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 100.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` currency `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"USD\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Bob accepts the transfer from Alice.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou2 `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd tpab `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal_Accept`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Bob offers Charlie a transfer.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` tpbc `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd iou2 `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`ProposeTransfer`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` charlie`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Charlie accepts the transfer from Bob.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit charlie `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd tpbc `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouTransferProposal_Accept`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`use-role-contracts-for-ongoing-authorization`,children:`Use role contracts for ongoing authorization`}),`\n`,_jsx(_components.p,{children:`Many actions, like the issuance of assets or their transfer, can be pre-agreed. You can represent this succinctly in Daml through relationship or role contracts.`}),`\n`,_jsxs(_components.p,{children:[`Jointly, an `,_jsx(_components.code,{children:`owner`}),` and `,_jsx(_components.code,{children:`newOwner`}),` can transfer an asset, as demonstrated in the script above. In `,_jsx(_components.code,{children:`compose`}),`, you will see how to compose the `,_jsx(_components.code,{children:`ProposeTransfer`}),` and `,_jsx(_components.code,{children:`IouTransferProposal_Accept`}),` choices into a single new choice, but for now, here is a different way. You can give them the joint right to transfer an IOU:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Mutual_Transfer`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller owner, newOwner`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create this with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` owner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Up to now, the controllers of choices were known from the current contract. Here, the `,_jsx(_components.code,{children:`newOwner`}),` variable is part of the choice arguments, not the `,_jsx(_components.code,{children:`Iou`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`This is also the first time we have shown a choice with more than one controller. If multiple controllers are specified, the authority of `,_jsx(_components.em,{children:`all`}),` the controllers is needed. Here, neither `,_jsx(_components.code,{children:`owner`}),`, nor `,_jsx(_components.code,{children:`newOwner`}),` can execute a transfer unilaterally, hence the name `,_jsx(_components.code,{children:`Mutual_Transfer`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouSender`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` sender `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` receiver `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory receiver`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` observer sender`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` nonconsuming choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Send_Iou`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iouCid `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Iou`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller sender`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` fetch iouCid`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` assert (iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`cash`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`amount `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 0.0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` assert (sender `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`.`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`owner)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exercise iouCid `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Mutual_Transfer`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` newOwner `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` receiver`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The above `,_jsx(_components.code,{children:`IouSender`}),` contract now gives one party, the `,_jsx(_components.code,{children:`sender`}),` the right to send `,_jsx(_components.code,{children:`Iou`}),` contracts with positive amounts to a `,_jsx(_components.code,{children:`receiver`}),`. The `,_jsx(_components.code,{children:`nonconsuming`}),` keyword on the choice `,_jsx(_components.code,{children:`Send_Iou`}),` changes the behaviour of the choice so that the contract it’s exercised on does not get archived when the choice is exercised. That way the `,_jsx(_components.code,{children:`sender`}),` can use the contract to send multiple Ious.`]}),`\n`,_jsx(_components.p,{children:`Here it is in action:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`-- Bob allows Alice to send him Ious.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` sab `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouSender`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` sender `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` receiver `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Charlie allows Bob to send him Ious.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` sbc `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit charlie `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`IouSender`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` sender `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` receiver `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` charlie`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Alice can now send the Iou she issued herself earlier.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou4 `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd sab `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Send_Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iouCid `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:` -- Bob sends it on to Charlie.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd sbc `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`Send_Iou`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iouCid `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` iou4`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`daml’s-authorization-model`,children:`Daml’s authorization model`}),`\n`,_jsx(_components.p,{children:`Hopefully, the above will have given you a good intuition for how authority is passed around in Daml. In this section you’ll learn about the formal authorization model to allow you to reason through your contract models. This will allow you to construct them in such a way that you don’t run into authorization errors at runtime, or, worse still, allow malicious transactions.`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`choices`}),` you learned that a transaction is, equivalently, a tree of transactions, or a forest of actions, where each transaction is a list of actions, and each action has a child-transaction called its consequences.`]}),`\n`,_jsxs(_components.p,{children:[`Each action has a set of `,_jsx(_components.em,{children:`required authorizers`}),` — the parties that must authorize that action — and each transaction has a set of `,_jsx(_components.em,{children:`authorizers`}),` — the parties that did actually authorize the transaction.`]}),`\n`,_jsx(_components.p,{children:`The authorization rule is that the required authorizers of every action are a subset of the authorizers of the parent transaction.`}),`\n`,_jsx(_components.p,{children:`The required authorizers of actions are:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The required authorizers of an `,_jsx(_components.strong,{children:`exercise action`}),` are the controllers on the corresponding choice. Remember that `,_jsx(_components.code,{children:`Archive`}),` and `,_jsx(_components.code,{children:`archive`}),` are just an implicit choice with the signatories as controllers.`]}),`\n`,_jsxs(_components.li,{children:[`The required authorizers of a `,_jsx(_components.strong,{children:`create action`}),` are the signatories of the contract.`]}),`\n`,_jsxs(_components.li,{children:[`The required authorizers of a `,_jsx(_components.strong,{children:`fetch action`}),` (which also includes `,_jsx(_components.code,{children:`fetchByKey`}),`) are somewhat dynamic and covered later.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The authorizers of transactions are:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The root transaction of a commit is authorized by the submitting party.`}),`\n`,_jsx(_components.li,{children:`The consequences of an exercise action are authorized by the actors of that action plus the signatories of the contract on which the action was taken.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`an-authorization-example`,children:`An authorization example`}),`\n`,_jsxs(_components.p,{children:[`Consider the transaction from the script above where Bob sends an `,_jsx(_components.code,{children:`Iou`}),` to Charlie using a `,_jsx(_components.code,{children:`Send_Iou`}),` contract. It is authorized as follows, ignoring fetches:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Bob submits the transaction so he’s the authorizer on the root transaction.`}),`\n`,_jsxs(_components.li,{children:[`The root transaction has a single action, which is to exercise `,_jsx(_components.code,{children:`Send_Iou`}),` on a `,_jsx(_components.code,{children:`IouSender`}),` contract with Bob as `,_jsx(_components.code,{children:`sender`}),` and Charlie as `,_jsx(_components.code,{children:`receiver`}),`. Since the controller of that choice is the `,_jsx(_components.code,{children:`sender`}),`, Bob is the required authorizer.`]}),`\n`,_jsxs(_components.li,{children:[`The consequences of the `,_jsx(_components.code,{children:`Send_Iou`}),` action are authorized by its actors, Bob, as well as signatories of the contract on which the action was taken. That’s Charlie in this case, so the consequences are authorized by both Bob and Charlie.`]}),`\n`,_jsxs(_components.li,{children:[`The consequences contain a single action, which is a `,_jsx(_components.code,{children:`Mutual_Transfer`}),` with Charlie as `,_jsx(_components.code,{children:`newOwner`}),` on an `,_jsx(_components.code,{children:`Iou`}),` with `,_jsx(_components.code,{children:`issuer`}),` Alice and `,_jsx(_components.code,{children:`owner`}),` Bob. The required authorizers of the action are the `,_jsx(_components.code,{children:`owner`}),`, Bob, and the `,_jsx(_components.code,{children:`newOwner`}),`, Charlie, which matches the parent’s authorizers.`]}),`\n`,_jsxs(_components.li,{children:[`The consequences of `,_jsx(_components.code,{children:`Mutual_Transfer`}),` are authorized by the actors (Bob and Charlie), as well as the signatories on the Iou (Alice and Bob).`]}),`\n`,_jsxs(_components.li,{children:[`The single action on the consequences, the creation of an Iou with `,_jsx(_components.code,{children:`issuer`}),` Alice and `,_jsx(_components.code,{children:`owner`}),` Charlie has required authorizers Alice and Charlie, which is a proper subset of the parent’s authorizers.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`You can see the graph of this transaction in the transaction view of the IDE:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`27`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`TX 12 1970-01-01T00:00:00Z (Parties:276:3)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`#12:0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`│ disclosed to (since): 'Bob' (12), 'Charlie' (12)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└─> 'Bob' exercises Send_Iou on #10:0 (Parties:IouSender)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` with`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` iouCid = #11:3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` children:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` #12:1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └─> 'Alice' and 'Bob' fetch #11:3 (Parties:Iou)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` #12:2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └─> 'Bob' and 'Charlie' exercise Mutual_Transfer on #11:3 (Parties:Iou)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` with`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` newOwner = 'Charlie'`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` children:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` #12:3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` │ disclosed to (since): 'Bob' (12), 'Charlie' (12), 'Alice' (12)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └─> 'Alice' and 'Charlie' create Parties:Iou`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` with`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` issuer = 'Alice';`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` owner = 'Charlie';`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` cash =`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` (Parties:Cash with`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` currency = \"USD\"; amount = 100.0000000000)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Note that authority is not automatically transferred transitively.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`template `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`NonTransitive`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyA `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyB `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` Party`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` where`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` signatory partyA`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` observer partyB`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`TryA`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` NonTransitive`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller partyA`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` create `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`NonTransitive`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyA `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyB`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyB `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyA`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` choice `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`TryB`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` :`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` NonTransitive`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` other `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`:`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` ContractId`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` NonTransitive`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` controller partyB`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` do`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exercise other `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`TryA`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`haskell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`haskell`,children:_jsxs(_components.code,{language:`haskell`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`nt1 `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`NonTransitive`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyA `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyB `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` nt2 `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`\u003c-`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submit alice `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` createCmd `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`NonTransitive`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyA `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` alice`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` partyB `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` bob`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` submitMustFail bob `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` exerciseCmd nt1 `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`TryB`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` with`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` other `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` nt2`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The consequences of `,_jsx(_components.code,{children:`TryB`}),` are authorized by both Alice and Bob, but the action `,_jsx(_components.code,{children:`TryA`}),` only has Alice as an actor and Alice is the only signatory on the contract.`]}),`\n`,_jsxs(_components.p,{children:[`Therefore, the consequences of `,_jsx(_components.code,{children:`TryA`}),` are only authorized by Alice. Bob’s authority is now missing to create the flipped `,_jsx(_components.code,{children:`NonTransitive`}),` so the transaction fails.`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-up`,children:`Next up`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`compose`}),` you will put everything you have learned together to build a simple asset holding and trading model akin to that in the `,_jsx(_components.code,{children:`/app-dev/bindings-java/quickstart`}),`. In that context you’ll learn a bit more about the `,_jsx(_components.code,{children:`Update`}),` action and how to use it to compose transactions, as well as about privacy on Daml ledgers.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Authorization Model","description":"Understand Daml's authorization model - signatories, observers, and controllers","href":"/appdev/modules/m3-authorization"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Parties and authority","slug":"parties-and-authority","depth":1,"children":[]},{"title":"Prevent IOU revocation","slug":"prevent-iou-revocation","depth":2,"children":[]},{"title":"Use Propose-Accept workflow for one-off authorization","slug":"use-propose-accept-workflow-for-one-off-authorization","depth":2,"children":[]},{"title":"Use role contracts for ongoing authorization","slug":"use-role-contracts-for-ongoing-authorization","depth":2,"children":[]},{"title":"Daml’s authorization model","slug":"daml’s-authorization-model","depth":2,"children":[{"title":"An authorization example","slug":"an-authorization-example","depth":3,"children":[]}]},{"title":"Next up","slug":"next-up","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/cantonfoundation/9c03e72e153d6207/mintlify-sidebar-footer-patch.js","/_mintlify/custom/cantonfoundation/17537d003d412865/osano.js","/_mintlify/custom/cantonfoundation/ab79e5cc3fdba73d/giscus.js","/_mintlify/custom/cantonfoundation/675ffe7726579720/nav-transition.js","/_mintlify/custom/cantonfoundation/9b7a7a7db37d0115/ga-analytics-adjust.js"],"subdomain":"cantonfoundation","siteName":"Canton Network Docs","title":"Authorization Model - Canton Network Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-13T12:58:44.837Z","originalFileLocation":"appdev/modules/m3-authorization.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Understand Daml\u0026#x27;s authorization model - signatories, observers, and controllers\">\u003cmeta data-mint-head name=\"application-name\" content=\"Canton Network Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/svg+xml\" sizes=\"180x180\" href=\"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026amp;auto=format\u0026amp;n=OOy41G-b8QJx6Gkr\u0026amp;q=85\u0026amp;s=d5d59c10fc4ca9be021afb188db72e2f\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"32x32\" href=\"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026amp;auto=format\u0026amp;n=OOy41G-b8QJx6Gkr\u0026amp;q=85\u0026amp;s=d5d59c10fc4ca9be021afb188db72e2f\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"16x16\" href=\"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026amp;auto=format\u0026amp;n=OOy41G-b8QJx6Gkr\u0026amp;q=85\u0026amp;s=d5d59c10fc4ca9be021afb188db72e2f\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/svg+xml\" href=\"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026amp;auto=format\u0026amp;n=OOy41G-b8QJx6Gkr\u0026amp;q=85\u0026amp;s=d5d59c10fc4ca9be021afb188db72e2f\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authorization Model - Canton Network Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Understand Daml\u0026#x27;s authorization model - signatories, observers, and controllers\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Canton Network Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.canton.network/appdev/modules/m3-authorization\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cantonfoundation.mintlify.site/_mintlify/api/og/v2?division=Module+3%3A+Daml+Smart+Contracts\u0026amp;title=Authorization+Model\u0026amp;description=Understand+Daml%27s+authorization+model+-+signatories%2C+observers%2C+and+controllers\u0026amp;theme=ffe2080e38fe73bda4a88670\u0026amp;signature=7468a96beb0f891150d9cc164f2236db14a60e607c1874b89b4202e1ee69f3d9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Authorization Model - Canton Network Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Understand Daml\u0026#x27;s authorization model - signatories, observers, and controllers\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cantonfoundation.mintlify.site/_mintlify/api/og/v2?division=Module+3%3A+Daml+Smart+Contracts\u0026amp;title=Authorization+Model\u0026amp;description=Understand+Daml%27s+authorization+model+-+signatories%2C+observers%2C+and+controllers\u0026amp;theme=ffe2080e38fe73bda4a88670\u0026amp;signature=7468a96beb0f891150d9cc164f2236db14a60e607c1874b89b4202e1ee69f3d9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/cantonfoundation/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Canton Network Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#734BE2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.canton.network/appdev/modules/m3-authorization\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/appdev/modules/m3-authorization.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.canton.network/#organization\",\"name\":\"Canton Network Docs\",\"url\":\"https://docs.canton.network\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cantonfoundation/OOy41G-b8QJx6Gkr/images/canton-logo-dark.svg?fit=max\u0026auto=format\u0026n=OOy41G-b8QJx6Gkr\u0026q=85\u0026s=d5d59c10fc4ca9be021afb188db72e2f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.canton.network#website\",\"name\":\"Canton Network Docs\",\"url\":\"https://docs.canton.network\",\"publisher\":{\"@id\":\"https://docs.canton.network/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.canton.network/appdev/modules/m3-authorization#webpage\",\"url\":\"https://docs.canton.network/appdev/modules/m3-authorization\",\"name\":\"Authorization Model\",\"description\":\"Understand Daml's authorization model - signatories, observers, and controllers\",\"dateModified\":\"2026-05-13T12:58:44.837Z\",\"isPartOf\":{\"@id\":\"https://docs.canton.network#website\"},\"breadcrumb\":{\"@id\":\"https://docs.canton.network/appdev/modules/m3-authorization#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.canton.network/appdev/modules/m3-authorization#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Module 3: Daml Smart Contracts\",\"item\":\"https://docs.canton.network/appdev/modules/m3-dev-environment\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authorization Model\",\"item\":\"https://docs.canton.network/appdev/modules/m3-authorization\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.canton.network/appdev/modules/m3-authorization#article\",\"headline\":\"Authorization Model\",\"name\":\"Authorization Model\",\"description\":\"Understand Daml's authorization model - signatories, observers, and controllers\",\"url\":\"https://docs.canton.network/appdev/modules/m3-authorization\",\"mainEntityOfPage\":{\"@id\":\"https://docs.canton.network/appdev/modules/m3-authorization#webpage\"},\"dateModified\":\"2026-05-13T12:58:44.837Z\",\"publisher\":{\"@id\":\"https://docs.canton.network/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.canton.network#website\"}}]}\u003c/script>","agentPointerHref":"/appdev/modules/m3-authorization.md","siteName":"Canton Network Docs","nav":{"global":null,"products":[{"product":"Overview","icon":"book-open","pages":[{"title":"Overview","href":"/overview/understand/what-is-canton"}]},{"product":"App Development","icon":"code","groups":[{"group":"Get Started","pages":[{"title":"Choose Your Path","href":"/appdev/get-started/choose-your-path"},{"title":"What's New","href":"/appdev/get-started/whats-new"},{"title":"Upgrading from Previous Versions","href":"/appdev/get-started/upgrading-from-previous-versions"}]},{"group":"QuickStart","pages":[{"title":"Canton Network QuickStart","href":"/appdev/quickstart/index"},{"title":"Prerequisites and Installation","href":"/appdev/quickstart/prerequisites"},{"title":"Running the Demo","href":"/appdev/quickstart/running-the-demo"},{"title":"Project Structure","href":"/appdev/quickstart/project-structure"},{"title":"Using the JSON Ledger API","href":"/appdev/quickstart/json-api"},{"title":"Keycloak in the QuickStart","href":"/appdev/quickstart/keycloak"},{"title":"Onboard External Parties in Quickstart","href":"/appdev/quickstart/external-parties"},{"title":"Deploy Quickstart to DevNet","href":"/appdev/quickstart/deploy-to-devnet"},{"title":"Debugging with lnav","href":"/appdev/quickstart/lnav"},{"title":"Observability and Tracing","href":"/appdev/quickstart/observability-and-tracing"},{"title":"QuickStart FAQ","href":"/appdev/quickstart/faq"}]},{"group":"Module 1: Understanding Canton","pages":[{"title":"Module 1: Understanding Canton","href":"/appdev/modules/m1-understanding-canton"},{"title":"Mental Models for Canton","href":"/appdev/modules/m1-mental-models"},{"title":"The Canton Development Stack","href":"/appdev/modules/m1-development-stack"}]},{"group":"Module 2: Canton for Ethereum Developers","pages":[{"title":"Canton for Blockchain Developers","href":"/appdev/modules/m2-canton-for-ethereum-devs"},{"title":"Concept Translation Tables","href":"/appdev/modules/m2-concept-translation"},{"title":"Privacy Model Differences","href":"/appdev/modules/m2-privacy-differences"},{"title":"Smart Contract Paradigm Shift","href":"/appdev/modules/m2-smart-contract-paradigm"},{"title":"Network Architecture Comparison","href":"/appdev/modules/m2-network-architecture"},{"title":"Multi-Party Workflows","href":"/appdev/modules/m2-multi-party-workflows"},{"title":"Migration Checklist","href":"/appdev/modules/m2-migration-checklist"}]},{"group":"Module 3: Daml Smart Contracts","pages":[{"title":"Development Environment Setup","href":"/appdev/modules/m3-dev-environment"},{"title":"Language Fundamentals","href":"/appdev/modules/m3-language-fundamentals"},{"title":"The Daml Standard Library","href":"/appdev/modules/m3-standard-library"},{"title":"Contract Templates","href":"/appdev/modules/m3-contract-templates"},{"title":"Choices","description":"Learn how to add behavior to Daml contracts using choices - the methods that transform contract state","href":"/appdev/modules/m3-choices"},{"title":"Authorization Model","href":"/appdev/modules/m3-authorization"},{"title":"Composition and Design Patterns","description":"Compose multi-step transactions, understand Daml's execution model and privacy, and apply common multi-party workflow patterns","href":"/appdev/modules/m3-design-patterns"},{"title":"Working with Time","href":"/appdev/modules/m3-working-with-time"},{"title":"Contract Keys","href":"/appdev/modules/m3-contract-keys"},{"title":"Interfaces","href":"/appdev/modules/m3-interfaces"},{"title":"Testing Daml Contracts","href":"/appdev/modules/m3-testing"},{"title":"Building and Packaging","href":"/appdev/modules/m3-building-packaging"}]},{"group":"Module 4: Full-Stack Application Development","pages":[{"title":"Building Applications","href":"/appdev/modules/m4-building-apps-intro"},{"title":"Application Architecture","href":"/appdev/modules/m4-app-architecture"},{"title":"SDKs and APIs","href":"/appdev/modules/m4-sdks-apis"},{"title":"Backend Development","href":"/appdev/modules/m4-backend-dev"},{"title":"Frontend Development","href":"/appdev/modules/m4-frontend-dev"},{"title":"Canton and the JSON Ledger API","href":"/appdev/modules/m4-json-api-tutorial"},{"title":"Multi-Synchronizer Operations with the JSON Ledger API and TypeScript","href":"/appdev/modules/m4-multi-synchronizer-tutorial"},{"title":"Canton Coin and Traffic","href":"/appdev/modules/m4-canton-coin"},{"title":"Featured App Activity Markers","href":"/appdev/modules/m4-featured-app-activity-marker"},{"title":"Observability","href":"/appdev/modules/m4-observability"},{"title":"Connect and Query PQS","href":"/appdev/modules/m4-pqs-tutorial"},{"title":"Query Contracts and Transactions with PQS","href":"/appdev/modules/m4-query-with-pqs"}]},{"group":"Module 5: Testing \u0026 Deployment","pages":[{"title":"Testing Strategies","href":"/appdev/modules/m5-testing-strategies"},{"title":"LocalNet Development","href":"/appdev/modules/m5-localnet-development"},{"title":"SV Operated Networks and Use-cases","href":"/appdev/modules/m5-networks-and-use-cases"},{"title":"Deployment Progression","href":"/appdev/modules/m5-deployment-progression"},{"title":"Environment Configuration","href":"/appdev/modules/m5-environment-configuration"},{"title":"CI/CD Integration","href":"/appdev/modules/m5-ci-cd-integration"},{"title":"How to upload and query Daml packages","href":"/appdev/modules/m5-manage-daml-packages"}]},{"group":"Module 6: Smart Contract Upgrades","pages":[{"title":"Smart Contract Upgrades Overview","href":"/appdev/modules/m6-overview"},{"title":"Upgrade Compatibility","href":"/appdev/modules/m6-upgrade-compatibility"},{"title":"Writing Your First Upgrade","href":"/appdev/modules/m6-writing-first-upgrade"},{"title":"Package Selection","href":"/appdev/modules/m6-package-selection"},{"title":"Testing Upgrades","href":"/appdev/modules/m6-testing-upgrades"},{"title":"Upgrade Deployment","href":"/appdev/modules/m6-deployment"},{"title":"Upgrade Limitations","href":"/appdev/modules/m6-limitations"},{"title":"Package Naming","href":"/appdev/modules/m6-package-naming"}]},{"group":"Module 7: Production Best Practices","pages":[{"title":"Security Best Practices","href":"/appdev/modules/m7-security"},{"title":"Package Management","href":"/appdev/modules/m7-package-management"},{"title":"Smart Contract Upgrades in Production","href":"/appdev/modules/m7-smart-contract-upgrades"},{"title":"Performance Best Practices","href":"/appdev/modules/m7-performance"},{"title":"Error Handling","href":"/appdev/modules/m7-error-handling"},{"title":"Compliance Considerations","href":"/appdev/modules/m7-compliance"},{"title":"Canton Coin Preapprovals","href":"/appdev/modules/m7-canton-coin-preapprovals"}]},{"group":"Deep Dives","pages":[{"title":"Privacy Model for App Developers","href":"/appdev/deep-dives/privacy-model"},{"title":"Multi-Party Applications and Workflows","href":"/appdev/deep-dives/composition-multi-party"},{"title":"Decentralization","href":"/appdev/deep-dives/decentralization"},{"title":"Multi-Hosting and Resilience","href":"/appdev/deep-dives/multi-hosting"},{"title":"Multi-Synchronizer Application Best Practices","href":"/appdev/deep-dives/multi-synchronizer-best-practices"},{"group":"External Signing","pages":[{"title":"External Signing","href":"/appdev/deep-dives/external-signing"},{"title":"External Signing: Party Onboarding","href":"/appdev/deep-dives/external-signing-onboarding"},{"title":"External Signing: Submitting Transactions, Part 1","href":"/appdev/deep-dives/external-signing-transactions-part-1"},{"title":"External Signing: Submitting Transactions, Part 2","href":"/appdev/deep-dives/external-signing-transactions-part-2"},{"title":"External Signing: Topology Transactions","href":"/appdev/deep-dives/external-signing-topology"},{"title":"External Signing: Hashing Algorithm","href":"/appdev/deep-dives/external-signing-hashing-algorithm"}]},{"group":"External Calls","pages":[{"title":"External Calls","href":"/appdev/deep-dives/external-calls"},{"title":"Using External Calls","href":"/appdev/deep-dives/external-calls-usage"}]},{"title":"Performance Optimization","href":"/appdev/deep-dives/performance-optimization"},{"title":"Active Contracts Head Snapshot (ACHS)","href":"/appdev/deep-dives/achs"},{"title":"Parties and users on a Canton ledger: How to allocate and query parties","href":"/appdev/deep-dives/manage-daml-parties"},{"title":"Contracts and Transactions in Java","href":"/appdev/deep-dives/contracts-and-transactions-in-java"},{"title":"Smart Contract Upgrade (SCU)","href":"/appdev/deep-dives/smart-contract-upgrade"},{"title":"Canton Network Application Architecture Design","href":"/appdev/deep-dives/app-architecture-design"},{"title":"Command Deduplication","href":"/appdev/deep-dives/command-deduplication"},{"title":"Explicit Contract Disclosure","href":"/appdev/deep-dives/explicit-contract-disclosure"},{"title":"Values in the Ledger API","href":"/appdev/deep-dives/values-in-the-ledger-api"},{"title":"Open Tracing in Ledger API Client Applications","href":"/appdev/deep-dives/open-tracing"},{"title":"Authorization","href":"/appdev/deep-dives/authorization"},{"title":"Token Standard","href":"/appdev/deep-dives/token-standard"}]},{"group":"Tooling","pages":[{"title":"Development Tools Overview","href":"/appdev/tooling/development-tools-overview"},{"title":"IDE Setup","href":"/appdev/tooling/ide-setup"},{"title":"Debugging Tools","href":"/appdev/tooling/debugging-tools"}]},{"group":"App Rewards","pages":[{"title":"App Rewards","href":"/appdev/app-rewards"}]},{"group":"Troubleshooting","pages":[{"title":"Common Issues FAQ","href":"/appdev/faq"},{"title":"Troubleshooting Cheat Sheet","href":"/appdev/troubleshooting"},{"title":"Installation Issues","href":"/appdev/troubleshooting-guide/installation-issues"},{"title":"Development Issues","href":"/appdev/troubleshooting-guide/development-issues"},{"title":"Operational Issues","href":"/appdev/troubleshooting-guide/operational-issues"},{"title":"Common Questions","href":"/appdev/troubleshooting-guide/common-questions"},{"title":"Daml Error Codes","href":"/appdev/troubleshooting-guide/error-code-reference"},{"title":"Ledger API Errors","href":"/appdev/troubleshooting-guide/ledger-api-errors"}]},{"group":"Reference","pages":[{"title":"Daml Language Reference","href":"/appdev/reference/daml-language-reference"},{"title":"Daml-LF Reference","href":"/appdev/reference/daml-lf-reference"},{"title":"Admin API Reference","href":"/appdev/reference/admin-api-reference"},{"title":"Configuration Reference","href":"/appdev/reference/configuration-reference"},{"title":"Error Codes","href":"/appdev/reference/error-codes"},{"title":"Smart Contract Upgrading Reference","href":"/appdev/deep-dives/smart-contract-upgrading-reference"}]}]},{"product":"Global Synchronizer","icon":"server","pages":[{"title":"Global Synchronizer","href":"/global-synchronizer/understand/overview"}]},{"product":"Integrations","icon":"plug","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"product":"SDKs and Tools","icon":"wrench","pages":[{"title":"SDKs and Tools","href":"/sdks-tools/overview"}]},{"product":"API Reference","icon":"book-open","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Release Notes","icon":"note","pages":[{"title":"Release Notes","href":"/release-notes"}]},{"product":"Version Dashboard","icon":"table","pages":[{"title":"Version Dashboard","href":"/shared/version-compatibility-dashboard"}]},{"product":"Page templates","icon":"file-pen","hidden":true,"pages":[{"title":"Page templates","href":"/src/appdev/deep-dives/token-standard"}]}]},"basePath":"","title":"Authorization Model - Canton Network Docs","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}