Coder Social home page Coder Social logo

keys-n-hashes's Introduction

Electron Cash - Lightweight Bitcoin Cash client

Licence: MIT Licence
Author: Electron Cash Developers
Language: Python
Homepage: https://electroncash.org/
Help translate Electron Cash online GitHub Actions Tests GitHub Actions Build GitHub Actions Python Audit

Getting started

Note: If running from source, Python 3.8 or above is required to run Electron Cash. If your system lacks Python 3.8, you have other options, such as the AppImage / binary releases or running from source using pyenv (see section Running from source on old Linux below).

macOS: It is recommended that macOS users run the binary .dmg as that's simpler to use and has everything included. Otherwise, if you want to run from source, see section Running from source on macOS below.

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

sudo apt-get install python3-pyqt5 python3-pyqt5.qtsvg

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

./electron-cash

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

sudo apt-get install python3-setuptools
python3 setup.py install

Compile the icons file for Qt (normally you can skip this step, run this command if icons are missing):

sudo apt-get install pyqt5-dev-tools
pyrrc5 icons.qrc -o electroncash_gui/qt/icons.py

This will download and install the Python dependencies used by Electron Cash, instead of using the 'packages' directory.

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

Hardware Wallet - Ledger Nano S

Electron Cash natively support Ledger Nano S hardware wallet. If you plan to use you need an additional dependency, namely btchip. To install it run this command:

sudo pip3 install btchip-python

If you still have problems connecting to your Nano S please have a look at this troubleshooting section on Ledger website.

Development version

Check your python version >= 3.8, and install pyqt5, as instructed above in the Getting started section above or Running from source on old Linux section below.

If you are on macOS, see the Running from source on macOS section below.

Check out the code from Github:

git clone https://github.com/Electron-Cash/Electron-Cash
cd Electron-Cash

Install the python dependencies:

pip3 install -r contrib/requirements/requirements.txt --user

Create translations (optional):

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

Compile libsecp256k1 (optional, yet highly recommended):

sudo apt-get install libtool automake
./contrib/make_secp

For plugin development, see the plugin documentation.

Running unit tests (very optional, advanced users only):

pip install tox
tox

Tox will take care of building a faux installation environment, and ensure that the mapped import paths work correctly.

Running from source on old Linux

If your Linux distribution has a different version of python 3 (such as python 3.5 in Debian 9), it is recommended to do a user dir install with pyenv. This allows Electron Cash to run completely independently of your system configuration.

  1. Install pyenv in your user account. Follow the printed instructions about updating your environment variables and .bashrc, and restart your shell to ensure that they are loaded.
  2. Run pyenv install 3.11.1. This will download and compile that version of python, storing it under .pyenv in your home directory.
  3. cd into the Electron Cash directory. Run pyenv local 3.11.1 which inserts a file .python-version into the current directory.
  4. While still in this directory, run pip install pyqt5.
  5. If you are installing from the source file (.tar.gz or .zip) then you are ready and you may run ./electron-cash. If you are using the git version, then continue by following the Development version instructions above.

Running from source on macOS

You need to install either MacPorts or HomeBrew. Follow the instructions on either site for installing (Xcode from Apple's developer site is required for either).

  1. After installing either HomeBrew or MacPorts, clone this repository and switch to the directory: git clone https://github.com/Electron-Cash/Electron-Cash && cd Electron-Cash
  2. Install python 3.8 or later. For brew: brew install python3 or if using MacPorts: sudo port install python311
  3. Install PyQt5: python3 -m pip install --user pyqt5
  4. Install Electron Cash requirements: python3 -m pip install --user -r contrib/requirements/requirements.txt
  5. Compile libsecp256k1 (optional, yet highly recommended): ./contrib/make_secp. This requires GNU tools and automake, install with brew: brew install coreutils automake or if using MacPorts: sudo port install coreutils automake
  6. At this point you should be able to just run the sources: ./electron-cash

Creating Binaries

Linux AppImage & Source Tarball

See contrib/build-linux/README.md.

Mac OS X / macOS

See contrib/osx/.

Windows

See contrib/build-wine/.

Android

See android/.

iOS

See ios/.

keys-n-hashes's People

Contributors

cculianu avatar echterago avatar fyookball avatar jcramer avatar markblundeberg avatar melroy89 avatar mpapec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keys-n-hashes's Issues

Remove libgmodule-2.0.so from the Linux AppImage

Due to some changes in AppImage and inclusion/exclusion of some libraries, Electroncash Linux Appimage fails to run with this error:
symbol lookup error: /usr/lib64/libgio-2.0.so.0: undefined symbol: g_module_open_full

A workaround is using LD_PRELOAD to force it to use the system library:
LD_PRELOAD=/usr/lib64/libgmodule-2.0.so ./Electron-Cash-4.3.1-x86_64.AppImage

Or you could just remove it from the Appimage when packaging it. Of course, this is not a bug in Electroncash, but one in how Appimage handles the included libraries.

import paper wallet

Trying to import a paper wallet. I'm getting stuck when I input the private key, it doesn't allow me to click the 'next' button.

These are the steps I'm taking up until that point:

File - New/Restore

Wallet - Standard Wallet

Use public or Private keys

Any ideas? Im pretty sure I've downloaded the latest version (Windows)

could not find paymentrequest_pb2.py

I now get this message when running either Electrum or Electron:

Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto'

In which directories should I call this command?

SHA1 differs

Hello.

The SHA1 checksum differs in my situation. Could you confirm that the one in your repo is the latest one?
Or even better, can you change the SHA1 to SHA2? SHA1 is not safe as you can read here.

What I ran was:

$ sha1sum Electron-Cash-2.9.0.tar.gz 
53391d5e824ee221e59a2636635063903a333d16  Electron-Cash-2.9.0.tar.gz

sha256sum ElectronCash-3.0.tar.gz

I'm receiving a different sha256sum when checking the linux tar download from the site. It doesn't match the SHA256.ElectronCash-3.0.tar.gz.txt checksum.

QR Code button for MPK during multisig wallet creation

Please enable a QRCode display button in the screen where it shows the MPK during multisignature wallet creation.

Also, there should be a WebCam display button in the screen where you enter in the other cosigner's MPK.

Example:

Screenshot from 2021-03-13 11-59-31

Unexpected result from gpg2 --verify

I got an unexpected result... Using โ€ฆ

gpg2 --verify Electron-Cash-3.3.2.2-macosx.dmg.sig

Resulted in the following:

gpg: no signed data
gpg: can't hash datafile: No data

Please advise.

Symbol not found: _getentropy on OS X 10.10.5

ElectronCash 2.9.2 crashes immediately when opening.

OS Version: Mac OS X 10.10.5 (14F2511)

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Dyld Error Message:
Symbol not found: _getentropy
Referenced from: /Applications/Electron-Cash.app/Contents/Frameworks/Python.framework/Versions/2.7/Python (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib

BAD signatures for 4.0.11?

I tried the following GPG commands but surprisingly they returned "BAD signature from Jonald/Calin":

gpg --verify JF.Electron-Cash-4.0.11-x86_64.AppImage.asc SHA256.Electron-Cash-4.0.11-x64_64.AppImage.txt
gpg --verify CC.Electron-Cash-4.0.11-x86_64.AppImage.asc SHA256.Electron-Cash-4.0.11-x64_64.AppImage.txt

Am I doing the verification wrong or is there a problem with the signatures?

SHA does not match

Hello:
I downloaded:
ElectronCash-3.1.1.exe
and:
SHA256.ElectronCash-3.1.1.exe.txt

2 things:
-the SHA does not look like a SHA
-Unsurprisingly, it does not match

please see screenshot: https://imgur.com/a/Fd5hw

please advise

key signature problem

$ gpg --import ElectronCashPubKeyDev/jonaldkey2.txt

gpg: key EFF1DDE1: "Jonald Fyookball [email protected]" not changed
gpg: Total number processed: 1
gpg: imported: 1

Was ok...

$ gpg --verify ElectronCash-3.1.2.tar.gz.sig ElectronCash-3.1.2.tar.gz

gpg: Signature made 2018. jan. 9., tuesday, 07:34:56 CET using DSA key ID EFF1DDE1
gpg: Good signature from "Jonald Fyookball [email protected]"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: D56C 110F 4555 F371 AEEF CB25 4FD0 6489 EFF1 DDE1

Fail...

MacOS Dark Mode broken on v4.2.4

macOS Big Sur v11.2.2
Choosing 'Dark' Color Theme from Preferences tells me to use System Preferences to switch color themes.
But I have 'Dark' set in General -> Appearance in System Preferences and Electron Cash is no longer Dark after upgrading to 4.2.4.

Checking the signature from 4.0.11 to 4.0.12 have been broken

What keys should I use to compare the signature?

I have only used D56C110F4555F371AEEFCB254FD06489EFF1DDE1 for all released up to 4.0.11.

Should I include D465135F97D0047E18E99DC321810A542031C02C?

Are there other keys I should add? Or should I change some flags for gpgv2?

jonny@jonny-thinkpad ~/fedora-scm/electron-cash (master) {8.12.0} $ spectool -g electron-cash.spec 
Getting https://github.com/Electron-Cash/Electron-Cash/releases/download/4.0.12/Electron-Cash-4.0.12.tar.gz to ./Electron-Cash-4.0.12.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617    0   617    0     0   1649      0 --:--:-- --:--:-- --:--:--  1649
100 4232k  100 4232k    0     0   336k      0  0:00:12  0:00:12 --:--:--  541k
Getting https://github.com/Electron-Cash/keys-n-hashes/raw/master/sigs-and-sums/4.0.12/win-linux/JF.Electron-Cash-4.0.12.tar.gz.asc to ./JF.Electron-Cash-4.0.12.tar.gz.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
jonny@jonny-thinkpad ~/fedora-scm/electron-cash (master) {8.12.0} $ spectool -g electron-cash.spec 
Getting https://github.com/Electron-Cash/Electron-Cash/releases/download/4.0.12/Electron-Cash-4.0.12.tar.gz to ./Electron-Cash-4.0.12.tar.gz
./Electron-Cash-4.0.12.tar.gz already exists, skipping download
Getting https://github.com/Electron-Cash/keys-n-hashes/raw/master/sigs-and-sums/4.0.12/win-linux/Electron-Cash-4.0.12.tar.gz.asc to ./Electron-Cash-4.0.12.tar.gz.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   197  100   197    0     0    358      0 --:--:-- --:--:-- --:--:--   358
100   441  100   441    0     0    514      0 --:--:-- --:--:-- --:--:--   514
jonny@jonny-thinkpad ~/fedora-scm/electron-cash (master) {8.12.0} $ fedpkg local 


Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6OlUdU
+ umask 022
+ cd /home/jonny/fedora-scm/electron-cash
+ gpgv2 --quiet --keyring /home/jonny/fedora-scm/electron-cash/gpgkey-electron-cash.gpg /home/jonny/fedora-scm/electron-cash/Electron-Cash-4.0.12.tar.gz.asc /home/jonny/fedora-scm/electron-cash/Electron-Cash-4.0.12.tar.gz
gpgv: Signature made Tue Dec 10 16:07:10 2019 CET
gpgv:                using DSA key D465135F97D0047E18E99DC321810A542031C02C
gpgv: Can't check signature: No public key
gpgv: Signature made Wed Dec 11 04:17:57 2019 CET
gpgv:                using DSA key 4FD06489EFF1DDE1
gpgv: Good signature from "Jonald Fyookball <[email protected]>"
error: Bad exit status from /var/tmp/rpm-tmp.6OlUdU (%prep)
    Bad exit status from /var/tmp/rpm-tmp.6OlUdU (%prep)


RPM build errors:
Could not execute local: rpmbuild --define '_sourcedir /home/jonny/fedora-scm/electron-cash' --define '_specdir /home/jonny/fedora-scm/electron-cash' --define '_builddir /home/jonny/fedora-scm/electron-cash' --define '_srcrpmdir /home/jonny/fedora-scm/electron-cash' --define '_rpmdir /home/jonny/fedora-scm/electron-cash' --define 'dist %{?distprefix}.fc32' --define 'fedora 32' --eval '%undefine rhel' --define 'fc32 1' --eval '%undefine fc30' -ba /home/jonny/fedora-scm/electron-cash/electron-cash.spec | tee .build-4.0.12-1.fc32.log

Hashes not signed

The hashes are not signed, you have signatures separate from the hash values, you're meant to generate a hash value then sign it so the signature is part of the hash value. Otherwise we can't verify the hash value is legitimate.

Here's an example:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Verify:

SHA256:

3f38984734b03e15a5659d7332ed2e068d349f195ef8f1b96447a4fa3b66d25f Exodus-linux-x64-1.32.0.zip
70c907046fceadcca17038427cbb5cf5262e8014f8cf9d07612648a062d931bb Exodus-macos-1.32.0.dmg
fdd2fc8a4840825601951e2764530f46195cc334e8de597d4d9f838df47804c9 Exodus-windows-x64-1.32.0.exe
c6b1a6291b5a347ddc6f0697435be359550bdeddf7eaa0487f0f6b6a28d81766 Exodus-windows-x64-1.32.0.nupkg

-----BEGIN PGP SIGNATURE-----

wsFcBAEBCAAQBQJZlj5qCRCdlZRVMlt4GgAAAG0QANR87v1upFVkNxLW4OYoTDWI
znn+uDFYJyVZDHhDzlTbEiNHfcLV0uOLVuIQoAQ1S4Ny+kjUJnr/xUTkW3Qxo6an
T/I3X89WPAI2xyb2263PJIcil507yL4+emyvDLkZU8nlIbd5mKHyKhnxrgjakdjn
Okk2nStlgjSeMQWzpniW3Ri5r8GwLoPR3daazUUYh3edhLKEpetQ9izOs9h38IBx
9oA8gWy4ljdfqtQT4XmvCiuHGp+0jf3uwMH8oE9uG7mHcFJlQLCbar9BfUTHemsK
104wMqyFhzo5JDPh1fRqB1Al+AwEBpY21Q6x7XtLejBShPR81H5Qz/Hmj9mU4A7p
1xn+naonw/o/VdpzRyfRQCz71KPvXQdKi4GiD2Vv9eTfTumViCtFXX9f9Ne0S8lD
EGJKa2Jnbs8WNZvU1882GMC2QyhO9crd82q32m23TuQ9LuxohxB83DMxB31oqNcj
NNmtdJEPBeVURtcaMPeZ6jZpaV4NDorj71vrZa4eflo6gQ63YNlNJvAYzBUb5RZX
b+amSHEevrAeuBVf4csD3rjsWnpWWSnxM53oZUxsUrO49svjubBWJVEX6FiyFUeG
CsRE8TWUL6Uo+gFX6E1Ul024MC4v6iM9IpeKBAv8qINq0kTmJq9I5S3Pbhb5hIl8
t89Nhk7/wUqbOWawjfG4
=J9UJ
-----END PGP SIGNATURE-----

Problem verifying signature for ElectronCash-3.1.2.exe

I have been unable to verify the signature for ElectronCash-3.1.2.exe.
I imported the second public key for fyookball successfully.
I then attempted to verify the signature using:
gpg --verify ElectronCash-3.1.2.exe.sig ElectronCash-3.1.2.exe
but received the message:
gpg: no valid OpenPGP data found.
gpg: the signature could not be verified.
Please remember that the signature file (.sig or .asc)
should be the first file given on the command line.

Any suggestion gratefully received. I am new to verifying signatures so please excuse any elementary error.
Thank you.
Hans.

Electron Cash cannot sign transaction

I am trying to sign a transaction on my offline computer by using Tools > Load transaction.
When I click "sign", and after I entered my wallet password, I get an error dialog showing only the word "value".

I traced this down to lib/transaction.py Transaction.serialize_preimage:

def serialize_preimage(self, i):
    nVersion = int_to_hex(self.version, 4)
    nHashType = int_to_hex(self.nHashType(), 4)
    nLocktime = int_to_hex(self.locktime, 4)
    inputs = self.inputs()
    outputs = self.outputs()
    txin = inputs[i]
    if True or self.is_segwit_input(txin): <---- Why is this hardcoded to True?
        hashPrevouts = Hash(''.join(self.serialize_outpoint(txin) for txin in inputs).decode('hex')).encode('hex')
        hashSequence = Hash(''.join(int_to_hex(txin.get('sequence', 0xffffffff - 1), 4) for txin in inputs).decode('hex')).encode('hex')
        hashOutputs = Hash(''.join(self.serialize_output(o) for o in outputs).decode('hex')).encode('hex')
        outpoint = self.serialize_outpoint(txin)
        scriptCode = push_script(self.get_preimage_script(txin))
        amount = int_to_hex(txin['value'], 8) <---- Here it fails because txin doesn't have 'value'
        nSequence = int_to_hex(txin.get('sequence', 0xffffffff - 1), 4)

Second private key?

I'm not sure why the second public key is there? Perhaps you meant to sign the second key with the first one?

I don't know if I should trust any signatures from the second key or not... Maybe an announcement on electron cash website might help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.