NNS Governance Canister
The NNS Governance canister is the core governance system of the Internet Computer Protocol. It manages neurons, proposals, and voting to enable decentralized control of the network.Overview
The Governance canister provides:- Neuron Management: Create, configure, and manage ICP neurons with staking and voting power
- Proposal System: Submit and vote on proposals that govern the Internet Computer
- Voting Rewards: Distribute voting rewards to participating neurons
- Network Economics: Manage network-wide economic parameters
- SNS Creation: Launch Service Nervous Systems (SNS) for decentralized applications
Core Concepts
Neurons
Neurons are the fundamental unit of governance. They represent staked ICP tokens and provide voting power based on:- Stake amount: The amount of ICP locked in the neuron
- Dissolve delay: The time until the neuron can be dissolved (up to 8 years)
- Age: How long the neuron has been non-dissolving
Voting Power
Neurons have two types of voting power:- Potential Voting Power: Maximum voting power based on stake, age, and dissolve delay
- Deciding Voting Power: Actual voting power used in proposals, which decreases if the neuron doesn’t refresh regularly
- Voting directly (not via following)
- Setting followees
- Calling
refresh_voting_power
Proposals
Proposals are suggestions for changes to the Internet Computer. They can:- Upgrade canisters
- Modify network economics
- Manage subnet infrastructure
- Create new SNS instances
- Execute arbitrary NNS functions
Key Methods
Neuron Management
manage_neuron
Manage a neuron by executing various commands.Identifies the neuron to manage, either by neuron ID or subaccount
The operation to perform on the neuron:
Spawn: Create a new neuron from maturitySplit: Split neuron into two neuronsFollow: Set neuron to follow others on a topicSetFollowing: Set multiple followees across topicsConfigure: Change neuron configurationDisburse: Withdraw ICP from neuronDisburseMaturity: Convert maturity to ICPStakeMaturity: Convert maturity to stakeMergeMaturity: Merge maturity into stakeMerge: Merge two neuronsMakeProposal: Submit a proposalRegisterVote: Vote on a proposalRefreshVotingPower: Refresh the neuron’s deciding voting power
Result of the command execution, which varies based on the command type
create_neuron
Create a new neuron using ICRC-2 transfer_from (requires prior approval).The amount of ICP to stake in e8s (1 ICP = 100,000,000 e8s)
The subaccount to transfer ICP from (defaults to default subaccount)
The controller of the new neuron (defaults to caller)
The followees to set for the new neuron (defaults to network defaults)
The dissolve delay in seconds (defaults to 7 days, max 8 years)
Whether the neuron should start dissolving immediately (defaults to false)
Whether to automatically stake maturity (defaults to false)
Returns the newly created neuron ID on success
claim_or_refresh_neuron_from_account
Claim or refresh a neuron from a ledger account.The principal that controls the neuron
The memo used when transferring ICP to create the neuron
Returns the neuron ID if successful, or an error
Neuron Operations
Configure Operations
When using theConfigure command in manage_neuron, you can perform these operations:
IncreaseDissolveDelay
Number of seconds to add to the dissolve delay (max 8 years total)
Set an absolute timestamp when the neuron will be dissolved
Add a principal that can vote and submit proposals (but not disburse)
Remove a previously added hot key
Enable or disable automatic staking of maturity
Set neuron visibility (0 = private, 1 = public)
Proposal Management
MakeProposal
Submit a new proposal (viamanage_neuron command).
URL with additional information about the proposal
Short title for the proposal
Description of the proposal
The action to execute if the proposal is adopted:
Motion: Text motion with no executionManageNetworkEconomics: Update economic parametersManageNeuron: Perform neuron operationInstallCode: Install/upgrade canister codeStopOrStartCanister: Stop or start a canisterCreateServiceNervousSystem: Launch an SNSExecuteNnsFunction: Execute arbitrary NNS functionAddOrRemoveNodeProvider: Manage node providersRewardNodeProvider: Reward node providers- And many more…
The ID of the newly created proposal
Optional message with additional information
list_proposals
Query proposals with filtering options.Maximum number of proposals to return
Return proposals with IDs less than this (for pagination)
Filter by proposal status (1=Open, 2=Rejected, 3=Adopted, 4=Executed, 5=Failed)
Filter by reward status
Exclude proposals on specific topics
Include all manage neuron proposals (otherwise only caller’s)
Omit large fields like ballots to reduce response size
List of proposals matching the filters
get_proposal_info
Get detailed information about a specific proposal.The ID of the proposal to query
Complete information about the proposal including:
- Current status and voting deadline
- Proposer neuron ID
- Vote tallies
- Ballots from all neurons
- Execution timestamps
- Failure reason (if failed)
get_pending_proposals
Get all proposals that are currently open for voting.List of all open proposals
Voting
RegisterVote
Vote on a proposal (viamanage_neuron command).
The proposal to vote on
The vote to cast:
- 1 = Yes
- 2 = No
Query Methods
list_neurons
List neurons with filtering and pagination.Specific neuron IDs to include
Include neurons where caller is controller or hotkey
Include full details for public neurons
Page number for pagination
Number of neurons per page
Public information about neurons (redacted view)
Complete neuron data (only for authorized neurons)
Total number of pages available
get_full_neuron
Get complete information about a neuron by ID.The ID of the neuron to query
Complete neuron data if caller is authorized, including:
- Stake and maturity
- Dissolve state
- Followees
- Hot keys
- Voting power (potential and deciding)
- Recent ballots
get_neuron_info
Get public information about a neuron.The ID of the neuron to query
Public neuron information including:
- Dissolve delay and state
- Stake amount
- Age in seconds
- Voting power
- Created timestamp
list_known_neurons
List all publicly known neurons (neurons with public visibility).List of known neurons with their metadata:
- Neuron ID
- Name and description
- Links (social media, website, etc.)
- Topics they’re committed to voting on
get_network_economics_parameters
Get current network economic parameters.Current economic parameters including:
- Neuron minimum stake
- Transaction fees
- Reject cost for proposals
- Maximum node provider rewards
- Voting power economics (refresh thresholds)
get_metrics
Get cached governance metrics.Comprehensive governance statistics including:
- Total staked ICP
- Total supply
- Neuron counts by state
- Maturity totals
- Voting power distributions
- Community fund statistics
- Subset metrics for different neuron categories
Advanced Features
list_neuron_votes
Get voting history for a known neuron.The neuron ID (must be a known neuron)
Return votes for proposals before this ID (for pagination)
Maximum votes to return (max 500)
List of votes cast by the neuron
Proposals before this ID are finalized in history
get_neurons_fund_audit_info
Get audit information for Neurons’ Fund participation in an SNS swap.The NNS proposal ID that created the SNS
Complete audit trail including:
- Initial participation amounts
- Final participation amounts
- Refund information
- Neuron portions allocated
simulate_manage_neuron
Simulate a neuron management operation without executing it.The neuron to simulate the operation on
The command to simulate
Simulated result of the command
Data Types
Neuron
Represents a staked ICP neuron with governance rights.Unique identifier for the neuron
Principal with full control over the neuron
Principals that can vote and submit proposals
Staked ICP in e8s (1 ICP = 100,000,000 e8s)
Accumulated voting rewards (maturity) in e8s equivalent
Maturity that has been staked to increase voting power
Accumulated fees that will be deducted on disburse
Current dissolve state:
DissolveDelaySeconds: Neuron is not dissolving (delay in seconds)WhenDissolvedTimestampSeconds: Neuron is dissolving (timestamp when dissolved)
When the neuron started aging (reset when dissolving starts)
When the neuron was created
Map of topic to followees for automatic voting
Current voting power used in proposals (affected by refresh timing)
Maximum voting power if regularly refreshed
When voting power was last refreshed
Visibility setting: 0 = Private, 1 = Public
Public metadata if this is a known neuron
ProposalInfo
Unique proposal identifier
Neuron that submitted the proposal
Proposal content including title, summary, URL, and action
Current status: 1=Open, 2=Rejected, 3=Adopted, 4=Executed, 5=Failed
Proposal topic/category
Map of neuron ID to ballot (vote and voting power)
Current vote counts (yes, no, total)
When the proposal was created
Voting deadline (affected by wait-for-quiet)
When the proposal was decided (if decided)
When the proposal was executed (if executed)
When the proposal failed (if failed)
Error details if execution failed
Whether the proposal is eligible for voting rewards
Proposal Topics
Proposals are categorized by topic, which affects voting parameters:- NeuronManagement (1): Neuron operations
- ExchangeRate (2): ICP/XDR exchange rate updates
- NetworkEconomics (3): Economic parameter changes
- Governance (4): Governance system upgrades
- NodeAdmin (5): Node management
- ParticipantManagement (6): Participant operations
- SubnetManagement (7): Subnet configuration
- Kyc (9): KYC verification
- NodeProviderRewards (10): Node provider compensation
- IcOsVersionDeployment (13): IC OS version deployments
- IcOsVersionElection (14): IC OS version elections
- SnsAndCommunityFund (15): SNS and Neurons’ Fund
- ApiBoundaryNodeManagement (16): API boundary nodes
- SubnetRental (17): Subnet rental management
- ApplicationCanisterManagement (18): Application canisters
- ProtocolCanisterManagement (19): Protocol canisters
- ServiceNervousSystemManagement (20): SNS management
Error Types
Common governance error types:- Unspecified (0): Unknown error
- InsufficientFunds (1): Not enough ICP for operation
- InvalidCommand (2): Invalid command parameters
- NotAuthorized (3): Caller not authorized
- PreconditionFailed (4): Operation precondition not met
- NotFound (5): Resource not found
- ResourceExhausted (6): Rate limit or capacity exceeded
- InvalidProposal (7): Invalid proposal parameters
- AlreadyExists (8): Resource already exists
- External (9): External call failed
- LedgerUpdateOngoing (10): Ledger operation in progress
Best Practices
For Neuron Holders
- Maximize Voting Power: Increase dissolve delay to 8 years and let neurons age
- Stay Active: Regularly refresh voting power (vote directly, update followees, or call refresh_voting_power)
- Set Followees: Configure followees on topics you want to delegate
- Use Hot Keys: Add hot keys for voting without exposing controller keys
- Auto-Stake Maturity: Enable to compound rewards automatically
For Developers
- Batch Operations: Use
list_neuronspagination for large queries - Query Methods: Use query methods when possible for faster responses
- Error Handling: Always check for errors and handle retry logic
- Simulate First: Use
simulate_manage_neuronfor testing - Monitor Refresh: Track
voting_power_refreshed_timestamp_seconds