bittoku-bsv
A comprehensive BSV Blockchain SDK for Rust. Facade crate that re-exports every component of the
bsv-sdk-rust workspace under one name.
Cryptographic primitives, transaction building, script interpretation, wallet operations, authenticated messaging, SPV verification, and STAS token templates — all in one dependency.
Install
Or in Cargo.toml:
[]
= "0.3"
Enable optional transports (ARC broadcaster, JungleBus indexer):
[]
= { = "0.3", = ["transports"] }
What's included
The crate re-exports the following modules:
| Module | Underlying crate | Purpose |
|---|---|---|
primitives |
bsv-primitives |
Hash, EC keys (secp256k1), Base58, AES-256-GCM, BRC-42 key derivation |
script |
bsv-script |
Script parsing, opcodes, addresses, full script interpreter |
transaction |
bsv-transaction |
Transaction building, sighash (BIP-143 FORKID), P2PKH templates |
wallet |
bsv-wallet |
29-method wallet interface, BRC-42/43 derivation, ProtoWallet, wire protocol |
message |
bsv-message |
BRC-78 ECIES encryption, BRC-77 message signing |
auth |
bsv-auth |
Peer authentication, sessions, BRC-31 identity certificates |
spv |
bsv-spv |
Merkle path verification (BRC-74), BEEF format (BRC-64/95/96) |
tokens |
bsv-tokens |
STAS token templates (Gen2, 3.0), bundle factory, P2MPKH |
arc |
bsv-arc |
ARC broadcaster client (feature: transports) |
junglebus |
bsv-junglebus |
JungleBus indexer client (feature: transports) |
Quick start
Sign a P2PKH transaction
use PrivateKey;
use Transaction;
use p2pkh;
let key = from_wif?;
let mut tx = new;
// ... add inputs and outputs ...
sign?;
Encrypt a message (BRC-78)
use PrivateKey;
use ;
let sender_key = from_wif?;
let recipient_pub = recipient_key.pub_key;
let ciphertext = encrypt?;
let plaintext = decrypt?;
Wallet key derivation (BRC-42)
use ;
use *;
let wallet = from_private_key?;
let result = wallet.get_public_key?;
STAS token transfer
use transfer;
// See the workspace docs for full STAS Gen2 / 3.0 examples.
Standards implemented
| BRC | Description |
|---|---|
| BRC-31 | Identity certificates |
| BRC-42 | Key derivation protocol |
| BRC-43 | Invoice numbering |
| BRC-64 | BEEF transaction format |
| BRC-74 | Merkle path format (BUMP) |
| BRC-77 | Message signing |
| BRC-78 | Message encryption (ECIES) |
| BRC-95/96 | BEEF extensions |
Plus the STAS token protocol Gen2 and 3.0 templates with full P2MPKH support, bundle factories, and provenance verification.
Origin
Ported from the Go BSV SDK with idiomatic Rust patterns and equivalent test coverage. All test vectors match the Go and TypeScript SDKs byte-for-byte.
Repository
Full source, individual crate documentation, and contribution guide: https://github.com/Bittoku/bsv-sdk-rust