-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add support for Satochip hardware wallet #8453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 70 commits
71e51de
64191bd
6668a05
9a770c1
707bb8c
3ea3e2b
ecfff27
dc70165
9fa120a
23ee3e8
1f2b83c
5789ad6
a4e6ff5
1017b1c
dc612ba
591b297
98a2321
636b9f5
bb04379
037fcd0
5eeab49
23d857a
75fb217
fdff14f
6676fad
1b949e7
bc44e6f
a3c351b
d83fff5
10c60c4
481691d
933e89b
cb26ea9
a6057e7
bdb5aeb
52bbf97
d1011ab
e5345b7
1472b3e
2b5abe7
d425254
ae0f58b
ff0580c
2aab3ba
1f84f1f
d3683fe
aac6aac
f75c143
1bfe0fe
149e4a4
704a726
1e41eed
426c467
fedc984
8e50c0b
b0eb046
e054035
7b01798
020bbdf
10a5d22
63d6ed7
ce80c48
afd14ce
3c118e9
5e462eb
f1f8dda
116e5e1
c540056
db5921c
6f876f0
331fe1f
cd0cfe5
5a5605e
59b4b5d
b1467d2
c00ac5d
d95c687
1a143db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,6 +154,54 @@ PYINSTALLER_COMMIT="413cce49ff28d87fad4472f4953489226ec90c84" | |
| info "Installing PyInstaller." | ||
| python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location "$CACHEDIR/pyinstaller" | ||
|
|
||
|
|
||
| info "DEBUG SATOCHIP START" | ||
|
|
||
| info "Installing some build-time deps for compilation..." | ||
| brew install autoconf automake libtool gettext coreutils pkgconfig | ||
|
|
||
|
|
||
| info "Building PyInstaller." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this whole block is duplicated from above?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sorry, the MacOS build is still a work in progress, I pushed the changes I made so far to the Satochip repo in order to work on the mac build from my mac...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this PR is still in progress better to change it into a draft |
||
| PYINSTALLER_REPO="https://github.com/pyinstaller/pyinstaller.git" | ||
| PYINSTALLER_COMMIT="40c9abce2d8de879e414fd377c933dccaab1e156" | ||
| # ^ tag "4.2" | ||
| # TODO test newer versions of pyinstaller for build-reproducibility. | ||
| # we are using this version for now due to change in code-signing behaviour | ||
| # (https://github.com/pyinstaller/pyinstaller/pull/5581) | ||
| ( | ||
| if [ -f "$CACHEDIR/pyinstaller/PyInstaller/bootloader/Darwin-64bit/runw" ]; then | ||
| info "pyinstaller already built, skipping" | ||
| exit 0 | ||
| fi | ||
| cd "$PROJECT_ROOT" | ||
| ELECTRUM_COMMIT_HASH=$(git rev-parse HEAD) | ||
| cd "$CACHEDIR" | ||
| rm -rf pyinstaller | ||
| mkdir pyinstaller | ||
| cd pyinstaller | ||
| # Shallow clone | ||
| git init | ||
| git remote add origin $PYINSTALLER_REPO | ||
| git fetch --depth 1 origin $PYINSTALLER_COMMIT | ||
| git checkout -b pinned "${PYINSTALLER_COMMIT}^{commit}" | ||
| rm -fv PyInstaller/bootloader/Darwin-*/run* || true | ||
| # add reproducible randomness. this ensures we build a different bootloader for each commit. | ||
| # if we built the same one for all releases, that might also get anti-virus false positives | ||
| echo "const char *electrum_tag = \"tagged by Electrum@$ELECTRUM_COMMIT_HASH\";" >> ./bootloader/src/pyi_main.c | ||
| pushd bootloader | ||
| # compile bootloader | ||
| python3 ./waf all CFLAGS="-static" | ||
| popd | ||
| # sanity check bootloader is there: | ||
| [[ -e "PyInstaller/bootloader/Darwin-64bit/runw" ]] || fail "Could not find runw in target dir!" | ||
| rm pyinstaller.py # workaround for https://github.com/pyinstaller/pyinstaller/pull/6701 | ||
| ) || fail "PyInstaller build failed" | ||
| info "Installing PyInstaller." | ||
| python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location "$CACHEDIR/pyinstaller" | ||
|
|
||
|
|
||
| info "DEBUG SATOCHIP END" | ||
|
|
||
| info "Using these versions for building $PACKAGE:" | ||
| sw_vers | ||
| python3 --version | ||
|
|
@@ -176,6 +224,8 @@ info "generating locale" | |
| "$CONTRIB/build_locale.sh" "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE" | ||
| ) || fail "failed generating locale" | ||
|
|
||
| info "Installing some build-time deps for compilation..." | ||
| brew install swig | ||
|
|
||
| if [ ! -f "$DLL_TARGET_DIR/libsecp256k1.2.dylib" ]; then | ||
| info "Building libsecp256k1 dylib..." | ||
|
|
||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| 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'] |
There was a problem hiding this comment.
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.