#newtype #parser #bitcoin

no-std bip21

Rust-idiomatic, compliant, flexible and performant BIP21 crate

7 unstable releases

0.4.0 Feb 8, 2024
0.3.1 May 26, 2023
0.3.0 Mar 22, 2023
0.2.0 Oct 18, 2022
0.1.1 Nov 22, 2021

#1703 in Magic Beans

Download history 1242/week @ 2024-03-14 2197/week @ 2024-03-21 1410/week @ 2024-03-28 2671/week @ 2024-04-04 2316/week @ 2024-04-11 1280/week @ 2024-04-18 1331/week @ 2024-04-25 981/week @ 2024-05-02 1170/week @ 2024-05-09 2318/week @ 2024-05-16 2555/week @ 2024-05-23 1699/week @ 2024-05-30 1368/week @ 2024-06-06 1193/week @ 2024-06-13 678/week @ 2024-06-20 563/week @ 2024-06-27

4,295 downloads per month
Used in 6 crates (3 directly)

MITNFA license

39KB
625 lines

Rust implementation of BIP21

Rust-idiomatic, compliant, flexible and performant BIP21 crate.

About

Important: while lot of work went into polishing the crate it's still considered early-development!

  • Rust-idiomatic: uses strong types, standard traits and other things
  • Compliant: implements all requirements of BIP21, including protections to not forget about req-. (But see features.)
  • Flexible: enables parsing/serializing additional arguments not defined by BIP21.
  • Performant: uses zero-copy deserialization and lazy evaluation wherever possible.

Serialization and deserialization is inspired by serde with these important differences:

  • Deserialization signals if the field is known so that req- fields can be rejected.
  • Much simpler API - we don't need all the features.
  • Use of Param<'a> to enable lazy evaluation.

The crate is no_std but does require alloc.

Features

  • std enables integration with std - mainly std::error::Error.
  • non-compliant-bytes - enables use of non-compliant API that can parse non-UTF-8 URI values.

MSRV

1.48.0

License

MITNFA

Dependencies

~7MB
~81K SLoC