
Ethereum from scratch – Part 1: Ping - mjfl
https://ocalog.com/post/10/
======
canada_dry
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.

~~~
xj9
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?

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

~~~
AlwaysBCoding
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.

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

~~~
fragsworth
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.

------
mjfl
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!

~~~
brighton36
There are no uses for turing complete smart contracts on a blockchain

~~~
ChrisClark
Of course, us maximalists all know Bitcoin is the pinnacle and can never be
improved on. /s

~~~
brighton36
It can be improved on, but blockchain is REALLY REALLY hard

------
mgbmtl
I like the intro, very clear! I also like the narrative cross-referencing the
docs, which people will sooner or later need to do as well. I have to admit
that I only glanced over the code.

This caught my attention: "In the EndPoint specification, it demands the "BE
encoded 4-byte" address, which is exactly what's outputted by
self.address.packed."

Does this mean that Ethereum only supports IPv4?

I searched around and only found this, dating back to 2014:
[https://github.com/ethereum/wiki/wiki/IPv6](https://github.com/ethereum/wiki/wiki/IPv6)

~~~
Roxxik
documentation says it all:

"bytes address; // BE encoded 4-byte or 16-byte address (size determines ipv4
vs ipv6)"[0]

[0]:
[https://github.com/ethereum/devp2p/blob/master/rlpx.md](https://github.com/ethereum/devp2p/blob/master/rlpx.md)

~~~
mgbmtl
thanks!

------
andrewbinstock
Java Magazine published an article on Ethereum, explaining how it works, and
how to access from Java [1]

[1]
[http://www.javamagazine.mozaicreader.com/JanFeb2017#&pageSet...](http://www.javamagazine.mozaicreader.com/JanFeb2017#&pageSet=36&page=0)

~~~
TheChaplain
This is a very useful resource, thank you!

------
mjfl
Hi! Thank you all for the attention! I was not expecting it!

It seems that the user registration emails are causing a 500 server error and
I'm working on a fix.

Edit: I'm bypassing the email confirmations for now, if you got a 500 error,
please try to login using the account you signed up with. It should work,
otherwise email me at mflynn210 <at> gmail.com.

------
Artlav
Neat. I contemplated writing something like that, only without the "import
rlp" cheat.

Basically, there were a lot of blind spots in the official documentation and
it took me a while to figure out things like how to make a proper key recovery
id or which endianness to use where in the messages.

How far have you been able to get to? I still can't quite wedge into the
mainnet - the nodes keep disconnecting me for unknown reasons some time after,
and finding a new node to connect to takes a while.

My node does works rather well on the ropsten testnet, however.

~~~
mjfl
> the "import rlp" cheat.

Ah, I knew someone was going to get me on that. They actually give you the
encode function in the specification. It's pretty straightforward and if I was
to write it, would end up the same, so I decided to just import the library.
But I agree it does go against the "from scratch" title a little bit.

> there were a lot of blind spots in the official documentation

Totally agree.

> How far have you been able to get to?

I'm actually trying to get the mainnet nodes to talk to me as well.

------
zagdul
Wasn't the purpose of bitcoin to eventually hit a limit someday? Isn't the
creation of Ethereum just devaluing bitcoin?

~~~
patrickk
If you are taking about the issuing of Bitcoins, yes, at some far distant
point in the future, no more Bitcoin will be issused.

Bitcoin and Ethereum have very different intended use cases, as this article
demonstrates. You could argue that Ethereum could be a threat to Bitcoin, or
coexist, depending on your perspective.

------
mdevere
excellent thank you

------
aqsheehy
Ponzi pumping

