Live data from Hacker News

Ethereum from scratch – Part 1: Ping

ocalog.com

71–80 of 134 posts

Re: Ethereum from scratch – Part 1: Ping

#71
post #47
post #39

Earlier quoted context omitted.

Agreed, and the massive hacks and losses will continue as long as smart contracts are written in Solidity.

The EVM is Turing-complete, so this will be a risk with any language that compiles into a smart contract. Solidity doesn't appeal to me because its goal seems to be on-boarding JavaScript programmers. But new languages that compile to EVM can be easier to use "safely" and you will see several of these in the next few years. I'm really excited that a project to embed Turing-complete behavior in a blockchain has actual…

The EVM might be Turing complete but you can still have languages that compile down to only some tractable sub-set of the possible EVM programs.

The interesting question is whether a language can be design which allows the important domain-relevant requirements to written down in an understandable way and also proved rigorously.

So far neither lawyers nor programmers have done a very good job of this in their respective field. Watching people trying to do it in both fields simultaneously sounds like popcorn time to me.

Re: Ethereum from scratch – Part 1: Ping

#72
post #2

Hi all, I'm the author of the post, and also the creator of the website. I'm writing this series of posts to demonstrate the site. Do you guys get what the site's trying to do? Hope you enjoy the post. If you have any constructive criticism you'd like to give regarding either the post or the website, let me know!

Signed up and got 500 server error :(

Re: Ethereum from scratch – Part 1: Ping

#73
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…

That's a different subject. I was only addressing the notion that Ethereum the application is at risk from the code that users run on it.

I completely agree that the tools and processes for writing and testing smart contracts need to improve.

Re: Ethereum from scratch – Part 1: Ping

#76
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…

Write your own tools.

The EVM, which is what executes contracts, has a public spec. It's a bytecode machine and writing a compiler for it should be rather trivial compared to x86.

There are also several other languages you can code in and there are some code verifier tools that allow you to check if your contract is good.

The problem is that despite these tools existing, even if they are used, they are underused.

Re: Ethereum from scratch – Part 1: Ping

#77
post #47
post #39

Earlier quoted context omitted.

Agreed, and the massive hacks and losses will continue as long as smart contracts are written in Solidity.

The EVM is Turing-complete, so this will be a risk with any language that compiles into a smart contract. Solidity doesn't appeal to me because its goal seems to be on-boarding JavaScript programmers. But new languages that compile to EVM can be easier to use "safely" and you will see several of these in the next few years. I'm really excited that a project to embed Turing-complete behavior in a blockchain has actual…

The EVM might be turing-complete but since you can only get finite number of execution cycles, you can usually determine the behaviour of your program or if it halts within the current gas limits.

Re: Ethereum from scratch – Part 1: Ping

#78

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.

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 simple server that tracks your debts, with a simple web app to log in and send funds. Suddenly it's much easier for you to pay each other!

Once that works, you realize it would be really neat to have group payments, where you can automatically split a dinner bill, for example. And then maybe you'll even want to kind of crowdfund your dinners, so that any of you can put up a request that says "please send me 5$ each until tomorrow at 4 and I'll order food." You can see this becoming more and more complex.

This is kind of the evolution of blockchain going from simple transactions towards arbitrary smart contracts.

A contract on Ethereum is basically just an address that's associated with a little script in a stack machine bytecode. When you send a message to such a contract, you're actually signing a transaction that says "I hereby perform the instructions of this contract with these given parameters."

For example, the bytecode of contract X might be:

    VALUE 2 DIV DUP  SEND  SEND
(The SEND instruction doesn't actually exist; you'd use the CALL instruction, but it takes some parameters that would make the example less clear.)

So this contract, when transacted with, would split the ETH value sent to it in half and send to "address 1" and "address 2".

The neat thing about this blockchain thing, compared to a Messenger-style central server, is that you can federate the service in a P2P way, so several of the friends can run a node that verifies all the history, and nobody needs to be trusted with an admin password that can change history.

The neat thing about having those smart contracts on the blockchain instead of as proprietary code is that each participant can (in principle) look at the contract's definition and know for sure what it does, and the contract can't be changed arbitrarily.

Re: Ethereum from scratch – Part 1: Ping

#79

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.

I like to think of smart contracts as ways to program money. Imagine if you could program a dollar bill. Then there's lots of cool stuff that could be done :)

If you could program money, you might not really need insurers anymore. You could just program insuree's money so it redistributed appropriately in case of flooding (for eg). No need to give you money to an entity and have a conflict of interest with your insurer.

Smart contracts are ways to program money by sending it to special addresses. These addresses contain a script that will decide how to redistribute the money. It's like if you insurance was a program.

Re: Ethereum from scratch – Part 1: Ping

#80
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?

Solidity's relationship to JavaScript is negligible and way overplayed in its marketing. Similarities are entirely superficial.

This 100%. I think this becomes evident almost as soon as one tries to do any smart contract coding. It's an entirely different paradigm with considerations that dwarf anything about language syntax and style. In fact I think these considerations are very non-trivial to grasp.
Post reply on HN