Git Product home page Git Product logo

bwt-electrum-plugin's Introduction

Bitcoin Wallet Tracker - Electrum Plugin

Build Status Latest release Downloads MIT license Pull Requests Welcome

Electrum plugin for Bitcoin Wallet Tracker, a lightweight personal indexer for bitcoin wallets.

The plugin allows connecting Electrum to a Bitcoin Core full node backend, by running an embedded bwt Electrum server within the Electrum wallet itself.

Support development: ⛓️ on-chain or ⚡ lightning via BTCPay

Screenshot of bwt integrated into Electrum

Compatibility

The plugin supports Electrum v3 and v4. It is available for Linux, Mac, Windows and ARMv7/v8. It works with multi-signature wallets. It does not support Lightning.

Bitcoin Core v0.19+ is recommended, but it can work (not as well) with v0.17+. txindex is not required. Pruning is supported, but you can only scan for transactions in the non-pruned history.

The plugin can be used with the Electrum AppImage (see special instructions below), Linux package manager installations, the Windows installer, the tar.gz package, or from source. It cannot be used with the standalone Windows executable.

The plugin currently supports watch-only wallets only and cannot be used with hot wallets. This is expected to eventually change. For now, you can use the plugin with hardware wallets or with an offline Electrum setup. For hot wallets, you will need to setup a standalone server instead of using the plugin.

Installation

  1. Install and sync Bitcoin Core. If you're using QT, set server=1 in your bitcoin.conf file.

    It is recommended, but not required, to create a separate bitcoind wallet with createwallet <name> true true.

  2. Download the bwt plugin from the releases page, verify the signature (see below) and unpack the bwt directory into your electrum/plugins directory.

    You can find the location of your plugins directory by running electrum.plugins.__path__ in the Electrum console tab.

  3. Restart Electrum, open Tools -> Plugins, enable bwt, click Connect to bitcoind, configure your Bitcoin Core RPC details, and click Save & Connect. That's it!

On the first run, rescanning for historical transactions from genesis may take up to 2-3 hours. To speed this up, set the rescan date to when the wallet was created (or disable rescanning entirely for new wallets). If your node is pruned, the rescan date has to be within the range of non-pruned blocks.

The plugin automatically configures Electrum with oneserver (to avoid connecting to public servers) and skipmerklecheck (necessary for pruning). To avoid connecting to public servers while setting up the plugin, make sure the "auto connect" feature is disabled or run Electrum with --offline until everything is ready.

With the Electrum AppImage

If you're using the Electrum AppImage, you will have to extract it to a directory first and copy the bwt plugin directory into it. This can be done as follows:

# Extract AppImage (to a subdirectory named 'squashfs-root')
$ ./electrum-x.y.z-x86_64.AppImage --appimage-extract

# Copy the bwt plugin directory
$ cp -r /path/to/bwt squashfs-root/usr/lib/python3.7/site-packages/electrum/plugins/

# Start Electrum
$ ./squashfs-root/AppRun

Or using the run-appimage.sh utility script available within the plugin directory (which does the same):

# Extract the AppImage, copy bwt and start Electrum
$ ./bwt/run-appimage.sh ./electrum-x.y.z-x86_64.AppImage

# Can also forward arguments
$ ./bwt/run-appimage.sh ./electrum-x.y.z-x86_64.AppImage --offline

Verifying the signature

The releases are signed by Nadav Ivgi (@shesek). The public key can be verified on the PGP WoT, github, twitter, keybase, hacker news and this video presentation.

# Download plugin (change x86_64-linux to your platform)
$ wget https://github.com/bwt-dev/bwt-electrum-plugin/releases/download/v0.2.4/bwt-electrum-plugin-0.2.4-x86_64-linux.tar.gz

# Fetch public key
$ gpg --keyserver keyserver.ubuntu.com --recv-keys FCF19B67866562F08A43AAD681F6104CD0F150FC

# Verify signature
$ wget -qO - https://github.com/bwt-dev/bwt-electrum-plugin/releases/download/v0.2.4/SHA256SUMS.asc \
  | gpg --decrypt - | grep x86_64-linux | sha256sum -c -

The signature verification should show Good signature from "Nadav Ivgi <[email protected]>" ... Primary key fingerprint: FCF1 9B67 ... and bwt-electrum-plugin-0.2.4-x86_64-linux.tar.gz: OK.

Welcome banner

The bwt Electrum server provides a welcome banner with information about your node and the Bitcoin network. You can view it by opening the Console tab.

Screenshot of the bwt welcome banner

Building from source

To build the plugin from source, first build the bwt binary (as also described here), copy it into the src directory in this repo, then copy that directory into electrum/plugins, but renamed to bwt (Electrum won't recognize it otherwise).

$ git clone https://github.com/bwt-dev/bwt-electrum-plugin && cd bwt-electrum-plugin
$ git checkout <tag>
$ git verify-commit HEAD
$ git submodule update --init

$ cd bwt
$ cargo build --release --no-default-features --features cli,electrum
$ cd ..
$ cp bwt/target/release/bwt src/
$ cp -r src /usr/local/lib/python3.8/site-packages/electrum/plugins/bwt

Reproducible builds

The builds for all supported platforms can be reproduced in a Docker container environment as follows:

$ git clone https://github.com/bwt-dev/bwt-electrum-plugin && cd bwt-electrum-plugin
$ git checkout <tag>
$ git verify-commit HEAD
$ git submodule update --init

# Linux, Windows, ARMv7 and ARMv8
$ docker build -t bwt-builder - < bwt/scripts/builder.Dockerfile
$ docker run -it --rm -u `id -u` -v `pwd`:/usr/src/bwt-electrum-plugin -w /usr/src/bwt-electrum-plugin \
  --entrypoint scripts/build.sh bwt-builder

# Mac OSX (cross-compiled via osxcross)
$ docker build -t bwt-builder-osx - < bwt/scripts/builder-osx.Dockerfile
$ docker run -it --rm -u `id -u` -v `pwd`:/usr/src/bwt-electrum-plugin -w /usr/src/bwt-electrum-plugin \
  --entrypoint scripts/build.sh bwt-builder-osx

$ sha256sum dist/*

The builds are reproduced on Travis CI using the code from GitHub. The SHA256 checksums are available under the "Reproducible builds" stage.

License

MIT

bwt-electrum-plugin's People

Contributors

shesek avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

bwt-electrum-plugin's Issues

Use with the Electrum AppImage

Unfortunately Tails has not the recent Electrum version and since I cannot use pip I cannot either install from source.

The only option is to use AppImage, but AFAIK this plugin cannot work with it. There is any workaround to this?

(I cannot use the old Electrum, because my watch-only wallet has been created with a recent electrum version and is not compatible)

--tx-broadcast-cmd is parsed incorrectly

the plugin's gui provides a window for custom options to be passed to bwt; however I've been unsuccessful with --tx-broadcast-cmd, it seems it seems the way the arguments are parsed breaks it.

Arguments at that input area get cut at every space, and --tx-broadcast-cmd requires at the very least a space, between the command and the {tx_hex} field, alas I find no way to escape the espace

Bitcoin Core 0.21: Not able to connect

I'm running latest bwt on my linux with a Bitcoin Core 0.21 pruned.

I keep receiving this warning when I click on Save & Connect. I'm waiting but cannot connect to my instance.

With latest version of Bitcoin Core all was flawless, will try to downgrade and will see

WARN bwt::electrum » rpc #6 server.banner failed: JSON-RPC error: JSON decode error: missing field `addnode`

Unable to connect to local bitcoind instance

I am running a fully synced bitcoind on an Odroid box and I am trying to connect to it using the bwt-electrum-plugin on my M1 Mac. Upon configuring the options (I am using a user:password auth and not the cookie) and clicking 'Save & Connect', I get the following error as part of the Trace (note: I have blanked the xpub and the last two places of the local IP) -

DEBUG bwt » Config { network: Bitcoin, verbose: 2, timestamp: false, bitcoind_wallet: None, bitcoind_dir: Some(""), bitcoind_url: Some("http://192.168.xxx.yyy:8332"), bitcoind_auth: Some("**SCRUBBED**"), bitcoind_cookie: None, create_wallet_if_missing: false, descriptors: [], xpubs: [—], addresses: [], addresses_file: None, rescan_since: Timestamp(1546128000), force_rescan: false, gap_limit: 20, initial_import_size: 350, wait_sync: true, prune_until: None, auth_cookie: None, auth_token: None, auth_ephemeral: false, print_token: false, electrum_addr: Some(127.0.0.1:61668), electrum_skip_merkle: true, electrum_socks_auth: false, poll_interval: 5s, broadcast_cmd: None, startup_banner: false, unix_listener_path: Some("/Applications/Electrum.app/Contents/MacOS/electrum/plugins/bwt/bwt-socket"), require_addresses: true, setup_logger: true }
DEBUG bitcoincore_rpc » JSON-RPC request: getnetworkinfo []
DEBUG bitcoincore_rpc » JSON-RPC failed parsing reply of getnetworkinfo: JsonRpc(Json(Error("EOF while parsing a value", line: 1, column: 0)))
ERROR bwt » JSON-RPC error: JSON decode error: EOF while parsing a value at line 1 column 0

Any idea why is the plugin unable to connect to bitcoind?

No watch-only hd wallets found.

When clicking the "Connect to bitcoind" button, I get:

No watch-only hd wallets found. Note that bwt cannot currently be used with hot wallets. See the README for more details.

I ran createwallet "watch_only" true true in Bitcoin Core terminal.

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.