Copyright | © 2018-2020 IOHK |
---|---|

License | Apache-2.0 |

Safe Haskell | Safe |

Language | Haskell2010 |

**Submodules** of this module provide implementations of
**coin selection algorithms**.

Algorithms can be divided into two categories:

Algorithms that implement the general

`CoinSelectionAlgorithm`

interface.Algorithms that provide functionality suited to specialized purposes.

# Generalized Algorithms

The following algorithms implement the general
`CoinSelectionAlgorithm`

interface:

**Cardano.CoinSelection.Algorithm.LargestFirst**Provides an implementation of the

**Largest-First**algorithm.When selecting inputs from a given set of UTxO entries, this algorithm always selects the

*largest*entries*first*.**Cardano.CoinSelection.Algorithm.RandomImprove**Provides an implementation of the

**Random-Improve**algorithm.When selecting inputs from a given set of UTxO entries, this algorithm always selects entries at

*random*.Once selections have been made, a second phase attempts to

*improve*on each of the existing selections in order to optimize change outputs.

For **guidance on choosing an algorithm** that's appropriate for your
scenario, please consult the following article:

https://iohk.io/blog/self-organisation-in-coin-selection/

# Specialized Algorithms

The following algorithms provide functionality suited to specialized purposes:

**Cardano.CoinSelection.Algorithm.Migration**Provides an algorithm for migrating all funds from one wallet to another.