Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rust-bitcoin/rust-bip47
BIP47 implementation in Rust
https://github.com/rust-bitcoin/rust-bip47
Last synced: about 16 hours ago
JSON representation
BIP47 implementation in Rust
- Host: GitHub
- URL: https://github.com/rust-bitcoin/rust-bip47
- Owner: rust-bitcoin
- License: cc0-1.0
- Created: 2021-12-09T15:05:11.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-25T11:02:31.000Z (over 2 years ago)
- Last Synced: 2024-05-02T09:16:23.044Z (7 months ago)
- Language: Rust
- Size: 20.5 KB
- Stars: 26
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust BIP47 Library
This library implements the BIP47 standard and provides functionality
for generating static payment codes that two parties can use to create
a private payment address space between them.Original specification: [BIP-0047](https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki).
## 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 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 can now pay Bob privately
assert_eq!("12edoJAofkjCsWrtmVjuQgMUKJ6Z7Ntpzx", bob_address_0.to_string());```
## MSRV
The minimum supported Rust version is **1.29**.