Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[package]
name = "bip47"
version = "0.3.0"
authors = ["Straylight <https://github.com/straylight-orbit>"]
authors = ["Straylight <https://github.com/straylight-orbit>", "Spartacus <https://github.com/spartacus2523>"]
license = "CC0-1.0"
description = "BIP47 (Reusable Payment Codes) implementation"
repository = "https://github.com/straylight-orbit/rust-bip47"
keywords = ["bitcoin", "bip47"]
readme = "README.md"
edition = "2021"
rust-version="1.56.1"

[dependencies]
bitcoin = "0.28"
bitcoin = "0.32.5"
thiserror = "2.0.12"
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ Original specification: [BIP-0047](https://github.com/bitcoin/bips/blob/master/b

## Usage
```rust
// Alice constructs her own payment code using a BIP32 seed
let alice_private = PrivateCode::from_seed(&alice_seed, 0, Network::Bitcoin).unwrap();
// Alice constructs her own payment code using a BIP32 seed and account 0
let alice_private = PrivateCode::from_seed(&alice_seed, Network::Bitcoin, Some(0), None).unwrap();

// Alice parses Bob's payment code
let bob_public = PublicCode::from_wif("PM8TJS2JxQ5ztXUpBBRnpTbcUXbUHy2T1abfrb3KkAAtMEGNbey4oumH7Hc578WgQJhPjBxteQ5GHHToTYHE3A1w6p7tU6KSoFmWBVbFGjKPisZDbP97").unwrap();

// Alice calculates Bob's receive address at index 0, known only to them
let bob_address_0 = bob_public.address(&alice_private, 0, false).unwrap();
// Alice calculates Bob's receive address at index 0, known only to them. Address can either be P2PKH or P2WPKH
let bob_address_0 = bob_public.address(&alice_private, 0, AddressType::P2PKH).unwrap();

// Alice can now pay Bob privately
assert_eq!("12edoJAofkjCsWrtmVjuQgMUKJ6Z7Ntpzx", bob_address_0.to_string());

```

## MSRV
The minimum supported Rust version is **1.29**.

The minimum supported Rust version is **1.56.1**.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.29.0"
msrv = "1.56.1"
Loading