Hacker News new | ask | show | jobs
by afidrya 1606 days ago
In simple words, he should have called a smart contract's function which would withdraw his tokens and send real ETH to his address. Instead, he sent tokens to smart contract's address and they will stay there forever, not associated with any account. This complexity should be abstracted away by wallet's UI. Users don't have to call APIs directly. Also, this whole situation could be prevented by trying to send a smaller amount first.
5 comments

I've written middleware APIs for accepting currency in carts and casinos that interfaced with / polled bitcoind and other daemons. Why on earth would this person be calling APIs directly, and why would the daemon not just reject the transaction if it's an unexpected kind of token? Or if he added funds to the contract why not be able to remove them to the same address? I never dealt with smart contracts but even allowing this to happen without an error seems like a crazy, terrible design.
from the reddit comments, similar question, apparently every instruction adds gas fees to running the contract, so if you're going to use the contract a lot, you leave out any kind of validation.

>> Wow why didn't the contract creators think this through and block requests to the contract

> Because adding that check would increase the cost of every user transaction. All AMM swaps would be done with WETH so it’s the right call to not have it in there

There are, of course, other industries with financial incentives against safety features. We usually regulate them.

We can point and laugh at this one person, but according to the reddit thread they're the 265th person to make this mistake, and more than half of the money in the inaccessible account is not theirs.

And that's just for this particular token. You can go to just about any token contract and see how numerous people have sent their tokens to the contract address itself.
I hadn't even thought about this. With BTC early on, the only party to really benefit from lost coins would be "Satoshi", but his coins weren't worth anything until the currency took off anyway, so it was more important and long-term profitable to build a system that didn't lead to user anger than one that would lose coins to deflate what was already a deflationary currency. It really does show how slimy the whole cryptocurrency world has become.
I really can't think of an expression other then "lol" to sum up my response here for just how incredibly stupid this is, as a "platform of the future".

A design which actively discourages robust programming and error handling in financial software. Wow.

It's like a libertarian utopia. Literally everything is an individual responsibility with no wider recourse.

Want validation? Other people don't want to pay for stuff they're not validating... so it's on you to be careful.

Accidentally fuck up? Not our problem, that's on you for not calling the right API.

Want your money back? We're not paying money to cover for other people's mistakes. You're on your own bud.

You forgot to add “If you don’t like it, you’re free to create your own blockchain”.
What about the Eth DAO forks? How was that individual responsibility?
All smart contracts are immutable, but some are more mutable than others.
Ok… but then if you’re going to throw out these cases you should also address how markets can fix these issues, such as great customer service: “when I fucked up they helped me out, they’ll get more of my business”, or maybe insurance, or just better products that don’t have these issues.

Idk why people conflate libertarianism with this hyper-individualist stuff. It really isn’t the case.

Do ethereum and smart contracts currently have excellent customer service, such that the guy in TFA can get his 500k back?
Low-cost insurance is an interesting idea that might actually work to smooth over some of the hard edges of "code is law".

It ought to be possible to craft an insurance policy that would pay out the $500k (or equivalent WETH/ETH) in cases like the one in this article, where the transparency of the ledger clearly shows that the tokens are unrecoverable.

As insurance companies are notorious for declining to pay out, the clear evidence trail would be helpful to allow the insuree to take the claim to a regular court for a human decision on its validity.

> but then if you’re going to throw out these cases you should also address how markets can fix these issues, such as great customer service

Ahahahahahha. Ahahahahahahahahahha. Ahahahahahhahahahahahahahah.

--- several minutes of laughter later ---

Markets don't care and they will not fix these issues, because suckers losing money is a much better market proposition than losing money on customer support.

Fo go ahead and learn some history, will you? Almost every single regulation we have in place is precisely because markets never ever fix things.

Good grief, this is like machine language for money
exactly, with no-do overs. Everyone hand codes their assembly correctly on the first try right!?!!
There are plenty of do-overs, it's called the "development phase" and involves testing things on your local computer with the team.

No one gets everything right the first time, but with a lot of testing, you can actually write software that does exactly what you think it will do, and you can achieve pretty cool stuff. Remember that humans wrote the software that took humanity to the moon!

As we know, no software has had bugs caught once launched to prod. The existence of some software that worked under this model is not evidence that it is a good model. "Just test prior to release" is not a complete solution.
In this case, not really. User was calling a "ROM"

What you describe are dry runs.

Yes, and that code had bugs.

https://www.forbes.com/sites/lanceeliot/2019/07/16/apollo-11...

There are 0 do-overs on smart contracts in production. No stopping the network for a minute to triage, no rolling back a minute, no circuit breakers. No "Error 1202, do you want to continue?" pop-up messages.

“Premature optimization is the root of all evil.” And now in a whole new way!
Back in the day or at least when I ran my own bitcoin node, any call against the blockchain was free. This sounds like someone charging for hitting the API on a rented node, as opposed to an actual cost imposed by the currency to consult the blockchain (?) But maybe the contract-generators aren't even running their own node, just piggybacking on someone else's API. Sure. Cheaper.
AFAIU, smart contracts on the ethereum VM can be arbitrarily complex, so you pay the network to execute them, or a random user with an infinite loop would bring down the network.

You are indeed renting a machine to run some code, and if you want many people to use your code you want to make it cheap. There's a trade off.

You can fuck up things on the BTC blockchain too, "burning" crypto by sending it to a dead address has been a thing for a long time.

It always seemed stupid to me that it was possible, compared to sending money to an invalid IBAN, but I'm not a crypto enthusiast so I may be biased.

On BTC, you could send things to the wrong address, yes. But you can't send the wrong type of currency or send it to a nonexistent address. In this case it seems like the contract has created the black hole (not the Ethereum blockchain itself), but that's even more absurd since someone ultimately should have control over everything that was put into the contract, regardless of the source.
> But you can't send the wrong type of currency or send it to a nonexistent address

Of course you can do both things, which is why catastrophic financial ruin is a daily fear when dealing with cryptocurrencies.

https://www.quora.com/How-can-I-find-my-Bitcoin-cash-that-I-...

Sending currency to non-existant addresses is how people encode arbitary data on the bitcoin blockchain, so definitely possible.

Giving a person control over the funds allocated to their smart contract probably opens holes where they can steal the smart contract's money, though obviously creating software that handles money and can't be updated is its own kettle of fish.

It truly is laughable. Ever heard of "Return to Sender" in case of invalid events/transactions?
YES. Weren't these supposed to be SMART contracts? My email provider is smarter than that.
Every self-denominated SMART thing that I know of is DUMBER than the conventional thing.
"Smart contracts" was always a really bad name for this functionality.
What a joke.
A better term would be dumb contracts.
First time I hear about IMAP/POP3 provider being able to "undo" emails after being sent. What provider are you using and how does that work behind the scenes? And no, gmails fake "we don't actually send it until you close the tab/wait 30 seconds so you can undo it" doesn't count.
Really? If a mail server (and the post office of most countries) don't have the specified address, it either gets sent back if there is a return address written (email non-delivery notice (aka return to sender, NOT undo) or it goes into a catch all bin (same as a lost & found)(or root account for most mail servers)(or dump it in the bin).
Yes yes, as mentioned in another sibling comment, your wallet won't allow you to send anything to an invalid address. In this case, the address was not invalid, so why expect it to get rejected?
So imagine the bank give all objects in their company an address. The desk has an address, the fridge has an address and so on. Bank accounts have an address too. All these addresses look the same and use the same system to interact with them. The problem is that Johnny wanted to deposit $50 dollar into his account, but he accidentally used the wrong address, and now the fridge in the the bank's kitchen on the 5th floor now owns $50. To his dismay, there is nobody to send his funds back since no human owns the fridge and nobody is even able to break the fridge open to get it out. Don't blame the fridge they say, don't blame the bank they say, don't blame the currency or the address system or the person who made the rules so that fridge addresses and bank account addresses work the same. No, lets blame Johnny, the dumb ignorant fool who doesn't understand the glory of the banks special addressing system. It is working as intended. He should've known better, he should've read the docs etc. Fuck Johnny and his $50.
You’re using a different definition of the word invalid.

Obviously the person you replied to meant invalid in the sense of “not intended to receive funds”

It would have been a competent design decision for a system to require some type of initial registration of intent to receive funds for an address in order for a transaction to post.

I’m sure you’ve heard of it, but in case you haven’t, it’s called bouncing when there’s no valid inbox on the other end. Before you object, yes, you can set up a catch-all incinerator, but that’s not the default as is the case here, you have to explicitly set it up.
"Bouncing" can happen in cryptocurrency world as well, it's called "sending to an invalid address". It just happens to be that the address-space is so big you don't really know what address has a real physical person behind it or not, or yet even.

Try sending cryptocurrency to an invalid address and you'll see that the wallet will reject sending it, just like email bouncing.

Most people setting up mailservers don’t consider a catch-all forwarding to /dev/null a valid inbox. And no sane mailserver software forwards to /dev/null by default if you don’t explicitly tell it what to do when it receives email it isn’t supposed to receive.

A “valid” address locking up funds sent to it without recourse is /dev/null.

> And no, gmails fake "we don't actually send it until you close the tab/wait 30 seconds so you can undo it" doesn't count.

Why doesn't it count and why does it matter how Gmail works behind the scenes?

Because that feature of gmail is not a part of email, it's a part of gmail the product. And it is not "undoing" sending a sent email, it's cancelling an email that was never sent in the first place.
Because email doesn't work that way. Gmail doesn't send the email for a minute. It would be like your boss asking you to send this email and you wait a minute for him to change his mind before you presses send.
Yeah. Even in the original bitcoind API you would run a validation call on the address and the spend before actually committing it. Afaik you couldn't accidentally send coins into a black hole even if you tried.
I think the address was valid, the problem is that there is no way of getting the coins out of it.

The same thing was done on the bitcoin chain, e.g. counterparty[0] was relying on a "proof of burn" which was basically "Send BTC to a black hole".

[0] https://counterparty.io/docs/faq-xcp/

If no one ever moved coins out of their burn addresses I'll eat my socks.
Uh, do you really like socks that much? I think this is something very easy to verify, just look at the burn address on the chain?
Just monitor this address then and let me know if anyone moves anything out of it :) https://etherscan.io/address/0x00000000000000000000000000000...
The thing is that is not an invalid transaction. The problem is in what happens _after_ the smart contract has received the money.
As far as Ethereum is concerned it's valid, but the contract API is riding on top of Ethereum's blockchain. It's middleware. It's responsible for enforcing the contract. How does it have a giant black hole in it?
It's the same as you and I agreeing on a contract where it says when you send me money, I will burn it. If you then use a bank transfer to me, it's not the bank's fault your money is gone, we agreed on that contract and it's not the bank's business to deal with that. Doesn't mean that there shouldn't be safeguards, there absolutely should be, but just laying out where the responsibilities start and stop and the whole deal with crypto currency is the absence of central control so if you choose to shoot yourself in the foot, you're free to do so. But freedom of action doesn't mean freedom of consequences and in the case of a blockchain, it's forever.
> it's not the bank's fault your money is gone, we agreed on that contract and it's not the bank's business to deal with that.

There's a reason some contracts (in the regular legal world) are illegal.

It was a really bad design decision to have smart contracts have this "send to the address" capability, rather than requiring clients call a method that is explicitly defined.
> he sent tokens to smart contract's address and they will stay there forever, not associated with any account.

Wait... so the tokens are really still there, just inaccessible? In what way do the tokens still exist? What makes them inaccessible? Is there really no possibility of restoring the tokens? No possibility of cleverly hacking them out with the assumed myriad of unpublished security flaws?

The tokens are a number in a hash-map of user to balance in the weth program. Any eth program ("smart contract") can be a user. All the smart contract that owns the tokens has to do is tell the weth smart contract to transfer them, or approve mister redditor to transfer them on the contract's behalf. But that contract wasn't built to do such a thing. And now that it's published, it also can't be updated to do such a thing. A new contract could be uploaded, but that new contract won't be the same user. So they're just gone for good. Hope that cleared things up.
So, could the Ethereum community get together and agree to rewrite the blockchain and undo this transaction? Perhaps they could vote on it and have a hearing of the facts. Of course that introduces its own tyranny but is it possible?
It is possible. That's why you have Ethereum and Ethereum Classic, two different chains. The latter one is the unaltered chain, while Ethereum (which is the most popular that's everybody are using) has been forked in such a way that you're describing once after a large hack.
Specifically, it forked because even though the system is specifically designed to make rewriting history impossible, the hackers screwed so many users that they decided to undo it by ignoring history and starting from before the hack.

... Lest anyone ever think Blockchain tech is somehow immune to network effects and social considerations.

Technically, rather than ignoring history and starting from before the hack, they added a nonstandard transaction (not generally allowed) which reversed the effects of the hack. This did not revert other transactions that happened after the hack.

But, yes, blockchain stuff is fundamentally based on consensus about what the rules are, and people/organizations with more social influence can [...] .

The chain is by nature append only, so you'd have to fork it, which they sure as hell are not going to do for a "little guy," to put it mildly. At least, that's my layman's understanding.
Yep. Little users can still get screwed, but players too big to fall get to make up new rules.

... Reminds me of another financial infrastructure I know.

In simple words, he should have done what everyone else does and used Uniswap or Zapper or Sushi or ANY exchange and swapped WETH for ETH that way.

This is just a dumbass user doing dumbass things. This is basic-level stuff right here. Don't interact with contracts directly unless you 100% know what you're doing.

But people are allowed to interact with smart contracts. To obtain the WETH he needed to do that. This is a "why do we even have that lever" kind of situation. If my brokerage had a "permanently burn all of your money" button then it wouldn't be reasonable to just say "well, people shouldn't push that button."

We can even see this with the criticism of wire fraud. Wire fraud is a huge fucking mess that occasionally costs people their life savings. The entire setup is rightly criticized (heck, even by the crypto community) for having users interact with a highly error-prone system with huge consequences.

People are allowed to login as root and delete their systems too. Yes, today's software doesn't make it easy - and the same can be said about this wallet/token; this was a complex sequence of steps in the wrong direction, not a missclick.
And a lot of ink is spilled about systems to make this very difficult, with people continuing to work to improve things. We didn't simply say "well, just don't type those characters" and move on with our lives.
Exactly like in this crypto case.
People don’t usually store 500k on their PCs.
But people run production servers on their PCs all the time.
The set of people running a service with a revenue of 500k on a personal device must be minuscule and the people doing it almost certainly know it’s stupid.

This is qualitatively different from crypto that allows you to burn your money on accident, while the people who build the infrastructure for this tell you is a smart, safe place to put your money.

> This is just a dumbass user doing dumbass things.

I tend to agree. Dumbasses clearly designed this system if it allows money to be accidentally destroyed. Dumbasses doing dumbass things indeed.

> Don't interact with contracts directly unless you 100% know what you're doing.

But if you use any of the exchanges you described, you have to trust that they 100% know what they're doing.

It seems safer to avoid smart contracts and cryptocurrencies altogether.