Blockstream / aqua_ios

Old GDK iOS wallet, new repo at https://github.com/AquaWallet/aqua-wallet
https://github.com/AquaWallet/aqua-wallet
GNU General Public License v3.0
18 stars 11 forks source link

Funds lost on transfer from Elements #7

Closed motud2 closed 3 years ago

motud2 commented 3 years ago

Aqua wallet gave me this as an L-BTC receive address:

Executed a sendtoaddress from Elements, completed normally and returned txid:

Transaction appears on block explorer with many confirmations, but Aqua wallet is empty.

Zero balance and no transactions. It’s been 24 hours.

iPad os 14.4.1 Aqua 1.0.4

I’ve uninstalled, reinstalled, deleted and restored wallet, no joy. Same result on wallet on a different device.

Have I done something stupid ?

LeoComandini commented 3 years ago

Hi @motud2,

We have reasons to believe that your funds are not lost, but you might need to wait a bit to recover them.

So the tx you are linking is a pegin transaction. We assume the following tx is the one sending from Elements to Aqua.

The pegin transaction sent funds to an unblinded address, indeed we can see the amount on the explorer.

Then you probably called (or perhaps you used elements-qt but should be the same):

elements-cli sendtoaddress VJLDJ14tMUSaQmN5pdmL2msAiWxKXkX9rKhcLs9sNaPeMPaeySLC7D92GNCkhnw2HMPAKTCPcAw7sCWz 0.01599958 "" "" true

Where the last flag specifies that the you want to subtract the fee from the amount to send all funds without generating a change output.

However you are attempting to create a tx with an unblinded input and a single blinded output, but such a transaction cannot be blinded. And since sendtoaddress defaults to ignoreblindfail true, the blinding failure went silent and you sent funds to an unblinded address rather than the blinded one. Indeed we can again see the amount on the explorer.

Now, Aqua only displays confidential addresses and does not expect to receive funds on unblinded addresses. It thus ignores received outputs if they are unblinded, although it has the ability to spend them. This ensures that all inputs spent by Aqua are always confidential.

So that's why you see no balance and no transactions in your wallet.

Spending unconfidential utxos, has been implemented recently in the library used by Aqua. There are a couple of scenarios: either Aqua will allow to spend confidential utxos in a future release, or you have to wait for Green single-sig that will allow you to spend such utxo. In both cases you have to wait a bit of time.

If you are really in a hurry, you might want to build use GDK to perform recovery yourself, but this is quite advanced.

Finally, if you don't want to dox yourself and your coins you might want to consider closing and removing this issue and open a ticket with the support team.

motud2 commented 3 years ago

First thanks for your prompt and detailed response. it is much appreciated.

Second, yes, I can’t believe I screwed that up and copied the wrong txid, but I did, sorry.

There are 3 issues that I now need to understand.

Why the pegin transaction was not blinded Why the sendtoaddress defaults to allow non blinded transactions Why Aqua does not show these transactions

Along with where we go from here and can I possibly use an address generator to generate xpub and xprv addresses to then import into Elements using importmulti.

I need to unravel what happened and where I went wrong by sending you exactly what I did at each stage of the process.

Can I do this using this email address ?

I appreciate that this may have to wait until Monday.

Cheers,

Motu

:)

On 30 Apr 2021, at 11:42, LeoComandini @.***> wrote:

 Hi @motud2,

We have reasons to believe that your funds are not lost, but you might need to wait a bit to recover them.

So the tx you are linking is a pegin transaction. We assume the following tx is the one sending from Elements to Aqua.

The pegin transaction sent funds to an unblinded address, indeed we can see the amount on the explorer.

Then you probably called (or perhaps you used elements-qt but should be the same):

elements-cli sendtoaddress VJLDJ14tMUSaQmN5pdmL2msAiWxKXkX9rKhcLs9sNaPeMPaeySLC7D92GNCkhnw2HMPAKTCPcAw7sCWz 0.01599958 "" "" true Where the last flag specifies that the you want to subtract the fee from the amount to send all funds without generating a change output.

However you are attempting to create a tx with an unblinded input and a single blinded output, but such a transaction cannot be blinded. And since sendtoaddress defaults to ignoreblindfail false, the blinding failure went silent and you sent funds to an unblinded address rather than the blinded one. Indeed we can again see the amount on the explorer.

Now, Aqua only displays confidential addresses and does not expect to receive funds on unblinded addresses. It thus ignores received outputs if they are unblinded, although it has the ability to spend them. This ensures that all inputs spent by Aqua are always confidential.

So that's why you see no balance and no transactions in your wallet.

Spending unconfidential utxos, has been implemented recently in the library used by Aqua. There are a couple of scenarios: either Aqua will allow to spend confidential utxos in a future release, or you have to wait for Green single-sig that will allow you to spend such utxo. In both cases you have to wait a bit of time.

If you are really in a hurry, you might want to build use GDK to perform recovery yourself, but this is quite advanced.

Finally, if you don't want to dox yourself and your coins you might want to consider closing and removing this issue and open a ticket with the support team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

motud2 commented 3 years ago

FYI I have already opened a support request, 2561, the opening of this issue was the result of no response from that request.

Happy to continue on 2561 if more suitable.

On 30 Apr 2021, at 11:42, LeoComandini @.***> wrote:

 Hi @motud2,

We have reasons to believe that your funds are not lost, but you might need to wait a bit to recover them.

So the tx you are linking is a pegin transaction. We assume the following tx is the one sending from Elements to Aqua.

The pegin transaction sent funds to an unblinded address, indeed we can see the amount on the explorer.

Then you probably called (or perhaps you used elements-qt but should be the same):

elements-cli sendtoaddress VJLDJ14tMUSaQmN5pdmL2msAiWxKXkX9rKhcLs9sNaPeMPaeySLC7D92GNCkhnw2HMPAKTCPcAw7sCWz 0.01599958 "" "" true Where the last flag specifies that the you want to subtract the fee from the amount to send all funds without generating a change output.

However you are attempting to create a tx with an unblinded input and a single blinded output, but such a transaction cannot be blinded. And since sendtoaddress defaults to ignoreblindfail false, the blinding failure went silent and you sent funds to an unblinded address rather than the blinded one. Indeed we can again see the amount on the explorer.

Now, Aqua only displays confidential addresses and does not expect to receive funds on unblinded addresses. It thus ignores received outputs if they are unblinded, although it has the ability to spend them. This ensures that all inputs spent by Aqua are always confidential.

So that's why you see no balance and no transactions in your wallet.

Spending unconfidential utxos, has been implemented recently in the library used by Aqua. There are a couple of scenarios: either Aqua will allow to spend confidential utxos in a future release, or you have to wait for Green single-sig that will allow you to spend such utxo. In both cases you have to wait a bit of time.

If you are really in a hurry, you might want to build use GDK to perform recovery yourself, but this is quite advanced.

Finally, if you don't want to dox yourself and your coins you might want to consider closing and removing this issue and open a ticket with the support team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LeoComandini commented 3 years ago

Why the pegin transaction was not blinded

Because the input in parent chain is not blinded

Why the sendtoaddress defaults to allow non blinded transactions

It makes porting integration tests from Bitcoin code base easier, anyway that's questionable and might be changed in the future.

Why Aqua does not show these transactions

To ensure that all inputs spent by Aqua will always be confidential. Consider also that sending to a non-confidential address is cheaper than sending confidential one. If the 2 options had the same result (receiver sees balance in its wallet), we would introduce a weird incentive as the sender may willfully send to the unblinded address to save some fees. This would degrade privacy for the receiver and the whole network. However this may change in the future.

generate xpub and xprv addresses

Aqua is BIP44 compliant. Uses coin type 1776. Its addresses are p2sh-p2pkh (BIP49).

You may want to consider waiting for single sig support in Green though.