Skip to main content

Group Module API Reference

Overview

The Group module provides a comprehensive API for managing on-chain multisig groups and collective decision-making. Package: cosmos.group.v1 Go Import: github.com/cosmos/cosmos-sdk/enterprise/group/x/group

Data Types

GroupInfo

Represents a group on-chain.
Fields:
  • id (uint64): Unique group identifier, auto-assigned on creation
  • admin (string): Cosmos SDK address of the group administrator
  • metadata (bytes): Optional group metadata
  • version (uint64): Incremented on every group update; used to detect stale proposals
  • total_weight (string): Sum of all member weights
  • created_at (Timestamp): Block time when the group was created

GroupMember

Represents a member’s relationship to a group.
Fields:
  • address (string): Cosmos SDK address of the member
  • weight (string): Voting weight. Set to "0" to remove a member.
  • metadata (bytes): Optional member metadata
  • added_at (Timestamp): Block time when the member was added

GroupPolicyInfo

Represents a group policy account.
Fields:
  • address (string): The group policy’s account address (auto-generated)
  • group_id (uint64): The group this policy is associated with
  • admin (string): Address with authority to update the policy
  • decision_policy (Any): The policy’s decision logic (threshold or percentage)
  • version (uint64): Incremented on every update; used to detect aborted proposals

Proposal

Represents an on-chain proposal submitted to a group policy.
ProposalStatus values:
  • PROPOSAL_STATUS_SUBMITTED - Open for voting
  • PROPOSAL_STATUS_ACCEPTED - Passed; ready for execution
  • PROPOSAL_STATUS_REJECTED - Failed tally
  • PROPOSAL_STATUS_ABORTED - Group or policy updated during voting
  • PROPOSAL_STATUS_WITHDRAWN - Withdrawn by proposer or policy admin
ProposalExecutorResult values:
  • PROPOSAL_EXECUTOR_RESULT_NOT_RUN
  • PROPOSAL_EXECUTOR_RESULT_SUCCESS
  • PROPOSAL_EXECUTOR_RESULT_FAILURE

TallyResult

The accumulated vote counts for a proposal.

Query API

The Query service provides read-only access to Group module state.

GroupInfo

Get information about a group by ID. gRPC: cosmos.group.v1.Query/GroupInfo REST: GET /cosmos/group/v1/groups/{group_id} CLI:
Example:

GroupPolicyInfo

Get information about a group policy account. gRPC: cosmos.group.v1.Query/GroupPolicyInfo REST: GET /cosmos/group/v1/group_policies/{address} CLI:

GroupMembers

List all members of a group. gRPC: cosmos.group.v1.Query/GroupMembers REST: GET /cosmos/group/v1/groups/{group_id}/members CLI:

GroupsByAdmin

List all groups administered by a given address. gRPC: cosmos.group.v1.Query/GroupsByAdmin REST: GET /cosmos/group/v1/groups/by_admin/{admin} CLI:

GroupPoliciesByGroup

List all group policies associated with a group. gRPC: cosmos.group.v1.Query/GroupPoliciesByGroup REST: GET /cosmos/group/v1/groups/{group_id}/group_policies CLI:

GroupPoliciesByAdmin

List all group policies administered by a given address. gRPC: cosmos.group.v1.Query/GroupPoliciesByAdmin REST: GET /cosmos/group/v1/group_policies/by_admin/{admin} CLI:

Proposal

Get a proposal by ID. gRPC: cosmos.group.v1.Query/Proposal REST: GET /cosmos/group/v1/proposals/{proposal_id} CLI:

ProposalsByGroupPolicy

List all proposals for a given group policy account. gRPC: cosmos.group.v1.Query/ProposalsByGroupPolicy REST: GET /cosmos/group/v1/proposals/by_group_policy/{address} CLI:

VoteByProposalVoter

Get a specific vote on a proposal. gRPC: cosmos.group.v1.Query/VoteByProposalVoter REST: GET /cosmos/group/v1/votes/{proposal_id}/{voter} CLI:

VotesByProposal

List all votes on a proposal. gRPC: cosmos.group.v1.Query/VotesByProposal REST: GET /cosmos/group/v1/votes/by_proposal/{proposal_id} CLI:

TallyResult

Get the current tally for a proposal. gRPC: cosmos.group.v1.Query/TallyResult REST: GET /cosmos/group/v1/proposals/{proposal_id}/tally CLI:
Example Response:

Groups

List all groups on chain. gRPC: cosmos.group.v1.Query/Groups REST: GET /cosmos/group/v1/groups CLI:

Transaction Messages (Msg Service)

CreateGroup

Create a new group with an admin and initial members. Msg: MsgCreateGroup CLI:
Members JSON format:
Authorization: Any address can create a group. Failure conditions:
  • Metadata length exceeds MaxMetadataLen
  • Members have invalid addresses, duplicate entries, or zero weight

UpdateGroupMembers

Add, remove, or reweight members in a group. Msg: MsgUpdateGroupMembers CLI:
Note: Set a member’s weight to "0" to remove them from the group. Authorization: Must be signed by the group admin. Failure conditions:
  • Signer is not the group admin
  • Any associated group policy’s Validate() method fails against the updated member set

UpdateGroupAdmin

Transfer group administration to a new address. Msg: MsgUpdateGroupAdmin CLI:
Authorization: Must be signed by the current group admin.

UpdateGroupMetadata

Update a group’s metadata. Msg: MsgUpdateGroupMetadata CLI:
Authorization: Must be signed by the group admin.

CreateGroupPolicy

Create a new group policy account with a decision policy. Msg: MsgCreateGroupPolicy CLI:
Threshold policy example:
Percentage policy example:
Authorization: Must be signed by the group admin. Failure conditions:
  • Signer is not the group admin
  • Metadata length exceeds MaxMetadataLen
  • Decision policy’s Validate() method fails against the group

CreateGroupWithPolicy

Create a group and a group policy in a single transaction. Msg: MsgCreateGroupWithPolicy CLI:
Set --group-policy-as-admin to make the group policy account the group admin (enabling a self-governed group).

UpdateGroupPolicyAdmin

Transfer group policy administration to a new address. Msg: MsgUpdateGroupPolicyAdmin CLI:
Authorization: Must be signed by the group policy admin.

UpdateGroupPolicyDecisionPolicy

Update the decision policy for a group policy account. Msg: MsgUpdateGroupPolicyDecisionPolicy CLI:
Authorization: Must be signed by the group policy admin. Note: Updating the decision policy aborts any in-flight proposals for that policy.

UpdateGroupPolicyMetadata

Update a group policy’s metadata. Msg: MsgUpdateGroupPolicyMetadata CLI:
Authorization: Must be signed by the group policy admin.

SubmitProposal

Submit a proposal to a group policy account. Msg: MsgSubmitProposal CLI:
Proposal JSON format:
Set "exec": 1 (EXEC_TRY) to attempt immediate execution. When using EXEC_TRY, proposers are automatically counted as yes votes. Authorization: Must be signed by at least one group member. Failure conditions:
  • Metadata, title, or summary length exceeds MaxMetadataLen
  • Proposer is not a group member

WithdrawProposal

Withdraw a pending proposal. Msg: MsgWithdrawProposal CLI:
Authorization: Must be signed by a proposer or the group policy admin. Failure conditions:
  • Signer is neither a proposer nor the group policy admin
  • Proposal is already closed or aborted

Vote

Cast a vote on an open proposal. Msg: MsgVote CLI:
Vote options:
  • VOTE_OPTION_YES
  • VOTE_OPTION_NO
  • VOTE_OPTION_ABSTAIN
  • VOTE_OPTION_NO_WITH_VETO
Set --exec 1 to attempt immediate execution after voting. Authorization: Must be signed by a group member. Failure conditions:
  • Metadata length exceeds MaxMetadataLen
  • Proposal is no longer in the voting period

Exec

Execute an accepted proposal. Msg: MsgExec CLI:
Authorization: Any address can execute an accepted proposal. Notes:
  • Proposal must be in ACCEPTED status
  • Execution must occur before MaxExecutionPeriod after the voting period ends
  • A failed execution (PROPOSAL_EXECUTOR_RESULT_FAILURE) can be retried until expiry

LeaveGroup

Remove yourself from a group. Msg: MsgLeaveGroup CLI:
Authorization: Must be signed by the member leaving. Failure conditions:
  • Signer is not a group member
  • Any associated group policy’s Validate() method fails against the updated member set

Events

The Group module emits the following events:
Event TypeKeyValue
cosmos.group.v1.EventCreateGroupgroup_id{groupId}
cosmos.group.v1.EventUpdateGroupgroup_id{groupId}
cosmos.group.v1.EventCreateGroupPolicyaddress{groupPolicyAddress}
cosmos.group.v1.EventUpdateGroupPolicyaddress{groupPolicyAddress}
cosmos.group.v1.EventCreateProposalproposal_id{proposalId}
cosmos.group.v1.EventWithdrawProposalproposal_id{proposalId}
cosmos.group.v1.EventVoteproposal_id{proposalId}
cosmos.group.v1.EventExecproposal_id, logs{proposalId}, {logs}
cosmos.group.v1.EventLeaveGroupproposal_id, address{proposalId}, {address}
cosmos.group.v1.EventProposalPrunedproposal_id, status, tally_resultpruning details

REST API Endpoints

MethodEndpointDescription
GET/cosmos/group/v1/groups/{group_id}Get group info
GET/cosmos/group/v1/groups/by_admin/{admin}List groups by admin
GET/cosmos/group/v1/groupsList all groups
GET/cosmos/group/v1/groups/{group_id}/membersList group members
GET/cosmos/group/v1/group_policies/{address}Get group policy info
GET/cosmos/group/v1/groups/{group_id}/group_policiesList policies for a group
GET/cosmos/group/v1/group_policies/by_admin/{admin}List policies by admin
GET/cosmos/group/v1/proposals/{proposal_id}Get proposal
GET/cosmos/group/v1/proposals/by_group_policy/{address}List proposals for a policy
GET/cosmos/group/v1/proposals/{proposal_id}/tallyGet tally result
GET/cosmos/group/v1/votes/{proposal_id}/{voter}Get a specific vote
GET/cosmos/group/v1/votes/by_proposal/{proposal_id}List votes for a proposal

Common Use Cases

1. Create a 2-of-3 Multisig Group

2. Submit and Execute a Proposal

3. Self-Governing Group (Policy as Admin)

4. Multiple Policies for Different Actions