pub struct Bip143PrecomputedHashes {
pub hash_prevouts: [u8; 32],
pub hash_sequence: [u8; 32],
pub hash_outputs: [u8; 32],
}Expand description
Precomputed hash components for BIP143 sighash. These are computed once per transaction and reused for all inputs.
Fields§
§hash_prevouts: [u8; 32]SHA256(SHA256(all input prevouts)) - 0 if ANYONECANPAY
hash_sequence: [u8; 32]SHA256(SHA256(all input sequences)) - 0 if ANYONECANPAY/NONE/SINGLE
hash_outputs: [u8; 32]SHA256(SHA256(all outputs)) - varies by sighash type
Implementations§
Source§impl Bip143PrecomputedHashes
impl Bip143PrecomputedHashes
Sourcepub fn compute(
tx: &Transaction,
_prevout_values: &[i64],
_prevout_script_pubkeys: &[&[u8]],
) -> Bip143PrecomputedHashes
pub fn compute( tx: &Transaction, _prevout_values: &[i64], _prevout_script_pubkeys: &[&[u8]], ) -> Bip143PrecomputedHashes
Compute precomputed hashes for a transaction. This is the expensive part - compute once, reuse for all inputs. Production: uses thread-local buffer to avoid 3 Vec allocs per SegWit tx.
Trait Implementations§
Source§impl Clone for Bip143PrecomputedHashes
impl Clone for Bip143PrecomputedHashes
Source§fn clone(&self) -> Bip143PrecomputedHashes
fn clone(&self) -> Bip143PrecomputedHashes
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 Bip143PrecomputedHashes
impl RefUnwindSafe for Bip143PrecomputedHashes
impl Send for Bip143PrecomputedHashes
impl Sync for Bip143PrecomputedHashes
impl Unpin for Bip143PrecomputedHashes
impl UnsafeUnpin for Bip143PrecomputedHashes
impl UnwindSafe for Bip143PrecomputedHashes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more