Veil-Project / veil

Veil-Project
MIT License
118 stars 91 forks source link

Stealth CT amounts received as 0.00000001 one satoshi of Veil per stealth input #668

Open seanPhill opened 4 years ago

seanPhill commented 4 years ago

I know this has been looked at before, but I can't find any issues relating to it, except for possible instances in January that were not noticed as a cause of the problem while looked at in Github issues.

This happened to me today twice within a few minutes and has been seen from time to time over a number of months. The first time noticed was when an exchange first allowed stealth withdrawals, and the exchange subsequently discontinued allow withdrawals to stealth addresses.

The situation is this.

  1. An amount, usually thousands of Veil is sent to a stealth CT recipient address. In my case today these were all coming from zerocoin spends, but other cases came from basecoin (in the exchange's case).
  2. The recipient may report this as a lost withdrawal, as it is so small and is not noticed, or they see that the amount received is just 2 satoshis or 4 or 6 depending on how many stealth amounts they are receiving, where CT divides each one into two amounts. My case today, I spent zerocoins from two wallets.
  3. 2 x 10K zerocoins to stealth resulting in two stealth outputs.
  4. 9000 Veil in various zerocoins resulting in four stealth outputs.

After rescanblockchain 360000 (to rescan the blockchain looking for the transactions) I did not notice the amount received. I fully unlocked the wallet in order to rescanringctwallet no additional balance found. I restarted the wallet, checked, unlocked and rescanringctwallet and finally realised there were six Satoshis of Veil 0.00000006 in the getbalances response, which was easy to miss in a column of eight decimal place zeroes.

So, please note, the solution above required unlock, rescanringctwallet, stop, start again, and unlock and rescanringctwallet again before the full 29000 Veil appeared in spendable CT.

There must be some underlying cause for this, and unless this cannot happen when we go full ringct, we should find a way to ensure that incoming Veil from transactions are fully detected.

CryptoMaximalist commented 4 years ago

This is the behavior of a locked wallet receiving CT funds. The range proof which protects the privacy of the Tx amounts means a locked wallet can't access the private key to determine the amount, but it knows each output must be worth at least 1 satoshi. CT and RingCT will always have at least 2 outputs because having only one would betray the output amount based on the input amounts

seanPhill commented 4 years ago

That would have been nice to have disclosed in the (GUI and CLI) wallet. :o How about then there be added a button or function that can unlock and rescan that one block for the transaction? -- Oh! Or how about Unlocked for Staking only ALSO add for scanning received transactions? Going full RingCT is going to make this very important. A single click solution would take barely a second or three.

Did I mention above that users reporting this problem stopped at least one exchange offering withdrawals to stealth addresses?

seanPhill commented 4 years ago

I just did a little silent video showing me fix this problem as it happened. Bearing in mind that you can't just preemptively unlock your wallet before money arrives from a third party wallet.

https://vimeo.com/380165170