7 releases

0.0.7 Aug 26, 2024
0.0.6 Aug 22, 2024
0.0.1 Jul 22, 2024

#406 in Magic Beans

Download history 104/week @ 2024-07-22 96/week @ 2024-07-29 322/week @ 2024-08-05 53/week @ 2024-08-12 160/week @ 2024-08-19 192/week @ 2024-08-26

738 downloads per month

CC0 license

31KB
772 lines

BIP-322

Implements BIP-322, generic message signing and verification.

Types of Signatures

At the moment this crate supports P2TR, P2WPKH and P2SH-P2WPKH single-sig addresses. Feedback through issues or PRs on the interface design and security is welcome and encouraged.

  • simple
  • full
  • full (proof-of-funds)
  • legacy (BIP-137)

The goal is to provide a full signing and verifying library similar to this Javascript library.

Test Vectors

Compile for WASM (on MacOs)

brew install llvm
cargo install wasm-pack
rustup target add wasm32-unknown-unknown
AR=/opt/homebrew/opt/llvm/bin/llvm-ar \
CC=/opt/homebrew/opt/llvm/bin/clang \
wasm-pack build \
    --target web \
    --out-name bip322 \
    www

The WASM binary and Javascript glue code can then be found in www/pkg. The bip322.rs site also runs a small WASM binary if you'd like to check it out.

Dependencies

~12MB
~151K SLoC