Kyoto (bip157) fork used by Nido: peer selection by speed, parallel block requests and range-based filter sync.
  • Rust 99.5%
  • Just 0.4%
  • Nix 0.1%
Find a file
2026-11-24 21:54:36 +01:00
.cargo build: move build complexity to justfile 2025-04-16 14:17:27 -07:00
.github ci: add weekly check job 2025-06-16 15:06:10 +01:00
doc doc: Update DETAILS.md 2025-10-11 15:21:32 +01:00
examples Remove bitcoin::Address re-export 2026-10-24 06:44:56 +01:00
src test(race): pin the handover from a principal that leaves to the fastest connected peer 2026-11-04 09:19:31 +01:00
tests feat(client): look up the filter header at a height 2026-11-03 14:34:56 +01:00
.gitignore build: move build complexity to justfile 2025-04-16 14:17:27 -07:00
Cargo.toml Release 0.8.1 2026-10-28 18:42:32 +00:00
CHANGELOG.md Release 0.8.1 2026-10-28 18:42:32 +00:00
CONTRIBUTING.md doc: update contributing guide 2025-06-03 16:37:45 +01:00
flake.lock Add flake.nix 2026-07-17 21:31:24 +01:00
flake.nix Add flake.nix 2026-07-17 21:31:24 +01:00
justfile Update justfile commands 2025-11-22 09:54:18 +00:00
LICENSE license: APACHE-2.0/MIT 2024-05-17 16:03:49 -10:00
LICENSE-APACHE license: APACHE-2.0/MIT 2024-05-17 16:03:49 -10:00
LICENSE-MIT license: APACHE-2.0/MIT 2024-05-17 16:03:49 -10:00
README.md docs: note that this is a fork of Kyoto 0.8.1 with changes for Nido 2026-11-24 21:54:36 +01:00

Kyoto: Bitcoin Light Client

An Implementation of BIP-157/BIP-158

Crate Info MIT or Apache-2.0 Licensed CI Status API Docs Rustc Version 1.63.0+

This is a fork. It is Kyoto 0.8.1 with changes made for Nido, a Sparrow Wallet companion by Semilla Bitcoin. It is not an official release of Kyoto: for that, use the upstream repository and the bip157 crate.

The changes, on top of upstream 0.8.1, are about downloading compact filters faster and more reliably from public peers:

  • filter batches are downloaded from several peers at once, and peers race to serve them, so the fastest one downloads the rest; peers much slower than the best are dropped;
  • filter headers are synced in ranges checked against agreed checkpoints;
  • several blocks are requested at once;
  • fixes to peer handling: no duplicate connections, optional reconnection to whitelisted peers, no dialing back a filter peer that disconnected.

We intend to propose these changes upstream. The license is unchanged (MIT or Apache-2.0).

About

Kyoto is aiming to be a simple, memory-conservative, and private Bitcoin client for developers to build wallet applications. To read more about the scope, usage recommendations, and implementation details, see DETAILS.md.

Running an example

To run the Signet example, in the root directory:

cargo run --example signet

Or, with just:

just example

Getting Started

It is recommended to walk through the Signet example code. Unlike usual clients that source data from the blockchain, there are two components to the CBF system. There is a "node" that fetches data on behalf of a user, and a "client" that receives data, logs, and warnings from the node. The client may also interact with the node by sending transactions to broadcast or fetching metadata. This crate allows a highly configurable node construction, so your app may optimize for the desired speed, privacy, and preferences.

See the docs for more details on the Builder, Node, Client, and more.

To add to your project:

cargo add bip157

BDK

Kyoto integrates well with the Bitcoin Dev Kit (BDK) ecosystem.

  • Book of BDK - Kyoto Examples: Learn how to use Kyoto with BDK Wallet through step-by-step examples.
  • BDK FFI: Build native Bitcoin experiences across multiple platforms by combining Kyoto with BDK's foreign function interface libraries.
  • bdk-kyoto Crate: A dedicated crate that provides direct integration between BDK and Kyoto for Rust applications.

Minimum Supported Rust Version (MSRV) Policy

The bip157 core library with default features supports an MSRV of Rust 1.84.

Contributing

Please read CONTRIBUTING.md to get started.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

License

Licensed under either of

at your option.