- Decentralization Manager
- Concepts and development
- Module selection and custom Daml
Module selection and custom Daml
Choose a package
Section titled “Choose a package”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.
| Need | Package | Main actions |
|---|---|---|
| The shared interface of every governed action | governance-action-v1 | The GovernableAction interface. Every package below depends on it. |
| Governance rules and generic votes | governance-core-v1 | GovernanceRules, the confirmation templates, GovernanceExecutionResult and GenericVoteProposal |
| Token custody | governance-token-custody-v1 | Transfer, AcceptTransfer, SetupCcPreapproval and SetupTokenPreapproval |
| Utility services and token issuance | governance-utility-onboarding-v1 | SetupUtility, ProvisionProviderService, provider and user service requests, registrar and instrument onboarding, instrument issuer onboarding and offboarding, Mint, Burn, AcceptMintRequest, AcceptBurnRequest, SetProviderAppRewardBeneficiaries, SetEnableResultContracts, CreateDelegatedBatchedMarkersProxy and RequestDevNetFeaturedAppRight |
| Credentials | governance-utility-credential-v1 | OfferFreeCredential, OfferPaidCredential and AcceptFreeCredential |
| Reward automation | governance-rewards-automation-v1 | SetupMintingDelegation, AcceptExternalPartySetup, SetupCouponReassignmentDelegation and RevokeCouponReassignmentDelegation |
| A custom governed action | Your own package | Any 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.
Released DARs
Section titled “Released DARs”The repository keeps the built DARs under releases/v1/. The newest version of each built-in package is:
| DAR file | Package version |
|---|---|
governance-action-v1-0.1.0.dar | 0.1.0 |
governance-core-v1-0.1.0.dar | 0.1.0 |
governance-token-custody-v1-0.1.0.dar | 0.1.0 |
governance-utility-onboarding-v1-0.5.0.dar | 0.5.0 |
governance-utility-credential-v1-0.1.0.dar | 0.1.0 |
governance-rewards-automation-v1-0.1.0.dar | 0.1.0 |
Distribute every package that a party uses to every participant that hosts the party.
Built-in package names
Section titled “Built-in package names”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.
Custom Daml actions
Section titled “Custom Daml actions”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:
| Field | Meaning |
|---|---|
governanceParty | The Decentralized Party whose authority the action needs |
proposer | The member or additional proposer who created the proposal |
actionLabel | A short, stable label for the UI and the audit record |
description | A 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.
Template conventions
Section titled “Template conventions”| Concern | Convention | Reason |
|---|---|---|
| Signatory | proposer only | One member can create the proposal without a multi-party submission. |
| Observer | governanceParty | The rules contract must fetch the proposal during confirm and execute. |
governanceParty | Equal to the governance party of the rules contract | The confirm choice checks it. |
proposer | A member or an additional proposer | The confirm choice checks it against the live rules. |
actionLabel | A distinct label per template, for example PauseResource | The UI groups confirmations by label, and the audit records copy it. |
description | A self-explanatory text | The text is the permanent on-ledger record of the vote. |
| Preconditions | ensure clauses on the template | Invalid 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.
How a custom proposal reaches governance
Section titled “How a custom proposal reaches governance”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 /contractscreates contracts from typed field definitions, with signatures from the participant nodes. Use this path for infrastructure contracts that the governance party signs, such asGovernanceRules. - 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.
Deployment approvals
Section titled “Deployment approvals”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.
Design steps
Section titled “Design steps”- Define the application state and the governed action.
- Decide who can propose and who executes.
- Define the validation in
ensureclauses and the failure behavior. - Implement the
GovernableActioninterface. - Build the DAR and test it with Daml Script tests.
- Review the authorization and the privacy of every contract.
- Distribute the DAR to every participant with the DARs workflow.
- Check that every node has vetted the package.
- Create one low-risk proposal, then confirm and execute it.
- Query the
GovernanceExecutionResultand 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.
Versioning
Section titled “Versioning”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.
Boundaries
Section titled “Boundaries”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.
Technical sources
Section titled “Technical sources”- Custom Daml templates
- Architecture: Governance System
- Daml packages
- Released DARs
- governance-rewards-automation-v1 README
- Built-in package names
- Contract preparation
Related pages
Section titled “Related pages”- Governance lifecycle
- Use cases
- Package and contract operations
- API and workflow reference
- Complete your first governance action
Next step
Section titled “Next step”See the packages in context: Use cases.
Ask the docs
Answers come only from this documentation and can be wrong. Check the linked pages.
Ask a question about BitSafe, CBTC or the developer guides. For example: