Live data from Hacker News

153k Ether Stolen in Parity Multi-Sig Attack

etherscan.io

641–650 of 754 posts

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

#641
post #564

Earlier quoted context omitted.

Thank you for succinctly summarizing all my frustrations with Solidity. I am developing a fairly complex smart contract (i.e. not a crowdsale) and it's fucking painful. Trivial computations that would take less than an hour to do in any other language take days to implement correctly. Debugging is also a nightmare. There's no way to step through function calls or set break points, even though it's basically just Java…

How do you create unit tests for Solidity code? This would eliminate much of the need for a debugger while also leading to safer code

Unit tests do help, and they are relatively easy in Truffle, the most used JS framework for Solidity. I guess I need to move to more of a TDD style than I'm used to.

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

#642
post #540

Earlier quoted context omitted.

Can someone explain to me why they chose to make their own language instead of creating a DSL inside of an existing language?

What language would you choose? AFAIK there are almost no _actually_ secure languages. The ones that exist (e.g. Idris, Agda) are notoriously hard to use (although their Turing "incompleteness" is arguably a feature for smart contracts/distributed computations). Daily LoL: Googling "secure language" brings up mostly results about Java.

Idris isn't difficult to use for things that don't require tons of library support (since there aren't many libraries to speak of yet), unlike Agda, which is far from a programming language in the usual sense (it's a proof assistant, and you're only really supposed to typecheck stuff with it).

You can just skip messing with the termination checker (just don't mark your functions total) in Idris and write Haskell-ish code. The occasional rough edge aside, it's not hard to write the kind of programs we're talking about here: and if you want to prevent DDoS-like infinite looping, put the "total" annotations back in.

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

#643
post #392

Earlier quoted context omitted.

It's almost as if software technology can't magically solve problems inherent in the flawed nature of humanity.

That's a strawman of what GP said. Of course technology can't solve humanity's flaws. The point was that smart contracts caused many problems they weren't meant to, which was exemplified by the DAO hack. Smart contracts failed to deliver on their promise and the fallout proved that when it came down to brass tax, nobody with skin in the game would respect a smart contract's execution anyway.

FYI the term is "brass tacks" not "brass tax"

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

#645
post #641

Earlier quoted context omitted.

How do you create unit tests for Solidity code? This would eliminate much of the need for a debugger while also leading to safer code

Unit tests do help, and they are relatively easy in Truffle, the most used JS framework for Solidity. I guess I need to move to more of a TDD style than I'm used to.

In fact the tolling around Solidity and smart contracts is quite rich. It's possible to write unit tests, execute contracts code on a private chain in a similar way to integration/API tests, and measure the code coverage.

Sadly, it's not a common practice to develop contracts with full use of such tooling. See [0] for an analysis of the recent 2017 ICOs and their use of the tooling in crowdsale contracts. A few gems exist, that do quite thorough testing including a CI approach.

[0] https://medium.com/@bocytko/would-you-trust-your-money-to-a-...

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

#646

Earlier quoted context omitted.

Monero is the ONLY cryptocurrency where full privacy is enforced by default. No mixers, no opt-in mode, no super-nodes, no tumblers, it's all obfuscated by default. I'm very bullish on Monero long-term.

What I don't like about monero, and why I think it'll ultimately lose to another anon product, is that the transaction history is written to the blockchain, albeit in obfuscated form. But there is no proof on the bounds of what a sophisticated blockchain analysis can uncover given enough information. Roughly speaking, its conceivable that given enough transaction information downstream from a transaction of interest…

What you said is essentially meaningless though. "I don't like a blockchain-based currency because the record of transactions is permanent." Well...yeah, that's the whole point of blockchains. The strength in Monero's case is that everything is so obfuscated (and amounts + addresses are encrypted) that it's the best option out there. It doesn't have to be perfect, it just has to be better than its competitors.

e.g. Facebook isn't perfect, but it sure obliterated MySpace.

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

#647

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…

Can someone explain to me why they chose to make their own language instead of creating a DSL inside of an existing language?

This new language for Ethereum by Vitalik is exactly what you said: https://github.com/ethereum/viper

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

#648
post #260

Earlier quoted context omitted.

Poking around in that project, I don't see any specific tests of the Wallet contract... would be interested to see what UTs/STs were included if anyone knows where they are -- or was it just manually tested on the testnet? It seems that a basic set of UTs for this contract should have caught this issue. It's not even in the category of weird timing attacks or complicated internal states allowing unexpected state tran…

I've been writing some smart contracts over the last couple weeks and have learned a lot from OpenZeppelin's solidity repo–you can either use them directly (importing and extending off of them) or use them as a good resource for building tokens, crowdsales, etc–can't recommend them enough. https://github.com/OpenZeppelin/zeppelin-solidity

Agreed, it's definitely the way to go. Hope the project will continue to evolve. Both Aragon [0] and Storj [1] are making active use of them, if you look for example usage.

[0] https://github.com/aragon/aragon-network-token

[1] https://github.com/Storj/storj-contracts

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

#649
post #641

Earlier quoted context omitted.

How do you create unit tests for Solidity code? This would eliminate much of the need for a debugger while also leading to safer code

Unit tests do help, and they are relatively easy in Truffle, the most used JS framework for Solidity. I guess I need to move to more of a TDD style than I'm used to.

I cannot say enough good things about TDD, but YMMV. I also don't stick to it always... it's just that when I take the time to, my code clearly ends up better. I would imagine it's even MORE beneficial in code that deals with a money...

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

#650
post #461

Earlier quoted context omitted.

99 out of 100 questions. Solidity is ostensibly designed to let people write smart contracts for Ethereum. More realistically, it is a marketing tool for enabling and onboarding people onto the Ethereum platform, which Ethereum benefits monetarily (enormously so) from. Security and design are secondary goals to the extent that they help prevent disasters which hurt adoption or churn developers away. Through this lens…

Being a good, secure language for writing smart contracts is absolutely one of the most important goals for Solidity. I can say so because I have been involved as a regular contributor to the compiler for more than a year. If onboarding a lot of people to the platform quickly were the goal instead, they would have ported some crippled version of Java or JS and called it a day. The problem is that it's just not easy t…

These things are not just details. Things like scope, mutability, and operator precedence are core language design decisions.
Post reply on HN