You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python3.13开发Monero MultiSig CLI Wallet:实验性多签功能启用失败及密钥交换异常修复求助

Troubleshooting Monero Experimental Multisig Enablement in Python CLI Wrapper

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-interactive flag: 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-cli inside 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:

  1. Navigate to your wallet directory: cd ~/monero-wallets
  2. Run the CLI with experimental mode enabled:
    monero-wallet-cli --wallet-file=wallet --password=YOUR_PASSWORD --enable-multisig-experimental --non-interactive
    
  3. 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 12:29:05