rustywallet_lightning/lib.rs
1//! # rustywallet-lightning
2//!
3//! Lightning Network utilities for Bitcoin wallets.
4//!
5//! This crate provides tools for working with the Lightning Network,
6//! including BOLT11 invoice parsing/creation, payment hash handling,
7//! and node identity derivation.
8//!
9//! ## Features
10//!
11//! - **BOLT11 Invoices**: Parse and create Lightning invoices
12//! - **Payment Hashes**: Generate and verify payment hashes/preimages
13//! - **Node Identity**: Derive node ID from HD seed
14//! - **Route Hints**: Parse and create route hints
15//! - **Channel Points**: Handle channel point references
16//!
17//! ## Quick Start
18//!
19//! ```rust
20//! use rustywallet_lightning::prelude::*;
21//!
22//! // Generate payment hash from preimage
23//! let preimage = PaymentPreimage::random();
24//! let hash = preimage.payment_hash();
25//! println!("Payment hash: {}", hash);
26//!
27//! // Verify preimage matches hash
28//! assert!(hash.verify(&preimage));
29//! ```
30//!
31//! ## Node Identity
32//!
33//! ```rust
34//! use rustywallet_lightning::node::NodeIdentity;
35//!
36//! // Derive node identity from 64-byte seed
37//! let seed = [0u8; 64]; // In practice, use a proper seed
38//! let identity = NodeIdentity::from_seed(&seed).unwrap();
39//! println!("Node ID: {}", identity.node_id());
40//! ```
41
42pub mod bolt11;
43pub mod channel;
44pub mod error;
45pub mod node;
46pub mod payment;
47pub mod prelude;
48pub mod route;
49
50#[cfg(test)]
51mod tests;
52
53// Re-export main types
54pub use bolt11::{Bolt11Invoice, InvoiceBuilder, InvoiceData};
55pub use channel::ChannelPoint;
56pub use error::LightningError;
57pub use node::NodeIdentity;
58pub use payment::{PaymentHash, PaymentPreimage};
59pub use route::{RouteHint, RouteHintHop};