5 ms·
Some variant of this kind of disaster with smart contracts seems to do the rounds on Twitter every couple of days. Why does this keep happening? Since software
by RVuRnvbM2e 4y ago
Some variant of this kind of disaster with smart contracts seems to do the rounds on Twitter every couple of days. Why does this keep happening?
Since software will always have bugs, how do developers of smart contracts intend to fix this kind of problem? Does anyone actually have a solution to this?
- TimJRobinson 4y agoProbably because there are tens of thousands of smart contracts now and hundreds are created every day. Companies get hacked every single day too, probably many that you use, it's just more opaque when that happens.
- aordano 4y agoI always wondered why aren't smart contracts developed strictly; proving them with Coq or some proof assistant, or making a formal TLA+ struct to define them before coding. As the siblings say, it smells like contractors that don't take it as seriously as (imo) they should.
- Sargos 4y agoMost important smart contracts like MakerDAO are formally verified already and there are ways to code smart contracts in functional and other safer languages.
- ______-_-______ 4y agoAt this point I just want to know why it's considered news. This site is called hacker news, after all. The sun rises in the east, another smart contract eats people's money, another shitcoin goes to zero. Here's your coffee, sir.
- fsflover 4y agoI guess crypto haters are trying to prove to themselves their vision.
- meibo 4y agoThis kind of code is usually contracted out to the lowest bidder because the people that want to pull the scam/MLM/NFT project/whatever you want to call it don't have the technical skill, but can do the marketing. This leads to bugs or exploits often ending up in these "contracts". The concept is inherently flawed, as they can't be updated and can't be reevaluated or reinterpreted by e.g. a court. The money's just lost.
- RVuRnvbM2e 4y ago> The concept is inherently flawed, as they can't be updated and can't be reevaluated or reinterpreted by e.g. a court. The money's just lost. This is the way it seems to me too, but I just can't understand how a flaw this obvious could be overlooked by so many people? Surely we are both missing something?
- TheColorYellow 4y agoIt's mostly neglect on behalf of the teams. In this case, the code was never audited and was created by a rather immature team that was rushing for production. So recupe for disaster. In truth you can write code that is upgradable or ammendable, but always within limits of Ethereum transactions being immutable. However, when a project wants to emphasize that immutability, because that's perceived as the need by the users and the devs, then you end up in this situation. So, as usual, the problem is solvable with a little diligence. The challenge is for crypto culture to get over itself and mature and actually perform that diligence. I will say that there are very mature, very well developed projects that you don't hear about getting hacked, because they take advantage of the wealth of experience that's been built on this subject.
- HideousKojima 4y ago>So, as usual, the problem is solvable with a little diligence. If you're going to potentially lose tens or hundreds of millions, you need a lot more than a little diligence. Formally proved code (something along the lines of Ada with Spark Pro) is the bare minimum for something with some much money on the line, and even then I'd still prefer a traditional contract and leave things to the courts.
- supernt 4y agoBar to entry is extremely low; copy-paste existing contract, change a few variables and launch. Yet, the contract must resist state-sponsored attacks, eg. https://rekt.news/big-phish/ https://rekt.news/big-phish/ Maybe one day there will be a sort of unhackable template that everything derives from, or an automatic software-prover.
- kwertyoowiyop 4y agoThey will certainly fix it if you give their startup another metric fuckton of money. ;-)
- thomascgalvin 4y ago> Since software will always have bugs, how do developers of smart contracts intend to fix this kind of problem? They don't. I doubt most are even thinking about it, and of those that are, most probably think it can't happen to them. Crypto tries to make financial programming more like web development, and less like writing code for a bank, but there's a reason writing code for a bank is such a pain in the ass: it has to work more or less perfectly, every time, at least on the backend. If you trust your financial framework to someone who took a UDemy course last weekend, you get what you deserve.
- charcircuit 4y ago>They don't This is wrong. It's pretty standard for contracts to be able to be upgraded. Usually you want to put a delay before updates are applied. This time delay allows users to see what is happening with the upgrade and gives them a chance to cash out if it's bad. There might also be a way to do an emergency upgrade, but typically this account is much more locked down compared to just being able to make a normal update.
- kelnos 4y agoAnd when there inevitably is a problem with the code at a bank, you call a real person who investigates and then fixes the problem and makes you whole. This process is far far far from perfect, but at least it exists. When a smart contact developer makes a mistake, your money is just gone, forever, with no recourse.
- lugao 4y agoThe academy have developed tools for code verification, state modeling and formal proofs. The choice of using a javascript fork for financial contracts is deliberately dumb and will result in the craziest bugs we could imagine.
- 323 4y agoFormal proofs will not save you if the assumptions are wrong. You can formally prove a bug that you thought is a feature.
- lugao 4y agoYou could at the very least model impossible states and check they won't happen. The assumptions are not that hard to model either, there are not that many moving parts.
- deleted 4y ago[deleted]
- wpietri 4y agoI know a lot of smart, professional software developers. Many of them, me included, have taken a look at this stuff, or even been recruited to join a cryptocurrency-related project. Some of them even tried it out. But very much on purpose, none of them are currently involved. So my guess as to why it keeps happening is a sort of Dunning Kruger effect combine with a selection filter such that the people most eager to get involved are the ones least likely to be able to spot the problems.
- weare138 4y agoIMO the APIs are overly complicated and there's no proper dev tools to test and debug the code. There's a few testing frameworks out there but I'm not really sure how well they work considering how often this happens. I don't get why there isn't some straight forward way to build failsafes into these contracts.
- jfk13 4y agoI imagine the process of "building a failsafe" is just as bug-prone as writing the main contract. It's just more code, after all.
- masklinn 4y ago> Some variant of this kind of disaster with smart contracts seems to do the rounds on Twitter every couple of days. Why does this keep happening? Because it’s code which means errors are a fact of life, and the goal of crypto pushers was to spread the scam so instead of looking at formal methods in order to make “smart” contract ironclad, they started from ECMAScript so that any idiot could go from a frontend widget to deploying a smart contract with minimal introspection or reflexion.
- dcolkitt 4y agoApproximately $300 billion of value is secured by on-chain smart contracts. What makes it to the front page of HN probably gives a distortionary perception, in the same way that watching sensationalist news makes you think kids are being abducted left and right. Only bad news sells. A $35 million bug makes it to the front page, but how often do you hear about Uniswap processing $1+ billion in trading every day without a single hack in 5 years. In general, there’s actually been a sustained improving trend of fewer hacks, higher likelihood of recovery, and lower losses as a percent of assets. The headline numbers may be higher, but that’s largely a denominator effect of the meteoric growth in on-chain assets. It’d be like judging New York City based on how many murders are in the paper instead of the murder rate.