Live data from Hacker News

Learn Ethereum smart contract programming

ethereumdev.io

91–100 of 244 posts

Re: Learn Ethereum smart contract programming

#91
post #83

Earlier quoted context omitted.

> I mean, not everyone would read the code to see what it really does, so what happens in that case? This is true with real world contracts too, that's why people hire lawyers - they understand the "code" of contract law.

But real world contracts are never 100% clear, and can be modified retroactively in court when their terms violate the law, are vague, or are otherwise deemed unenforceable.

So can "smart contracts".

Re: Learn Ethereum smart contract programming

#92
post #30

Earlier quoted context omitted.

You know Bitcoin is useful. One of the useful things in Bitcoin is that you can make a transaction conditional on a multiparty approval ("multisig"). This is used by many organizations to control funds in a safe way. Ethereum lets you construct even more interesting types of transactions. For example you can easily implement the logic of a crowdfunding (unless X is raised by time Y everyone is refunded). In that cont…

Just shifting the problem. Okay, so the money is raised... you still never get your vaporware product.

You could program a smart contract to say "unless greater than half of funders agree tbat the product was shipped, refund everyone's money"

It's a programmable decentralized escrow

Re: Learn Ethereum smart contract programming

#93
post #83

Earlier quoted context omitted.

> In that context, "smart contract" is just a way of saying that you're not relying on the promise of a third party to perform the refund—it's automatic What if the code is malicious, and instead of auto refund it steals the money? I mean, not everyone would read the code to see what it really does, so what happens in that case?

> I mean, not everyone would read the code to see what it really does, so what happens in that case? This is true with real world contracts too, that's why people hire lawyers - they understand the "code" of contract law.

Except that in real-world contract and criminal law, there are various mechanisms that attempt, with some degree of success, to dissuade fraudulent behavior and allow for some form of restitution. Blockchain currencies, on the other hand, have been promoted partly on the premise that they are free of this sort of governmental interference.

Re: Learn Ethereum smart contract programming

#94

Am I misreading the code? Isn't the EndLottery function completely broken? It looks like it finds the first user who bet less than the winning number. So, in order to win you should play ASAP and bet epsilon > 0, right?.

yeah, it's completely broken. which normally you would fix, but oh look too late!

Re: Learn Ethereum smart contract programming

#96

The problem I see with Ethereum is that it is way too complex. I have read perhaps at least 10 times on their home page without even understanding what it does, what problems it solves etc. This is the sole reason why I don't think it will be successful in it's current state. With most successful tech or services or whatever the core idea is often super simple to grasp and you can instantly see the benefit. I don't s…

The big thing that helped me was to understand that: smart contract == program stored on the blockchain The blockchain tracks the program's state and handles state transitions. Read-only functions are free to execute; functions that alter the program's state cost Ethereum to run. That's it. It's quite powerful and conceptually simple, but the phrase "smart contract" seems to throw a lot of people off.

I've got that now but that worries me even further. I don't trust myself to create bug-free programs and are in the belief that it's impossible.

The issue with the system is that you can't update the contract, which means it has to be perfect when it is distributed on the blockchain. 1 bad mistake away from loosing maybe the entire wallet and it seems to already have happened several times.

The main issue that it is a big incentive to find bugs since you can make a lot of money from it and the contracts are vulnerable since they can't be updated.

But people in favor of this system, Ethereum, seems to just wave shit like that off with fancy words. If some system handles my money, it better be damn secure and the only way to be secure IMO is constantly updating it.

Re: Learn Ethereum smart contract programming

#97
post #36

Earlier quoted context omitted.

In the example code used, the random number which determines the winner is derived from the previous block hash. Since the lottery-owner determines when the function is run, they could call the function when the previous block hash favors their own bet, or else modify their bet before calling the function.

Yep that is why there is a notice and link about random number generation in the tutorial.

try this lottery code instead https://github.com/renasboy/ETHLottery

Re: Learn Ethereum smart contract programming

#98
They talk about storing money in the contract.

Does this mean I will be "charged" right in the moment I "store" money in the contract?

Or does it mean I'll be charged when the contract gets "destroyed" and the money "in the contract" is sent to some address?

I'm asking because both sides have problems.

If I don't get charged when storing money in the cotract, I could spend it elsewhere until the contract resolves.

If I get charged when storing money, someone could write contracts that never resolve to purge money.

Re: Learn Ethereum smart contract programming

#99

The problem I see with Ethereum is that it is way too complex. I have read perhaps at least 10 times on their home page without even understanding what it does, what problems it solves etc. This is the sole reason why I don't think it will be successful in it's current state. With most successful tech or services or whatever the core idea is often super simple to grasp and you can instantly see the benefit. I don't s…

Ethereum reminds me of what happened to the web: the desire to add code. The blockchain by itself wasn't good enough so Ethereum added code to it, just like HTML wasn't good enough so people added applets, Flash, and JavaScript.

I understand why they would want to do this but I think it gets the priorities wrong. It prioritizes features and functionality over security and reliability. Given how hostile the Internet has become I think this is a mistake.

My guess is that Ethereum is only a couple of scandals away from being perceived as a fundamentally insecure platform. Bitcoin has its own problems and it may not survive either. Perhaps another cryoto currency can learn from the mistakes of both and deliver something better?

Re: Learn Ethereum smart contract programming

#100

Earlier quoted context omitted.

But real world contracts are never 100% clear, and can be modified retroactively in court when their terms violate the law, are vague, or are otherwise deemed unenforceable.

So can "smart contracts".

Unless the attacker is careless enough to reveal his identity, or puts his ill-gotten gains at risk of being hacked back, or the victims are Ethereum foundation members, your chances of restoration are slim to none.
Post reply on HN