Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 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
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
115 changes: 115 additions & 0 deletions README-electrum.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Electrum - Lightweight Bitcoin client
=====================================

::

Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python
Homepage: https://electrum.org/


.. image:: https://travis-ci.org/spesmilo/electrum.svg?branch=master
:target: https://travis-ci.org/spesmilo/electrum
:alt: Build Status
.. image:: https://coveralls.io/repos/github/spesmilo/electrum/badge.svg?branch=master
:target: https://coveralls.io/github/spesmilo/electrum?branch=master
:alt: Test coverage statistics
.. image:: https://img.shields.io/badge/help-translating-blue.svg
:target: https://crowdin.com/project/electrum
:alt: Help translating Electrum online





Getting started
===============

Electrum is a pure python application. If you want to use the
Qt interface, install the Qt dependencies::

sudo apt-get install python3-pyqt5

If you downloaded the official package (tar.gz), you can run
Electrum from its root directory, without installing it on your
system; all the python dependencies are included in the 'packages'
directory. To run Electrum from its root directory, just do::

./electrum

You can also install Electrum on your system, by running this command::

sudo apt-get install python3-setuptools
pip3 install .[fast]

This will download and install the Python dependencies used by
Electrum, instead of using the 'packages' directory.
The 'fast' extra contains some optional dependencies that we think
are often useful but they are not strictly needed.

If you cloned the git repository, you need to compile extra files
before you can run Electrum. Read the next section, "Development
Version".



Development version
===================

Check out the code from GitHub::

git clone git://github.com/spesmilo/electrum.git
cd electrum

Run install (this should install dependencies)::

pip3 install .[fast]

Render the SVG icons to PNGs (optional)::

for i in lock unlock confirmed status_lagging status_disconnected status_connected_proxy status_connected status_waiting preferences; do convert -background none icons/$i.svg icons/$i.png; done

Compile the icons file for Qt::

sudo apt-get install pyqt5-dev-tools
pyrcc5 icons.qrc -o gui/qt/icons_rc.py

Compile the protobuf description file::

sudo apt-get install protobuf-compiler
protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto

Create translations (optional)::

sudo apt-get install python-requests gettext
./contrib/make_locale




Creating Binaries
=================


To create binaries, create the 'packages' directory::

./contrib/make_packages

This directory contains the python dependencies used by Electrum.

Mac OS X / macOS
--------

See `contrib/build-osx/`.

Windows
-------

See `contrib/build-wine/`.


Android
-------

See `gui/kivy/Readme.txt` file.
152 changes: 68 additions & 84 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,113 +1,97 @@
Electrum - Lightweight Bitcoin client
=====================================
Electrum-Satochip - Lightweight Bitcoin client for the Satochip Hardware Wallet
=================================================================================

::

Licence: MIT Licence
Author: Thomas Voegtlin
Author: Thomas Voegtlin, modified by Toporin
Language: Python (>= 3.6)
Homepage: https://electrum.org/
Homepage:

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

.. image:: https://travis-ci.org/spesmilo/electrum.svg?branch=master
:target: https://travis-ci.org/spesmilo/electrum
:alt: Build Status
.. image:: https://coveralls.io/repos/github/spesmilo/electrum/badge.svg?branch=master
:target: https://coveralls.io/github/spesmilo/electrum?branch=master
:alt: Test coverage statistics
.. image:: https://d322cqt584bo4o.cloudfront.net/electrum/localized.svg
:target: https://crowdin.com/project/electrum
:alt: Help translate Electrum online
This is a fork of Electrum modified for use with the Satochip Hardware Wallet. To use it, you need a device with the Satochip Javacard Applet installed.
Copy link
Member

Choose a reason for hiding this comment

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

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! In this phase, it is strongly recommended to use the software on the Bitcoin testnet only.
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)

Getting started
===============
Clone or download the code from GitHub.

Electrum is a pure python application. If you want to use the
Qt interface, install the Qt dependencies::
Open a PowerShell command line in the electrum folder

sudo apt-get install python3-pyqt5
In PowerShell, install the electrum dependencies::

If you downloaded the official package (tar.gz), you can run
Electrum from its root directory without installing it on your
system; all the python dependencies are included in the 'packages'
directory. To run Electrum from its root directory, just do::
python -m pip install .
You may also ned to install Python3-pyqt5::

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

You can also install Electrum on your system, by running this command::
python -m pip install pyscard
In case of error message, you may also install pyscard from the installer:
Download the .whl files from https://sourceforge.net/projects/pyscard/files/pyscard/pyscard%201.9.7/ and run::

sudo apt-get install python3-setuptools
python3 -m pip install .[fast]
python -m pip install pyscard-1.9.7-cp36-cp36m-win_amd64.whl

This will download and install the Python dependencies used by
Electrum instead of using the 'packages' directory.
The 'fast' extra contains some optional dependencies that we think
are often useful but they are not strictly needed.
In PowerShell, run electrum on the testnet (-v allows for verbose output)::

If you cloned the git repository, you need to compile extra files
before you can run Electrum. Read the next section, "Development
Version".
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::

Development version
===================
sudo apt-get install python3-pyqt5

Check out the code from GitHub::

git clone git://github.com/spesmilo/electrum.git
git clone git://github.com/Toporin/electrum.git
cd electrum

In the electrum folder:

Run install (this should install dependencies)::

python3 -m pip install .[fast]


Compile the protobuf description file::

sudo apt-get install protobuf-compiler
protoc --proto_path=electrum --python_out=electrum electrum/paymentrequest.proto

Create translations (optional)::

sudo apt-get install python-requests gettext
./contrib/pull_locale




Creating Binaries
=================

Linux (tarball)
---------------

See :code:`contrib/build-linux/README.md`.


Linux (AppImage)
----------------

See :code:`contrib/build-linux/appimage/README.md`.


Mac OS X / macOS
----------------

See :code:`contrib/osx/README.md`.


Windows
-------

See :code:`contrib/build-wine/README.md`.


Android
-------
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
Test suite
=============

To run the test suite, run::

python -m unittest electrum.plugins.satochip.test_CardConnector
The test suite uses the following default PIN code: "12345678".
If you run the test suite after (or before) electrum, you may block the card if the PIN used are not the same!
If the card is locked, you will have to reinstall the javacard applet on the card.

See :code:`electrum/gui/kivy/Readme.md`.
Empty file modified contrib/build-linux/appimage/apprun.sh
100755 → 100644
Empty file.
Empty file modified contrib/build-linux/appimage/build.sh
100755 → 100644
Empty file.
8 changes: 6 additions & 2 deletions contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ hiddenimports += collect_submodules('safetlib')
hiddenimports += collect_submodules('btchip')
hiddenimports += collect_submodules('keepkeylib')
hiddenimports += collect_submodules('websocket')
hiddenimports += collect_submodules('satochip') #DebugSatochip
hiddenimports += collect_submodules('smartcard') #DebugSatochip
hiddenimports += collect_submodules('ckcc')
hiddenimports += ['PyQt5.QtPrintSupport'] # needed by Revealer

Expand All @@ -44,6 +46,7 @@ datas = [
(home+'electrum/plugins', 'electrum/plugins'),
('C:\\Program Files (x86)\\ZBar\\bin\\', '.'),
(home+'electrum/gui/icons', 'electrum/gui/icons'),
(PYHOME+'\\Lib\\site-packages\\smartcard\\scard\\_scard.cp36-win32.pyd', '.\\smartcard\\scard\\') #debugSatochip
]
datas += collect_data_files('trezorlib')
datas += collect_data_files('safetlib')
Expand All @@ -68,6 +71,7 @@ a = Analysis([home+'run_electrum',
home+'electrum/plugins/safe_t/qt.py',
home+'electrum/plugins/keepkey/qt.py',
home+'electrum/plugins/ledger/qt.py',
home+'electrum/plugins/satochip/qt.py', #DebugSatochip
home+'electrum/plugins/coldcard/qt.py',
#home+'packages/requests/utils.py'
],
Expand Down Expand Up @@ -121,7 +125,7 @@ exe_standalone = EXE(
strip=None,
upx=False,
icon=home+'electrum/gui/icons/electrum.ico',
console=False)
console=True) #DebugSatochip True
Copy link
Member

Choose a reason for hiding this comment

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

leftover by mistake??

# console=True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used

exe_portable = EXE(
Expand All @@ -134,7 +138,7 @@ exe_portable = EXE(
strip=None,
upx=False,
icon=home+'electrum/gui/icons/electrum.ico',
console=False)
console=True) #DebugSatochip True
Copy link
Member

Choose a reason for hiding this comment

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

same


#####
# exe and separate files that NSIS uses to build installer "setup" exe
Expand Down
14 changes: 14 additions & 0 deletions contrib/build-wine/prepare-wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ PYINSTALLER_REPO="https://github.com/SomberNight/pyinstaller.git"
PYINSTALLER_COMMIT=d1cdd726d6a9edc70150d5302453fb90fdd09bf2
# ^ tag 3.4, plus a custom commit that fixes cross-compilation with MinGW

#DebugSatochip pyscard
#PYSCARD_FILENAME=pyscard-1.9.7-cp36-cp36m-win_amd64.whl #python64-bits
#PYSCARD_URL=https://sourceforge.net/projects/pyscard/files/pyscard/pyscard%201.9.7/pyscard-1.9.7-cp36-cp36m-win_amd64.whl/download
#PYSCARD_SHA256=c63a87e4e7c87ce4c1299a1d8e0cae4e43f27451ca210f2c54f2dcd7467565c5
PYSCARD_FILENAME=pyscard-1.9.8-cp36-cp36m-win32.whl #python32-bits
PYSCARD_URL=https://ci.appveyor.com/api/buildjobs/j60tkykj6vh0ppiy/artifacts/dist%2Fpyscard-1.9.8-cp36-cp36m-win32.whl
PYSCARD_SHA256=4641b5db53fb3562671b7b7c685ddf8f715180e2809106fb2a9361dfad553b4b
Copy link
Member

Choose a reason for hiding this comment

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

is this not available on pypi/pip? i.e. https://pypi.org/project/pyscard/ ?
is the issue that they do not seem distribute a win32 wheel?
and we cannot build it ourselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The maintainer of the project does not provide official releases for Windows 32-bit apparently. Since the project is open-source, it should be possible to build it from sources but it looks quite complex (LudovicRousseau/pyscard#55). The link provided in the script comes from the appveyor account for pyscard (https://ci.appveyor.com/project/LudovicRousseau/pyscard), and is the suggested workaround provided by the maintainer (see LudovicRousseau/pyscard#55 (comment))


PYTHON_VERSION=3.6.8

## These settings probably don't need change
Expand Down Expand Up @@ -65,6 +73,12 @@ download_if_not_exist "$CACHEDIR/$ZBAR_FILENAME" "$ZBAR_URL"
verify_hash "$CACHEDIR/$ZBAR_FILENAME" "$ZBAR_SHA256"
wine "$CACHEDIR/$ZBAR_FILENAME" /S

#DebugSatochip install pyscard
info "Installing pyscard..."
download_if_not_exist $PYSCARD_FILENAME "$PYSCARD_URL"
verify_hash $PYSCARD_FILENAME "$PYSCARD_SHA256"
$PYTHON -m pip install "$PWD/$PYSCARD_FILENAME"
Copy link
Member

Choose a reason for hiding this comment

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

instead of $PWD, use $CACHEDIR
see surrounding lines for examples


info "Installing NSIS."
download_if_not_exist "$CACHEDIR/$NSIS_FILENAME" "$NSIS_URL"
verify_hash "$CACHEDIR/$NSIS_FILENAME" "$NSIS_SHA256"
Expand Down
Empty file modified contrib/build_tools_util.sh
100755 → 100644
Empty file.
Empty file modified contrib/osx/make_osx
100755 → 100644
Empty file.
Empty file modified contrib/sign_version
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion electrum/electrum

This file was deleted.

1 change: 1 addition & 0 deletions electrum/electrum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../run_electrum
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.
2 changes: 1 addition & 1 deletion electrum/gui/kivy/data/fonts/tron/License.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2011, Jeff Bell [www.randombell.com] | [jeffbell@randombell.com].
Copyright (c) 2010-2011, Jeff Bell [www.randombell.com] | [jeffbell@randombell.com].
Copy link
Member

Choose a reason for hiding this comment

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

please clean this so that git sees no change

This font may be distributed freely however must retain this document as well as the Readme.txt file.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is available with a FAQ at: http://scripts.sil.org/OFL
2 changes: 1 addition & 1 deletion electrum/gui/kivy/data/fonts/tron/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UPDATE HISTORY:

1/22/11 - Made minor corrections to all previous letters and punctuation. Corrected issue with number 8's top filling in.

ABOUT THE AUTHOR:
ABOUT THE AUTHOR:
Copy link
Member

Choose a reason for hiding this comment

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

please clean this so that git sees no change

Jeff Bell has produced fonts before, but this is the first one in over 10 years. His original 3 fonts were under the name DJ-JOHNNYRKA and include "CASPER", "BEVERLY HILLS COP", "THE GODFATHER" and "FIDDUMS FAMILY".

For more information on Jeff Bell and his work can be found online:
Expand Down
Loading