helios icon indicating copy to clipboard operation
helios copied to clipboard

Enhance Coin Selection

Open gavinharris-dev opened this issue 2 years ago • 2 comments

Perhaps we can use the Nami Implementation as a basis for this?

https://github.com/berry-pool/nami/blob/main/src/lib/coinSelection.js

gavinharris-dev avatar Feb 02 '23 01:02 gavinharris-dev

Please consider giving this a read and think about maybe implementing something else than Smallest First and Largest First. I am consulting on a project where helios is used and the Coin Selection is resulting in a very large amount of invalid transactions (mainly because of tx size).

https://github.com/cardano-foundation/CIPs/issues/232

The discussion presents a few ways to address this issue with better algorithms

nicolasayotte avatar Mar 05 '24 01:03 nicolasayotte

@nicolasayotte thanks for commenting on this.

The largestFirst/smallestFirst coinselection algorithms were implemented provisionally, and more advanced algorithms will be added to the library in the coming months (a project I'm currently working is having similar issues).

Note to all those reading this: the coinselection interface is a mere function type, so custom algorithms can easily be used with the Helios library (eg. wrapping whatever already exists in other libraries)

christianschmitz avatar Mar 05 '24 18:03 christianschmitz