joseluis / bsv-wasm

BSV stdlib written in Rust and runs in WASM environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BSV.WASM

A Rust/WASM Library to interact with Bitcoin SV

Installation

NodeJS:
npm i bsv-wasm --save

Web:
npm i bsv-wasm-web --save

Webpack:
npm i bsv-wasm-bundler --save

Rust:
https://crates.io/crates/bsv-wasm

Usage

Note: Rust and JS/TS method names and structs are the same

  • Derive private key from XPriv and log out P2PKH String ExtendedPrivateKey.fromWIF('LMyWif...').getPrivateKey().getPublicKey().toAddress().toString()

Caveats

  • Bitcoin Signed Message (BSM) struct does not implement any base64 string parsing, please pass the raw Signature type or call fromCompactBytes on the Signature struct and pass it to the BSM.verify function.

Features

  • Hash (SHA256, SHA256d, SHA1, RIPEMD160, Hash160, SHA512)
  • KDF (PBKDF2)
  • Encryption (AES-CBC, AES-CTR)
  • ECDSA (Private Key, Public Key, Signatures)
  • Transaction (Building, Serialising, Deserialising)
  • Script (Serialising, Deserialising)
  • Addresses (P2PKH)
  • Sighash Support
  • Extended Private Keys and Child Derivation (BIP32, BIP42)

TODO:

  • ECIES
  • Script Builder
  • Isomorphic Package for JS
  • Write documentation (Inline on functions and structs)
  • Testnet Support

Will not do:

  • Mnemonics

Thanks

About

BSV stdlib written in Rust and runs in WASM environments

License:MIT License


Languages

Language:Rust 99.6%Language:Makefile 0.4%Language:HTML 0.0%