Expand description
§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.
§Usage
// 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());
Re-exports§
pub extern crate bitcoin;
Structs§
- Basic
Transaction - Represents the on-chain notification mode and provides functionality for constructing an on-chain notification message.
- BitMessage
Preference - A set of Bitmessage preferences indicated by the receiving party.
- BitMessage
Send Params - Contains all the parameters needed to send a bitmessage to a recipient.
- Bitmessage
- Represents the Bitmessage notification mode and provides functionality for constructing a Bitmessage notification message.
- Bloom
Multisig - Represents the “bloom-multisig” (also known as v2) notification mode and provides functionality for constructing an on-chain notification message.
- Private
Code - Represents the private side of a payment code, as seen from the perspective of the sender. This is what the sender will use in conjunction with a receiver’s public payment code in order to be able to send funds.
- Public
Code - Represents the public side of a payment code. This is what the party that wishes to receive funds shares with sending parties.
Enums§
- Error
- Represents an error as pertaining to BIP47 operations.
- Notification
Mode - The notification mode to be used with a payment code.
- Version
- Represents the version number of a BIP47 payment code.
Functions§
- blinding_
factor - Calculates a blinding factor. The operation is symmetrical, therefore the key combination can be: