Coinfy - A Proposal to avoid Privacy problems on UTXOs selection#7619
Closed
rodrigovilar wants to merge 13 commits into
Closed
Coinfy - A Proposal to avoid Privacy problems on UTXOs selection#7619rodrigovilar wants to merge 13 commits into
rodrigovilar wants to merge 13 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CoinfyWallet - A Bitcoin & Lightning Wallet
This project is a fork of BlueWallet, a popular Bitcoin wallet for iOS and Android. This project was submitted as a result of a hackathon on Bitcoin++ 2025 - Florianopolis, Brazil.
Changes on BlueWallet source code:
class/wallets/legacy-wallet.ts:There are two algorithms used to select coins:
coinSelectSplitandcoinSelect. We added a paramcoinfyLambdathat, if present, changes the selection algorithm tocoinSelectCoinfy.coinSelectCoinfysplit the UTXOs based on its memo, which is stored on Wallet app, not on blockchain.If memo contains the
dirtykeyword, the UTXO is added on dirty UTXOs set.If memo contains the
cleankeyword, the UTXO is added on clean UTXOs set.If memo contains the
nonekeyword or memo is empty, the UTXO is added on none UTXOs set.Example of a list of UTXO with memos:
Then
coinSelectCoinfyalgorithm tries to select only safe UTXOs:cleanandnoneusing thecoinSelectalgorithm. If they contain enough balance, the algorithm creates the new transaction and returns it.The next step is trying to select only dirty UTXOs using the
coinSelectalgorithm. If they contain enough balance, the algorithm creates the new transaction and returns it.Example of a scenario without mixed UTXOs:
Otherwise, it will need to mix safe and dirty UTXOs. If they contain enough balance, the algorithm creates the new transaction and returns it, adding a warn message about UTXO mixing and informing the amount of clean sats necessary to be added on wallet in order to enable not mixing them.
Example of a scenario with mixed UTXOs:
componentsfolderscreen/send/SendDetails.tsxscreen, the graphic changes were made on create the UTXO mixing warn and a button that will open the Privacy configuration screen, which will gather the params necessary for Bitcoin Coin selection with leverage.