Live data from Hacker News

Ethereum from scratch – Part 1: Ping

ocalog.com

121–130 of 134 posts

Re: Ethereum from scratch – Part 1: Ping

#121
post #61

Earlier quoted context omitted.

A kickstarter clone, that could be implemented in a few lines of code on top of Ethereum.. If there is > 1,000 Ether in this contract address before timestamp x then send the Ether to the project lead, else refund all the users.

Nice! Thank you. You know there are many different types of contracts, why didn't they just call it 'smart transactions'?

Because it's conceptually more like a contract. Someone writes the contract code, and then by uploading and depositing money into the contract it's as if they signed it. After that point it works without anyone needing to trust the signer.

And they can include conditions about arbitrary information that is reported on the blockchain (weather data, stock prices, etc...)

And multiple people can sign these things. They really are like contracts.

Re: Ethereum from scratch – Part 1: Ping

#122
post #104

Earlier quoted context omitted.

That's a good lesson for me when wondering whether to include something, to leave it out. Maybe, you'd like to address the questions I raised and points of logic I made rather than the snark.

Here's basically all I'm saying. 1. Payments and value management on the internet currently suck horribly compared to what you could imagine. (Insert your own imaginations here, since you don't like mine.) 2. Some attempts are being done to make payments and value management on the internet more convenient, but they are controlled by central authorities -- Facebook, Apple, Google, Twitter, Amazon, whatever -- so they…

" Blockchains are the only way I know of to do this kind of thing without that kind of central authority, in a thoroughly open source way."

Alternatively, the banks or payment companies are a series of non-profit foundations with protections or basic rights of customers built into their charter using regular, efficient databases with zero or low cost transfer between them. You pay a small, monthly fee to participate with your specific bank which may be waived if you do a lot of business with them. You get regular statements authenticated by the bank's HSM w/ hashes of those posted in one or more trusted, timestamping services for event bank's records are lost. Any major changes to practices might receive a majority vote by customers or people representing them from a diverse background.

So, basically traditional banks with legal incentives to not do bad stuff run by people whose background is pretty trustworthy. Many examples exist of coops, credit unions, and nonprofits that take care of customers due to good incentives. The admin overhead is kept lean per charters. The tech is vastly more efficient than proof-of-work-type schemes since it's just database transactions. Better cost/efficiency than before since new banks aren't stuck on expensive mainframes. ;) What you think?

Re: Ethereum from scratch – Part 1: Ping

#123
post #86

Earlier quoted context omitted.

I dislike algorithms that I understand, and I distrust algorithms that I don't when it comes to stuff like social security or insurance. Smart contracts by composition would be really nice. Like a compile to EVM lisp!

Related: could we please have a Lisp for Ethereum VM? Thanks!

Lisp programmers know the value of everything and the gas cost of nothing...

Re: Ethereum from scratch – Part 1: Ping

#124
post #78

Earlier quoted context omitted.

Imagine you and your friends are for some reason dissatisfied with the way you are able to deal with money among yourselves. For example, maybe you like to quickly reimburse each other for dinner, but you won't or can't use Facebook Messenger payments, perhaps because some of you aren't on Facebook, or you're not in the US. So you want to make your own little payments system. You might start with just setting up a si…

Thanks! This is an easier to digest explanation. What about another use case that's also fairly mundane but is date/time triggered and has a slightly different result/outcome? Say someone wants to use ethereum to manage the sending of a bunch of birthday cards to friends. Is it possible for an ethereum script be set up to trigger an event on a specific day to send a pre-composed email along with some funds (e.g. bitc…

The Ethereum blockchain is reactive, it only performs any effects when someone makes a transaction. So you can't directly do something like a timer.

So, for example, with crowdfund contracts that have an expiration time, you would typically just make it so that after the expiration time, if the crowdfund didn't succeed, then everyone can reclaim their funds. They aren't refunded automatically; you need some user action to trigger anything.

It would be possible to have a single "refundEveryone" method which would send all the funds to everyone when anyone called it. But if there were thousands of participants, this function would be expensive to call, and possibly even too expensive for the network's limits.

The standard solution to this limitation is that you just have to incentivize people to call your contract at the right time. So you can for example make it so that whoever is the first to call the contract after the deadline gets a reward. Then you publish that and hope someone will do it.

(A simpler solution is to just run a cronjob on your own computer...)

Re: Ethereum from scratch – Part 1: Ping

#125
post #78

Earlier quoted context omitted.

Imagine you and your friends are for some reason dissatisfied with the way you are able to deal with money among yourselves. For example, maybe you like to quickly reimburse each other for dinner, but you won't or can't use Facebook Messenger payments, perhaps because some of you aren't on Facebook, or you're not in the US. So you want to make your own little payments system. You might start with just setting up a si…

Recognizing it's merely an example, I think nonetheless it would be good to present examples that are actually compelling. Let's think about your example and what it entails. So you're going to a pizza party with your friends, and instead of saying to your buddy Mike who you're about to see in person and share some pizza with, "Hey Mike, here's 5 bucks, thanks!" Instead you fire up the ol' ethereum whizbang machine,…

What it can enable/improve upon according to Goldman Sachs [0]:

Assorted banking use cases, trade settlements, payments to notaries, voting systems, vehicle registrations, wire fees, gun checks, academic records, cataloging ownership of works of art.

The Ethereum alliance contains many big name companies such as Mastercard as Cisco [1]. They all believe there is real use in Ethereum

[0] http://www.goldmansachs.com/our-thinking/pages/macroeconomic...

[1] https://entethalliance.org/

Re: Ethereum from scratch – Part 1: Ping

#126
post #53
post #26

Earlier quoted context omitted.

professional etherem devs haven't even gotten to the point where they can write correct contracts themselves. but the concept is pretty simple. a "smart contract" is a script that runs on a blockchain to execute terms and manage funds. the problem is that the tools that you use to make these are basically garbage. you don't write fin-tech in what amounts to javascript y'know?

What would be an example of a "smart contract"?

Their main use case is maintaining critical/sensitive state information that you want to protect via rules of interaction between multiple parties (that don't trust each other) without the need for a trusted intermediary. The contract is tamper proof and only via correctly and cryptographically signing messages/transactions intended for the smart contract will the state of the smart contract change, but only according to the rules defined in the smart contract.

The (non-fintec) example I often hear about often is a voting system. (See: https://github.com/stonecoldpat/anonymousvoting , here zk-snarks algorithm is introduced to ensure privacy)

Essentially anything that requires co-ordination between parties that don't trust each other over a piece of data (a balance of money, the tally of a ballot) is a perfect use case for smart contracts. But since there is cost to running it on these secure networks it is important that they remain O(1) or at most O(n) time complexity, which for these kinds of applications is often totally enough. (eg. if (the message is signed by the 'owner') { send the funds } else { throw })

Re: Ethereum from scratch – Part 1: Ping

#127
post #53
post #26

Earlier quoted context omitted.

professional etherem devs haven't even gotten to the point where they can write correct contracts themselves. but the concept is pretty simple. a "smart contract" is a script that runs on a blockchain to execute terms and manage funds. the problem is that the tools that you use to make these are basically garbage. you don't write fin-tech in what amounts to javascript y'know?

What would be an example of a "smart contract"?

Another interesting use case is for supply chain management, since the history of a interactions relating product can be documented in a secure manner Eg. you can buy a nike shoe that you can cryptographically validate that it was signed off by Nike, who made it, when they made it, when it was shipped, and even how much each of these parties got paid for their service. (Take a listen here: https://media.consensys.net/state-change-44-shining-a-light-...)

Re: Ethereum from scratch – Part 1: Ping

#128
post #29

Earlier quoted context omitted.

People were saying the same thing about non-C++ back in the day. "Web apps aren't written in scripting languages y'know?"

I view this more as "web apps should not be written in C++ due to security issues that we have long come to understand" than "web apps should be written in C++ due to performance issues we are guessing at"... like, do you believe that in a few years people will decide "no, strongly typed and proof assisted languages were overkill for contracts: it was actually better to code them in a language that has weirdly fluid…

The main thing to keep in mind at this point in time is that these contracts have very little tolerance for inefficiency, since inefficiency in this case costs money. Even solidity is very inefficient. Sure it would be great to write contracts in Haskell or Coq but can you insure O(1) or at most O(n) run time with little to no constant overhead? For example LLL (Low-Level Lisp-Like Language) produces 70% more efficient code than solidity [1] and thus it is the chosen language for the ENS (Ethereum Name Service) registry smart contract (who wouldn't want to pay 70 less for interacting with a contract?). But no doubt, better languages will come with time :)

[1] https://media.consensys.net/an-introduction-to-lll-for-ether...

Re: Ethereum from scratch – Part 1: Ping

#129
post #66
post #64

Earlier quoted context omitted.

Users cannot run 'any code'. They can run contract code, which can only interact with the underlying application through a protocol. The multisig hack was not a case of the underlying application being compromised. The contract itself was compromised due to a vulnerability in its code. The only parties affected were those that trusted the contract. The rest of the contracts operating on the application were unaffecte…

the problem is that the tools don't facilitate writing correct contracts i don't know how to do this myself, mind your. to be broadly applicable the tech has to be accessible to people who would be writing contracts. a fucking professional using the state of the art for this shit has very little tooling support for checking that the contract actually operates in a particular fashion. something like an SQL query plann…

To be fair, traditional "dumb" contracts written by lawyers also have exploits and loopholes. That's why we have courts with judges and juries that can make subjective decisions based on context outside of the contract. Smart contracts don't allow for that subjective judgment, and thus won't work in a subjective society.

Re: Ethereum from scratch – Part 1: Ping

#130

Though I meet the criteria as stated (knowledge level wise - I'm a retired IT Exec/long time geek), yet this still is a bit too esoteric for me. As one of the 'killer apps' for ethereum is smart contracts, I'd like to see this explained in a 'for dummies' high level way, then decomposed into the finer technical chunks needed to make it happen.

Ethereum would make a hell of a card game. It's naturally adversarial and the incentives are already balanced.
Post reply on HN