Skip to content

rustaceanrob/kyoto

Kyoto Light Client

⚠️ Warning: This project is under development and is not suitable for actual use ⚠️

Description

Kyoto is aiming to be a light-weight and private Bitcoin client. While Neutrino is the standard SPV for LND, integrations with existing Rust clients for LDK and BDK haven't come to furition. The Nakamoto project is complete with some very modular, elegant programming, but the lead maintainer has other projects to focus on. Murmel is yet another light client in Rust, but the last commit was 4 years ago at the time of writing. The Rust community of crates has evolved quickly in terms of asynchronus frameworks and runtime executors. Like the LDK node project, this project leverages the use of tokio. By leveraging how futures and executors have developed over the years, the hope is a light client in Rust should be significantly easier to maintain. To read more about the scope, usage recommendations, and implementation details, see DETAILS.md.

Running an example

To run the Signet example, fork the project and run: cargo run --example signet in the root directory.

Getting Started

The following snippet demonstrates how to build a Kyoto node. See the docs for more details on the NodeBuilder, Node, Client, and more.

use kyoto::node::NodeBuilder;
use kyoto::TrustedPeer;
let builder = NodeBuilder::new(bitcoin::Network::Signet);
// Add node preferences and build the node/client
let (mut node, mut client) = builder
    // Add the peers
    .add_peers(vec![TrustedPeer::from_ip(peer_1), TrustedPeer::from_ip(peer_1)])
    // The Bitcoin scripts to monitor
    .add_scripts(addresses)
    // Only scan blocks strictly after an anchor checkpoint
    .anchor_checkpoint(HeaderCheckpoint::new(
        180_000,
        BlockHash::from_str("0000000870f15246ba23c16e370a7ffb1fc8a3dcf8cb4492882ed4b0e3d4cd26")
            .unwrap(),
    ))
    // The number of connections we would like to maintain
    .num_required_peers(2)
    // Create the node and client
    .build_node()

About

a Bitcoin node in your pocket

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages