Live data from Hacker News

Thinking About Smart Contract Security

blog.ethereum.org

51–60 of 85 posts

Re: Thinking About Smart Contract Security

#51
post #16
post #4

> The reason for this fundamental conclusion is as follows. All instances of smart contract theft or loss – in fact, the very definition of smart contract theft or loss, is fundamentally about differences between implementation and intent. This is, I think, to its core the fundamental problem with any kind of rigid language in contracts. It's nice to see an acknowledgement of its existence, but disappointing to see n…

I agree broadly - and the current DAO was a terrible idea on many fronts, but I'll discuss one quibble in case it starts a broader discussion. > You can't possibly create a smart contract to purchase a house, because at the end of the day the person that physically occupies the house is in the position of power. It's likely that if something like this ever succeeded, there'd be many parties that would provide bridges…

- The adherents are international, and may prefer a standardized form of law accessible cheaply and easily to all

I think this is undervalued, and probably going to become even more important in the future. Largely because it's something that the current legal framework simply doesn't provide.

We have tenuous legal agreements between nation-states (largely of the "we choose to obey now because it's in our best interest" variety). And we have legal systems that apply in a single country. But we really don't have an ironclad anything in the ether (ha!) between those.

Re: Thinking About Smart Contract Security

#52
post #48

Formal verification can be layered on top. One simple use case is as a way of proving termination, greatly mitigating gas-related issues. Another use case is proving specific properties – for example, “if all participants collude, they can get their money out in all cases”, or “if you send your tokens A to this contract, you are guaranteed to either get the amount of token B that you want or be able to fully refund y…

Because:

1. It's very hard to create a language that is both restrictive yet useful enough, without it being just as hard to verify (e.g. total-functional languages are not nearly restrictive enough to make some global properties easily provable; the only languages that make this somewhat feasible are finite state machines, and their expressiveness is questionable).

2. Even if that were somehow possible, it wouldn't solve the real problem, which is defining the right safety properties. However you verify safety, the hard problem remains what safety means.

Re: Thinking About Smart Contract Security

#53

Ethereum/DAO would be much less of a tire fire embarassment if the management had taken some time to learn anything about the basics of contracts and law, instead of making it up as they go and assuming the entirety of centuries of civilization has no clue what they were doing.

Its not that civilization has no clue what they are doing. It just hasn't integrated technological advances fully.

The recent problems were very technical and specific as well as being solvable from a number of approaches.

Re: Thinking About Smart Contract Security

#54
post #3

Is there one, solid as in time tested example of a smart contract working? Sorry in advance for my total naivete

There are lots of Ethereum contracts that have been working and that they can be pretty certain don't have issues. He goes into details of some types that are generally like that.

Re: Thinking About Smart Contract Security

#55

Help? I have no idea WTF is going on here. I've tried to search around for a clue but the more I read the more confusing it gets. At first it seemed that Ethereum was a kind of cryptocurrency like bitcoin (something that people could "mine" and exchange), then something about "contracts" that don't require trust, then something about it being effectively "a computer" that never stops, an investment system investing i…

Start with https://github.com/ethereum/wiki/wiki/White-Paper, I guess?

http://ethdocs.org/en/latest/ may be helpful.

Re: Thinking About Smart Contract Security

#56
post #26

Ethereum/DAO would be much less of a tire fire embarassment if the management had taken some time to learn anything about the basics of contracts and law, instead of making it up as they go and assuming the entirety of centuries of civilization has no clue what they were doing.

assuming the entirety of centuries of civilization has no clue what they were doing This is a common assumption in these circles, unfortunately.

I think that there is an interesting outlook here. It seems to me that some people are under the impression that the world is essentially simple, and it is stupid people and institution that complicate it. If we apply careful mathematical reasoning, we could find better solutions to anything.

The interesting thing is that about 100 years ago some mathematicians believed something similar about math itself. They believed that since we have formal procedures to reason about math, eventually we'd be able to understand (i.e. prove) everything we want to know. That hope was finally crushed by the discovery of simple, finite, small mathematical objects, that while subject to mathematical reasoning, are able to forever elude complete understanding and proof. Those objects inhabit a very large, unbridgeable gap between our ability to reason and our ability to fully understand (and prove). Those objects, of course, are what today we call computer programs.

If there's anything that proves beyond any doubt that even systems that operate according to a small set of rules, and subject to mathematical reasoning and manipulation, are still able to defy complete understanding -- even in theory, let alone in practice -- it is computer science.

Yet, even though computer science is the very discipline that proved that complexity that can arise even in the smallest of systems is essential and cannot ever be tamed, it is computer scientists and software developers who often attempt to challenge the very foundation of their own discipline.

Re: Thinking About Smart Contract Security

#57
The fundamental problem is that Vitalik (and rest of eth devs) knows the answer, but can't face it. If a tx gets revoked, ethereum turns into nothing more than a private-chain/bank-chain. What about the crypto-law, state revolution everyone in that crew have promised the users :(

Re: Thinking About Smart Contract Security

#58
post #4

> The reason for this fundamental conclusion is as follows. All instances of smart contract theft or loss – in fact, the very definition of smart contract theft or loss, is fundamentally about differences between implementation and intent. This is, I think, to its core the fundamental problem with any kind of rigid language in contracts. It's nice to see an acknowledgement of its existence, but disappointing to see n…

Any smart contract enforcement mechanism would necessarily rely upon some outside system Absolutely. This drastically limits the scope of smart contracts. You can do all kinds of interesting stuff with the contracts and digital money, like ponzi schemes, simple gambling games, and so on, but you can't link them with the real world without relying on some third party trust. And once you require trust, then you might a…

I don't see why this is a fundamental problem. At worst, a simple legal shim of the "third party law firm legally bound to do X if smart contract dictates so" would bridge pretty effectively.

Smart hardware locks sounds interesting. I'll have to read up on what they tried -- it sounds like a technically interesting problem.

Re: Thinking About Smart Contract Security

#59

Help? I have no idea WTF is going on here. I've tried to search around for a clue but the more I read the more confusing it gets. At first it seemed that Ethereum was a kind of cryptocurrency like bitcoin (something that people could "mine" and exchange), then something about "contracts" that don't require trust, then something about it being effectively "a computer" that never stops, an investment system investing i…

A few quick answers:

- Ethereum is a contracting language combined with a crypto currency; to run the contracting language requires miners to not only determine the solution to a puzzle (as in Bitcoin), but also to run code written by contract writers in a virtual machine[1]; the blockchain stores the results of these computations

There's a lot written on the DAO (just search HN), but a quick summary:

- A DAO is an autonomous organization that is self governing, with its by laws written into code - and often the potential to fork off if you disagreed with the majority decisions

- "The DAO" which caused the recent blow up was the first public iteration of this and was an investment fund meant to encourage apps on the blockchain, by letting others fund it and then vote on proposals to receive money

- "The DAO"had substantial flaws in how it was written, tested, and released

- This was very successful by funding metrics, but that is based on a highly speculative currency that had appreciated 30-40X in a few months (otherwise, it might have just been a few million dollar experiment)

- The flaws were pretty egregious (e.g., naming two functions essentially the same - and calling the wrong one, not putting in place proper mutexes) - and many on HN who worked on any mission critical code (e.g., finance, embedded systems) would be surprised at how quickly it was released without testing, community discussion, or a thoughtful rollout plan

- Yes, people are losing money in two ways 1) in "The DAO" itself, if the funds can't be recovered fully, 2) due to the price of Ethereum to Dollars/Euros which people own and trade (which has fallen 50% since "The DAO" issues, but that is still 10-15X up since late last year)

[1] Technically, Bitcoin miners also interpret contract code, but the language is more complex and limited - with the most popular Bitcoin contract to simply lock and unlock bitcoins

Re: Thinking About Smart Contract Security

#60
post #52
post #48

Formal verification can be layered on top. One simple use case is as a way of proving termination, greatly mitigating gas-related issues. Another use case is proving specific properties – for example, “if all participants collude, they can get their money out in all cases”, or “if you send your tokens A to this contract, you are guaranteed to either get the amount of token B that you want or be able to fully refund y…

Because: 1. It's very hard to create a language that is both restrictive yet useful enough, without it being just as hard to verify (e.g. total-functional languages are not nearly restrictive enough to make some global properties easily provable; the only languages that make this somewhat feasible are finite state machines, and their expressiveness is questionable). 2. Even if that were somehow possible, it wouldn't…

1. Starting from a declarative language (think XML), you might not be as expressive, but you would still have a lot of value and mitigate a lot of the potential problems.

2. Safety properties that fall back on current law could be added in case of dispute.

This scenario would still have great value as a smart contract.

Post reply on HN