Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
71e51de
Initial commit
Alcofribas4 Dec 18, 2018
64191bd
Basic Segwit support:
Alcofribas4 Jan 15, 2019
6668a05
Update support to Satochip v0.6 (non-hardened chilp optimization)
Alcofribas4 Feb 7, 2019
9a770c1
code cleaning: use card_transmit(apdu) instead of @unlock_pin wrapper
Alcofribas4 Feb 7, 2019
707bb8c
* Add Unit Tests for BIP32 derivation
Alcofribas4 Feb 14, 2019
3ea3e2b
Add Unit Test: test card_sign_message()
Alcofribas4 Feb 14, 2019
ecfff27
refactor get_extended_key(): parse response and return (key, chaincod…
Alcofribas4 Feb 19, 2019
dc70165
Improved smartcard detection function 'detect_smartcard_reader(self)'…
Alcofribas4 Feb 26, 2019
9fa120a
Merge remote-tracking branch 'electrum/master' into satochip
Alcofribas4 Feb 26, 2019
23ee3e8
Remove old test class (replaced by test_CardConnector.py)
Alcofribas4 Feb 26, 2019
1f2b83c
update README,
Toporin Feb 28, 2019
5789ad6
minor formatting
Toporin Feb 28, 2019
a4e6ff5
Change .gitignore to add ./gui/qt/icons_rc.py
Toporin Feb 28, 2019
1017b1c
add satochip icons in electrum
Toporin Mar 1, 2019
dc612ba
improve PIN support: prompt for PIN if needed
Toporin Mar 5, 2019
591b297
Improved PIN support:
Toporin Mar 12, 2019
98a2321
packaging electrum-satochip into executable for windows
Toporin Mar 15, 2019
636b9f5
Sync repository with the latest release of electrum v3.3.4
Toporin Mar 25, 2019
bb04379
Packaging electrum-satochip v3.3.4 into executable for windows
Toporin Mar 26, 2019
037fcd0
Electrum v3.3.4 - Satochip v0.7: Add 2FA support
Toporin May 30, 2019
5eeab49
cleanup & remove temporary build files for osx
Toporin Jul 9, 2019
23d857a
Upgrade to Electrum-Satochip v3.3.8-0.7
Toporin Jul 22, 2019
75fb217
Build .exe distributables with new pyscard .whl version (v.1.9.8)
Toporin Jul 23, 2019
fdff14f
Update test suite in test_CardConnector.py
Toporin Jul 23, 2019
6676fad
Remove temp files in contrib/build-wine
Toporin Jul 23, 2019
1b949e7
Clean up code based on https://github.com/spesmilo/electrum/pull/5523
Toporin Jul 26, 2019
bc44e6f
Clean up code based on https://github.com/spesmilo/electrum/pull/5523
Toporin Jul 27, 2019
a3c351b
Clean up code based on https://github.com/spesmilo/electrum/pull/5523
Toporin Oct 3, 2019
d83fff5
Electrum-Satochip v3.3.8-0.8
Toporin Oct 4, 2019
10c60c4
Electrum-Satochip v3.3.8-0.8
Toporin Oct 4, 2019
481691d
Electrum-Satochip v3.3.8-0.9
Toporin Nov 26, 2019
933e89b
Electrum-Satochip v3.3.8-0.9
Toporin Nov 26, 2019
cb26ea9
Patch: Electrum crashes when cancelling PIN change or seed reset
Toporin Dec 5, 2019
a6057e7
Patch "Recovered authentikey does not correspond to registered authen…
Toporin Dec 5, 2019
bdb5aeb
Electrum-Satochip v4.0.0a0-0.9
Toporin Jan 10, 2020
52bbf97
Updated libpcsclite-dev and swig packages in dockerfile for linux app…
Toporin Jan 10, 2020
d1011ab
Electrum-satochip-v4.0.0a0-0.9
Toporin Jan 10, 2020
e5345b7
Electrum-Satochip v4.0.2-0.11.2
Toporin Aug 12, 2020
1472b3e
Switch to BIP39 seeds by default for Satochip
Toporin Sep 22, 2020
2b5abe7
Bump pysatochip version to v0.11.3 instead of v0.11.2
Toporin Sep 22, 2020
d425254
Merge branch 'switch-to-bip39' into electrum-satochip-v4.0.2-0.11
Toporin Sep 22, 2020
ae0f58b
Merge branch 'master' into electrum-satochip-v4.0.2-0.11
Toporin Oct 5, 2020
ff0580c
Merge remote tracking branch & minor improvements
Toporin Jan 7, 2021
2aab3ba
Add support for Satochip v0.12
Toporin Aug 9, 2021
1f84f1f
Build Electrum-Satochip v4.0.9-0.12 for windows
Toporin Aug 9, 2021
d3683fe
Merge branch 'satochip' into electrum-satochip-v4.0.9-0.12
Toporin Aug 10, 2021
aac6aac
Upgrade Electrum-Satochip to v4.1.5-0.12
Toporin Sep 27, 2021
f75c143
build Linux & Windows
Toporin Sep 28, 2021
1bfe0fe
Merge branch 'electrum-satochip-v4.1.5-0.12' into satochip
Toporin Sep 29, 2021
149e4a4
Clean code
Toporin Sep 29, 2021
704a726
build for osx
Toporin Sep 29, 2021
1e41eed
Update build MacOS
Jun 27, 2022
426c467
Merge branch 'master' into electrum-satochip-v4.3.3-0.12
Toporin Jan 23, 2023
fedc984
Patch satochip.py to correct errors introduced by merging
Toporin Jan 23, 2023
8e50c0b
Improve Satochip UI
Toporin Jan 23, 2023
b0eb046
Update pyopenssl
Toporin Jan 24, 2023
e054035
In satochip/qt.py plugin, replace client.handler.{show_error(), show_…
Jan 24, 2023
7b01798
Improve connection with 2FA server
Toporin Jan 25, 2023
020bbdf
Merge branch 'electrum-satochip-v4.3.3-0.12' into satochip
Toporin May 16, 2023
10a5d22
Merge commit 'a6f3ee6364e4ad667ceb146bf0c951659cecd6f5' into electrum…
Toporin May 16, 2023
63d6ed7
Update Satochip plugin following upstream merge
Toporin May 22, 2023
ce80c48
Refactor 2FA challenge-response
Toporin May 24, 2023
afd14ce
Clean and remove unused code
Toporin Jun 12, 2023
3c118e9
Refactor class QRDialog: add optionnal 'cancel' button
Toporin Jun 13, 2023
5e462eb
Refactor config mgmt for server_2FA
Toporin Jun 20, 2023
f1f8dda
(minor) improve display of Satochip chain of certificates
Toporin Jun 20, 2023
116e5e1
Satochip setup wizard: remove BIP39 seed generation
Toporin Jun 21, 2023
c540056
Upgrade pysatochip from v0.12.3 to 0.12.5
Toporin Jun 21, 2023
db5921c
update locale
Toporin Jun 21, 2023
6f876f0
Merge branch 'master' into electrum-satochip-v4.4.3-0.12
Toporin Jun 21, 2023
331fe1f
Add satochip support for MacOS build
Jun 22, 2023
cd0cfe5
Workaround to build pyscard from win32 wheel (not available in pypi)
Toporin Jun 27, 2023
5a5605e
Use autopep8 to correct flake8 errors
Toporin Jun 27, 2023
59b4b5d
Bump pyscard to v2.0.7
Toporin Jul 10, 2023
b1467d2
Merge branch 'master' into electrum-satochip-v4.4.3-0.12
Toporin Jul 10, 2023
c00ac5d
Patch error caused by the method "parse_URI()" being moved and renamed:
Toporin Jul 10, 2023
d95c687
Merge branch 'master' into electrum-satochip-v4.4.3-0.12
Toporin Jul 10, 2023
1a143db
(minor) code formatting: add newline at end of file
Toporin Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contrib/build-linux/appimage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ RUN apt-get update -q && \
zlib1g-dev \
libffi-dev \
libncurses5-dev \
libpcsclite-dev \
swig \
libncurses5 \
libtinfo-dev \
libtinfo5 \
Expand Down
2 changes: 1 addition & 1 deletion contrib/build-wine/build-electrum-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-scr
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-binaries.txt
info "Installing hardware wallet requirements..."
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
--no-binary :all: --only-binary cffi,cryptography,hidapi \
--no-binary :all: --only-binary cffi,cryptography,hidapi,pyscard \
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-hw.txt

pushd $WINEPREFIX/drive_c/electrum
Expand Down
3 changes: 3 additions & 0 deletions contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ hiddenimports += collect_submodules('keepkeylib')
hiddenimports += collect_submodules('websocket')
hiddenimports += collect_submodules('ckcc')
hiddenimports += collect_submodules('bitbox02')
hiddenimports += collect_submodules('smartcard') # satochip
hiddenimports += ['electrum.plugins.jade.jade']
hiddenimports += ['electrum.plugins.jade.jadepy.jade']
hiddenimports += ['PyQt5.QtPrintSupport'] # needed by Revealer
Expand Down Expand Up @@ -50,6 +51,7 @@ datas += collect_data_files('btchip')
datas += collect_data_files('keepkeylib')
datas += collect_data_files('ckcc')
datas += collect_data_files('bitbox02')
datas += collect_data_files('pysatochip')

# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
a = Analysis([home+'run_electrum',
Expand All @@ -69,6 +71,7 @@ a = Analysis([home+'run_electrum',
home+'electrum/plugins/keepkey/qt.py',
home+'electrum/plugins/ledger/qt.py',
home+'electrum/plugins/coldcard/qt.py',
home+'electrum/plugins/satochip/qt.py',
home+'electrum/plugins/jade/qt.py',
#home+'packages/requests/utils.py'
],
Expand Down
16 changes: 16 additions & 0 deletions contrib/deterministic-build/requirements-hw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ pyaes==1.6.1 \
pycparser==2.21 \
--hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \
--hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206
pysatochip==0.12.5 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 0.14.1 and 0.14.2 marked as latest on pypi (but has a date of 2021)? That confused me.

--hash=sha256:7adc031bbf4f0f6498ad7a2fddc20c9fac8b2e0531556574a32b7ad49042ea05 \
--hash=sha256:ce028b718b7a860ed873df0b49122f11bdc66b1437b424ced0fa34b277a4facb
pyscard==2.0.7 \
--hash=sha256:278054525fa75fbe8b10460d87edcd03a70ad94d688b11345e4739987f85c1bf \
--hash=sha256:8e37b697327e8dc4848c481428d1cbd10b7ae2ce037bc799e5b8bbd2fc3ab5ed \
--hash=sha256:beacdcdc3d1516e195f7a38ec3966c5d4df7390c8f036cb41f6fef72bc5cc646 \
--hash=sha256:a2266345bd387854298153264bff8b74f494581880a76e3e8679460c1b090fab \
--hash=sha256:06666a597e1293421fa90e0d4fc2418add447b10b7dc85f49b3cafc23480f046 \
--hash=sha256:5a5865675be294c8d91f22dc91e7d897c4138881e5295fb6b2cd821f7c0389d9 \
--hash=sha256:39e030c47878b37ae08038a917959357be6468da52e8b144e84ffc659f50e6e2 \
--hash=sha256:2d4bdc1f4e0e6c46e417ac1bc9d5990f7cfb24a080e890d453781405f7bd29dc \
--hash=sha256:da70aa5b7be5868b88cdb6d4a419d2791b6165beeb90cd01d2748033302a0f43 \
--hash=sha256:59a466ab7ae20188dd197664b9ca1ea9524d115a5aa5b16b575a6b772cdcb73c \
--hash=sha256:f704ad40dc40306e1c0981941789518ab16aa1f84443b1d52ec0264884092b3b \
--hash=sha256:a0c5edbedafba62c68160884f878d9f53996d7219a3fc11b1cea6bab59c7f34a
pyserial==3.5 \
--hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \
--hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0
Expand Down
2 changes: 1 addition & 1 deletion contrib/osx/make_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all:
|| fail "Could not install build dependencies (mac)"

info "Installing some build-time deps for compilation..."
brew install autoconf automake libtool gettext coreutils pkgconfig
brew install autoconf automake libtool gettext coreutils pkgconfig swig

info "Building PyInstaller."
PYINSTALLER_REPO="https://github.com/pyinstaller/pyinstaller.git"
Expand Down
3 changes: 3 additions & 0 deletions contrib/osx/osx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ hiddenimports += collect_submodules('keepkeylib')
hiddenimports += collect_submodules('websocket')
hiddenimports += collect_submodules('ckcc')
hiddenimports += collect_submodules('bitbox02')
hiddenimports += collect_submodules('smartcard') # Satochip
hiddenimports += ['electrum.plugins.jade.jade']
hiddenimports += ['electrum.plugins.jade.jadepy.jade']
hiddenimports += ['PyQt5.QtPrintSupport'] # needed by Revealer
Expand All @@ -47,6 +48,7 @@ datas += collect_data_files('btchip')
datas += collect_data_files('keepkeylib')
datas += collect_data_files('ckcc')
datas += collect_data_files('bitbox02')
datas += collect_data_files('pysatochip')

# Add libusb so Trezor and Safe-T mini will work
binaries = [(electrum + "electrum/libusb-1.0.dylib", ".")]
Expand Down Expand Up @@ -74,6 +76,7 @@ a = Analysis([electrum+ MAIN_SCRIPT,
electrum+'electrum/plugins/keepkey/qt.py',
electrum+'electrum/plugins/ledger/qt.py',
electrum+'electrum/plugins/coldcard/qt.py',
electrum+'electrum/plugins/satochip/qt.py',
electrum+'electrum/plugins/jade/qt.py',
],
binaries=binaries,
Expand Down
4 changes: 4 additions & 0 deletions contrib/requirements/requirements-hw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ ckcc-protocol>=0.7.7
# device plugin: bitbox02
bitbox02>=6.2.0

# device plugin: satochip
pyscard>=1.9.9
pysatochip==0.12.5

# device plugin: jade
cbor>=1.0.0,<2.0.0
pyserial>=3.5.0,<4.0.0
Expand Down
Binary file added electrum/gui/icons/satochip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added electrum/gui/icons/satochip_unpaired.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions electrum/gui/qt/qrcodewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ def setData(self, data):

self.update()


def paintEvent(self, e):
if not self.data:
return

black = QColor(0, 0, 0, 255)
grey = QColor(196, 196, 196, 255)
grey = QColor(196, 196, 196, 255)
white = QColor(255, 255, 255, 255)
black_pen = QPen(black) if self.isEnabled() else QPen(grey)
black_pen.setJoinStyle(Qt.MiterJoin)
Expand Down Expand Up @@ -128,6 +127,7 @@ def __init__(
show_text=False,
help_text=None,
show_copy_text_btn=False,
show_cancel_btn=False,
config: SimpleConfig,
):
WindowModalDialog.__init__(self, parent, title)
Expand Down Expand Up @@ -182,10 +182,21 @@ def copy_text_to_clipboard():
hbox.addWidget(b)
b.clicked.connect(print_qr)

b = QPushButton(_("Close"))
hbox.addWidget(b)
b.clicked.connect(self.accept)
b.setDefault(True)
if show_cancel_btn:
b = QPushButton(_("Ok"))
hbox.addWidget(b)
b.clicked.connect(self.accept)
b.setDefault(True)

b = QPushButton(_("Cancel"))
hbox.addWidget(b)
b.clicked.connect(self.reject)
b.setDefault(True)
else:
b = QPushButton(_("Close"))
hbox.addWidget(b)
b.clicked.connect(self.accept)
b.setDefault(True)

vbox.addLayout(hbox)
self.setLayout(vbox)
Expand Down
83 changes: 83 additions & 0 deletions electrum/plugins/satochip/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Satochip plugin for electrum
=================================================================================

::

Licence: MIT Licence
Author: Toporin
Language: Python (>= 3.6)
Homepage: https://github.com/Toporin/electrum-satochip

Introduction
============

This plugin allows to integrate the Satochip Hardware Wallet with Electrum. To use it, you need a device with the Satochip javacard applet installed (see https://github.com/Toporin/SatochipApplet).
If the wallet is not intialized yet, Electrum will perform the setup (you only need to do this once). During setup, a seed is created: this seed allows you to recover your wallet at anytime, so make sure to BACKUP THE SEED SECURELY! During setup, a PIN code is also created: this PIN allows to unlock th device to access your funds. If you try too many wrong PIN, your device will be locked indefinitely (it is 'bricked'). If you loose your PIN or brick your device, you can only recover your funds with the seed backup.

The Satochip wallet is currently in Beta, use with caution!You can use the software on the Bitcoin testnet using the --testnet option.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Rem: Electrum uses Python 3.x. In case of error, check first that you are not trying to run Electrum with Python 2.x or with Python 2.x libraries.

Development version (Windows 64bits)
=====================================

Install the latest python 3.6 release from https://www.python.org (https://www.python.org/downloads/release/python-368/)
(Caution: installing another release than 3.6 may cause incompatibility issues with pyscard)

Clone or download the code from GitHub.

Open a PowerShell command line in the electrum folder

In PowerShell, install the electrum dependencies::

python -m pip install .
You may also ned to install Python3-pyqt5::

python -m pip install pyqt5
Install pyscard from https://pyscard.sourceforge.io/
Pyscard is required to connect to the smartcard::

python -m pip install pyscard

In PowerShell, run electrum on the testnet (-v allows for verbose output)::

python .\run_electrum -v --testnet

Development version (Ubuntu)
==============================
(Electrum requires Python 3.6, which should be installed by default on Ubuntu)
(If necessary, install pip: sudo apt-get install python3-pip)

Electrum is a pure python application. To use the
Qt interface, install the Qt dependencies::

sudo apt-get install python3-pyqt5

Check out the code from GitHub::
git clone git://github.com/Toporin/electrum.git
cd electrum
In the electrum folder:

Run install (this should install dependencies)::

python3 -m pip install .
Install pyscard (https://pyscard.sourceforge.io/)
Pyscard is required to connect to the smartcard::
sudo apt-get install pcscd
sudo apt-get install python3-pyscard
(For alternatives, see https://github.com/LudovicRousseau/pyscard/blob/master/INSTALL.md for more detailed installation instructions)


To run Electrum use::
python3 electrum -v --testnet

Comment on lines +1 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this README is included? I do not see other hardware plugins having such a README.

6 changes: 6 additions & 0 deletions electrum/plugins/satochip/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

fullname = 'Satochip Wallet'
description = 'Provides support for Satochip hardware wallet'
requires = [('satochip', 'github.com/Toporin/pysatochip')]
registers_keystore = ('hardware', 'satochip', "Satochip wallet")
available_for = ['qt']
Loading