Hacker News new | past | comments | ask | show | jobs | submit login
Simple Contracts are Better Contracts: the Meltdown of the DAO (blockstack.org)
189 points by jackaltman on June 18, 2016 | hide | past | favorite | 102 comments



How many of the TheDAO Curator members are lawyers?

Contracts are agreements that are meant to be legally enforceable. The enforcer has always been the King, a local governmental authority and a third party. The very concept of a contract assumes the neutral third party. That third party is to interpret the contract, identify potential scoundrels, nullify illegal contracts and generally make sure everyone isn't playing games. Smart contracts seek to sidestep that ancient structure by replacing the neutral third party with an inflexible machine. Good luck with that.

Contract language is also meant as a manifestation of intent. Smart contracts seek a perfect manifestation, dismissing all notions of imperfect knowledge or misunderstanding. Typos rarely matter in real contracts. Intent can trump language where appropriate. But in smart contracts typos are everything. Good luck with that too.


I'll make a prediction about where this is going longterm. Smart contracts will take off despite their rigidity but we will start writing them to include common law arbitration protocols. The arbiters will initially be 1 or more human but as the block chain begins to evolve it's own common law(s), fuzzy machine arbiters will emerge to fill the "incompleteness".


>>... to include common law arbitration protocols.

That's a great example of the sort of ambiguity that an arbitrator must deal with. Do you mean to refer to "the common law" as in the body of law descending from the brits, or do you mean the common law principals of precedent and authority? Or do you mean only the concept of precedent by which past decisions under similar fact patterns are used to inform decisions regarding new fact patterns. I have some assumptions based on your choice of language and my best guesses as to your cultural background, but good luck finding a machine capable of such understanding. If we crack that, then much of our culture is moot and the robots can be left to run things.


I mean a "concept of precedent by which past decisions under similar fact patterns are used to inform decisions regarding new fact patterns." Without the need for territorial jurisdiction there will be many competing (but still distinct) common law groups. Signatories would pick a lineage at signing (npm install JAMS).

We'll start with human only arbiters, (panel of three from JAMS for example) then moved to mixed panels, then totally mechanical arbiters will handle most disputes once they're good enough.


then totally mechanical arbiters will handle most disputes once they're good enough.

I'm not seeing it. Who's going to enforce the outcomes of machine dispute resolution? I mean, who's going to even want to sign up to the machine dispute resolution? Not me, no way, that's the freaky dystopian future we're supposed to be trying to avoid.


> I mean, who's going to even want to sign up to the machine dispute resolution? Not me, no way, that's the freaky dystopian future we're supposed to be trying to avoid.

Hell, that was a plot point in a 1987 episode of Max Headroom, "The Blanks", where a "blank" (someone who has erased themselves from all government databases, which is a crime in the world of Max Headroom) protests after she is tried by a computer that she has a right to be judged by a human but the prosecutor points out that as a "blank" she "has no rights" (implying that if she was not a "blank" she would have such a right).


Business wants a reliable and predictable legal system. They don't care that the judge has a pulse. If the machine looses it and starts making terrible decisions, people would just start using a different arbitration group. You could probably even update old (well written) contracts to accommodate that.


Business wants a just and fair legal system.

Reliability and predictability are extraordinarily easy. For example: he who pays the most to the judge wins. That's very reliable, very predictable. It can be automated. Decisions can be taken instantaneously with absolute and perfect certainty as to who should be the victor. But it isn't just or fair, nor is it friendly to business.


Business wants to maximize profit. It supports justice and fairness to the extent that they aid the production of profit and absolutely no further.

A just legal system may be imposed upon businesses, but the desire of each business is to transform that system into one where it receives maximum benefit for minimum expenditure.

Your example isn't desirable because it maximizes expenditure, not because it minimizes justice.


I am from Brazil.

You are right, and wrong.

Your second paragraph is right.

Your first, depends. The tiny businessman will claim he wants fair courts, but the big business love the predictable and reliable courts, because they save time and money when making decisions with legal repercussions, and are great for those with money.

Brazil economy tanked recently in part BECAUSE courts suddenly become actually fair, sending several corrupted companies, and their thousands of (mostly innocent) employees to their doom, and making rich people wary of investing, because now they are unsure about their own future, and the corrupt ones fear for their future.


Business wants a legal system that will rule in their favor.


I cannot wait until I can do UNIDROIT[0]-compatible contracts in Rust using Parity[1]. building an implementation of UNCITRAL Model Law[2] would be the biggest market disruption I could think of. Imagine being able to do ex aequo et bono (think Judge Judy/small claims rules) arbitration; even with human (flawed/biased) arbitral tribunals, this would be amazing.

ROSS is killing the need for lawyers, and this is the path to killing the need for judges. Software is eating the world, and i couldn't be happier.

0. http://www.unidroit.org/english/principles/contracts/princip...

1. https://ethcore.io/parity.html

2. http://www.uncitral.org/uncitral/en/uncitral_texts/arbitrati...


>then totally mechanical arbiters will handle most disputes once they're good enough.

It seems to me that any such arbiter would need to have the practical ability to interpret the human intent behind imprecise/incorrect language and author/fix code. I think that would be a major advance in computer science and the most important application would be writing software.


You're being pedantic. Contracts explicitly specify the arbitrator, such as AAA or JAMS. More info at http://arbitrationnation.com/arbitrationnation-roadmap-when-...


Yes but that is a flesh-and-blood arbitrator. We are talking about coding the arbitration process into a machine. Being pedantic is exactly what happens when one tries to express cultural norms in the exact terms used by mechanisms.


If you could capture the entire logic in code, it wouldn't be arbitration, it'd just be a feature of the smart contract.

The way you'd encode an arbitration clause into a smart contract is making the arbitrator an oracle. That makes it a part of the smart contract, but it's still resolved by an external arbitrator.


That's fair point.

""So I’ll start there, and imagine that there are semi-trusted ‘oracles’ that compete to be the most reliable and trustworthy verifiers of contracts. People involved in contracts choose N of them, and then require that contract conditions be validated by one or more of them before the contract pays out. Pick more than one so no single oracle can steal the contract’s funds, but less than N in case some of them go out of business or just aren’t around to validate contracts when it is time for the contract to pay out."

http://gavintech.blogspot.com/2014/06/bit-thereum.html

So you can "just" write contract in some language so that: - it will cover most of cases without human intervention - if there will be bug with code oracle will read (as human) content of terms to get idea about contract intent (basically dispute)

But it seems that good marketing and some really interesting technology can switch focus from asking basic question - "we are trying to solve existing business problem or just create cool tech?" And yet when i read blogposts about ethereum i see more and more complicated contraptions (ruby goldberg machines in fact) and reason why this whole thing is even build is not clear.


Right, the point is that the arbiter can evolve independently of the contract logic (via establishing new precedent). The contract would just specify a unique, unforgeable designator for the arbiter to use.


Am I correct in thinking that a smart contract has to be open source? Because there might be good reasons to keep the arbitration oracle's source code secret.


No, multiple parties could execute a smart contract between themselves, and keep the code private. Smart contract just means it's a contract that gets executed through code.

Even in the case of a public and decentralized platform like Ethereum, I don't think there's any requirement to make it open source. Further, I think with Ethereum, a smart contract is made up of compiled code and a Application Binary Interface (defines what functions can be called in your contract), so it could be possible to never even share the source publicly. I've never written an Ethereum smart contract so this is just my understanding, and I may be wrong.


Pretty clear to me that he's talking about creating/evolving new common law, in the vein of the living body of common law descending from the Brits


>> in the vein of the living body of common law descending from the Brits.

Does the speaker recognize the various forks of that body of law? The US/Canada/Australia and others split many years ago and are now developing their own versions. I assume the OP is speaking of them collectively, but try asking an American whether Canadian cases should be relevant to US decisions.


The US has 50 versions, not 1


It;s actually much more than the 50 states. There are the territories and the feds. Then there is the precedent used by various boards and committees such as the NLRB. Canada and the UK have similar splits (ie scotland) but the biggest and most relevant divide is that between nations.


Yep. This is what I meant.

I'd add that there could be many competing common law lineages and that contractees would selecting one when they draw up a contract.


For example:

either party to this contract submit a signed request for arbitration within the escrow period of this contacts then

1) a panel of 3 arbiters from the New Atlantis Common Law Arbitration Group will be selected at random.

2) 50-ETH will be set aside for court fees.

3) The panel can execute any 1 of 5 events by submitting 2 of 3 signed tokens. If the panel cannot arrive at a consensus, one token will execute at random.

Many competing standard arbitration packages will develop.


If the panel cannot arrive at a consensus, one token will execute at random.

Hang on, this isn't the casino. Contracts don't usually have a 'random outcome' clause, do they?

I think we better take this to the courts.


>> Contracts don't usually have a 'random outcome' clause, do they?

Like in a betting shop? When I lay my chip on "red" then I am entering into a contract with the casino. A random event can be a term in a contract, but you are correct in stating that in the case of a dispute we do not allow a coin flip on the "who is right" question.


Whether the random number is pulled before the hearing (picking just 1 judge instead of 3) or after (by picking one vote token at random) seems the same to me.


Maybe I'm missing what you're getting out? It seems like you're suggesting dispute resolution should have a "fuck it, let's flip a coin" option?


I'm saying that it kind of already does. Judges are picked for a case partially at random.


That's why smart contracts will be really lousy for things that traditional contracts are used for.

But on the other hand, there are some simple - yet important - things that can be implemented in smart contracts pretty easily. Say, futures, or stock options, or certain kinds of insurance. For these things smart contracts are great because they offer extremely cheap enforceability and speed.

This is a textbook blue ocean, or innovator's dilemma. The new tech is much worse than the old one in some cases (enforcing intent), but far better in some other ones (speed, enforceability, global access)


Typos rarely matter in real contracts. Intent can trump language where appropriate. But in smart contracts typos are everything. Good luck with that too.

The City of Cleveland and Frank McCourt would like to have a word with you about your novel theory. In real contracts, typos--like an errant comma--can be significant and completely change the meaning of the language. Cleveland lost the original Browns because of a typo; McCourt lost the Dodgers in part because of a typo.


In those cases the court found the intent manifest in the language. These were sophisticated parties with legal advice. Even if they court didn't see intent, it is within the courts' power to force such persons to follow the language if for nothing else than to serve as example to other negligent contract drafters.

A court will only grant that which is asked for. So for a typo to matter, one of the two parties before the court must be claiming that is isn't a typo.


There are also cases of people selling cars (and other stuff) ultra cheap on ebay, because they misplaced a comma when specifying a price.

It was obvious that the price was supposed to be $20k, not $20.000, and yet the seller lost.


Prices for the sale of consumer goods are subject to some special rules, mostly to prevent bait-and-switch advertising. But actual typos happen all the time and are corrected. There are a great many instances of airline websites getting prices horribly wrong. These contracts are not normally honoured and wouldn't be enforced by a court (40,000$ tickets for 50$ sort of things). Much depends on the specific facts and whether the price is obviously a mistake.


I once read a story told by a young U.S. lawyer who happened to come from one of West European countries and thus had a specific cultural background. They were in the middle of finishing a deal and when he was re-reading the contract, he noticed that he made a typo and turned $1.5M they were to pay at some stage into $15M. And the contract was already signed! In horror he went to the business owner and confessed. It was a revelation to him when the owner took it very lightly and told him something like: "It's OK, I'll just phone them and we'll have this fixed."

(And it wouldn't stand a chance in court either, because a simple calculation would show this couldn't possibly be a right sum for a sane person to pay for whatever the contract was about.)


> Contract language is also meant as a manifestation of intent.

I challenge you to create a formalization of the intent and create a better programming language for smart contracts that includes intent. I could imagine quite well that intent could be formalized to some kind of "firewall" or "sandbox" rules for the smart contract, i.e. that if the execution of the smart contract violates these rules, it will, for example, be canceled by the system.


I would counter with the concept that any valid interpretation of intent must come from one with cultural understanding. Machines do not have cultural understanding. They cannot identify language/intent clearly in violation of cultural norms. Before attempting the intent code, I'd first need to see a machine capable of understanding why Shylock's pound of flesh was an illegal contract.


Machines don't understand. They simply compute. It is up to the programmer to have them perform the appropriate computations.


The fact that machines don't understand doesn't entail they can't understand given a suitable model for what constitutes "understanding". We simply lack such a model.


We can define words to mean whatever we want. The machines under consideration are algorithmic, defined by simple logical rules that allow the next state to be derived from the previous. Any understanding within a model comes from the algorithm, not the machine.


If the machine knows Asimov's three laws of robotics then it will know that Shylock's pound of flesh cannot be had.


Asimov's Three Laws aren't a replacement for the whole system of human values. His robot stories are full of robots doing strange things that conflict with human intuition but are aligned with the Three Laws. Asimov himself recognized that the laws were not sufficient, and added the Zeroth Law as a workaround:

"A robot may not harm humanity, or, by inaction, allow humanity to come to harm."

But this law is vague and difficult to interpret. The Laws of Robotics are not a formal specification of ethical behavior. From the point of view of a fiction author this is no problem. The ambiguities allow for more exciting stories. But when real human lives are at stake, it's a serious problem. "Friendly AI" is a non-starter if we can't even define what "friendly" means.


I think the whole idea of these stories was to find ways these seemingly simple and straight laws can come into amazing deadlocks.


Intent is simply the will of the party manifest. If each party presents their will, there is no misunderstanding. Conflicts of will can be treated like merge conflicts and resolved in the meat space.


(I'm not a member of The Dao, although I do have some Ether. I switched from engineering to law in the early 90's.)

I'm sure there are some lawyers who got involved--I was tempted to get some experience with the concept early on. I decided not to primarily because the basic concept of crowdsourcing decisions where the ownership interest determines who has most of the voting power and the major holders are likely to be new at it strikes me as, frankly, a silly idea.

But even if all the participants were lawyers or represented by lawyers there are still going to be bugs. Pick up any set of service terms for just about anything and there will be logical flaws. It's just human nature. There is no such thing as a perfect contract.

To me the most interesting thing about this episode is that The Dao included limitations imposing an time lock on withdrawal that gave the community some time to consider what to do and the pros and cons re the whales in the Ethereum community doing a hard fork in the name of justice.


I don;t think lawyers could help with bugs, but their absence could be telling. Most of the lawyers I know wouldn't go anywhere near this sort of thing. A board of directors, or any other governing body, without any lawyers makes me suspect those that were asked fled the project. Or that the organizers deliberately didn't approach any lawyers because they knew what they would say. Anyone with a background in contracts, specifically dealing with contracts gone sour, would see red flags all over this concept.


> Contracts are agreements that are meant to be legally enforceable.

You have hit on an important point, but like most commentators here and elsewhere, you seem entirely to have failed to recognize its significance. In the American and English tradition of common law, a contract is an agreement made with the intention that it be subject to legal enforcement [0]. Not every agreement is meant to give its parties recourse to legal remedy, and hence not every agreement is a contract. That is, not every agreement is subject to contract law [1].

It is of little significance that people in the Ethereum community (or in the broader crypto-asset community) have taken to calling their programs "smart contracts"; the name signifies nothing. In the main, and particularly in the case of the DAO, it has been made clear, ad nauseum, that these programmatic agreements are not meant to be subject to legal enforcement; in short, it has been emphasized from the start, and at every intermediate step, that smart contracts are not contracts in the legal sense. Indeed, the major motivation for the development of programmatic agreements (i.e., "smart contracts"), has been to supplant enforcement de jure by enforcement de machina.

The law allows for agreements that do not have the force of law behind them, and naturally the law says little about such agreements. For this reason alone, absent separate provisions which purport to invoke legal enforcement of the intent behind the code that implements a smart contract, it is perfectly reasonable, legally speaking, to argue that prima facie these agreements are not subject to contract law.

Thus the independence of programmatic agreements from legal constraints is legally plausible; this is a very different situation from the legally absurd arguments put forth by some crypto-zealots that, for example, transfers of cryptocurrencies are not subject to laws restricting money transmission.

Now, might a judge decide that any particular programmatic agreement—or "smart contract"—is in fact a legal contract? And that therefore the judge, not the code, ultimately determines who gets what? Sure. Judges tend to decide that they get to decide, when there's any question about it. But it's not unreasonable to imagine that a judge might really say, "No, this is not a legally enforceable contract. It says so right on the box." And if that happens, then what the code says goes.

0. https://en.m.wikipedia.org/wiki/Intention_to_be_legally_boun...

1. Beyond the determination of whether the agreement is legally a contract, I mean. In particular, I mean to point out that a so-called "smart contract" might well be legally deemed not to be a contract at all, and therefore not subject to the provisions of contract law that give precedence to the parties' intent in the agreement over its literal interpretation. In other words, if a programmatic "smart contract" is not legally a contract, there is no legal reason that the law should favor any outcome other that what the code's execution ordains, or that the law should say anything on the subject at all.


Nothing wrong in principle with having a mechanical third party. You just have to actually write your contracts correctly.


It seems simple enough to include a fallback mechanism to human judgment in times of extreme error. Maybe requiring 90+% consensus from members, or something like that. Obviously, TheDAO didn't have that, and explicitly precludes any fallback to traditional systems in its documentation.


and explicitly precludes any fallback to traditional systems in its documentation.

Which is, of course, nonsense. You can't document your way outside the law. Not in any country I'd want to live or conduct business in anyway.

If enough of any one persons money is involved you can bet there are lawyers right now trying to working out who to sue.


Can code both embody and replace law for the exact function for which it is set up?

DAO strives to execute through code an idealized pooled investment system by which contract issues are resolved entirely by code and wholly apart from any external societal legal or enforcement mechanisms.

All well and good but, where people are involved, code simply cannot define all the relations needed to capture what the law does (and, indeed, and in spite of its flaws, does very well indeed).

Consider the argument that the exploit here is not a flaw at all but just another variation on what the code does, with the result that investors who suddenly are $50M lighter in their wallets have not been harmed at all and should have no recourse to any remedy to restore their funds to them. The idea here is that the code is the contract and, if that is what the code does, well, that is what you bargained for, whether this is good or bad from any particular moral perspective. Right at the entry point of the system is a prominent disclaimer that says this in exact words. So a contract is a contract. If you don't like the result, tough.

The participants here are wealthy and presumably sophisticated investors. What if they aren't? What if this were marketed to a lot of gullible small investors who were induced to part with their money through various representations stating that their funds were entirely safe, subject only to normal investment risks relating to the underlying companies they funded? What does society do when people like this lose their life savings when some newly discovered "feature" of the code allows a sharpie to walk away with their funds? Are they to have no legal recourse because a "contract is a contract," especially if it embodied in code?

And what happens if a system is set up and the person or persons who find the new "feature" enabling them to walk away with other people's funds are the very people who organized the fund? Does law from the broader world step in to provide a remedy to those who lost their money? Or does the "contract is a contract, especially in code" logic work to deny any remedy to the participants here as well?

And, setting aside any of the more extreme examples, what if it is simply the case that those who did participate had reasonable expectations that any code that would define and limit their rights would do all that was expected in terms of defining their investments but would include safeguards that would prevent anyone from simply coming in to remove their funds altogether (dare I say "steal")? What if they were misled into having such expectations by promoters of the venture who said or implied that such safeguards existed? Is it enough to say that none of this matters because of some disclaimer buried in fine print? Is all of this simply irrelevant just because a "contract is a contract, especially in code"?

Contracts are part of any system of law that includes private property, and a very important part at that.

But contracts can never define the totality of the law that applies to a given situation, even if the parties swear up and down that that is their intent.

That is why securities laws exist, to help investors who get swindled by sharpies with well-honed contracts.

That is why the laws relating to fraud exist, to help those who are misled by others to their financial detriment.

Indeed, that is why a sophisticated body of laws exists relating to contracts themselves, to cover cases where the intent of the parties is sometimes so frustrated by one thing or another as to make it inequitable to enforce a contract.

Law is and always has existed in multiple layers. Legislatures pass statutes but courts exist to interpret them to cover specific cases as disputes arise. The same with administrative regulations promulgated by agencies. Even within the courts themselves, common law courts would declare legal "rules" only to have courts of equity intervene to correct things where the "rules" led to harsh or inequitable results.

Basically, all of this is another way of saying that human relations are complex and any system of laws and justice needs to be able to handle such complexity if it is to be worthy of being a system of justice.

Perhaps in narrow cases, things such as DAO can be set up to create a rich guy's playground of sorts in which, for the overwhelming number of cases, outside laws play no part within the self-contained system. Perhaps there is even an ideal of some type to be realized here (get rid of lawyers, etc.).

But no such system can ever be utterly divorced from the rules of the broader society. Ideal or no ideal, this is just not how the law works. Apart perhaps from some survivalist society or other, people simply cannot exempt themselves from the general rules of law no matter how much they desire to do so. They can limit the application of such broader laws to a degree but, when key bounds are transgressed, the law will apply in its full force regardless of their intentions.

So, I would say that the curators here probably had no choice. It was either do what they did or watch as lawsuits followed, probably in abundance. This may have violated some ideal in play here but it was a pragmatic necessity given how law in reality works (and always will work).


> But contracts can never define the totality of the law that applies to a given situation, even if the parties swear up and down that that is their intent.

I think this is true, and this is probably all you had to say.

> Can code both embody and replace law for the exact function for which it is set up?

Sure, yeah. 99.9999% of people in rich code-enforced transactional systems like EVE Online and the NASDAQ order book are content with how code has replaced and embodied the "law" (or more broadly, "how things work"), despite the fact that people win and lose at this video game and in the real stock market all the time. It's clearly not just about people being mad and losing a ton of their money, because that happens in the stock market all the time but losers rarely sue NASDAQ.

It's just when people do sue NASDAQ, hilariously, it's when there's bugs in the order book / exchange code, or shutdowns of the market due to technical errors. Do you see how that is different? What matters isn't whether or not a "contract is a contract," but whether or not there are bugs.

A bug is a concrete thing. It's not something you can abstract away into your bigger point about "human relations" and a "system of laws."

You can write a test for nearly all kinds of bugs and show very confidently that whatever the issue was, it won't happen again. There's no such thing as unit tests for laws, unless you get so abstract as to lose everything essential about unit tests. You can reproduce bugs in code infinitely, but you don't get to re-adjudicate disagreements in contracts infinitely. There's so much that's different between disagreements over legal interpretations and a software bug that you're missing why people view the fork as relatively uncontroversial.

There was a bug in the code which led to an exploit. It isn't a refutation of law being embodied in code. It's just a refutation that this particular exciting contract system wasn't treated like the multi-hundred-million dollar software product it turned out to be. The story is smaller than you make it to be.


There are two fundamental problems with Etherium contracts.

1. They're executable programs. They could have been a set of declarative rules listed in priority order, but no, the designers went overboard and made them general programs with loops and recursion. There are straightforward ways to analyze sets of rules; they're usually amenable to case analysis. It's hard to analyze programs.

Writing a declarative contract language is a challenge. But doing so forces the designers to think through what they want the system to be able to do, and what they don't want it to do. Doing contracts as executable programs is punting on the problem. It says "we don't know how to do this, so we'll dump the problem on the users."

2. The stack overflow problem is idiotic. The system should have been designed so that if a program aborts, anything it did is rolled back. That's the design flaw this attack exploits.


To be fair, ethereum has bytecode at its base- almost certainly someone will wrote a more declarative language on top of it now to help minimize the chance that unexpected calling trees can lead to unexpected behavior.

Also, the existing solidity language is pretty well designed, it's just a hard problem and an even better design may be needed.


> To be fair, ethereum has bytecode at its base- almost certainly someone will wrote a more declarative language on top of it now to help minimize the chance that unexpected calling trees can lead to unexpected behavior.

The mismatch between executable code and high-level language is a known attack vector called the "full abstraction" problem. This has already been used to subvert the CLR and the JVM. If your bytecode is not inherently secure, and you permit executing arbitrary bytecode, then any language running on top that builds more sophisticated invariants that aren't enforceable via the bytecode are very likely vulnerable.


Almost certainly someone will wrote a more declarative language on top of it

Papering over the mold seldom works. It makes things easier, not more reliable. See C++ templates.


Note that putting a language on top of the existing language won't prevent VM stack overflows of the type used in the attack. It's more likely to hide them.


A better example is Haskell, which usually compiles down to a low level C dialect.


Any language can compile to the low level C dialect.


Bailing out the DAO undermines the core value propositions of Ethereum - contract immutability (stability) and decentralization. I understand that the argument is "this is a special (ie, too big to fail) case; however, who can be sure?

IMO the better way to handle this is to acknowledge the mistake and let it fail. It's embarrassing I get it. Honestly, the big bank types who threw millions at this tech without doing due diligence deserve to lose their shirt. It's called speculation for a reason.

If the core team cares about the long term credibility of the project with the people who real matter - the tech community - they will not bail it out.

Edit:

For anyone interested, there's a really great discussion on this subject at the Ethereum reddit https://www.reddit.com/r/ethereum/comments/4oiqj7/critical_u...


"Simple Contracts are Better Contracts" has always been the mantra of the Ethereum and DAO team. Most times when a security question was raised, "simple contracts" was their defacto answer [1].

This exploit suggests that the most competent developers in this space, who always preached simple contracts, are not yet able to consistently write secure contracts.

Also, the OP states the importance of being able to update a contract. As of last year that meant the original contract MUST include a self-modifying code provision. Self-modifying code doesn't align well with keeping your code simple.

As an aside, "contracts" are Ethereum's raison d'être and the Ether currency value is largely based on adoption. Even though this exploit did not expose a flaw in the Ethereum block chain, the Ether sell-off is an expected consequence.

Lastly does anyone have a link to the original contract code and how it could be rewritten so that it isn't vulnerable to this exploit ?

[1] https://www.youtube.com/watch?v=cahj4WJtp20 Q&A at 42m44s is relevant.

Edit: corrected time stamp for above video


"Most competent developers"? There are probably thousands of better informed developers/researchers who would not attempt to set up such a company before they have stronger formal guarantees.

Of course, if you want to be first-to-market, none of that seems to matter.


Strong formal guarantees are complicated see? and we run around telling ourselves that simple is better, so we keep writing shit code.


Most Competent Marketers


Simple contracts then are only as scalable, reliable, and secure as the code that runs off the blockchain.

Arguably, that defeats the whole purpose because it is then who controls the code (since it is no longer decentralized), controls the contract.

If I'm reading this right (I'm not 100% sure of that), this is the equivalent almost of not running a blockchain at all (if the idea is taken to its finality).

Storing the who and the what of contracts has never really been the issue, its been the execution and the honoring of the contract that man has not yet solved.

But centralizing the code that runs the contracts, and taking it off the blockchain doesn't sound like the way to do it.


What is supposed to give us the impression the problem of contract execution hasn't been solved?

A huge majority of contracts are never disputed, carried out to completion or ran as a going concern without any issues. Contracts are routinely renegotiated when one or both parties have a change in circumstances, or at specific time intervals. Only a very tiny fraction of contracts are ever disputed, and fewer of those reach the courts.

I don't understand the problem trying to be solved here.


>> I don't understand the problem trying to be solved here.

Lawyers. They want to get rid of the lawyers.

It's a common desire. Like politicians, you want to get rid of them up until the day you actually need one. That day may have come for smart contracts. Does anyone here doubt TheDAO are now seeking legal advice on this matter?


Exactly. If you write a crummy contract but believe it is sound, then set out to convince other people of it soundness, and they sign up and pour their money in, and then the contract leaks, who's responsible? ... well, next minute: lawyers.

We'll first have to invent, and deploy at scale, the immutable person before we can have the perfect contract 100% of the time.

So long as people change, minds are fallible, misunderstandings and disagreements continue to occur, interpretation and intent are going to be fuzzy.


>>its been the execution and the honoring of the contract that man has not yet solved.

I think we've worked it out. Billions of contracts are executed and honoured between flesh-and-blood persons every day. 99.999999% work without issue. A few wind up in courts, but I'd still call that a very good track record.

(Yes I said billions, read up on all the various forms of contracts. Anyone reading this likely enters into and honours a dozen contracts in a typical day.)


> Billions of contracts are executed and honoured between flesh-and-blood persons every day. 99.999999% work without issue.

It's a great point about volume. However a huge number of legal cases + contracts never get started in the first place because of cost. So those would be absent from your success rate.

To put it bluntly there is no point in writing a contract for a $200 dollar job. Countless little guys get screwed over every day because of this. Ultimately they work by handshake deals or through family businesses because working with larger corps is a headache. My father for example had to pay 200 euros for a large firm he worked for to process some paperwork they also invented. That is; a firm that he works for, he has to pay them money, in order to be hired by them in the future. This is probably illegal but this is what happens when you can't risk finding out whether this is a breach of contract. That seems like a failure to me.

That's where I see digital contracts making a real difference. Making the legal system comprehensible and inexpensive for the working poor.


>> ... there is no point in writing a contract for a $200 dollar job.

You don't need to "write" a contract for a contract to be in place. Contracts can exist between people who are illiterate, even those who cannot express themselves. A contract is a state-sanctioned and enforced relationship. The document is just one form of evidence useful in defining that relationship.


There are more types of contracts than written contracts. Even handshake deals can be considered contracts (though you'd need evidence that the agreement happened as well as evidence that all of the other conditions for enforceable contracts apply). Paper contracts exist so that there is a very clear statement of intent, but that's just one kind of contract.


It's not like honoring contracts is unsolved.

Bookies have been doing it forever with questionable effectiveness.

PayPal offers arbitration on stranger to stranger sales. Again with questionable fairness in tough cases.

Kickstarter et al are doing a pretty good job as arbitrators and collecting money and issuing refunds more or less fairly.


I do see room for improvement in efficiency.

Kickstarter and PayPal surely have large teams working on arbitration, review and fraud that could be delegated back to the involved parties vote with some rules.

And law suits can be very inefficient.

This absolutely could be solved without a block chain.


This absolutely could be solved without a block chain.

I fail to see how, because a blockchain is just a continuously-growing list of data records hardened against tampering and revision[1].

A blockchain can't compel nor force me to action or inaction, nor enforce any legal penalty for inappropriate action or inaction.

The courts exist as an attempt to resolve differences between peoples interpretation of right and wrong, "slap a blockchain on it" won't change that.

1. https://en.wikipedia.org/wiki/Block_chain_(database)


How can code on a blockchain decide whether an eBay listing was fraudulent without paying humans to make the determination? Unless you have a general AI up your sleeve!


I don't understand how arbitration would work. Say "A" buys something from "B". Later "A" complains what was shipped isn't what he ordered. How do you solve this with a blockchain and votes?


As a software engineer everything here rings true to me.

Use as simple of tools as possible when programming and offer many ways for mere humans to change code and review correctness and review, approve and roll back critical transactions.

But this sounds effectively like the status quo with credit cards and Kickstarter.

So I'm not sure what a blockchain adds other than a different platform and maintainers than the existing financial and group purchasing corporations.


The AI equivalent to a recursive call bug are self-replicating Von Neumann probe paperclip maximixers that consume the entire universe. We're going to be in a world of hurt if we aren't able to sort this out. It's pretty essential that machines are able to discern our intent or the spirit of our contracts one way or another.


Easy solution: just hide all of the paper in some other universe :) On a serious note, well said.


If the contract code can be upgraded by the majority of involved parties, it would be simple to buy 51% of the voting power and change the code to pay out everything else. Each takeover would double your wallet. Am I missing something here?


51% attacks are a known issue. A sustained 51% attack is pretty much an existential threat to any blockchain. So I doubt the issue gets any better when dealing with individual contracts.

https://blog.ethereum.org/2014/05/15/long-range-attacks-the-...

http://ethereum.stackexchange.com/a/544


Thank you for your valuable input. The problem I see is not in having 51% of the whole capacity of the blockchain, but of the smaller entities/organizations/contract codes. With the proposed simple contracts, the little 'start-up' contract codes with little voting power will easily get acquired by bigger ones, which then vote for a code change to pay out the remaining shares. This is much more realistic that the traditional 51% attacks. Letting the majority of a small DAO-like organization vote for code change (which translates to law-change) will not only be used to fix bugs, but to change the contract to the majorities advantage. This may eventually result in one single big contract code that incorporates every new organization on the horizon.


But isn't that how businesses and boards work anyway? A supermajority will gladly screw over anyone else on the board. Just look at "Silicon Valley", the whole plot is about how boards can screw over the founders.


It should be possible to define that you need e.g. 90% of the shareholders to approve a change to the contract. The 90% could still steal money from the 10%.


It is. The example code for a DAO [0] illustrates how everything from minimum quorum for proposals to margin of votes for a majority is configurable. However like you said, so long as the contract is mutable, it's possible for a majority to subvert it.

[0]: https://www.ethereum.org/dao


If simple contracts, where much of the code is off chain, are to be the way of things it begs the question, why do we even need Turing complete contacts in the first place. A blockchain could be created which has a few fixed rules which enable the basics of a DAO with much lower risk.


I ended up writing an article explaining my position on the whole thing: https://blog.simpleblend.net/dao-attack-whos-blame/


Thought this was a commentary on the poor API contracts exposed by data access objects


I may be stepping outside of my area of expertise, but doesn't this seem like a perfect place to apply formal verification tools? As long as the contract isn't too long, it should be possible to ensure that the implementation exactly matches the specification.


I really wanted to know about the Data Access Object.


Just from reading commentators here at HN, it doesn't seem like these issues were unforeseen. Rather, it seemed that whatever intense optimism exists around cryptocurrencies is capable of overwhelming investor sense in return for the promise of some ideological "win".


Yup. To be honest, the bug with the implementation of the DAO that allowed someone to appropriate most of its assets is the least of the flaws behind the concept, which was fundamentally "let's put our money in a pool and let the anonymous votes of pool members decide what to do with it", complete with a big disincentive to opposing to stupid or malicious proposals since refraining from voting was the only way to ensure your funds weren't committed to a "contract", and absence of anyone, anywhere being accountable for anything as it's chief/only selling point. Since when was that a $150m opportunity?


I used to run an Ethereum meetup and I was pretty much the only skeptic in the whole group. Everyone I encountered were "true believers."


I feel like this might be a semi-unpopular opinion, but frankly I'm getting tired of the idea that a blockchain is the solution to every single problem the human race faces.

There's this almost religious level of looking the other way whenever there's some sort of failure in a blockchain system, and they always say "that was a one-off situation"


I'm also finding the "blockchain all the things" concept ... perplexing.

I really don't understand the mechanism or dynamics.

It seems I'm not the only one.

There's a growing set of evidence of breakdown among institutions founded on or around Blockchain: Bitcoin, MtGox, Ethereum, others.

And a profound failure to either understand or acknowledge (and I'm not sure which of the two it is predominantly, or how much it varies by individual) what money, currency, and contract actually are.


I'm not a dumb person by any stretch of the imagination, and I actually got lost in the weeds when trying to read The DAO's website and what exactly it does and how it works.

(which is a hilariously confusing thing to name a brand; "Which DAO are you talking about?" "The DAO" "Yes but which one")

There's situations where blockchains are a good idea, but there's many cases where they aren't.


This is what it looks like to me. They couldn't see the problem happening because culture blinded them from thinking of things in such a way that would allow them to see this coming.


Yes, I agree with that. This was pretty clearly a bad idea from the start. But, to say so was being a "hater" and so forth.


Code is law! Ohh, ummm, err, uhhh, except when we say it's not.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: