Struct serai_processor::networks::bitcoin::Bitcoin
source · pub struct Bitcoin { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Block<Bitcoin> for Block
impl Block<Bitcoin> for Block
source§impl Network for Bitcoin
impl Network for Bitcoin
§type Transaction = Transaction
type Transaction = Transaction
The type representing the transaction for this network.
§type SignableTransaction = SignableTransaction
type SignableTransaction = SignableTransaction
The type containing all information on a planned transaction, waiting to be signed.
§type Eventuality = Eventuality
type Eventuality = Eventuality
The type containing all information to check if a plan was completed. Read more
§type TransactionMachine = TransactionMachine
type TransactionMachine = TransactionMachine
The FROST machine to sign a transaction.
source§const NETWORK: ExternalNetworkId = ExternalNetworkId::Bitcoin
const NETWORK: ExternalNetworkId = ExternalNetworkId::Bitcoin
Network ID for this network.
source§const ESTIMATED_BLOCK_TIME_IN_SECONDS: usize = 600usize
const ESTIMATED_BLOCK_TIME_IN_SECONDS: usize = 600usize
The estimated amount of time a block will take.
source§const CONFIRMATIONS: usize = 6usize
const CONFIRMATIONS: usize = 6usize
The amount of confirmations required to consider a block ‘final’.
source§const COST_TO_AGGREGATE: u64 = 800u64
const COST_TO_AGGREGATE: u64 = 800u64
The cost to perform input aggregation with a 2-input 1-output TX.
source§const MAX_OUTPUTS: usize = 520usize
const MAX_OUTPUTS: usize = 520usize
The maximum amount of outputs which will fit in a TX.
This should be equal to MAX_INPUTS unless one is specifically limited.
A TX with MAX_INPUTS and MAX_OUTPUTS must not exceed the max size.
source§fn tweak_keys(keys: &mut ThresholdKeys<Self::Curve>)
fn tweak_keys(keys: &mut ThresholdKeys<Self::Curve>)
Tweak keys for this network.
source§fn branch_address(key: ProjectivePoint) -> Option<Address>
fn branch_address(key: ProjectivePoint) -> Option<Address>
Address for the given group key to use for scheduled branches.
source§fn change_address(key: ProjectivePoint) -> Option<Address>
fn change_address(key: ProjectivePoint) -> Option<Address>
Address for the given group key to use for change.
source§fn forward_address(key: ProjectivePoint) -> Option<Address>
fn forward_address(key: ProjectivePoint) -> Option<Address>
Address for forwarded outputs from prior multisigs. Read more
source§fn get_latest_block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_latest_block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the latest block’s number.
source§fn get_block<'life0, 'async_trait>(
&'life0 self,
number: usize,
) -> Pin<Box<dyn Future<Output = Result<Self::Block, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block<'life0, 'async_trait>(
&'life0 self,
number: usize,
) -> Pin<Box<dyn Future<Output = Result<Self::Block, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a block by its number.
source§fn get_outputs<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Self::Block,
key: ProjectivePoint,
) -> Pin<Box<dyn Future<Output = Vec<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_outputs<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Self::Block,
key: ProjectivePoint,
) -> Pin<Box<dyn Future<Output = Vec<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the outputs within a block for a specific key.
source§fn get_eventuality_completions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
eventualities: &'life1 mut EventualitiesTracker<Eventuality>,
block: &'life2 Self::Block,
) -> Pin<Box<dyn Future<Output = HashMap<[u8; 32], (usize, [u8; 32], Transaction)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_eventuality_completions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
eventualities: &'life1 mut EventualitiesTracker<Eventuality>,
block: &'life2 Self::Block,
) -> Pin<Box<dyn Future<Output = HashMap<[u8; 32], (usize, [u8; 32], Transaction)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the registered eventualities completed within this block, and any prior blocks which
registered eventualities may have been completed in. Read more
source§fn needed_fee<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
block_number: usize,
inputs: &'life1 [Output],
payments: &'life2 [Payment<Self>],
change: &'life3 Option<Address>,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn needed_fee<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
block_number: usize,
inputs: &'life1 [Output],
payments: &'life2 [Payment<Self>],
change: &'life3 Option<Address>,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Returns the needed fee to fulfill this Plan at this fee rate. Read more
source§fn signable_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
block_number: usize,
_plan_id: &'life1 [u8; 32],
_key: ProjectivePoint,
inputs: &'life2 [Output],
payments: &'life3 [Payment<Self>],
change: &'life4 Option<Address>,
(): &'life5 (),
) -> Pin<Box<dyn Future<Output = Result<Option<(Self::SignableTransaction, Self::Eventuality)>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn signable_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
block_number: usize,
_plan_id: &'life1 [u8; 32],
_key: ProjectivePoint,
inputs: &'life2 [Output],
payments: &'life3 [Payment<Self>],
change: &'life4 Option<Address>,
(): &'life5 (),
) -> Pin<Box<dyn Future<Output = Result<Option<(Self::SignableTransaction, Self::Eventuality)>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Create a SignableTransaction for the given Plan. Read more
source§fn attempt_sign<'life0, 'async_trait>(
&'life0 self,
keys: ThresholdKeys<Self::Curve>,
transaction: Self::SignableTransaction,
) -> Pin<Box<dyn Future<Output = Result<Self::TransactionMachine, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn attempt_sign<'life0, 'async_trait>(
&'life0 self,
keys: ThresholdKeys<Self::Curve>,
transaction: Self::SignableTransaction,
) -> Pin<Box<dyn Future<Output = Result<Self::TransactionMachine, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempt to sign a SignableTransaction.
source§fn publish_completion<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_completion<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a completion.
source§fn confirm_completion<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
eventuality: &'life1 Self::Eventuality,
_: &'life2 EmptyClaim,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn confirm_completion<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
eventuality: &'life1 Self::Eventuality,
_: &'life2 EmptyClaim,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Confirm a plan was completed by the specified transaction, per our bounds. Read more
source§fn get_latest_block_number_with_retries<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_latest_block_number_with_retries<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the latest block’s number, retrying until success.
source§fn get_block_with_retries<'life0, 'async_trait>(
&'life0 self,
block_number: usize,
) -> Pin<Box<dyn Future<Output = Self::Block> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_with_retries<'life0, 'async_trait>(
&'life0 self,
block_number: usize,
) -> Pin<Box<dyn Future<Output = Self::Block> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a block, retrying until success.
source§fn prepare_send<'life0, 'async_trait>(
&'life0 self,
block_number: usize,
plan: Plan<Self>,
operating_costs: u64,
) -> Pin<Box<dyn Future<Output = Result<PreparedSend<Self>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_send<'life0, 'async_trait>(
&'life0 self,
block_number: usize,
plan: Plan<Self>,
operating_costs: u64,
) -> Pin<Box<dyn Future<Output = Result<PreparedSend<Self>, NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare a SignableTransaction for a transaction. Read more
source§impl Output<Bitcoin> for Output
impl Output<Bitcoin> for Output
type Id = OutputId
fn kind(&self) -> OutputType
fn id(&self) -> Self::Id
fn tx_id(&self) -> [u8; 32]
fn key(&self) -> ProjectivePoint
fn presumed_origin(&self) -> Option<Address>
fn balance(&self) -> ExternalBalance
fn data(&self) -> &[u8] ⓘ
fn write<W: Write>(&self, writer: &mut W) -> Result<()>
fn read<R: Read>(reader: &mut R) -> Result<Self>
source§impl UtxoNetwork for Bitcoin
impl UtxoNetwork for Bitcoin
source§const MAX_INPUTS: usize = 520usize
const MAX_INPUTS: usize = 520usize
The maximum amount of inputs which will fit in a TX.
This should be equal to MAX_OUTPUTS unless one is specifically limited.
A TX with MAX_INPUTS and MAX_OUTPUTS must not exceed the max size.
impl Eq for Bitcoin
Auto Trait Implementations§
impl !Freeze for Bitcoin
impl !RefUnwindSafe for Bitcoin
impl Send for Bitcoin
impl Sync for Bitcoin
impl Unpin for Bitcoin
impl !UnwindSafe for Bitcoin
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> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.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 moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.