News for hackers. Stuff that matters.
Re:$600M taken in largest DeFi hack to date by clpm4j on Tuesday August 10, 2021 @02:41PM (#28132560)
"Code is Law" unfortunately glosses over the fact that most code is not very well written.
Re:$600M taken in largest DeFi hack to date by variaga on Tuesday August 10, 2021 @06:30PM (#28135552)
I think it's worse than that. I think the core problem is that the world is a messy complicated place and any time you take a simple, straightforward set of rules and require strict obedience to them in the real world, you're going to end up with situations that produce absurd results.

It's like trying to fit a finite-term polynomial to a fractal - there's literally no way to make things match up everywhere. [1]

People complain because law/finance/whatever seem to be too complicated, so they try simpler, more "obviously correct" sets of rules that perform even worse in practice than what we already had because the world is still a fractal, and simpler rules just mean you're trying to use fewer points to fit that infinitely complicated curve. It's easy to look at existing law/finance/whatever from the outside and say "it's too complicated, we should refactor everything from first principles" but there's good reason to believe that is always a mistake [2].

Simple, obvious rules like "Transactions should be immutable once they are completed" seem like a good idea, but then they encounter incredibly common real world situations like "what if somebody made a mistake when they specified the amount of the transaction or the account number in the 'to' field?" Real world finance has ways to handle this - if nothing else, you can take it to court and ask a judge "does this seem reasonable?". "Code-is-law", like Procrustes "perfect bed", only has admonitions to be completely perfect yourself or suffer the consequences.

So IMO it's not just that most code is not well written, it's that the very idea that any finite amount of code, no matter how "perfect", can be a good fit for all the intricate needs of the actual lives of billions of people is fundamentally flawed.

And also, most of the code is not very well written :)

[1] as an alternate analogy, it's like trying to fix Godelian incompleteness in a formal system by adding a finite number of axioms.

[2] https://www.joelonsoftware.com/2000/04/06/things-you-should-...

Re:$600M taken in largest DeFi hack to date by tvirosi on Tuesday August 10, 2021 @02:45PM (#28132590)
"code is law" unless those with concentrated power doesn't like the code
Re:$600M taken in largest DeFi hack to date by beeboop on Tuesday August 10, 2021 @03:20PM (#28133009)
just like with real laws
Re:$600M taken in largest DeFi hack to date by Tepix on Tuesday August 10, 2021 @02:56PM (#28132736)
The same applies to law (loopholes for tax evasion etc) yet we follow the law to the letter.
Re:$600M taken in largest DeFi hack to date by lazide on Tuesday August 10, 2021 @03:03PM (#28132828)
Well, we don’t follow the law to the letter basically anywhere. The law gets interpreted and judged by courts (at least in the English common law tradition, though it happens to some extent everywhere), precisely because people generally dislike someone doing something against the spirit of the law, and using technical terms to try to pretend it’s ok.

Doesn’t stop people from arguing that no one could tell what the intent was, or the intent was actually what they did, or the law was so badly written that they are right because. And sometimes they win. But it’s rare.

Re:$600M taken in largest DeFi hack to date by only_as_i_fall on Tuesday August 10, 2021 @03:05PM (#28132849)
Not really. The US is a common law system. The letter of the law is secondary to judicial opinions by definition.