Skip to content

Commit

Permalink
Add documentation to get_change_address
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnet3 committed Jan 31, 2024
1 parent 1ddd8bd commit e22cdb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/receiving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ impl Receiver {
}
}

/// Get the silent payment change address for this Receiver. This is the
/// static address associated with the change label, as described
/// in the BIP. Wallets can create silent payment-native change addresses
/// by sending to this static change address, much like sending to a normal
/// silent payment address.
/// Important note: this address should never be shown to the user!
pub fn get_change_address(&self) -> String {
let sk = SecretKey::from_slice(&self.change_label.as_inner().to_be_bytes())
.expect("Unexpected invalid change label");
Expand Down

0 comments on commit e22cdb7

Please sign in to comment.