#bitcoin #parser #newtype #bip21

no-std bitcoin_uri

Rust-idiomatic, compliant, flexible and performant bitcoin URI crate

1 unstable release

0.1.0 Dec 2, 2024

#54 in #newtype

Download history 166/week @ 2024-12-27 135/week @ 2025-01-03 145/week @ 2025-01-10 173/week @ 2025-01-17 131/week @ 2025-01-24 168/week @ 2025-01-31 129/week @ 2025-02-07 138/week @ 2025-02-14 156/week @ 2025-02-21 136/week @ 2025-02-28 173/week @ 2025-03-07 301/week @ 2025-03-14 867/week @ 2025-03-21 355/week @ 2025-03-28 208/week @ 2025-04-04 182/week @ 2025-04-11

1,636 downloads per month
Used in payjoin

MITNFA license

44KB
695 lines

Rust implementation of BIP21 bitcoin URIs

Rust-idiomatic, compliant, flexible and performant bitcoin URI 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.63.0

License

MITNFA

Dependencies

~7.5MB
~91K SLoC