Rust-idiomatic, compliant, flexible and performant BIP21 crate

Overview

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.41.1

License

MITNFA

You might also like...
Stack heap flexible string designed to improve performance for Rust

flexible-string A stack heap flexible string designed to improve performance. FlexibleString was first implemented in spdlog-rs crate, which improved

A flexible, stateless implementation of the bisection method

Flexibility is achieved by giving the user of this crate control over the input and output types

🤩 Flexible interpreted programming language

Jel Flexible, memory-safe, easy-to-use, interpreted programming language. work in progress Example Hello World: print(Hello World!) # this is valid pr

Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously

Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously. It is intended to suit one's every requirement regarding chat on omegle.

Rust on ESP32 STD "Hello, World" app. A "Hello, world!" STD binary crate for the ESP32[XX] and ESP-IDF.

Rust on ESP32 STD "Hello, World" app A "Hello, world!" STD binary crate for the ESP32[XX] and ESP-IDF. This is the crate you get when running cargo ne

A Rust crate providing utility functions and macros.

介绍 此库提供四类功能:异常处理、http post收发对象、格式转换、语法糖。 在 Cargo.toml 里添加如下依赖项 [dependencies.xuanmi_base_support] git = "https://github.com/taiyi-research-institute/x

Rust crate: Overloaded Literals to construct your datatypes without boilerplate and with compile-time validation.

overloaded_literals   Overloaded Literals to construct your datatypes without boilerplate and with compile-time validation. Features Compile-time vali

A rust crate can find first `Err` in `IteratorResultT, E` and iterating continuously, without allocation.

Api Document first-err Find the first Err in IteratorResultT, E and allow iterating continuously. This crate is specifically designed to replace t

Skeleton animation and IK crate

skelly Crate for skeleton animation. Optionally provides inverse-kinematics functionality. Example use {skelly::Skelly, na::{Point3, Vector3, Isometry

Comments
  • Why not use thiserror crate?

    Why not use thiserror crate?

    Is there some technical reason why bip21 does not use thiserror? If the docs for thiserror are correct then the derived code should be the same (I have not looked at the generated code myself though).

    Thiserror deliberately does not appear in your public API. You get the same thing as if you had written an implementation of std::error::Error by hand, and switching from handwritten impls to thiserror or vice versa is not a breaking change.

    I'm interested to understand you reasoning.

    Thanks

    question 
    opened by tcharding 8
  • A few minor fixes

    A few minor fixes

    While taking a look at this crate I did a few minor/trivial fixes.

    • Patch 1: fix typo
    • Patch 2: add two missing full stops
    • Patch 3: remove 2 instances of a clippy warning about integer bitcoin format 3_00_000_000.

    Nice crate! The code is super clean, a pleasure to read.

    opened by tcharding 2
  • More trait impls

    More trait impls

    We could and probably should derive/implement more things:

    • Clone for Uri
    • rewrite derive on Param to print string or bytes (hex encoded?)
    • Probably also (Partial)Eq and Hash
    enhancement good first issue 
    opened by Kixunil 2
  • Double-check the crate is actually compliant

    Double-check the crate is actually compliant

    While I did implement the most important things it's possible I missed something so a deep review would be helpful. Especially from someone independent.

    enhancement help wanted 
    opened by Kixunil 0
Owner
Martin Habovštiak
Beside programming, I'm interested in security, cryptography, Bitcoin and freedom.
Martin Habovštiak
Safe, idiomatic bindings to cFE and OSAL APIs for Rust

n2o4 The n2o4 crate provides safe, idiomatic Rust bindings to the APIs of cFE and OSAL, the libraries of the Core Flight System (cFS). IMPORTANT NOTE

null 3 Aug 29, 2022
A peer-reviewed collection of articles/talks/repos which teach concise, idiomatic Rust.

This repository collects resources for writing clean, idiomatic Rust code. Please bring your own. ?? Idiomatic coding means following the conventions

Matthias 4.2k Dec 30, 2022
Idiomatic Rust implementations for various Windows string types (like UNICODE_STRING)

nt-string by Colin Finck <[email protected]> Provides idiomatic Rust implementations for various Windows string types: NtUnicodeString (with NtUnicode

Colin Finck 5 Jun 4, 2023
Efficiently store Rust idiomatic bytes related types in Avro encoding.

Serde Avro Bytes Avro is a binary encoding format which provides a "bytes" type optimized to store &[u8] data like. Unfortunately the apache_avro enco

Akanoa 3 Mar 30, 2024
Simple and performant hot-reloading for Rust

reloady Simple, performant hot-reloading for Rust. Requires Rust nightly and only works on Linux for now. installing CLI To install the CLI helper car

Anirudh Balaji 24 Aug 5, 2022
Mote is a systems-programming language designed to be practical, performant, and simple.

Mote NOTE: this following lists the goals for what Mote is supposed to be. It does not promise that any of the features here will be accomplished or a

The Mote Programming Language 14 Jul 28, 2021
A highly performant HTTP bittorrent tracker (WIP)

kiryuu Rewrite of kouko in Rust, for better performance! Kiryuu powers http://tracker.mywaifu.best:6969/announce Thanks Many thanks to horsie and anon

Raghu Saxena 6 Dec 15, 2022
A typesafe, flexible, simple, and user-friendly unit system library for Rust that has good error messages.

uy A typesafe, flexible, simple, and user-friendly unit system library for Rust that has good error messages. Usage uy not only stores the unit of a v

Lachlan Sneff 19 Aug 8, 2023
A backend framework for building fast and flexible APIs rapidly.

Andromeda Andromeda is a backend framework for Rust, to simplify the development of the kinds of basic API services that we developers have to build s

Framesurge 7 Dec 28, 2022
A fast and flexible LRU map.

A fast and flexible LRU map This repository contains a fast and flexible LRU map. Blazingly fast. Up to twice as fast as the lru crate, and with less

Koute 67 Jan 1, 2023