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.id(uint64): Unique group identifier, auto-assigned on creationadmin(string): Cosmos SDK address of the group administratormetadata(bytes): Optional group metadataversion(uint64): Incremented on every group update; used to detect stale proposalstotal_weight(string): Sum of all member weightscreated_at(Timestamp): Block time when the group was created
GroupMember
Represents a member’s relationship to a group.address(string): Cosmos SDK address of the memberweight(string): Voting weight. Set to"0"to remove a member.metadata(bytes): Optional member metadataadded_at(Timestamp): Block time when the member was added
GroupPolicyInfo
Represents a group policy account.address(string): The group policy’s account address (auto-generated)group_id(uint64): The group this policy is associated withadmin(string): Address with authority to update the policydecision_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.PROPOSAL_STATUS_SUBMITTED- Open for votingPROPOSAL_STATUS_ACCEPTED- Passed; ready for executionPROPOSAL_STATUS_REJECTED- Failed tallyPROPOSAL_STATUS_ABORTED- Group or policy updated during votingPROPOSAL_STATUS_WITHDRAWN- Withdrawn by proposer or policy admin
PROPOSAL_EXECUTOR_RESULT_NOT_RUNPROPOSAL_EXECUTOR_RESULT_SUCCESSPROPOSAL_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:
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:
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. gRPC:cosmos.group.v1.Msg/CreateGroup
CLI:
- Metadata length exceeds
MaxMetadataLen - Members have invalid addresses, duplicate entries, or zero weight
UpdateGroupMembers
Add, remove, or reweight members in a group. gRPC:cosmos.group.v1.Msg/UpdateGroupMembers
CLI:
"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. gRPC:cosmos.group.v1.Msg/UpdateGroupAdmin
CLI:
UpdateGroupMetadata
Update a group’s metadata. gRPC:cosmos.group.v1.Msg/UpdateGroupMetadata
CLI:
CreateGroupPolicy
Create a new group policy account with a decision policy. gRPC:cosmos.group.v1.Msg/CreateGroupPolicy
CLI:
- 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. gRPC:cosmos.group.v1.Msg/CreateGroupWithPolicy
CLI:
--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. gRPC:cosmos.group.v1.Msg/UpdateGroupPolicyAdmin
CLI:
UpdateGroupPolicyDecisionPolicy
Update the decision policy for a group policy account. gRPC:cosmos.group.v1.Msg/UpdateGroupPolicyDecisionPolicy
CLI:
UpdateGroupPolicyMetadata
Update a group policy’s metadata. gRPC:cosmos.group.v1.Msg/UpdateGroupPolicyMetadata
CLI:
SubmitProposal
Submit a proposal to a group policy account. gRPC:cosmos.group.v1.Msg/SubmitProposal
CLI:
"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. gRPC:cosmos.group.v1.Msg/WithdrawProposal
CLI:
- Signer is neither a proposer nor the group policy admin
- Proposal is already closed or aborted
Vote
Cast a vote on an open proposal. gRPC:cosmos.group.v1.Msg/Vote
CLI:
VOTE_OPTION_YESVOTE_OPTION_NOVOTE_OPTION_ABSTAINVOTE_OPTION_NO_WITH_VETO
--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. gRPC:cosmos.group.v1.Msg/Exec
CLI:
- Proposal must be in
ACCEPTEDstatus - Execution must occur before
MaxExecutionPeriodafter the voting period ends - A failed execution (
PROPOSAL_EXECUTOR_RESULT_FAILURE) can be retried until expiry
LeaveGroup
Remove yourself from a group. gRPC:cosmos.group.v1.Msg/LeaveGroup
CLI:
- 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 Type | Key | Value |
|---|---|---|
cosmos.group.v1.EventCreateGroup | group_id | {groupId} |
cosmos.group.v1.EventUpdateGroup | group_id | {groupId} |
cosmos.group.v1.EventCreateGroupPolicy | address | {groupPolicyAddress} |
cosmos.group.v1.EventUpdateGroupPolicy | address | {groupPolicyAddress} |
cosmos.group.v1.EventCreateProposal | proposal_id | {proposalId} |
cosmos.group.v1.EventWithdrawProposal | proposal_id | {proposalId} |
cosmos.group.v1.EventVote | proposal_id | {proposalId} |
cosmos.group.v1.EventExec | proposal_id, logs | {proposalId}, {logs} |
cosmos.group.v1.EventLeaveGroup | proposal_id, address | {proposalId}, {address} |
cosmos.group.v1.EventProposalPruned | proposal_id, status, tally_result | pruning details |
REST API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| 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/groups | List all groups |
| GET | /cosmos/group/v1/groups/{group_id}/members | List group members |
| GET | /cosmos/group/v1/group_policies/{address} | Get group policy info |
| GET | /cosmos/group/v1/groups/{group_id}/group_policies | List 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}/tally | Get 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 |