Real-world Daml applications involve multiple parties with different roles, permissions, and trust relationships. This deep dive covers the Daml design patterns that make complex multi-party workflows work — from simple two-party agreements to multi-step authorization chains spanning several organizations.Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
The Propose-Accept Pattern
The most fundamental multi-party pattern in Daml. Since no party can unilaterally create a contract that binds another party (the signatory rule), you need a two-step process:Delegation
Delegation lets one party grant another party the authority to act on their behalf within a defined scope. Unlike the propose-accept pattern (which creates a shared agreement), delegation creates a one-directional trust relationship.Operate choice, but only for allowed operations. The owner can revoke the delegation by archiving the OperatorLicense.
Multi-Step Workflows
Many business processes require a sequence of actions by different parties. Model these as a chain of contracts, where each step’s output becomes the next step’s input:Atomic Composition
Daml transactions are atomic: either all the creates and archives in a transaction succeed, or none of them do. Use this property to implement complex operations that must happen together:Authorization Through Interfaces
Interfaces define abstract capabilities that templates can implement. Use them to create composable authorization patterns:Transferable gets the TransferTo choice. Your backend can work with the interface without knowing the specific template type, enabling generic transfer logic across different asset types.
Place interface definitions in standalone packages that contain only interfaces and no templates. An interface’s structure (methods and view type) cannot be modified after deployment. If changes are needed, introduce a new interface version in a new package.
Multi-Party Visibility Patterns
Canton’s privacy model means each party sees only the contracts where they are a stakeholder (signatory or observer). For workflows that need broader visibility without giving parties the ability to act, use the observer pattern:Design Considerations
When composing multi-party workflows:- Keep the signatory set minimal — each additional signatory adds coordination overhead
- Use observers for read-only access rather than making parties signatories
- Design templates so that each party’s choices are clear from the template declaration
- Avoid deep transaction trees (many nested exercises) as they increase transaction size and latency
- Consider whether a workflow step needs to be on-ledger or can happen off-ledger
Next Steps
- Decentralization — Strategies for decentralizing at each layer
- Multi-Hosting — Distributing parties across validators for resilience