pub struct UnsignedBalanceUpdate {
pub channel_id: String,
pub balance: u64,
pub message_hex: String,
pub tweak_scalar_hex: String,
}Expand description
An unsigned balance update, ready for signing.
Contains the precomputed message hash and tweak scalar needed for signing.
Once signed, use sign() to produce a BalanceUpdateMessage.
§Example
ⓘ
let unsigned = UnsignedBalanceUpdate::new(channel_id, balance, &funding)?;
let signature = host.sign_with_tweaked_key(
&funding.sender_pubkey_hex,
&unsigned.message_hex,
&unsigned.tweak_scalar_hex,
)?;
let balance_update = unsigned.sign(&signature)?;Fields§
§channel_id: StringChannel ID
balance: u64Balance (cumulative amount receiver can claim)
message_hex: StringSHA-256 hash of the SIG_ALL message (32 bytes, hex-encoded)
tweak_scalar_hex: StringP2BK blinding scalar for the sender (32 bytes, hex-encoded)
Implementations§
Source§impl UnsignedBalanceUpdate
impl UnsignedBalanceUpdate
Trait Implementations§
Source§impl Clone for UnsignedBalanceUpdate
impl Clone for UnsignedBalanceUpdate
Source§fn clone(&self) -> UnsignedBalanceUpdate
fn clone(&self) -> UnsignedBalanceUpdate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UnsignedBalanceUpdate
impl RefUnwindSafe for UnsignedBalanceUpdate
impl Send for UnsignedBalanceUpdate
impl Sync for UnsignedBalanceUpdate
impl Unpin for UnsignedBalanceUpdate
impl UnsafeUnpin for UnsignedBalanceUpdate
impl UnwindSafe for UnsignedBalanceUpdate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more