1
0
Files
electrum/contrib/build-wine
SomberNight aecc22dc08 build: win/mac: fix trezor plugin for new trezorlib
trezor==0.13.10 pulls in new dep "slip10", which relies on importlib magic

see 19561f0429/slip10/__init__.py (L6)

```
 10.13 | E | plugins.trezor.trezor | error importing trezor plugin deps
Traceback (most recent call last):
  File "importlib/metadata/__init__.py", line 397, in from_name
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "electrum/plugins/trezor/trezor.py", line 29, in <module>
    from .clientbase import TrezorClientBase, RecoveryDeviceInputMethod
  File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
  File "electrum/plugins/trezor/clientbase.py", line 18, in <module>
    import trezorlib.device
  File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
  File "trezorlib/device.py", line 27, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
  File "slip10/__init__.py", line 6, in <module>
  File "importlib/metadata/__init__.py", line 889, in version
  File "importlib/metadata/__init__.py", line 862, in distribution
  File "importlib/metadata/__init__.py", line 399, in from_name
importlib.metadata.PackageNotFoundError: No package metadata was found for slip10
```
2025-06-05 17:59:31 +00:00
..
2025-06-05 16:51:10 +00:00
2025-06-05 16:51:18 +00:00

Windows binaries

These binaries should be reproducible, meaning you should be able to generate binaries that match the official releases.

  • Minimum supported target system (i.e. what end-users need): x86_64, Windows 10 (1809)

This assumes an Ubuntu (x86_64) host, but it should not be too hard to adapt to another similar system.

  1. Install Docker

    See contrib/docker_notes.md.

    (worth reading even if you already have docker)

    Note: older versions of Docker might not work well (see #6971). If having problems, try to upgrade to at least docker 20.10.

  2. Build Windows binaries

    $ ./build.sh
    

    If you want reproducibility, try instead e.g.:

    $ ELECBUILD_COMMIT=HEAD ./build.sh
    
  3. The generated binaries are in ./contrib/build-wine/dist.

Code Signing

Electrum Windows builds are signed with a Microsoft Authenticode™ code signing certificate in addition to the GPG-based signatures.

The advantage of using Authenticode is that Electrum users won't receive a Windows SmartScreen warning when starting it.

The release signing procedure involves a signer (the holder of the certificate/key) and one or multiple trusted verifiers:

Signer Verifier
Build .exe files using make_win.sh
Sign .exe with ./sign.sh
Upload signed files to download server
Build .exe files using make_win.sh
Compare files using unsign.sh
Sign .exe file using gpg -b
Signer and verifiers:
Upload signatures to 'electrum-signatures' repo, as $version/$filename.$builder.asc

Verify Integrity of signed binary

Every user can verify that the official binary was created from the source code in this repository. To do so, the Authenticode signature needs to be stripped since the signature is not reproducible.

This procedure removes the differences between the signed and unsigned binary:

  1. Remove the signature from the signed binary using osslsigncode or signtool.
  2. Set the COFF image checksum for the signed binary to 0x0. This is necessary because pyinstaller doesn't generate a checksum.
  3. Append null bytes to the unsigned binary until the byte count is a multiple of 8.

The script unsign.sh performs these steps.

FAQ

How to investigate diff between binaries if reproducibility fails?

pyi-archive_viewer is needed, for that run $ pip install pyinstaller. As a first pass overview, run:

pyi-archive_viewer -l electrum-*.exe1 > f1
pyi-archive_viewer -l electrum-*.exe2 > f2
diff f1 f2 > d
cat d

Then investigate manually:

$ pyi-archive_viewer electrum-*.exe1
? help