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

Issues
  • 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
  • Setup CI

    Setup CI

    null

    enhancement good first issue code quality 
    opened by Kixunil 0
  • 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
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 14 Nov 8, 2021
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
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

Ivan Markov 9 Nov 26, 2021
Skeleton animation and IK crate

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

Zakarum 0 Oct 27, 2021
An experimental Rust crate for sigstore

Continuous integration Docs License This is an experimental crate to interact with sigstore. This is under high development, many features and checks

Flavio Castelli 0 Oct 23, 2021
An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous and blocking clients respectively.

eithers_rust An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous a

null 2 Oct 24, 2021
Leetcode Solutions in Rust, Advent of Code Solutions in Rust and more

RUST GYM Rust Solutions Leetcode Solutions in Rust AdventOfCode Solutions in Rust This project demostrates how to create Data Structures and to implem

Larry Fantasy 224 Nov 22, 2021
Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust 标准库中文版 这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust。 如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中

wtklbm 294 Nov 26, 2021
:crab: Small exercises to get you used to reading and writing Rust code!

rustlings ?? ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

The Rust Programming Language 20.2k Nov 27, 2021
A catalogue of Rust design patterns, anti-patterns and idioms

Rust Design Patterns An open source book about design patterns and idioms in the Rust programming language that you can read here. Contributing You ar

null 5.4k Nov 26, 2021
Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.

Speedy2D Hardware-accelerated drawing of shapes, images, and text, with an easy to use API. Speedy2D aims to be: The simplest Rust API for creating a

null 139 Nov 26, 2021
Rust, cargo and QEMU setup for multi-architecture OS development.

rust-osdev-jumpstart Rust, cargo and QEMU setup for multi-architecture OS development. Goal This repo should give you a boost in starting a bare-metal

Alister Lee 20 Nov 15, 2021
A bit-packed k-mer representation (and relevant utilities) for rust

K-mer class for rust The purpose of this repository is to build a simple library that exposes a bit-packed k-mer class for use in rust-based bioinform

COMBINE lab 38 Nov 28, 2021
Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth.

HexoDSP - Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth. This project contains the com

Weird Constructor 16 Oct 30, 2021
Some UwU and OwO for your Rust code

UwU Types Some UwU and OwO for your Rust code This is a Rust crate inspired by this tweet from @thingskatedid / @katef. Credits Some extra functionali

Evan Pratten 12 Nov 22, 2021
The source code that accompanies Hands-on Rust: Effective Learning through 2D Game Development and Play by Herbert Wolverson

Hands-on Rust Source Code This repository contains the source code for the examples found in Hands-on Rust. These are also available from my publisher

Herbert 112 Nov 27, 2021
A Collection of Rust Tips and Tricks

Table of Contents Using Nested Paths in Rust Struct Update Syntax in Rust Field Init Shorthand in Rust Shadowing in Rust Using Nested Paths in Rust So

Vandad Nahavandipoor 104 Nov 29, 2021
An i386 operation system written in pure rust for fun and no profit.

OrustS An i386 operation system written in pure rust (for fun and no profit). This operation system is under active developing. Checklist implement a

M4tsuri 3 Nov 21, 2021