Live data from Hacker News

A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

medium.freecodecamp.org

51–60 of 440 posts

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#51

Earlier quoted context omitted.

> I know I'm this situation the dev made a simple mistake, but I wonder if Ethereum is safe as a system assuming developers will make many mistakes, and those mistakes will happen more often as more complicated contracts are written. This will probably come off as being assholish, but I honestly don't mean it to be: you should read the rest of the article. It actually covers this topic in depth and has good thoughts…

The rest of the article amounts to a few points: - Humans make mistakes, the tools should have been better - The technology to make Ethereum safe doesn't really exist - We should work to make that technology exist - We should be happy this happened since it raises awareness about the problem > In the end, attacks like this are good for the community. They call you to your senses and force you to keep your eyes open.…

> We're not even close to a world where tools can offer amazing protection.

Actually, we're reasonably close--the tools aren't quite there yet for mass consumption (many are still feel quite researchy), but given that the trend of (research -> industry) usually takes 10-25 years, I'd expect that more and more critical systems will be formally verified in 10 years. Even now, companies like Amazon are using some formal methods (modelling with TLA+) to validate that specifications will behave as expected. (https://cacm.acm.org/magazines/2015/4/184701-how-amazon-web-...)

Formal methods & dependent types allow for some very cool tricks on top of that--basically, you can encode in the type system a proof that the program implementation matches a specification. CompCert is a mostly-formally verified C compiler--since it was released, iirc, no bugs have been found in the verified portion of the compiler. (CompCert page: http://compcert.inria.fr/man/manual001.html)

You can also prove that the specification has particular properties (in a distributed system, things like liveness and partition tolerance). Consider the Verdi framework (allows formal verification of distributed protocols) and their formal verification of RAFT. (Code here: https://github.com/uwplse/verdi-raft)

However--it's just that it currently takes a lot more work in terms of person-hours to do the development. But formal methods are getting used in more and more places, and they do make a difference in practice. (Wired has a not particularly deep, but straightforward article that shows another use: https://www.wired.com/2016/09/computer-scientists-close-perf... )

Anecdotally, as far as effort--I'm an industry programmer who writes mostly C#. I had to learn Coq (a formally verified language) for a class--it took me a couple of simple assignments to get the idea of how it worked. Even after a few months, hacking together a formally verified interpreter for a very simple language (functions, while loops, etc.--simple, but not trivial) took about 3-4 times longer than it would have taken me to do normally.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#52
I think the fundamental problem here is an economic one. Make three assumptions:

1) most contracts worth implementing in Ethereum are fairly complex

2) even given great developers, bugs are inevitable in complex code

3) the budget of the contract-makers' security team MUST be smaller than that of the hackers

You quickly see that if the chance of a bug is nonzero, "smart contracts" don't make economic sense. If you have a $100k contract, and you spend $5k on security (which would absolutely destroy most companies' margins by the way) you'll be facing hackers that are EACH willing to spend up to $90k or so. Let's say all the experts in this example world are $200/hr. You spent 25 expert-hours on security. But you're being hacked by people who spent 450 expert-hours on hacking you.

With that in mind, would YOU want to use a smart contract? Spend 5% of the contract value instantly on security, and risk losing 105%? This isn't a normal loss by the way, where you can prosecute someone or sue somebody. No, this is the instant, digital theft of the entire value of the contract, to an anonymous digital address where it will be quickly blended in with hundreds of millions of dollars of similar thefts a month.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#53
post #3

>"It’s important to understand that this exploit was not a vulnerability in Ethereum or in Parity itself." I mean.... I guess. It's a feature of Ethereum, if we're going to weasel around.

I think most developers know not to eval() Why would you execute arbitrary text in any other languages?

Your parallel is not an accurate one.

One of the key and powerful features of the Ethereum Virtual Machine or, EVM, is the ability to delegate execution to external libraries. You can think of this much the same way you think of installing 3rd party libraries in your favorite programming language of choice.

In the EVM you can write a "library" which performs some common functionality such as manipulation of date-time objects much like the `datetime` library in Python. Any other contract may then make use of this code simply by delegating execution to the deployed library address. This has inherent risks that every Ethereum developer should understand fully, but with that risk comes some incredible power and potential.

There currently is no "Standard Library" for the EVM but it is looking very likely that it will be comprised of this type of contract. Slowly, overtime, these library contracts will be written and deployed to the network. There is work being done on using theorem solvers to mathematically prove that a contract satisfies certain properties which opens the door to a "provably correct" standard library.

I know of no other computing environment or packaging system that has these properties. For me, it has been an enlightening subject and I feel like we've only just scratched the surface.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#54

Stories like this make me consider whether programmers that engage in commerce should be forced (yes, by law) into guilds that have rigid journeyman and apprenticeship stages before the programmer gets to touch the production environment. Specialized, official, bonded developer roles need to be established. Our community cannot continue operating in the hacker mode wherever money is involved.

[deleted]

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#55

I think the fundamental problem here is an economic one. Make three assumptions: 1) most contracts worth implementing in Ethereum are fairly complex 2) even given great developers, bugs are inevitable in complex code 3) the budget of the contract-makers' security team MUST be smaller than that of the hackers You quickly see that if the chance of a bug is nonzero, "smart contracts" don't make economic sense. If you ha…

I grant your point, but disagree with your framing of the problem.

I think a good analogy here is to compare to American settlers. You're going to have a few waves: the explorers who move into totally uncharted territory and take on significant risk by using smart contracts. These are kinda crazy people who love the innovation, and I'd argue this is the majority of people in the space right now.

Eventually there will be the settlers, who start finding early uses for this technology that can significantly lower costs. Basically collecting on low-hanging fruit. J.P. Morgan, many finance companies, some savvy governments will step in to capitalize on easy wins.

Then there will be the long tail of normal uses. By the time the average company invests in smart contracts, there will be very well-understood battle-tested templates and toolchains for creating smart contracts, as well as consulting firms that are specialized in writing them for you with provable security guarantees.

Right now it's early. Your average company should not use smart contracts, that's a no-brainer. But someday the economics are going to make it a no-brainer for certain things, like incorporation, or issuing shares, or doing payroll, or complying with import/export regulations, or doing corporate taxes, or whatever it is that ends up more efficient through blockchains.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#56

Stories like this make me consider whether programmers that engage in commerce should be forced (yes, by law) into guilds that have rigid journeyman and apprenticeship stages before the programmer gets to touch the production environment. Specialized, official, bonded developer roles need to be established. Our community cannot continue operating in the hacker mode wherever money is involved.

So now people who are self taught excellent programmers are unemployable without paying a 60,000 tax into the hands of private institutions but morons who graduated from diploma mills in countries with lax educational standards are entirely safe. I'm also sure that nobody will act to artificially limit the supply of legally employable programmers just to enrich the few at the expense of the rest of us. I'm also sure…

I don't think anyone is arguing that all computer programmers need to be accredited. The argument being put forward is that if you are deploying software in certain specific fields then your code should be signed off by a certified professional before it is allowed to be perform it's intended function (which in this case is handling financial transactions).

I am an engineer. There are codified regulations that I am required to comply with by law. Hypothetically if I certify the design of a structure and later on I was found to be have been negligent in performing my duties as a practicing professional engineer then Me, the company I work for (or both of us) are up for huge liabilities.

You can't build a $31M Bridge without the design being certified yet you can build software to handle $31M dollars of transactions just fine.

None of this would stop open source contributions. If you want to contribute code to some financial processing software submit your pull request and have the (professionally certified) reviewer sign off on it after doing his job (i.e reviewing it).

Edit: Here's a quote from William LeMessurier it's part of an ethics case study I learnt about at university (http://www.theaiatrust.com/whitepapers/ethics/study.php)

"If you’ve got a license from the State and a certification from the University first and now you’re gonna [sic] use the license to hold yourself out as a professional, you have a responsibility beyond yourself, if you see something that is a social risk...good heavens this thing would kill thousands! You must do something. You must do something"

Now a bug in this particular piece of code isn't going to kill someone but $31M is a lot of money to have stolen. No one in this topic is even thinking of the consequences. It could ruin multiple peoples lives losing that much money. A lot of people just seem to be content with this lawless "wild west" world of programming. Personally I think we should be striving for a higher level of professional and ethical standards.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#58

I think the fundamental problem here is an economic one. Make three assumptions: 1) most contracts worth implementing in Ethereum are fairly complex 2) even given great developers, bugs are inevitable in complex code 3) the budget of the contract-makers' security team MUST be smaller than that of the hackers You quickly see that if the chance of a bug is nonzero, "smart contracts" don't make economic sense. If you ha…

> This isn't a normal loss by the way, where you can prosecute someone or sue somebody. No, this is the instant, digital theft of the entire value of the contract, to an anonymous digital address where it will be quickly blended in with hundreds of millions of dollars of similar thefts a month.

Also worth pointing out that a non-trivial number of people would say that no theft at all has occurred, as the smart contracts are supposed to be the final authority, and if you can convince a smart contract to give up its value to an attacker then that's perfectly fine as that's how the contract was written. Ethereum Classic is a good example of this.

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#59

I think the fundamental problem here is an economic one. Make three assumptions: 1) most contracts worth implementing in Ethereum are fairly complex 2) even given great developers, bugs are inevitable in complex code 3) the budget of the contract-makers' security team MUST be smaller than that of the hackers You quickly see that if the chance of a bug is nonzero, "smart contracts" don't make economic sense. If you ha…

Is formal verification of contracts feasible? Is anyone working on it?

Also, here's a possibly crazy idea: could one create bug bounties for algorithms (or even arbitrary software) on the Ethereum blockchain by writing the algorithm into a contract such that if you somehow break it you receive the bounty?

An example of this would be the massive implicit bounty currently placed on the crypto algorithms (SHA256, ECDSA/Secp256k1, etc) underpinning cryptocurrencies (of course, if those were broken the value of the cryptocurrency would plummet instantly)

Re: A hacker stole $31M of Ether – how it happened, and what it means for Ethereum

#60

I think the fundamental problem here is an economic one. Make three assumptions: 1) most contracts worth implementing in Ethereum are fairly complex 2) even given great developers, bugs are inevitable in complex code 3) the budget of the contract-makers' security team MUST be smaller than that of the hackers You quickly see that if the chance of a bug is nonzero, "smart contracts" don't make economic sense. If you ha…

Is formal verification of contracts feasible? Is anyone working on it? Also, here's a possibly crazy idea: could one create bug bounties for algorithms (or even arbitrary software) on the Ethereum blockchain by writing the algorithm into a contract such that if you somehow break it you receive the bounty? An example of this would be the massive implicit bounty currently placed on the crypto algorithms (SHA256, ECDSA/…

See: https://www.youtube.com/watch?v=voyespPGQZI (Directions in Smart Contract Research A Selection - Philip Daian)
Post reply on HN