Skip to content

Module selection and custom Daml

Each governed capability is a Daml package. Each package defines proposal templates that implement the GovernableAction interface. The names below are the package names in each daml.yaml.

NeedPackageMain actions
The shared interface of every governed actiongovernance-action-v1The GovernableAction interface. Every package below depends on it.
Governance rules and generic votesgovernance-core-v1GovernanceRules, the confirmation templates, GovernanceExecutionResult and GenericVoteProposal
Token custodygovernance-token-custody-v1Transfer, AcceptTransfer, SetupCcPreapproval and SetupTokenPreapproval
Utility services and token issuancegovernance-utility-onboarding-v1SetupUtility, ProvisionProviderService, provider and user service requests, registrar and instrument onboarding, instrument issuer onboarding and offboarding, Mint, Burn, AcceptMintRequest, AcceptBurnRequest, SetProviderAppRewardBeneficiaries, SetEnableResultContracts, CreateDelegatedBatchedMarkersProxy and RequestDevNetFeaturedAppRight
Credentialsgovernance-utility-credential-v1OfferFreeCredential, OfferPaidCredential and AcceptFreeCredential
Reward automationgovernance-rewards-automation-v1SetupMintingDelegation, AcceptExternalPartySetup, SetupCouponReassignmentDelegation and RevokeCouponReassignmentDelegation
A custom governed actionYour own packageAny template that implements GovernableAction

For the action packages, the names in the table are the action labels. The labels appear on the Approvals page and in each GovernanceExecutionResult.

Several packages also depend on Splice DARs and utility DARs. The repository keeps these dependencies under daml/dars/.

governance-rewards-automation-v1 replaces the older governance-rewards-v1 package. The two packages are not upgrade-compatible.

The repository keeps the built DARs under releases/v1/. The newest version of each built-in package is:

DAR filePackage version
governance-action-v1-0.1.0.dar0.1.0
governance-core-v1-0.1.0.dar0.1.0
governance-token-custody-v1-0.1.0.dar0.1.0
governance-utility-onboarding-v1-0.5.0.dar0.5.0
governance-utility-credential-v1-0.1.0.dar0.1.0
governance-rewards-automation-v1-0.1.0.dar0.1.0

Distribute every package that a party uses to every participant that hosts the party.

Decentralization Manager refers to the built-in packages by name, for example #governance-core-v1. Canton then selects the highest vetted version with that name.

GET /party-config reports these names. PUT /party-config configures credentials only. A request with a packages field returns HTTP 400.

A fork of a built-in package under a different name needs a change to the built-in names in the Decentralization Manager code and a rebuild.

A custom template implements the GovernableAction interface from governance-action-v1. The only governance data-dependency that the package needs is governance-action-v1. It does not need governance-core at build time.

The interface view has four fields:

FieldMeaning
governancePartyThe Decentralized Party whose authority the action needs
proposerThe member or additional proposer who created the proposal
actionLabelA short, stable label for the UI and the audit record
descriptionA description that the execution result keeps

One GovernanceRules contract governs every custom action of its party. You do not deploy new rules for a new template.

ConcernConventionReason
Signatoryproposer onlyOne member can create the proposal without a multi-party submission.
ObservergovernancePartyThe rules contract must fetch the proposal during confirm and execute.
governancePartyEqual to the governance party of the rules contractThe confirm choice checks it.
proposerA member or an additional proposerThe confirm choice checks it against the live rules.
actionLabelA distinct label per template, for example PauseResourceThe UI groups confirmations by label, and the audit records copy it.
descriptionA self-explanatory textThe text is the permanent on-ledger record of the vote.
Preconditionsensure clauses on the templateInvalid proposals fail at creation, before any vote.

The executeImpl of the template runs with the authority of the governance party and of the proposer. It cannot use the authority of any other party. For a third-party signature, use a two-step flow: the action creates an offer, and the other party accepts it.

The proposer chooses every field of the proposal, including each contract ID in it. An action that uses a contract of the governance party must therefore check that the contract belongs to the governance party. Without this check, a proposer can name a contract that they control. Their own authority then passes the controller check of the choice. CreateTransferRule.daml shows the check.

A custom proposal needs no change to Decentralization Manager. A member creates the proposal in one of two ways:

  • Path A: the contracts workflow. POST /contracts creates contracts from typed field definitions, with signatures from the participant nodes. Use this path for infrastructure contracts that the governance party signs, such as GovernanceRules.
  • Path B: a direct Ledger API submission. The proposer is the only signatory. A member creates the proposal with any Ledger API client and its own credentials.

The members then confirm and execute the proposal with governance_type: "core_domain" and the proposal contract ID. See Governance lifecycle.

POST /governance/propose accepts only the built-in proposal types. A new proposal type on that route needs a change to the Decentralization Manager code.

A contracts invitation lists the creates in a fixed order. For each create, the invitation names the resolved package ID, the module, the template and a SHA-256 commitment to the create arguments. Compare these values with the intended deployment before you accept.

Decentralization Manager applies these rules:

  • Decentralization Manager resolves a package name to the newest installed version with that exact name. It does this before it stores the workflow run.
  • A version with more than one package ID needs an explicit package ID.
  • The resolved package ID stays fixed through preparation and retries, even after an upload of another version.
  • Each peer computes the hash of the prepared transaction again before it signs.
  • Each peer refuses changed arguments, other templates, exercises and extra nodes.

Contracts invitations from before these commitments must start again from an upgraded coordinator. Upgraded peers refuse to sign them. Upgrade every node before a deployment. A node accepts a peer only when the peer uses the same wire version and runs version 0.1.9 or later. All nodes of a Decentralized Party must run the same release. See Backup, recovery, and upgrades.

A DARs invitation names the file name and the SHA-256 hash of each DAR. On the Approvals page, a peer operator can download each DAR before they accept. The node checks the downloaded bytes against the hash in the invitation.

  1. Define the application state and the governed action.
  2. Decide who can propose and who executes.
  3. Define the validation in ensure clauses and the failure behavior.
  4. Implement the GovernableAction interface.
  5. Build the DAR and test it with Daml Script tests.
  6. Review the authorization and the privacy of every contract.
  7. Distribute the DAR to every participant with the DARs workflow.
  8. Check that every node has vetted the package.
  9. Create one low-risk proposal, then confirm and execute it.
  10. Query the GovernanceExecutionResult and the resulting application state.

The contracts workflow does not upload DARs. Step 7 therefore comes before any contract deployment. For step 8, use the Packages page or GET /packages/compare-peers. Any authenticated operator can call GET /packages/compare-peers. The admin role is not necessary.

For the routes and request bodies, see Package and contract operations.

Ship a breaking change as a new package with a new version suffix in its name, for example -v2. The old and new packages can then exist together until their pending proposals finish.

Do not change the behavior of a template version that is already in use. Members who confirm a proposal must be able to trust that its executeImpl stays the same.

Custom Daml still needs Daml expertise, package management, testing and node operations. The framework removes repeated governance work. It does not remove application design or security review.

See the packages in context: Use cases.