Create a Group Policy
This section will walk you through creating a group policy.
What is a Group Policy?
The group module in the Cosmos SDK allows the creation and management of on-chain multisig (multi-signature) accounts and enables voting for message execution based on configurable decision policies.
A group, in this context, is an aggregation of accounts with associated weights. It is not an account and doesn’t have a balance. It doesn’t in and of itself have any sort of voting or decision weight. It does have an “administrator” which has the ability to add, remove, and update members in the group1.
A group policy is an account that is associated with a specific group and a decision policy. The decision policy dictates how proposals are voted on and passed. For instance, a decision policy could be set such that a proposal needs a minimum number of yes votes to pass, or it could be set so that a proposal needs a certain percentage of yes votes to pass.
The group policy is what links the group (the collection of accounts) to the decision policy (the rules for passing proposals). It’s how the Cosmos SDK knows how to handle votes and proposals for a given group of accounts.
The key idea is that a single group can have multiple group policies, each with its own decision policy. This allows the group to handle different types of decisions in different ways. For example, a group could have one policy for financial decisions that requires a high percentage of yes votes to pass proposals, and another policy for non-financial decisions that only requires a simple majority.
Creating a group policy
To create a group policy will we need to first create a policy.json which outlines the voting policy.
Here in policy.json the threshold
is 2
which means that a minimum weight of 2 is needed in order to reach quorum and pass a proposal.
Next let’s create the policy using the following subcommand.
When creating the group we assigned a 3rd party admin which has the power to add, remove, and update members in the group. To create the group-policy [admin]
needs to be the group admin. Since the administrator of the group does not actually play a decision making role we will assign another administrator to the policy. In the case of our committees, the president will serve as the group policy administrator.
Assign new group policy admin
Last updated