Live data from Hacker News

153k Ether Stolen in Parity Multi-Sig Attack

etherscan.io

691–700 of 754 posts

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#691
post #585

Just skimming through the Solidity docs, I see a lot of unwise decisions there aside from the weird visibility defaults. All state is mutable by default (this includes struct fields, array elements, and locals). Functions can mutate state by default. Both are overridable by explicit specifiers, much like C++ "const", but you have to remember to do so. Even then, the current implementation doesn't enforce this for fun…

It is interesting to see but I think Solidity is the first software language/framework that people with no experience writing it or running it, comment and write about it on hackernews as if they did. A common criticism is the way for loops and arrays are implemented are broken? Well actually they should rarely be used in contracts, its not like you can send ether/btc to an array recipients or in a for loop. You do n…

> It is interesting to see but I think Solidity is the first software language/framework that people with no experience writing it or running it, comment and write about it on hackernews as if they did.

Not at all. Deconstruction of PL design is a popular pastime here.

> A common criticism is the way for loops and arrays are implemented are broken? Well actually they should rarely be used in contracts

If they cannot be used safely, they shouldn't be in a language.

If they can be used safely, but it requires caution and is to be rarely done, then the syntax should reflect that by not making it so easy to use them.

> Once again the type system doesn't need to be perfect, if your code on the blockchain is broken you pay a transaction fee and the contract doesn't execute it.

The type system enforces invariants that go beyond code being broken in a sense that it doesn't run. Sometimes broken code does run, with catastrophic consequences - remember Mars lander crash? That was one example of an error that could be prevented by a sufficiently advanced type system - in F#, for example, types can reflect units of measurement, and the language will plainly not allow you to do nonsensical things like add together feet and meters, without explicitly converting one way or the other.

By its very nature, smart contracts on a blockchain that deals with money have a huge potential for this sort of thing - a contract that doesn't trigger an error, but which silently behaves differently from what was intended by the author. The consequences, as we can see here, can be staggering, as in millions of dollars in damages.

It follows that the language that is used to write them should use every known mechanism to discover such errors early. This includes strong typing, immutability, explicitness, design by contract etc.

> For a language that was made less than 3 years ago

The language was not made in a vacuum 3 years ago. Other languages preceded it, and provided valuable lessons in PL design. Why these lessons weren't heeded is a reasonable question to ask.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#692
post #599
post #590

Earlier quoted context omitted.

> It is interesting to see but I think Solidity is the first software language/framework that people with no experience writing it or running it, comment and write about it on hackernews as if they did. It's interesting to see how the first virtualmachine specification for the first financial smart contract platform has overlooked all the pitfalls of the language-design industry and it doesn't look that a redesign is…

The language was not made from "scratch" but a progression from bitcoin scripts, Ethereum is the like to blockchain dev like Unity is to gamedev, it lowers the barrier to entry, it has a lot of the similar apis and functions as bitcoin, I don't really consider this a bad thing

Do we really want to lower barrier to entry for writing code that can misdirect $30 million dollars just like that?

By the way, I went and looked at the offending contract. The pull request that introduced the line with the bug added 2228 new lines of code while removing 918 lines. In fact, the diff is so large that GitHub doesn't even show parts of it by default (including the part with the bug). The pull request was reviewed by a single other person, and committed on the same day it was submitted.

I don't think I'm comfortable with the barrier being that low, at all.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#693

Earlier quoted context omitted.

> The larger a percentage of the economy that is transacted via a public blockchain, the less opportunity for all sorts of crime. Talk about unsupported assertions. You do realize the article you're commenting on is titled 153K Ether Stolen in Parity Multi-Sig Attack. Others have noted your confusion about what "consumer protections" means. It is patently obvious that paying out $153,000 in insurance claims would be…

I think your confusion is that you think the immutability mechanism is a flaw. Addressing the fraud should be done via insurance, since otherwise we need to trust yet another party to be sure transactions can't be mutated/reversed. I think if you examine all the assumptions leading up to your conclusion you may find that it is erroneous.

There's no confusion. I've pointed out that protecting consumers from immutable fraud via insurance premiums, as you propose, is much costlier than having a trusted intermediary police and reverse fraud. You have pointed to no errors in my assumptions or logic.

You simply believe that we "should" not trust intermediaries, which is fine, but you must accept the consequence that consumer protections will be weaker and/or costlier to implement. This is why Bitcoin was for the most part never more attractive to consumers than cards.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#694
post #458

Earlier quoted context omitted.

I never understood why they chose such a hacky language (an a VM model that encourages these kinds of languages), and expect people to write supposedly secure (in the sense of: obviously correct!) code with it. Any remotely popular functional programming language created over the last years shows a better design (and taste) than this one. And if that only attracts a certain type of programmers? (pun intended) That is…

None of the languages that you mention target the EVM, and the changes required to do so would turn them into restricted versions that look kind of like the original ones but have several differences that you need to keep in mind while programming in them. It makes quite a lot of sense to create a new language that takes advantage of the particular features provided by the EVM. It's also quite hard for programmers to…

> It's also quite hard for programmers to reason about performance or complexity in most functional languages

Yet another data point for 'why a TC language is a bad choice for smart contracts'.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#696
post #620

Earlier quoted context omitted.

> Yes because that would still be a crime. Expanding on your analogy - if I declare right now that it's ok to murder me, it's still not ok to come and murder me. The comparison to murder doesn't work because you can't consent to murder, but you can consent to theft. It's not clear to me whether that situation would be taken as consent, but unless you know something I don't, it probably shouldn't be clear to you eithe…

How do you consent to theft?

By giving something to someone.

I mean, legally, what happens is not "consenting to theft". Unlike say assault, which you can consent to, and legally speaking an assault actually happens but consent makes it okay; but with theft, if you consent what happens is not legally theft. (IANAL, but this is my recollection from law A-levels.)

But that distinction is irrelevant here. The point is that there's basically no way for someone to deliberately kill someone and have it not be a crime. But there are ways for someone to take someone else's stuff and have it not be a crime, and one way is if the owner consents.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#697

Earlier quoted context omitted.

> if mutability and trusted third party oversight is actually usually a necessary and desired fraud prevention feature in a payments system, there's probably not huge demand to replicate all that using blockchains whose most-touted virtue is immutability and trustlessness This is exactly right. Once you empower trusted intermediaries to police and reverse transactions, you lose cryptocurrency's primary raison d'être.

> cryptocurrency's primary raison d'être I don't think this is accurate. Let's talk about intermediaries: I buy a shirt online using cryptocurrency. The merchant teams up with an intermediary to ship it to me. I buy a shirt online. I team up with an intermediary to verify that the merchant ships the product as promised in exchange for a small fee. I buy an electric skateboard online. I view reviews written by interme…

None of those are intermediaries that police and reverse transactions. Even escrow services do not offer the same protection as credit card chargebacks, which go out to 90 days or longer. Once you implement that type of intermediary, the primary raison d'être of cryptocurrency -- decentralization and immutability -- goes out the window.

I take note that you have reduced the claimed value of cryptocurrency from decentralization and immutability to mere "efficient trust establishment". However you are still making a totally unsupported claim that it is more efficient that existing methods (e.g. getting a credit card or payment processor). Considering the enormous energy cost of mining you will need to offer some support for that. Otherwise it's just frothy hype.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#698
post #562

Just skimming through the Solidity docs, I see a lot of unwise decisions there aside from the weird visibility defaults. All state is mutable by default (this includes struct fields, array elements, and locals). Functions can mutate state by default. Both are overridable by explicit specifiers, much like C++ "const", but you have to remember to do so. Even then, the current implementation doesn't enforce this for fun…

Yet another homegrown PHP-sque language. The Fractal Of Bad Design is actually a pattern. My bet they never took any PL course, and have very vague understanding of what consequences certain design decisions would produce. "20 years of PHP coding" or something like that. Any decent PL course would emphasize the first-class-everything (procedures , obviously), lexical scooping for proper closures, strong but dynamic t…

I feel like what you say is sensible, but that your tone is needlessly derogatory.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#700

Earlier quoted context omitted.

In Haskell everything is public by default unless you specify exports for the module.

But it also has a statically checked type system.

I think if done in Haskell how good or bad it is depends on the chosen abstraction for effects not Haskell itself.

Haskell is a good basis but the developers need to make the API fool proof. E.g. expose limited effects rather than a big fat "IO" type.

Post reply on HN