News for hackers. Stuff that matters.
Re:$34M permanently locked into AkuDreams contract forever d... by RVuRnvbM2e on Saturday April 23, 2022 @10:29AM (#31134571)
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?

Re:$34M permanently locked into AkuDreams contract forever d... by dcolkitt on Saturday April 23, 2022 @02:20PM (#31136857)
Approximately $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.

Re:$34M permanently locked into AkuDreams contract forever d... by meibo on Saturday April 23, 2022 @10:37AM (#31134639)
This 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.

Re:$34M permanently locked into AkuDreams contract forever d... by RVuRnvbM2e on Saturday April 23, 2022 @10:39AM (#31134656)
> 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?

Re:$34M permanently locked into AkuDreams contract forever d... by TheColorYellow on Saturday April 23, 2022 @10:49AM (#31134725)
It'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.

Re:$34M permanently locked into AkuDreams contract forever d... by HideousKojima on Saturday April 23, 2022 @12:33PM (#31135767)
>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.

Re:$34M permanently locked into AkuDreams contract forever d... by exdsq on Saturday April 23, 2022 @11:28AM (#31135070)
It wasn’t overlooked - someone noticed the issue and reached out to the team just before launch but it was declared ‘FUD’. Ultimately it’s a junior team - this should have been caught. While not perfect, smart contracts are starting to mature - well-tested contracts become templates, access to 100% control flow fuzzing becomes easier, more people are releasing testnet versions with bug bounties… it is going in the right direction but only if you can be bothered to put that effort in. Ive worked as a contract test engineer in crypto for over three years now across several projects & blockchains, and yet to have a project have an issue like this.
Re:$34M permanently locked into AkuDreams contract forever d... by Icathian on Saturday April 23, 2022 @10:55AM (#31134763)
True believers think court interpretation is inherently corrupt and a systemic flaw, while these are just implementation bugs and ultimately fixable. Everyone else is either running a con, or a mark. There's really only three categories here and very little to miss I think.
Re:$34M permanently locked into AkuDreams contract forever d... by emerged on Saturday April 23, 2022 @10:53AM (#31134752)
Each time I’ve given crypto a chance, I get about 5 minutes into looking at Ethereum contracts and the EVM and end up walking away because it’s such a mess IMO. It really all feel very junior.
Re:$34M permanently locked into AkuDreams contract forever d... by Consultant32452 on Saturday April 23, 2022 @11:35AM (#31135150)
At this point I wouldn't bother with smart contracts and just use it as a medium of exchange or investment.

However, if Ethereum sticks around there will be standardized, off the shelf contracts for people to use that have wide-spread testing/adoption. Once we reach that level of maturity then it could make sense to use it for things like escrow on a contract/purchase.

Re:$34M permanently locked into AkuDreams contract forever d... by denton-scratch on Saturday April 23, 2022 @01:18PM (#31136176)
How do you use ETH on a contract to purchase goods? How does the contract know when it has been completed?

I can imagine using ETH for escrow; but there has to be a human in the loop for escrow, to direct escrow funds to be released. I guess one could contrive a situation where a "contract" could autonomously determine when it had been completed. But that's not the general case.

Re:$34M permanently locked into AkuDreams contract forever d... by Consultant32452 on Saturday April 23, 2022 @02:20PM (#31136853)
You put $10k in escrow to buy a house. Either both parties agree (human intervention) that the requirements have been met and the escrow is released to the seller, or the funds are returned to the buyer after some deadline.
Re:$34M permanently locked into AkuDreams contract forever d... by aaaaaaaaata on Saturday April 23, 2022 @03:49PM (#31137799)
Always good to have a consultant around to explain the tough words ;)
Re:$34M permanently locked into AkuDreams contract forever d... by aaaaaaaaata on Saturday April 23, 2022 @01:34PM (#31136332)
> How does the contract know when it has been completed?

Escrow, or an oracle (checking, say, FedEx delivery.)

Re:$34M permanently locked into AkuDreams contract forever d... by TimJRobinson on Sunday April 24, 2022 @03:13AM (#31141914)
There already is: https://openzeppelin.com/

Most people use them for their projects, but you don't hear about them because they don't make it to hacker news as only crypto pessimism is upvoted here.

Re:$34M permanently locked into AkuDreams contract forever d... by everfree on Saturday April 23, 2022 @01:04PM (#31136052)
What do you dislike about the EVM?
Re:$34M permanently locked into AkuDreams contract forever d... by otterley on Saturday April 23, 2022 @01:41PM (#31136408)
This is admittedly secondhand knowledge, but my understanding is that the EVM was written with 128 bit words, and consequently cannot be implemented using any common general purpose computer hardware. All of its operations have to be implemented in software, making it significantly slower than it could be as a result.
Re:$34M permanently locked into AkuDreams contract forever d... by aaaaaaaaata on Saturday April 23, 2022 @03:48PM (#31137791)
Isn't the whole point making the decentralized network itself the computer...?
Re:$34M permanently locked into AkuDreams contract forever d... by otterley on Saturday April 23, 2022 @04:16PM (#31138078)
Market makers need the ability to process transactions quickly. There is indeed a network of computers involved, but each computer is, well, a computer, and needs to make computations in order for transactions to process.
Re:$34M permanently locked into AkuDreams contract forever d... by aaaaaaaaata on Saturday April 23, 2022 @04:20PM (#31138111)
Does a zkEVM by Loopring+Vitalik consulting on it scratch your itch?
Re:$34M permanently locked into AkuDreams contract forever d... by cinntaile on Saturday April 23, 2022 @10:53AM (#31134750)
If you code it properly you can release a new version and disable the old version, forcing your users to use the new contract. It doesn't mean you can retrieve the money locked by this particular contract though. If the logic doesn't allow it you're out of luck.
Re:$34M permanently locked into AkuDreams contract forever d... by kjrose on Saturday April 23, 2022 @12:33PM (#31135768)
To me this almost seems like an argument to insist on legal level protections for development of contractual code. As in, you need to have qualifications like a lawyer, liability coverage like a lawyer (or bank) and have to be approved in some fashion before you can publish a contract that deals with more than a certain amount of capital.

Theres no difference between a badly codes contract and a badly written one that doesn't do what one signer intended. Short of you can try to convince a judge to adjust it or handle it differently.

In this case. There is no judgment system to allow for reversal of badly coded or misunderstood contracts. Which means that the standard for the development should be far higher with considerably more insurance and coverage for risk.

Re:$34M permanently locked into AkuDreams contract forever d... by ______-_-______ on Saturday April 23, 2022 @10:36AM (#31134636)
At 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.
Re:$34M permanently locked into AkuDreams contract forever d... by fsflover on Saturday April 23, 2022 @12:25PM (#31135676)
I guess crypto haters are trying to prove to themselves their vision.
Re:$34M permanently locked into AkuDreams contract forever d... by thomascgalvin on Saturday April 23, 2022 @11:36AM (#31135158)
> 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.

Re:$34M permanently locked into AkuDreams contract forever d... by kelnos on Saturday April 23, 2022 @01:19PM (#31136189)
And 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.

Re:$34M permanently locked into AkuDreams contract forever d... by charcircuit on Saturday April 23, 2022 @07:11PM (#31139589)
>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.

Re:$34M permanently locked into AkuDreams contract forever d... by masklinn on Saturday April 23, 2022 @12:47PM (#31135903)
> 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.

Re:$34M permanently locked into AkuDreams contract forever d... by aordano on Saturday April 23, 2022 @08:46PM (#31140197)
I 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.
Re:$34M permanently locked into AkuDreams contract forever d... by Sargos on Sunday April 24, 2022 @03:26AM (#31141975)
Most important smart contracts like MakerDAO are formally verified already and there are ways to code smart contracts in functional and other safer languages.
Re:$34M permanently locked into AkuDreams contract forever d... by supernt on Saturday April 23, 2022 @11:04AM (#31134852)
Bar 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/

Maybe one day there will be a sort of unhackable template that everything derives from, or an automatic software-prover.

Re:$34M permanently locked into AkuDreams contract forever d... by lugao on Saturday April 23, 2022 @12:13PM (#31135570)
The 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.
Re:$34M permanently locked into AkuDreams contract forever d... by 323 on Saturday April 23, 2022 @12:25PM (#31135679)
Formal proofs will not save you if the assumptions are wrong. You can formally prove a bug that you thought is a feature.
Re:$34M permanently locked into AkuDreams contract forever d... by lugao on Sunday April 24, 2022 @04:17AM (#31142178)
You 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.
Re:$34M permanently locked into AkuDreams contract forever d... by TimJRobinson on Sunday April 24, 2022 @03:10AM (#31141902)
Probably 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.

Re:$34M permanently locked into AkuDreams contract forever d... by weare138 on Saturday April 23, 2022 @12:45PM (#31135876)
IMO 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.
Re:$34M permanently locked into AkuDreams contract forever d... by jfk13 on Saturday April 23, 2022 @01:00PM (#31136010)
I imagine the process of "building a failsafe" is just as bug-prone as writing the main contract. It's just more code, after all.
Re:$34M permanently locked into AkuDreams contract forever d... by kwertyoowiyop on Saturday April 23, 2022 @11:19AM (#31134994)
They will certainly fix it if you give their startup another metric fuckton of money. ;-)
Re:$34M permanently locked into AkuDreams contract forever d... by wpietri on Saturday April 23, 2022 @12:31PM (#31135729)
I 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.