A command-line tool for rapidly provisioning minimal Squads multisig setups specifically designed for Solana feature gate governance. This tool enables parties to create multisig wallets where the default vault address can be mapped to feature gate account addresses, allowing collective voting on whether new Solana features should be implemented.
This tool is designed to streamline the creation of governance multisigs for Solana feature gates. Feature gates are mechanisms that control the activation of new blockchain features, and this tool enables decentralized governance by allowing multiple parties to collectively vote on feature implementations through a multisig structure.
- ๐ Rapid Provisioning: Quickly create Squads multisig wallets with minimal configuration
- ๐ Multi-Network Deployment: Deploy the same configuration across multiple Solana networks with automatic or manual deployment modes
- ๐ฅ Member Management: Interactive collection of member public keys with automatic permission assignment
- ๐ Persistent Configuration: Same create key across deployments ensures consistent addresses
- ๐จ Rich CLI Experience: Colored output and professional table formatting
- ๐ Comprehensive Reporting: Detailed deployment summary with all addresses and transaction signatures
# Clone the repository
git clone https://github.com/Squads-Protocol/feature-gate-multisig.git
cd feature-gate-multisig
# Build the project
cargo build --release
# The binary will be available at ./target/release/feature-gate-multisig-tool
feature-gate-multisig-tool [COMMAND]
Command | Description |
---|---|
create |
Create a new multisig wallet |
show <ADDRESS> |
Show feature multisig details for a given address |
interactive |
Start interactive mode (default when no command specified) |
config |
Show current configuration including networks array |
feature-gate-multisig-tool create [OPTIONS]
Options:
-t, --threshold <THRESHOLD> Number of required signatures (will be prompted if not provided)
-s, --signers <SIGNERS> Signers (currently unused - members are collected interactively)
-k, --keypair <KEYPAIR> Keypair file path for paying transaction fees (e.g., ~/.config/solana/id.json)
-h, --help Print help information
Examples:
# Create with specific fee payer
feature-gate-multisig-tool create --keypair ~/.config/solana/my-wallet.json
# Create with threshold and fee payer
feature-gate-multisig-tool create --threshold 2 --keypair ~/.config/solana/my-wallet.json
# Create interactively (will prompt for fee payer)
feature-gate-multisig-tool create
View your current configuration including the networks array:
feature-gate-multisig-tool config
Output:
๐ Configuration:
Config file: "/Users/user/.feature-gate-multisig-tool/config.json"
Default threshold: 2
Fee payer keypair: ~/.config/solana/id.json
Saved networks: 3 networks
Network 1: https://api.devnet.solana.com
Network 2: https://api.testnet.solana.com
Network 3: https://api.mainnet-beta.solana.com
Saved members: 2 members
Member 1: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
Member 2: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
Query details of an existing multisig with smart network discovery:
feature-gate-multisig-tool show GWVKaMd1faaxaH9HozFWikNQ9YUCiesEoNdKsfNSxVDD
Output:
๐ Fetching multisig details...
Available networks to search:
1: https://api.devnet.solana.com
2: https://api.mainnet-beta.solana.com
๐ Trying network: https://api.devnet.solana.com
โ
Found account on: https://api.devnet.solana.com
๐ก Using network: https://api.devnet.solana.com
๐ฏ Multisig address: GWVKaMd1faaxaH9HozFWikNQ9YUCiesEoNdKsfNSxVDD
๐ Account data length: 198 bytes
โ
Multisig deserialized successfully!
๐ MULTISIG DETAILS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Property โ Value โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Multisig Address โ GWVKaMd1faaxaH9HozFWikNQ9YUCiesEoNdKsfNSxVDD โ
โ Threshold โ 1 of 2 โ
โ Default Vault Address โ G39AVSauH1gyYDgbWp4Bqw8njUS7e1KQLei5YbQypWyU โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ฅ MEMBERS (2 total)
โญโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฎ
โ # โ Public Key โ Permissions โ Bitmask โ
โโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโค
โ 1 โ seanNDjjAuqnPjschE1sPxLVtD9amiT7mzNjsRYQY4E โ Initiate, Vote, Execute โ 7 โ
โ 2 โ GmRj6WF6J5aoBDmT1QBubAQv6L7LsTxo6VhnF6RGfqro โ Initiate โ 1 โ
โฐโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโฏ
The tool is designed to work primarily in interactive mode, providing a guided experience:
- Config Review: Checks for existing saved configuration and asks for confirmation
- Fee Payer Setup: Prompts for fee payer keypair file path with intelligent defaults
- Member Loading: If config exists, loads saved members with full permissions
- Interactive Fallback: If no config or user declines, collects members interactively
- Contributor Generation: Always generates fresh ephemeral contributor keypair (never saved)
- Create Key: Creates persistent key for consistent addresses across networks
- Contributor is automatically added with Initiate-only permissions (bitmask 1)
- Interactive prompts to add additional members
- Additional members receive full permissions with bitmask 7 (Initiate | Vote | Execute)
- Real-time validation of public key formats
The tool supports two deployment modes:
๐ Automatic Deployment Mode
- Configure multiple networks in your config file using the
networks
array - Deploy to all saved networks automatically with a single confirmation
- Consistent addresses across all networks using the same create key
โ๏ธ Manual Deployment Mode
- Enter RPC endpoints one by one during deployment
- Choose to continue or stop after each deployment
- Flexible for ad-hoc deployments to custom networks
๐ฆ Pre-deployment Preview For each deployment, the tool shows:
- Create key and contributor key
- Derived multisig PDA and vault PDA (index 0)
- All member keys with their permissions
Professional summary tables showing:
- Configuration details (create key, threshold, members)
- Members & permissions table
- Network deployments with addresses
- Transaction signatures for each deployment
- Key Generation: Creates persistent create key and contributor keypair
- Member Setup: Collects member public keys interactively
- Address Derivation: Calculates multisig and vault PDAs using Squads program
- Transaction Building: Constructs
MultisigCreateV2
instruction with:- 8-byte discriminator
- Borsh-serialized arguments
- Proper account metadata
- Multi-Network Support: Deploys identical configuration across different networks
- Confirmation: Provides comprehensive deployment summary
- Create Key: Persistent across deployments, ensures consistent addresses
- Multisig PDA: Derived from create key using Squads program seeds
- Vault PDA: Default vault (index 0) that can be mapped to feature gate addresses
- Members: Contributor receives Initiate-only permissions; additional members receive full permissions for governance participation
The primary goal is to create multisig structures for Solana feature gate governance:
- The default vault address (index 0) serves as the governance account
- This vault can be mapped to specific feature gate account addresses
- Enables decentralized voting on feature activation/deactivation
- Multisig Creation: Use this tool to create governance multisig
- Feature Gate Mapping: Map vault address to feature gate account
- Proposal Creation: Members can initiate proposals for feature changes
- Voting Process: Members vote using their multisig permissions
- Execution: Approved changes are executed through the multisig
Supports deployment to any Solana network:
- Mainnet Beta:
https://api.mainnet-beta.solana.com
- Devnet:
https://api.devnet.solana.com
(default) - Testnet:
https://api.testnet.solana.com
- Custom RPC: Any valid Solana RPC endpoint
The tool maintains configuration in ~/.feature-gate-multisig-tool/config.json
:
{
"threshold": 2,
"members": [
"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
],
"network": "https://api.devnet.solana.com"
}
{
"threshold": 2,
"members": [
"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ"
],
"networks": [
"https://api.devnet.solana.com",
"https://api.testnet.solana.com",
"https://api.mainnet-beta.solana.com"
],
"network": "https://api.devnet.solana.com"
}
- Automatic Saving: After successful deployments, member lists and threshold are saved
- Config Review: On startup, shows existing configuration and asks if you want to use it
- Member Preloading: Saved members are automatically loaded with full permissions (Initiate, Vote, Execute)
- Network Array Support: Configure multiple networks for automatic deployment using the
networks
array - Deployment Mode Selection: Choose between automatic deployment to saved networks or manual entry
- Contributor Exclusion: The ephemeral contributor key is never saved to config
- Backward Compatibility: Supports legacy single
network
field alongside newnetworks
array
A config.example.json
file is provided showing the expected format:
{
"threshold": 2,
"members": [
"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ"
],
"network": "https://api.devnet.solana.com",
"fee_payer_path": "~/.config/solana/id.json"
}
The tool now supports configurable fee payer keypairs for transaction costs:
# Specify fee payer directly via CLI
feature-gate-multisig-tool create --keypair ~/.config/solana/my-wallet.json
# Interactive mode will prompt for fee payer path
feature-gate-multisig-tool interactive
- Config Storage: Fee payer path is saved in
~/.feature-gate-multisig-tool/config.json
- Interactive Prompts: Fee payer keypair path is requested during interactive multisig creation
- Fallback Logic: If no fee payer is specified, the contributor keypair pays transaction fees
- Tilde Expansion: Paths starting with
~/
are automatically expanded to home directory
The tool includes advanced functionality for creating multisig transactions and proposals:
// Create transaction and proposal message for multisig governance
pub fn create_transaction_and_proposal_message(
program_id: Option<&Pubkey>,
fee_payer_pubkey: &Pubkey,
contributor_pubkey: &Pubkey,
multisig_address: &Pubkey,
transaction_index: u64, // Use 1 for fresh multisigs
vault_index: u8, // Use 0 for default vault
transaction_message: VaultTransactionMessage,
priority_fee: Option<u32>,
recent_blockhash: Hash,
) -> eyre::Result<(Message, Pubkey, Pubkey)>
Key Features:
- Dual Instructions: Creates both transaction (index 1) and proposal (index 1) in a single message
- PDA Derivation: Automatically derives transaction and proposal PDAs using Squads program logic
- Priority Fee Support: Optional compute budget instruction for transaction prioritization
- Message-Only: Returns Solana
Message
object for flexible signing and sending
The tool now intelligently searches across multiple networks:
# Tool automatically tries all configured networks to find multisig
feature-gate-multisig-tool show GWVKaMd1faaxaH9HozFWikNQ9YUCiesEoNdKsfNSxVDD
Network Discovery Features:
- Multi-Network Search: Tries all configured networks in order
- Real-time Feedback: Shows progress with colored status indicators
- Error Recovery: Continues searching if account not found on one network
- Performance Optimized: Stops on first successful network discovery
- Solana SDK: Blockchain interaction
- Squads Protocol: Multisig program integration
- Borsh: Serialization/deserialization
- Colored: Terminal output formatting
- Tabled: Professional table formatting
- Inquire: Interactive prompts
- Dialoguer: Confirmation dialogs
- Eyre: Error handling
- Dirs: Cross-platform directory handling
The project includes comprehensive test coverage with modern testing practices:
# Run all tests
cargo test
# Run specific test module
cargo test provision::tests
# Run with output
cargo test -- --nocapture
Test Features:
- Randomized Keys: Tests use
Pubkey::new_unique()
for better isolation and reliability - Comprehensive Coverage: 7 test cases covering serialization, PDA derivation, and message creation
- Real-world Scenarios: Tests both priority fee and no-fee transaction scenarios
- Deterministic Logic: While using random keys, test logic remains deterministic and reliable
- Multi-run Stability: Tests pass consistently across multiple executions
Test Modules:
test_create_transaction_data_serialization
- Transaction instruction format validationtest_create_proposal_data_serialization
- Proposal instruction format validationtest_vault_transaction_message_serialization
- Transaction message payload testingtest_pda_derivation
- Program Derived Address generation verificationtest_account_metas_generation
- Account metadata structure validationtest_create_transaction_and_proposal_message
- Full message creation with priority feestest_create_transaction_and_proposal_message_no_priority_fee
- Message creation optimization
- Multisig PDA: Main multisig account
- Vault PDA (index 0): Default vault for feature gate mapping
- Program Config: Squads program configuration account
- Persistent Keys: The same create key is used across all deployments
- Permission Model: Contributor has Initiate-only (bitmask 1); additional members have full permissions (bitmask 7)
- Network Consistency: Identical addresses across different networks
- โ Enhanced Fee Payer Support: CLI args, interactive prompts, and config persistence
- โ Smart Network Discovery: Multi-network search with intelligent fallback
- โ Transaction/Proposal Creation: Advanced multisig governance message building
- โ Improved Testing: Randomized test keys for better reliability and isolation
- โ Better Error Handling: Enhanced error messages and recovery scenarios
- โ Config Enhancements: Fee payer path storage and tilde expansion support
- Optimized Network Queries: Stops searching on first successful network
- Deterministic Testing: Consistent test results across multiple runs
- Memory Efficient: Minimal resource usage for transaction building
- Cross-platform: Works on macOS, Linux, and Windows
- Comprehensive Documentation: Updated README with all new features
- Rich CLI Help: Detailed help text for all commands and options
- Error Guidance: Helpful hints for common issues and solutions
- Test Coverage: 100% test coverage for critical transaction building logic
- Transaction Fees: Requires SOL for transaction fees on target networks
- Security: Generated keys are ephemeral - save important addresses from output
๐ Creating feature gate multisig configuration
๐ Found existing configuration:
Threshold: 2
Saved networks: 3 networks
Network 1: https://api.devnet.solana.com
Network 2: https://api.testnet.solana.com
Network 3: https://api.mainnet-beta.solana.com
Saved members: 2 members
Member 1: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
Member 2: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
โ
Use these saved members and settings? Yes
๐ Deploy to all saved networks automatically? Yes
๐ Automatic deployment mode - deploying to 3 networks
โ
Using saved configuration
๐ Final Configuration:
Contributor public key: 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ
Create key: 8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
Threshold: 2
๐ฅ All Members:
โ Contributor: 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ (Initiate)
โ Member 1: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM (Initiate, Vote, Execute)
โ Member 2: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU (Initiate, Vote, Execute)
๐ DEPLOYMENT SUMMARY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Configuration:
Create Key: 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ
Threshold: 2
Total Members: 2
๐ฅ Members & Permissions:
โญโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ # โ Public Key โ Permissions โ
โโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 1 โ 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU (Contributor) โ Initiate โ
โ 2 โ 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM โ Initiate, Vote, Execute โ
โฐโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ Network Deployments:
โญโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ # โ Network โ Multisig Address โ Vault Address โ Transaction Signature โ
โโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 1 โ https://api.devnet.solana.com โ 8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU โ 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ โ 5J7...xyz โ
โ 2 โ https://api.testnet.solana.com โ 8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU โ 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ โ 9B2...abc โ
โ 3 โ https://api.mainnet-beta.solana.com โ 8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU โ 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ โ 3F8...def โ
โฐโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
Successfully deployed to 3 network(s)!
๐พ Configuration saved for future use
๐ Creating feature gate multisig configuration
๐ Manual network entry mode
Enter RPC URL for deployment: https://api.devnet.solana.com
๐ Deploying to: https://api.devnet.solana.com
๐ฆ All public keys for this deployment:
Create key: 8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
Contributor: 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP6kQ
Multisig PDA: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
Vault PDA (index 0): 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
โ
Deployment successful on https://api.devnet.solana.com
Deploy to another network with the same configuration? No
Contributions are welcome! Please ensure:
- Code follows Rust conventions
- All tests pass
- Documentation is updated for new features
- Security best practices are maintained
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License provides:
- โ Commercial use - Use this tool in commercial projects
- โ Modification - Modify and adapt the code for your needs
- โ Distribution - Share and distribute the tool
- โ Private use - Use privately without restrictions
- โน๏ธ Attribution - Include the original license notice
โ ๏ธ No warranty - Software provided "as is" without warranty
For support, please:
- Check existing issues in the repository
- Create a new issue with detailed information
- Include relevant logs and configuration details