fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Include messages in coinsToSpend API

Open Voxelot opened this issue 2 years ago • 0 comments

When a user wants to transfer some funds or pay for gas, they need to call the coinsToSpend API to obtain a set of spendable inputs to use. With the addition of messages as a new type of spendable input, the coinsToSpend API should be expanded to also include messages received from L1 in addition to coins.

The current coinsToSpend API uses the random-improve algorithm to minimize utxo dust. While spending messages can't remove dust, there may be cases where using a message instead of a coin can help prevent the creation of dust. Until we have better modeling for this, messages should just be treated interchangeably for coins as an extension of the coin set for both random & largest first based selection.

Voxelot avatar Aug 29 '22 19:08 Voxelot