Bitcoin Forum

Bitcoin => Wallet software => Topic started by: d5000 on January 25, 2021, 12:16:01 PM



Title: How to "isolate" an UTXO in a wallet without coin control?
Post by: d5000 on January 25, 2021, 12:16:01 PM
I have received a very small transaction in a wallet which seems not to support coin control at all (GreenAddress / Blockstream Green). I don't want to use the resulting UTXO in any of my transactions. So I am searching for a method to "isolate" this UTXO.

The following idea came to my mind when reading this Stackexchange post (https://bitcoin.stackexchange.com/questions/1077/what-is-the-coin-selection-algorithm) (which details how UTXOs are selected in Bitcoin Core for transactions):

Create a transaction equal or smaller* than the value of the mentioned UTXO, with a very low fee, so it would likely be stuck for a while before being confirmed, or not confirm at all. While this transaction being stuck, transfer the rest of the wallet balance to another wallet.

Would this work? Or are there alternative ways to isolate an UTXO without coin control?

I think the success of this method also should depend on GreenAddress working roughly similar to Bitcoin Core when selecting UTXOs, something I don't know.

*Unfortunately the wallet doesn't give me the option to select an exact tx fee, so matching the exact UTXO value could be difficult. I guess however, if I understand the Stackexchange post correctly, that a slightly smaller transaction would also result in this UTXO being selected, because it's by far the smallest unspent output in my wallet.


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: DaveF on January 25, 2021, 12:26:57 PM
You *might* be able to use the green address recovery tool:
https://github.com/greenaddress/garecovery#:~:text=The%20GreenAddress%20Recovery%20Tool%20allows,two%20factor%20authentication%20(2FA)%20mechanism

If you can get the private key for that UTXO and import it into another wallet and send it someplace else [ I'll take if if you don't want it :-) ]. Then you can use the greenwallet as normal since the UTXO will not be there.

HOWEVER, once you run the tool you have "releveled" your private keys, even if you did it on an offline PC that you wiped after, there still could be a small security risk so creating a new wallet with a new mnemonic is probably a good security precaution.

-Dave


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: d5000 on January 26, 2021, 02:21:30 AM
Thanks for the suggestion. I also thought about using that tool, but to my knowledge, I would have to wait 90 days from my last nLocktime backup on to do this kind of recovery. So for now I'll leave this thread open ... I think if no other suggestions pop up then I'll try the strategy I lined out in the OP once fees are reasonable again.


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: pooya87 on January 26, 2021, 04:34:49 AM
Does your wallet support importing and signing transactions?

If it does then you could easily create a transaction with that single input and send its entire value as fee with a tiny (1 byte) OP_RETURN output (with value=0) effectively donating the dust to the miner that picks the transaction up. Then you simply import this tx to your wallet and sign then broadcast it.
I believe the fee of this transaction can be slightly higher than 1sat/vb too (112 bytes, 556 sat total, ~4.9 sat/byte).


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: nc50lc on January 26, 2021, 06:04:08 AM
*Unfortunately the wallet doesn't give me the option to select an exact tx fee, so matching the exact UTXO value could be difficult.
It's Blockstream Green right?
In the "network fee" drop-down menu, there's a "custom" fee that you can select, it's in sat/vB but you can add decimals to set the total fee that you need.
Then after clicking "REVIEW" the total fee will show above the send window, if it's less than the fee that you need, you can use "back" and increase the fee rate by 0.1 or 0.01; repeat until you set your preferred fee.


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: d5000 on January 26, 2021, 01:27:15 PM
Does your wallet support importing and signing transactions?
Unfortunately, it doesn't seem so. I also can't simply do it the other way around, e.g. use Electrum to import the transaction, as GreenAddress is a multisig wallet where Blockstream controls one of the private keys and has to sign the transaction. Anyway, thank you for the idea.

In the "network fee" drop-down menu, there's a "custom" fee that you can select, it's in sat/vB but you can add decimals to set the total fee that you need.
Ah, that's a good point and may be a convenient solution - if I can add decimals to the fee it should at least be possible to match the UXTO value. Thanks!

I just also saw that the nLocktime value for the garecovery tool can be set lower, to 144 blocks (1 day). So this option becomes attractive again. However, due to the security issue DaveF mentioned I think I'll try out first the approach with the "exact matching UTXO value".


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: hugeblack on January 27, 2021, 01:00:21 PM
Stop using that wallet, I was using them for a while before BCH hardfork happened and then I realized that claiming BCH was difficult. As far as I remember, I used this topic[1], so it might help you
What happens when you click the View button, you will not be able to see the I / O addresses?


[1] https://www.reddit.com/r/greenaddress/comments/7ibz8t/steps_to_move_2of2_with_ntimelockzip/


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: d5000 on January 27, 2021, 03:32:51 PM
Thank you @hugeblack, that reddit thread seems very useful!

What happens when you click the View button, you will not be able to see the I / O addresses?
Unfortunately in the process of sending transactions I can't see the inputs used, the view is extremely simplified (even more so with the new Blockstream Green interface, the old client is not supported anymore). Only when the transaction already has been broadcast, I can click on a "view on explorer" button where the data I need is finally displayed. Thus the idea with the "low fee tx" to isolate a specific input trying to match the value, because as long as I don't do RBF the transaction is unlikely to confirm currently if I use 1 sat/byte, so if anything goes wrong I can later perhaps try to doublespend it with the recovery tool.



Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: HCP on January 29, 2021, 10:50:16 AM
There is no guarantee that sending a transaction for the same (or slightly lower) amount as the UTXO you're trying to "isolate" will even use that particular UTXO... unless it is the only UTXO in your wallet.

If you don't have coin control options, then you're at the mercy of whatever algorithm/stragey the wallet devs use to pick UTXOs... which could be any one of:
- First in, First Out (spend oldest)
- Last in, First Out (spend newest)
- Random
- Minimum change produced
- Closest match
- Spend all
etc...

Unless you know exactly how the wallet is going to select UTXOs... attempting to do a 1 sat/byte transaction in the hopes of "isolating" this UTXO could prove to be a waste of time and btc.


Title: Re: How to "isolate" an UTXO in a wallet without coin control?
Post by: d5000 on January 30, 2021, 05:34:17 PM
There is no guarantee that sending a transaction for the same (or slightly lower) amount as the UTXO you're trying to "isolate" will even use that particular UTXO... unless it is the only UTXO in your wallet.
That may be true. However, there is a bit of control I can have before I send the transaction: the wallet shows me the fee per byte and the complete fee for the transaction. If I match the transaction value exactly (without a satoshi of difference) then I should get a transaction with exactly 1 input and 1 output - i.e. the minimum size in bytes for this type of transaction. Unfortunately it's a multisig tx so it probably won't match the well-known value of 180-190 bytes, but I could compare the values with another random "transaction attempt" with an input and two outputs or vice versa.

Quote
attempting to do a 1 sat/byte transaction in the hopes of "isolating" this UTXO could prove to be a waste of time and btc.

Well, about the waste of time ... I've already "wasted" some of it with this thread and thinking about the "problem". So a couple of additional minutes would not really be a problem ;)  And money should also not be wasted if I can guarantee that I create an 1-input 1-output transaction not affecting other UTXOs in my wallet.

I think I'll simply try it in the low fee phases of this weekend, and then report my results here, perhaps they may be of use for somebody.