Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethereum: find a way to differentiate between 0 balance and account does not exist #676

Open
webmaster128 opened this issue Jan 10, 2019 · 4 comments

Comments

@webmaster128
Copy link
Contributor

eth_getBalance gives us 0x0 for existing and non-existing accounts. We should be able to differentate this somehow to properly represent as BcpAccount | undefined.

@webmaster128
Copy link
Contributor Author

webmaster128 commented Feb 23, 2019

@LucasIsasmendi @ethanfrey do you think it is practically possible to clear a once used Ethereum account to 0 wei? With the gas system, some wei should always be left in an account, right? This would allow a very simple and fast implementation: balance 0 -> account never used

@ethanfrey
Copy link
Contributor

If you are smart, you can make it 0. Especially if such "smart" usage can trigger un-tested edge case -> possible exploit.

I mean, sending wei to another account has a known gas cost (42k I believe). Offer a high gas Price (eg. 10Gwei) and then deduct the predicatible fee from total balance and send it to a second account you control.

I mean, if you use the current gas calculation in iov-wallet, it is not practical, but most more advanced gas handling solutions would let you do this quite easily.

@webmaster128
Copy link
Contributor Author

#774 now moves the workaround from the wallet into IOV-Core.

I'll let this ticket open since I'm not convinced what the final answer will be. Scanning for transactions is a very expensive operation (extra request and parsing) and adds the dependency on a scraper to a simple operation like get balance.

@ethanfrey
Copy link
Contributor

I'll let this ticket open since I'm not convinced what the final answer will be. Scanning for transactions is a very expensive operation (extra request and parsing) and adds the dependency on a scraper to a simple operation like get balance.

Fair enough, very hard to do correctly. I'm happy with a simple solution for now, leaving the open issue for the correct solution

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

No branches or pull requests

2 participants