leather-io / extension

Leather browser extension
https://leather.io
MIT License
305 stars 143 forks source link

Revisit "protecting" UTXO's with inscriptions on BTC balance address #4654

Open 314159265359879 opened 11 months ago

314159265359879 commented 11 months ago

I see users reporting changing balances on the BTC balance address (native segwit starting with bc1q...) without any pending transfers that are getting confirmed.

I think it may be caused by incoming data from an API about UTXO's, when the wallet learns it has inscriptions it will protect the UTXO and not show its value as available balance.

image

The user reported this: image

Because this UTXO contains this cursed inscription (note hash and output ":2") https://ordinals.com/output/4ae6402d34ddb2f8fd19f1f8b55f014dcc064c32705bdb3f4dcb02d2a6035940:2

This is a significant UTXO with 0.010+ BTC image

We're also protecting worthless inscriptions such as BRC20 inscriptions that have already served their purpose. See for example this address with tens of BRC20 inscriptions "garbage".

image

Perhaps the wallet can make it easier for users to retrieve the UTXO to the ordinals inscription address?


A user like this would benefit from a dapp that allows unravelling inscribed sats from a UTXO that has several on non-standard offsets. Perhaps the service should allow moving all the BRC20 inscriptions to one small UTXO (preferably below the dust limit) and allow valuable ones to remain in a big enough UTXO with a sat offset of 0 (standard) and let users transfer it where they like in the process.

markmhendrickson commented 11 months ago

It seems you're raising three related but separate issues:

  1. The displayed BTC balance is prone to changing upon the indexing of inscriptions on Native SegWit addresses, leading to user confusion.
  2. There's no way for users who have undesired inscriptions on Native SegWit addresses to spend their underlying sats / free up those sats
  3. Users with multiple sats on a given UTXO have no way to send them (are there other issues with "raveled" inscribed sats currently?)

Does that sound accurate?

Perhaps the wallet can make it easier for users to retrieve the UTXO to the ordinals inscription address?

I don't suspect providing a migration option from Native SegWit to Taproot here is the best path, since we're aiming to make the distinction as irrelevant as possible. And it doesn't really solve the above problems anyway.

markmhendrickson commented 8 months ago

ping @314159265359879 re: the questions above

314159265359879 commented 8 months ago

1, 2, 3, are accurate.

3, In addition marketplaces do not support listing raveled (aka mixed) inscriptions.

Perhaps the wallet can make it easier for users to retrieve the UTXO to the ordinals inscription address?

I don't suspect providing a migration option from Native SegWit to Taproot here is the best path, since we're aiming to make the distinction as irrelevant as possible. And it doesn't really solve the above problems anyway.

If you add support in the wallet to make a transaction to unravel the UTXO, a transaction will have to be made, then the inscriptions can be send to any address, at least for now in the taproot address they cause the least confusion.

314159265359879 commented 8 months ago

Here a user sends ~1 BTC from a central exchange to their BTC address in Leather. https://ordinals.com/output/0c7492392685c3f9a1604669636b4b09ce9f37df517c71f3aaeb9f79dd866998:3 https://mempool.space/tx/0c7492392685c3f9a1604669636b4b09ce9f37df517c71f3aaeb9f79dd866998

The BTC doesn't show in Leather because it has four garbage (used BRC20) inscriptions. The user wants access to their BTC they do not want the inscription protected in this case.

When inscriptions are in huge UTXO (over 100 million sats in this case) (perhaps anything over 100k sats?) Users prefer to have an option to split the inscribed sats from the UTXO.

Lets not protect "used" BTC20 inscriptions. We should also consider making the distinction between used and unused transfer inscriptions in the collectables area, give them different labels: https://github.com/leather-wallet/extension/issues/5093

314159265359879 commented 7 months ago

More cases like this user sends funds, they see it on the explorer but not in their wallet.

Another solution could be if sending this UTXO/inscription anywhere (from within Leather) would take care of splitting the UTXO into uninscribed BTC and inscriptions so they can use the funds again.

https://ordinals.com/output/cc66c401cad73f3e71861e7392d40c23f4f4ff29628788231a93e4292fe90a77:11 image image

314159265359879 commented 7 months ago

Another case over 0.5 BTC UTXO protected with BRC20 inscriptions (hundreds) the user just wants to use the BTC but they can't until they get the inscriptions out. We should offer an option to split the inscriptions in Leather. Current workaround

kyranjamie commented 6 months ago

Speaking with a well-known community member earlier, they're running into this issue where they have 2 BTC in a single UTXO, hidden by Leather's UTXO filtering.

They want to send it, but it just so happens it contains 5 BRC-20 inscriptions, that they probably don't care about. A huge sum of money, hidden.

cc/ @mica000 @fabric-8 @markmhendrickson for visibility.

We've spoken before about a more advanced balance view in a hover card, that would help at least reveal the source of the hidden funds. In its current form, filtering inscriptions is an important feature, but one that needs better explanation, as to not leave users confused as to where their funds are.

fabric-8 commented 6 months ago

That's interesting – Maybe it could be a sort of "?" / explainer next to the balance.

that would help at least reveal the source of the hidden funds Just to better understand your idea: We display avail. balance with utxo filtering applied, but allow people to somehow understand how the balance is made up + what we're not including and why?

In this particular case where some random assets basically "block" 2 BTC: How would we imagine to allow people to send those BTC despite them being filtered out? Are there any examples out there already for how to do that?

mica000 commented 6 months ago

Following this thread but having a hard time understanding where the problem of filtering is actually happening. What is the root of the issue in here? Are the BTC balances now being displayed because the API cannot recognise them as balance because they are stored in in UTXO that contains BRC-20?

mica000 commented 6 months ago

@kyranjamie @314159265359879

How about we do smt like this?

We would show another BTC row however this would be disabled. When hovering, the tooltip says: "Some of your Bitcoin tokens are linked with Ordinal Inscriptions. Detach them to access their value". This tooltip should be persistent to allow the user to click and upon clicking in the tooltip, we launch a PSBT which would then separate them.

https://github.com/leather-wallet/extension/assets/119523541/c2e465a3-f9bc-4a9a-9e9d-f0c3cbfed2b6

kyranjamie commented 6 months ago

Thanks Michelly.

The UI would be really easy to build. Not a big fan of repeating the row, and showing icon etc twice, but it works. Would be a great improvement.

314159265359879 commented 6 months ago

I think adding a row would work too. I suggested a collapsible option for gas tokens to view all the different "balance types" in the wallet with explainers perhaps this can be a first step towards that? It would help if the name was adjusted or token labeled to make the difference. Could you show the second row "nested under the other one"?

Bitcoin (available) x.xxxx BTC

Bitcoin (with inscriptions/runes, locked/protected) x.xxxx BTC Bitcoin (pending outgoing) x.xxxx BTC Bitcoin (pending incoming) x.xxxx BTC

Note that users can also store UTXO's of normal sizes with an inscribed sat on the Bitcoin balance address and they'd be protected. How are we going to make the distinction? Use a threshold of 10k show anything above that as splitable?

Bitcoin (locked unsplitable, small UTXO's) we can explain that some padding is necessary to stay above the dust limit for users who do not realize some bitcoin is expected with inscriptions. Bitcoin (splitable, to unlock, large UTXO, likely with unintended inscriptions)

markmhendrickson commented 6 months ago

It seems the most comprehensive solution here would be three-fold:

  1. Indicate the protected vs. unprotected Bitcoin balance as suggested and explored above. It's probably best to tackle this indication during our upcoming design of asset detail screens (for tokens in particular) in which we display all balance types for a given token, not just these two types as a one-off enhancement. We'll have better real estate on the asset detail screen to display types than within the tokens list, as explored above.
  2. Allow the user to toggle whether a given inscription is protected or not. If the user toggles off protection (under "Collectibles" for the inscription as listed there), then its UTXO is unprotected and made available to the unlocked balance (and ready for spending). It's probably best to tackle this feature during the same upcoming design work for asset detail screens (for collectibles in particular).
  3. Allow the user to split ("Redeem"?) BTC from UTXOs shared with inscriptions. It's probably best to tackle solution 2 above first then see how much demand we have for splitting.