1
0
Oren 2fb0dd066f Timelock Recovery Extension (#9589)
* Timelock Recovery Extension

* Timelock Recovery Extension tests

* Use fee_policy instead of fee_est

Following 3f327eea07

* making tx with base_tx

Following ab14c3e138

* move plugin metadata from __init__.py to manifest.json

* removing json large indentation

* timelock recovery icon

* timelock recovery plugin: fix typos

* timelock recovery plugin: use menu instead of status bar.

The status bar should be used for displaying status. For example,
hardware wallet plugins use it because their connection status is
changing and needs to be displayed.

* timelock recovery plugin: ask for password only once

* timelock recovery plugin: ask whether to create cancellation tx in the initial window

* remove unnecessary code.

(calling run_hook from a plugin does not make sense)

* show alert and cancellation address at the end.

skip unnecessary dialog

* timelock recovery plugin: do not show transactions one by one.

Set the fee policy in the first dialog, and use the same fee
policy for all tx. We could add 3 sliders to this dialog, if
different fees are needed, but I think this really isn't
really necessary.

* simplify default_wallet for tests

All the lightning-related stuff is irrelevant for
this plugin.

Also use a different destination address
for the test recovery-plan (an address
that does not belong to the same wallet).

* Fee selection should be above fee calculation

also show fee calculation result with "fee: " label.

* hide Sign and Broadcast buttons during view

* recalculate cancellation transaction

The checkbox could be clicked after the fee rate
has been set. Calling update_transactions() may seem
inefficient, but it's the simplest way to avoid such edge-cases.

Also set the context's cancellation transaction to None when the
checkbox is unset.

* use context.cancellation_tx instead of checkbox value

context.cancellation_tx will be None iff the checkbox was unset

* hide cancellation address if not used

* init monospace font correctly

* timelock recovery plugin: add input info at signing time.

Fixes trezor exception: 'Missing previous tx'

* timelock recovery: remove unused parameters

* avoid saving the tx in a separate var

fixing the assertions

* avoid caching recovery & cancellation inputs

* timelock recovery: separate help window from agreement.

move agreement at the end of the flow, rephrase it

* do not cache alert_tx_outputs

* do not crash when not enough funds

not enough funds can happen
when multiple addresses are specified
in payto_e, with an amount larger
than the wallet has - so we set
the payto_e color to red.

It can also happen when the user
selects a really high fee, but this
is not common in a "recovery"
wallet with significant funds.

* If files not saved - ask before closing

* move the checkbox above the save buttons

people read the text from top to
bottom and may not understand
why the buttons are disabled

---------

Co-authored-by: f321x <f321x@tutamail.com>
Co-authored-by: ThomasV <thomasv@electrum.org>
2025-04-22 10:02:01 +02:00
2025-04-22 10:02:01 +02:00
2021-09-13 16:20:54 +00:00
2022-08-10 17:32:23 +02:00
2023-09-05 12:32:38 +00:00
2024-09-18 15:48:38 +00:00
2024-02-21 16:12:22 +00:00
2023-11-13 15:45:05 +00:00
2024-02-16 15:40:45 +01:00

Electrum - Lightweight Bitcoin client

Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python (>= 3.10)
Homepage: https://electrum.org/

Build Status Test coverage statistics Help translate Electrum online

Getting started

(If you've come here looking to simply run Electrum, you may download it here.)

Electrum itself is pure Python, and so are most of the required dependencies, but not everything. The following sections describe how to run from source, but here is a TL;DR:

$ sudo apt-get install libsecp256k1-dev
$ ELECTRUM_ECC_DONT_COMPILE=1 python3 -m pip install --user ".[gui,crypto]"

Not pure-python dependencies

Qt GUI

If you want to use the Qt interface, install the Qt dependencies:

$ sudo apt-get install python3-pyqt6

libsecp256k1

For elliptic curve operations, libsecp256k1 is a required dependency.

If you "pip install" Electrum, by default libsecp will get compiled locally, as part of the electrum-ecc dependency. This can be opted-out of, by setting the ELECTRUM_ECC_DONT_COMPILE=1 environment variable. For the compilation to work, besides a C compiler, you need at least:

$ sudo apt-get install automake libtool

If you opt out of the compilation, you need to provide libsecp in another way, e.g.:

$ sudo apt-get install libsecp256k1-dev

cryptography

Due to the need for fast symmetric ciphers, cryptography is required. Install from your package manager (or from pip):

$ sudo apt-get install python3-cryptography

hardware-wallet support

If you would like hardware wallet support, see this.

Running from tar.gz

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

$ ./run_electrum

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

$ sudo apt-get install python3-setuptools python3-pip
$ python3 -m pip install --user .

This will download and install the Python dependencies used by Electrum instead of using the 'packages' directory. It will also place an executable named electrum in ~/.local/bin, so make sure that is on your PATH variable.

Development version (git clone)

(For OS-specific instructions, see here for Windows, and for macOS)

Check out the code from GitHub:

$ git clone https://github.com/spesmilo/electrum.git
$ cd electrum
$ git submodule update --init

Run install (this should install dependencies):

$ python3 -m pip install --user -e .

Create translations (optional):

$ sudo apt-get install gettext
$ ./contrib/locale/build_locale.sh electrum/locale/locale electrum/locale/locale

Finally, to start Electrum:

$ ./run_electrum

Run tests

Run unit tests with pytest:

$ pytest tests -v

To run a single file, specify it directly like this:

$ pytest tests/test_bitcoin.py -v

Creating Binaries

Contributing

Any help testing the software, reporting or fixing bugs, reviewing pull requests and recent changes, writing tests, or helping with outstanding issues is very welcome. Implementing new features, or improving/refactoring the codebase, is of course also welcome, but to avoid wasted effort, especially for larger changes, we encourage discussing these on the issue tracker or IRC first.

Besides GitHub, most communication about Electrum development happens on IRC, in the #electrum channel on Libera Chat. The easiest way to participate on IRC is with the web client, web.libera.chat.

Languages
Python 89.1%
QML 8.4%
Shell 2%
Dockerfile 0.2%
Java 0.2%
Other 0.1%