#lightning #bitcoin #invoice #bolt11

no-std lightning-invoice

Data structures to parse and serialize BOLT11 lightning invoices

19 breaking releases

0.20.0 Oct 25, 2022
0.18.0 Jul 26, 2022
0.13.0 Mar 1, 2022
0.12.0 Dec 17, 2021
0.1.0 Dec 14, 2018

#93 in Magic Beans

Download history 752/week @ 2022-08-02 865/week @ 2022-08-09 629/week @ 2022-08-16 583/week @ 2022-08-23 1005/week @ 2022-08-30 1128/week @ 2022-09-06 1108/week @ 2022-09-13 675/week @ 2022-09-20 1094/week @ 2022-09-27 734/week @ 2022-10-04 574/week @ 2022-10-11 551/week @ 2022-10-18 862/week @ 2022-10-25 781/week @ 2022-11-01 1746/week @ 2022-11-08 1841/week @ 2022-11-15

5,303 downloads per month
Used in 11 crates (7 directly)

MIT/Apache

4MB
66K SLoC

lightning-invoice

Docs.rs

This repo provides data structures for BOLT 11 lightning invoices and functions to parse and serialize these from and to bech32.

Please be sure to run the test suite since we need to check assumptions regarding SystemTime's bounds on your platform. You can also call check_platform on startup or in your test suite to do so.


lib.rs:

This crate provides data structures to represent lightning BOLT11 invoices and functions to create, encode and decode these. If you just want to use the standard en-/decoding functionality this should get you started:

  • For parsing use str::parse::<Invoice>(&self) (see the docs of impl FromStr for Invoice)
  • For constructing invoices use the InvoiceBuilder
  • For serializing invoices use the Display/ToString traits

Dependencies

~6.5MB
~76K SLoC