For example, considering contracts are likely to be state machines (and the error in this case is a state machine issue), maybe an explicitly state machine-oriented language design would be good? I'm not familiar with academic research in this area but I have used a real-world one before, Linden Scripting Language, which incidentally is also used for what you could call “smart contracts” involving money, albeit not in a cryptocurrency environment.
Missing line in a smart contract leads to $10M hack
171–180 of 333 posts
Re: Missing line in a smart contract leads to $10M hack
#172Earlier quoted context omitted.
> so where does one draw the line between theft and just doing what the code allows? This is the heart of the problem with smart contracts. The theory is that the code is the law. There is no theft. There is no need to trust, authority, or arbitration. Of course, this only works when the smart contracts perfectly meet a correctly defined spec and have no bugs.
That's not enough, all parties would have to have 100% awareness and understanding of the smart contract, detail by detail. Real life contracts sometimes turn out to have non-enforceable clauses within our legal framework, or may be entirely invalid if, for example, signed under pressure or false pretense.
Re: Missing line in a smart contract leads to $10M hack
#173Earlier quoted context omitted.
Solidity is a DSL. DSLs have their purposes and this happened to be a correct purpose. It just also happens to be that Solidity is a terribly designed language.
In what way is Solidity terribly designed?
Re: Missing line in a smart contract leads to $10M hack
#174Earlier quoted context omitted.
Yeah, that's my question with all this. I mean, ransomware is obviously illegal. Finding vulnerabilities in smart contracts - well, "the code is the contract", so the hacker is just executing the code as it was published. I mean, the whole reason Ethereum Classic exists is because a subset of Ether folks felt that restoring the funds in the original DAO hack was contrary to the whole "the code is the contract" ethos.
Ignoring contract law (which would not blindly accept "the code is the contract", and people's ethos does not allow them to arbitrarily decide how contracts shall work in the country where they live), the fact that some action was explicitly written in a contract that was properly signed by everyone does not necessarily mean that the action was lawful. For example, if you intentionally misrepresent what the contract…
The entire reason that smart contracts exist is to get rid of the need for any trusted third party intermediary because (as proponents argue) all of the logic for the contract is completely embedded in the code.
If it then becomes necessary to say "The code is the contract, unless there's a bug, in which case we'll have some single or set of arbiters decide what the code was really supposed to do" then why have smart contracts at all, why not just go through a normal escrow process where there is an independent arbiter trusted to determine who "lawfully" deserves the funds.
Re: Missing line in a smart contract leads to $10M hack
#175Earlier quoted context omitted.
Yes, a smart contract is not a legally-binding agreement, although it could be a component of a legally-binding agreement. That’s my point. The smart contract in my hypothetical scenario might be something like a transaction with 3 parties: you (the customer), the construction company, and a third-party verification service, that executes your payment to the construction company when any 2 of the parties agree to exe…
But for this arrangement to work the customer, the construction party and the third-party need to enter into an agreement, i.e. a traditional contract. A traditional contract is legally binding, so of course the courts would treat it as legally binding. The smart contract may be part of the agreement but a smart contract by itself is not an agreement and something cannot be a legally-binding agreement if it isn't an…
Re: Missing line in a smart contract leads to $10M hack
#176Projects launch, raise a ton of money, then when people try to actually use the new project, they realize they have to pay $20 per transaction. This quickly kills the project; now onto the next scam. What kind of brand new project can justify making their users pay $20 per transaction? I struggle to think of any genuine use case.
Re: Missing line in a smart contract leads to $10M hack
#177Earlier quoted context omitted.
But also, surely the traditional legal system will still handle disputes over smart contracts just like it does with traditional contracts. I can’t imagine that a missing line of code (intentional or not) would be treated any differently by the legal system than a vaguely-worded clause in a traditional contract. The legal system almost certainly will not say “your contract was just code and the code executed properly…
Then what's the point of smart contracts? If you always must have some form of repudiation/reversal mechanism, you might as well go with the traditional contracts. You could argue there will be lowered costs in the happy path where nothing goes wrong, but I'm not sure that's valid since the underlying software still needs to written/supported by someone.
Re: Missing line in a smart contract leads to $10M hack
#178Earlier quoted context omitted.
That premise is clear, proponents of smart contracts would like it to become true, but as of now that premise is simply not true anywhere in the world. There may be obvious practical difficulties in identifying the counterparty and enforcing a judgement in them, but if that becomes possible (and if $10m is at stake, perhaps it might become possible, bounties, etc) then the argument that "code is the only representati…
But code is the only representation, like it or not. The smart contract is code and nothing else.
But the actual contract terms between the parties and facts like is this contract valid at all, who owns what and who owes what to whom are ultimately determined by contract law, not by the smart contract, like it or not. The smart contract may determine possession of certain things, and in many cases it would be uncontested and there it has a purpose of just doing the contract settlement automatically, but as soon as there's a dispute, then the legal ownership and any claims would be settled according to contract law, not according to what the code says.
Re: Missing line in a smart contract leads to $10M hack
#179Earlier quoted context omitted.
so where does one draw the line between theft and just doing what the code allows? I wonder in the future crypto courts is the defense, "your honor, the code allowed me to call initialize again, they specifically didn't set it to true." going to fly? Or will you have to prove that the 10 mil you now have was intended to be given to you and your "victim" isn't a victim at all.
> so where does one draw the line between theft and just doing what the code allows? This is the heart of the problem with smart contracts. The theory is that the code is the law. There is no theft. There is no need to trust, authority, or arbitration. Of course, this only works when the smart contracts perfectly meet a correctly defined spec and have no bugs.
In practice, if using a smart contract as a contract, the way you'd use a paper contract, then two parties would sit down and negotiate; draft the negotiated agreement into the form of a smart contract; and then agree (signatures, handshake, multi-sig deployment, whatever) that "what the smart contract does — as executed by the network-consensus abstract machine — is our explicit mutual intent, and damn any statement by either of us to the contrary."
This is the same thing you're doing with a paper contract: by both signing it, you're agreeing that "what the paper contract says — as interpreted by a judge — is our explicit mutual intent, and damn any statement by either of us to the contrary."
Of course, nobody's actually using smart contracts as contracts. They're just using them as trusts/agents. For now.
But a smart contract used as a contract wouldn't have "bugs." It's a negotiated agreement; negotiated agreements have loopholes. And loopholes are perfectly legal. If you left one in, and your counterparty exploits it? Too bad for you. You should have run your contract through a better (code) lawyer.
Re: Missing line in a smart contract leads to $10M hack
#180'initialised = true' just costed people $10M. I really like those DeFi things cause at first glance.. I think they might actually teach people how to code!