I'm not sure whether people answers question on Ethereum here as well but just in case...

  1. Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit? Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project? It is true? If so, what are the safeguards?

  2. Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).

  • There's really no such thing as "modifying a contract". If you modify it, it's a different contract entirely. You would need an unchanageable master contract that specifically supported the ability to take functionality from external contracts based on something that was changeable. And people would only trust such a contract, and send money to it, if what was changeable was acceptable to them. – David Schwartz Dec 2 '15 at 8:27
  • Sorry but I don't understand what you mean by unchangeable master contract? – blockFrance Dec 2 '15 at 9:08
  • and I understand that if i modify a contract, this is a different contract entirely. BUT as a user of the website, I have no possibilities to verify whether a new smart contract was not maliciously modified for the benefit of the developer? – blockFrance Dec 2 '15 at 9:12
  • I think you're missing the point. You can't "maliciously modify a contract". You can just create a new contract that's malicious. You make things unnecessarily complex and hard to understand by talking about a "change". The question is just this -- how can people know that the contracts they're sending money to can be trusted? A contract can't be changed, so issues with changes and modifications simply don't exist. – David Schwartz Dec 2 '15 at 10:49

Step back for a second and look at the big picture. You want my money. If I'm just willing to trust you to do the right thing with it, we don't need smart contracts. The case for smart contracts is where I'm not willing to send my money just anywhere -- I won't send it except under conditions where I am provided assurances that the money will be used as I expect it to be used.

If people trust you with their money, you can steal it. You don't need a smart contract for that. But if the sender doesn't trust you, he will insist on sending his money to a smart contract he trusts.

1 - Once my smart contract is active on the Ethereum, what prevents me from modifying the contract for my own benefit?

There is no such thing as "modifying the contract". You would just be creating some other new contract. Anyone can do that at any time, and you can do that. The trick is how you convince people to send money to the new contract.

Let's say I created a crowfunding dapp which users can use on my site www.crownfunding.com. Once users are using that dapp, as a malicious guy, I could link a new smart contract to that site sending investor's money to my own account instead of using that money for the crownfunded project? It is true? If so, what are the safeguards?

You can't send other people's money anywhere at all. Other people send their money where they want to send it. Of course if you could get people to send money anywhere you want then you can steal their money. But in that case, why use a smart contract? The whole point of a smart contract is that you can't just convince people to send money wherever you want them to, and they insist on using a smart contract to guarantee the money goes where they want.

2 - Could you tell me, in very plain words please, whether once I have created my contract code and "sent" it to the Ethereum network, I can update it? or do I have to write a new program and send it to the network (the oldest one then "dying" out of gas).

You can design a contract whose sole purpose is to decide what contract actually executes and it can use whatever rules you want make that decision. However, again, you are assuming that an attacker can get people to send money wherever he wants. If that's true, he doesn't need a smart contract to steal their money.

The whole point of smart contracts is that other people won't send money where you want them to, they'll send money only where they want to send it. And you need to provide a secure smart contract they trust for them to send money, otherwise they won't do it.

  • Thanks a lot for your answers David. This is much clearer to me now. Well just one last question...all that means that I, as an investor in a crowfunding website (for instance medium.com/@WeiFund) has access to the underlying contract code? I might repeat myself but under that website (medium.com/@WeiFund) there is a backend code (smart contract code) which is linked to the user interface. Is this true? If so, Weifund could design a new (malicious) smart contract code as the backend code? Do you get my point? sorry i'm just a beginner...;) – blockFrance Dec 2 '15 at 19:05
  • The logic of a smart contract is that the user is not willing to send money wherever a site tells him to but instead demands assurances that the money is controlled by a smart contract they trust. Sure, if a user will send money wherever a site tells him to, then that user trusts the site, and there's little need for a smart contract. The point of smart contracts is to handle cases where that trust doesn't exist and the user won't just send money wherever the site tells them. – David Schwartz Dec 2 '15 at 19:54
  • Thank you very much for your patience;) this has been of great help – blockFrance Dec 2 '15 at 21:55
  • Hi again. If I as investor is ready to invest in Bob's crowfunding project, we have to agree on the smart contract's code. This means I need knowledge of programming codes I guess? or I need a developper who can designe the code with the other counterparty (Bob)? Is is right? – blockFrance Dec 9 '15 at 22:25
  • Most likely you would be using some client whose developers had already decided on what crowdfunding contracts they consider reliable. Your client program would know how to read the contract parameters and present them to you in human-readable form for your approval. The contract would, of course, be available for anyone to inspect and would have to be coded as clearly and simply as possible in order to gain broad support. Developers have to convince each other the contract can be trusted so that clients and crowdfunding systems support the same contract. – David Schwartz Dec 9 '15 at 22:28

While @David's answer is correct, there is a caveat.

The likelihood is that anything other than a trivial DApp will be made of multiple co-operating contracts. Specifically, the logic and the data will live in separate contracts. This is to permit the logic contract to be logically updated (actually replaced as David explains) without losing the data. Any DAO architected this way, is effectively modifiable.

@david schwartz, the following is an extract from stephan Tual article: https://blog.slock.it/we-re-building-the-ethereum-computer-9133953c9f02#.pcpmb89or

This is perfectly suming up my fears about decentralized applications...

"If you’d rather use your own machine, you probably noticed current Dapps often require you to trust them with relaying your instructions correctly to the Ethereum network via their web interfaces. This is rather ironic (and dangerous!) considering Ethereum was designed with removing the need for trusted third parties in mind." "

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.