Skip to content

Coinfy - A Proposal to avoid Privacy problems on UTXOs selection#7619

Closed
rodrigovilar wants to merge 13 commits into
BlueWallet:masterfrom
rodrigovilar:initial-interface
Closed

Coinfy - A Proposal to avoid Privacy problems on UTXOs selection#7619
rodrigovilar wants to merge 13 commits into
BlueWallet:masterfrom
rodrigovilar:initial-interface

Conversation

@rodrigovilar

@rodrigovilar rodrigovilar commented Feb 22, 2025

Copy link
Copy Markdown

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:

  • The main logic changes were implemented on class/wallets/legacy-wallet.ts:

There are two algorithms used to select coins: coinSelectSplit and coinSelect. We added a param coinfyLambda that, if present, changes the selection algorithm to coinSelectCoinfy.

coinSelectCoinfy split the UTXOs based on its memo, which is stored on Wallet app, not on blockchain.
If memo contains the dirty keyword, the UTXO is added on dirty UTXOs set.
If memo contains the clean keyword, the UTXO is added on clean UTXOs set.
If memo contains the none keyword or memo is empty, the UTXO is added on none UTXOs set.

Example of a list of UTXO with memos:

Captura de Tela 2025-02-22 às 08 34 26

Then coinSelectCoinfy algorithm tries to select only safe UTXOs: clean and none using the coinSelect algorithm. 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 coinSelect algorithm. If they contain enough balance, the algorithm creates the new transaction and returns it.

Example of a scenario without mixed UTXOs:

Captura de Tela 2025-02-22 às 08 41 17

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:

Captura de Tela 2025-02-22 às 08 42 47
  • There are many design changes on the files of components folder
  • And finally on the screen/send/SendDetails.tsx screen, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants