Python3.13开发Monero MultiSig CLI Wallet:实验性多签功能启用失败及密钥交换异常修复求助
Let's break down the issues you're facing and walk through actionable fixes step by step:
1. Fix the Global CLI Parameter Issue
Your initial approach to adding --enable-multisig-experimental directly in the command args is correct, but two details might be blocking it:
- Parameter order matters for Monero CLI: Global flags like experimental mode should come before wallet-specific arguments.
- Missing
--non-interactiveflag: Without this, the CLI might hang waiting for user input instead of executing your commands silently.
Update your _build_cli_command function:
def _build_cli_command(self, command: Optional[str] = None, ignore_daemon: bool = False) -> List[str]: """ Build monero-wallet-cli command line arguments for this wallet. """ result = [ self.paths.cli_executable, "--enable-multisig-experimental", # Move to top to ensure global priority "--non-interactive", # Critical for silent, scripted execution "--wallet-file=wallet", f"--password={self.password}", "--daemon-ssl-allow-any-cert", ] for key, value in self.settings.items(): if ignore_daemon and key.startswith("daemon"): continue if not value: continue if isinstance(value, str): result.append(f"--{key}={value}") elif isinstance(value, bool) and value: result.append(f"--{key}") if command: result.append(f"--command={command}") return result
2. Fix the Direct set Command Execution
Your turn_ms_on function is relying on interactive input piping, which can have timing issues in WSL. Instead, use the --command flag to execute the set command directly without entering interactive mode:
def turn_ms_on(self) -> None: """ Enable experimental multisig support via CLI. """ # Execute the set command directly via --command to avoid timing/input issues cli_command = self._build_cli_command( command="set enable-multisig-experimental 1", ignore_daemon=True ) self._run_cli(cli_command, cwd=self.wallet_dir)
3. Resolve WSL-Specific Key Exchange Issues
The round3 key generation failure is likely tied to WSL environment quirks:
- Use WSL-native Monero CLI: Don't run the Windows version of
monero-wallet-cliinside WSL—install the Linux build directly via the official Monero repo for your Ubuntu version. - Avoid cross-filesystem wallet storage: Store your wallet files in WSL's native filesystem (e.g.,
~/monero-wallets) instead of Windows shared directories (/mnt/c/...). Shared directories often have file lock and permission issues that break multisig state tracking. - Verify permissions: Ensure your wallet directory has tight permissions (
chmod 700 ~/monero-wallets) to prevent unintended access or state corruption.
4. Validate Manually First
To rule out code-specific issues, test the flow directly in WSL terminal:
- Navigate to your wallet directory:
cd ~/monero-wallets - Run the CLI with experimental mode enabled:
monero-wallet-cli --wallet-file=wallet --password=YOUR_PASSWORD --enable-multisig-experimental --non-interactive - Execute the set command and check status:
set enable-multisig-experimental 1 multisig status
If this works, your code wrapper was the issue. If not, you may need to update your Monero CLI to the latest stable release (v0.18.x or newer) as older versions had experimental multisig bugs.
内容的提问来源于stack exchange,提问作者AztecCodes

