Crate bitcoin_coin_selection

Crate bitcoin_coin_selection 

Source
Expand description

Rust Bitcoin coin selection library.

Efficient algorithms for choosing an optimal UTXO set.

Modules§

errors
Possible returned error types if no match is found.

Structs§

WeightedUtxo
Represents the spendable conditions of a UTXO.

Functions§

branch_and_bound
Performs a deterministic depth first branch and bound search for a changeless solution.
select_coinsrand
Attempt a match with branch_and_bound falling back to single_random_draw.
single_random_drawrand
Randomize the input set and select coins until the target is reached. If the maximum weight is exceeded, then the least valuable inputs are removed from the selection using weight as a tie breaker. In so doing, minimize the number of UTXOs included in the result by preferring UTXOs with higher value.