{"id":19219381,"url":"https://github.com/bwt-dev/libbwt-jni","last_synced_at":"2025-08-17T12:36:04.873Z","repository":{"id":117492559,"uuid":"325466567","full_name":"bwt-dev/libbwt-jni","owner":"bwt-dev","description":"Java Native Interface bindings for Bitcoin Wallet Tracker, a lightweight personal indexer for bitcoin wallets.","archived":false,"fork":false,"pushed_at":"2021-03-25T00:51:25.000Z","size":233,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T00:44:47.496Z","etag":null,"topics":["android","bitcoin","bitcoin-wallet-tracker","bwt","jni"],"latest_commit_sha":null,"homepage":"https://bwt.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwt-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-30T05:49:04.000Z","updated_at":"2023-01-18T11:52:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"d61c73bb-eb38-4efe-9da2-c3744bc70699","html_url":"https://github.com/bwt-dev/libbwt-jni","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bwt-dev/libbwt-jni","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwt-dev%2Flibbwt-jni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwt-dev%2Flibbwt-jni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwt-dev%2Flibbwt-jni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwt-dev%2Flibbwt-jni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwt-dev","download_url":"https://codeload.github.com/bwt-dev/libbwt-jni/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwt-dev%2Flibbwt-jni/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270850051,"owners_count":24656443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","bitcoin","bitcoin-wallet-tracker","bwt","jni"],"created_at":"2024-11-09T14:31:01.416Z","updated_at":"2025-08-17T12:36:04.815Z","avatar_url":"https://github.com/bwt-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoin Wallet Tracker - JNI bindings\n\n[![Build Status](https://travis-ci.org/bwt-dev/libbwt-jni.svg?branch=master)](https://travis-ci.org/bwt-dev/libbwt-jni)\n[![Latest release](https://img.shields.io/github/v/release/bwt-dev/libbwt-jni?color=orange)](https://github.com/bwt-dev/libbwt-jni/releases/tag/v0.2.4)\n[![Downloads](https://img.shields.io/github/downloads/bwt-dev/libbwt-jni/total.svg?color=blueviolet)](https://github.com/bwt-dev/libbwt-jni/releases)\n[![MIT license](https://img.shields.io/github/license/bwt-dev/libbwt-jni.svg?color=yellow)](https://github.com/bwt-dev/libbwt-jni/blob/master/LICENSE)\n[![Pull Requests Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/bwt-dev/bwt#developing)\n\nJava Native Interface bindings for [Bitcoin Wallet Tracker](https://github.com/bwt-dev/bwt), a lightweight personal indexer for bitcoin wallets.\n\n`libbwt-jni` allows to programmatically manage bwt's Electrum RPC and HTTP API servers.\nIt can be used as a compatibility layer for easily upgrading Electrum-backed wallets to support a\nBitcoin Core full node backend (by running the Electrum server *in* the wallet),\nor for shipping software that integrates bwt's [HTTP API](https://github.com/bwt-dev/bwt#http-api)\nas an all-in-one package.\n\nSupport development: [⛓️ on-chain or ⚡ lightning via BTCPay](https://btcpay.shesek.info/)\n\n- [Usage](#usage)\n- [Installation](#installation)\n  - [AAR](#aar-for-androidkotlin) (for Android/Kotlin)\n  - [Manual](#manual-installation-non-android-or-without-kotlin) (non-Android or without Kotlin)\n  - [Electrum only](#electrum-only-variant)\n  - [Verifying the signature](#verifying-the-signature)\n- [Building from source](#building-from-source)\n- [Reproducible builds](#reproducible-builds)\n- [License](#license)\n\n\u003e Also see: [bwt](https://github.com/bwt-dev/bwt), [libbwt](https://github.com/bwt-dev/libbwt) and [libbwt-nodejs](https://github.com/bwt-dev/libbwt-nodejs).\n\n## Usage\n\nWith the higher-level `BwtDaemon` implemented in Kotlin:\n\n```kotlin\nimport dev.bwt.libbwt.daemon.*\nimport dev.bwt.libbwt.BwtException\n\nval bwt = BwtDaemon(BwtConfig(\n    bitcoindUrl = \"http://127.0.0.1:8332\",\n    bitcoindAuth = \"satoshi:otomakan\",\n    descriptors = arrayOf(\"wpkh(xpub66../0/*)\", \"wpkh(xpub66../1/*)\"),\n    xpubs = arrayOf(\"xpub11...\", \"ypub22...\", \"zpub33...\"),\n    rescanSince = 1510160280, // unix timestamp\n    electrumAddr = \"127.0.0.1:0\", // bind on any available port\n))\n\ntry {\n    // start() will block the current thread and won't return until the daemon is stopped.\n    bwt.start(object : ProgressNotifier {\n        override fun onBooting() {\n            // Called after the configuration is validated, right before starting up\n            println(\"Daemon booting up...\")\n        }\n        override fun onSyncProgress(progress: Float, tip: Date) {\n            println(\"Initial block download in progress... ($progress done, synced up to $tip)\")\n        }\n        override fun onScanProgress(progress: Float, eta: Int) {\n            println(\"Wallet rescanning in progress... ($progress done, ETA $eta seconds)\")\n        }\n        override fun onReady() {\n            println(\"Daemon ready, Electrum server bound on ${bwt.electrumAddr}\")\n            bwt.shutdown()\n        }\n    })\n} catch (e: BwtException) {\n    println(\"Daemon startup failed: $e\")\n}\n```\n\nAlternatively, you may use the lower-level [`NativeBwtDaemon`](library/src/main/java/dev/bwt/libbwt/daemon/NativeBwtDaemon.java)\ndirectly, which does not require Kotlin. Refer to the [`BwtDaemon`](library/src/main/java/dev/bwt/libbwt/daemon/BwtDaemon.kt)\nimplementation for example usage.\n\nFor the full list of available configuration options, refer to the\n[`libbwt` C FFI docs](https://github.com/bwt-dev/libbwt#config-options).\n\nThe API servers are unauthenticated by default, but\n[authentication can be enabled](https://github.com/bwt-dev/bwt/blob/master/doc/auth.md).\n\nNote that if you call `shutdown()` while bitcoind is importing/rescanning addresses, the daemon will\nnot stop immediately but will be marked for later termination.\n\n## Installation\n\nPre-built [signed](#verifying-the-signature) \u0026 [deterministic](#reproducible-builds) library\nfiles are available for Linux, Mac, Windows, ARMv7/8 and Android.\n\n\u003e ⚠️ The pre-built libraries are meant to make it easier to get started. If you're integrating bwt\n\u003e into real-world software, [building from source](#building-from-source) is *highly* recommended.\n\n#### AAR (for Android/Kotlin)\n\nThe AAR library is available for download from the [releases page](https://github.com/bwt-dev/libbwt-jni/releases).\n\nInstallation instructions for AAR [are available here](https://developer.android.com/studio/projects/android-library#AddDependency).\n\n#### Manual installation (non-Android or without Kotlin)\n\nIf you're not developing for Android, or if you are but would like to avoid using the AAR or Kotlin,\nyou can use the JNI libraries directly.\n\n1. Download the JNI library for you platform(s) from the [releases page](https://github.com/bwt-dev/libbwt-jni/releases)\n  and copy it into your `jniLibs` directory.\n\n2. Copy the [`dev.bwt.libbwt` source code](https://github.com/bwt-dev/libbwt-jni/tree/master/library/src/main/java/dev/bwt/libbwt)\n   into your project. You may omit `BwtDaemon.kt` and use `NativeBwtDaemon` directly instead.\n\n3. If you choose to use `BwtDaemon`, you'll need to have [`com.google.gson`](https://github.com/google/gson) installed.\n\n#### Electrum-only variant\n\nThe pre-built libraries are also available for download as an `electrum_only` variant,\nwhich doesn't include the HTTP API server. It is roughly 33% smaller and comes with less dependencies.\n\n#### Verifying the signature\n\nThe releases are signed by Nadav Ivgi (@shesek).\nThe public key can be verified on\nthe [PGP WoT](http://keys.gnupg.net/pks/lookup?op=vindex\u0026fingerprint=on\u0026search=0x81F6104CD0F150FC),\n[github](https://api.github.com/users/shesek/gpg_keys),\n[twitter](https://twitter.com/shesek),\n[keybase](https://keybase.io/nadav),\n[hacker news](https://news.ycombinator.com/user?id=nadaviv)\nand [this video presentation](https://youtu.be/SXJaN2T3M10?t=4) (bottom of slide).\n\n```bash\n# Download (change x86_64-linux to your platform)\n$ wget https://github.com/bwt-dev/libbwt-jni/releases/download/v0.2.4/libbwt-jni-0.2.4-x86_64-linux.tar.gz\n\n# Fetch public key\n$ gpg --keyserver keyserver.ubuntu.com --recv-keys FCF19B67866562F08A43AAD681F6104CD0F150FC\n\n# Verify signature\n$ wget -qO - https://github.com/bwt-dev/libbwt-jni/releases/download/v0.2.4/SHA256SUMS.asc \\\n  | gpg --decrypt - | grep x86_64-linux.tar.gz | sha256sum -c -\n```\n\nThe signature verification should show `Good signature from \"Nadav Ivgi \u003cnadav@shesek.info\u003e\" ... Primary key fingerprint: FCF1 9B67 ...` and `libbwt-jni-0.2.4-x86_64-linux.tar.gz: OK`.\n\n## Building from source\n\nManually build the JNI library for a single platform (requires Rust):\n\n```bash\n$ git clone https://github.com/bwt-dev/libbwt-jni \u0026\u0026 cd libbwt-jni\n$ git checkout \u003ctag\u003e\n$ git verify-commit HEAD\n$ git submodule update --init\n\n$ cargo build --release --target \u003cplatform\u003e\n```\n\nThe library file will be available in `target/\u003cplatform\u003e/release`, named\n`libbwt_jni.so` for Linux/Android/ARM, `libbwt_jni.dylib` for OSX, or `bwt_jni.dll` for Windows.\n\nTo build the `electrum_only` variant, set `--no-default-features --features electrum`.\n\nBuilding for Android targets requires NDK to be installed in your `PATH`.\n\nTo build the AAR, first build the JNI libraries for all android platforms, place them under\n`library/src/main/jniLibs`, then run `./gradlew build` (or use the Docker builder below).\n\n## Reproducible builds\n\nThe JNI builds for all supported platforms and the AAR library for Android can be reproduced\nin a Docker container environment as follows:\n\n```bash\n$ git clone https://github.com/bwt-dev/libbwt-jni \u0026\u0026 cd libbwt-jni\n$ git checkout \u003ctag\u003e\n$ git verify-commit HEAD\n$ git submodule update --init\n\n# JNI libraries for Linux, Windows, ARMv7 and ARMv8\n$ docker build -t bwt-builder - \u003c bwt/scripts/builder.Dockerfile\n$ docker run -it --rm -u `id -u` -v `pwd`:/usr/src/libbwt-jni -w /usr/src/libbwt-jni \\\n  --entrypoint scripts/build.sh bwt-builder\n\n# JNI libraries for Mac OSX (cross-compiled via osxcross)\n$ docker build -t bwt-builder-osx - \u003c bwt/scripts/builder-osx.Dockerfile\n$ docker run -it --rm -u `id -u` -v `pwd`:/usr/src/libbwt-jni -w /usr/src/libbwt-jni \\\n  --entrypoint scripts/build.sh bwt-builder-osx\n\n# JNI libraries + AAR for Android platforms (x86, x86_64, arm32v7, arm64v8)\n$ docker build -t bwt-builder-android - \u003c bwt/scripts/builder-android.Dockerfile\n$ docker run -it --rm -u `id -u` -v `pwd`:/usr/src/libbwt-jni -w /usr/src/libbwt-jni \\\n  --entrypoint scripts/build-android.sh bwt-builder-android\n\n$ sha256sum dist/*.tar.gz\n```\n\nYou may set `-e TARGETS=...` to a comma separated list of the platforms to build. \nThe available platforms are: `x86_64-linux`, `x86_64-osx`, `x86_64-windows`, `arm32v7-linux`, `arm64v8-linux`,\n`arm32v7-android`, `arm64v8-android`, `i686-android` and `x86_64-android`.\n\nBoth variants will be built by default. To build the `electrum_only` variant only, set `-e ELECTRUM_ONLY_ONLY=1`.\n\nThe builds are [reproduced on Travis CI](https://travis-ci.org/github/bwt-dev/libbwt-jni/branches) using the code from GitHub.\nThe SHA256 checksums are available under the \"Reproducible builds\" stage.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwt-dev%2Flibbwt-jni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwt-dev%2Flibbwt-jni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwt-dev%2Flibbwt-jni/lists"}