Hacker News new | past | comments | ask | show | jobs | submit login
Ethereum programming for web developers (happyfuncorp.com)
202 points by aaron_p on Jan 18, 2018 | hide | past | favorite | 75 comments



I've been dabbling recently, and as I've said before I'm quite put off by the limitations of Ethereum. As it stands now, it's main use case appears to be the development of new cryptocoins, perhaps voting applications..? And yet, every now and then you come across a nugget of true insight when working with the Ethereum protocol, for instance the gas payments to nodes to run code effectively should stop DDoS attacks since it would require vast sums of money to disrupt the network. It remains to be seen how valid this idea is in practice, but you could look at ideas like that and say, "Yeah, that seems like a step forward."

Anyways, if Ethereum really will become Web 3.0, then comparatively speaking I'd say we're not even in the 56k modem era yet.


Yeah I agree it's an incredibly clunky and slow user experience that seems to have limited application. Gambling I think is another decent use.


Once there is a proper infrastructure for trusted Oracles, there will be lots of interesting applications: small group crowd funding, payment distribution from trusts,execution of wills.


While I would love for this to be a thing, most cryptocurrency enthusiasts seem to distrust anything and everyone. How would one develop an oracle trusted enough that it would be accurate while not being vulnerable to sudden betrayals? There are for example plenty of stories from Eve Online (closest example of a lawless/trustless universe) where a very trusted middleman suddenly changed behavior when the benefits became great enough.

Especially when a cryptocoin includes strong anonymity, betrayal has very low downside since no retribution would be possible. However even if such anonymity is not present, it may not be possible to get retribution if the entity on the other side is (for example) the mafia.


Do you have a link for the Eve Online example?


http://www.ign.com/articles/2009/07/09/eve-online-bank-scand...

This is a classic example in which a user ran an in-game bank for some time, before making away with all of his clients assets.


> trusted Oracles

but why?! WHY?!

i thought the whole point of this blockchain stuff was that there was no trust in any one entity/group of entities (aside from the chain itself)

as soon as you have "blockchain plus a few trusted people", does that not completely undermine the whole idea?

why not just have a few trusted people?


A blockchain can only process its own data, no external api call allowed. Unfortunately a lot of interesting applications require access to external data. Thats what oracle are for. They import external data into the blockchains, embedded in transactions. Yes it does undermine the security model of the blockchain, but they are some work arounds. For example, you can have several oracles, and you can decided to only accept data that was provided by a majority of oracles, thus rejecting outliers.


oracle is just a blockchain buzzword for api


Is it? I was thinking it was more like .. "trusted external entity"

Here is a [old] post from the horses mouth https://blog.ethereum.org/2014/07/22/ethereum-and-oracles/


Uhh, with the risk of sounding "shilly", there is this token called chain link that is supposed to do just that, act as an oracle for data from the outside world.


With the risk of sounding "shilly", there is this token called chain link that is supposed to do just that, act as an oracle for data from the outside world.


Shameless self promotion. Today I rolled out my first tutorial to get you started on smart contract development.

> https://news.ycombinator.com/item?id=16176714


Very cool!

Sorry for the basic question, but is it legal to do a lottery application like this with Crypto Coins because they aren't real money?


That's a great question, as are many others around taxing cryptocurrency transactions. A quick googling indicates that, in the US, gambling with anything of value constitutes gambling. https://www.law.cornell.edu/uscode/text/31/5362


Not basic at all! I've never thought of that to start with. But in the end this is just an example and it does not even generate random numbers.


Can someone describe a few applications of blockchains in real world applications that cannot be implemented without a blockchain? I'm really struggling to come up with even a single case. I thought some sort of secure voting mechanism would be a good candidate, but that too could be done with an immutable database.

EDIT: Besides crytocurrencies, I mean.


> an immutable database

I guess the question would be: if you don't trust a central authority to keep that database immutable and add records honestly, how do you design a distributed solution?

Blockchains are pretty much just an append-only log, but they were the first decentralized answer to the double-spend problem. So I'm not sure it's a case of what blockchains can do that immutable databases can't - they're a way of implementing decentralized immutable databases.


> Blockchains are pretty much just an append-only log

By this definition, ethereum is not a blockchain[0]

> they were the first decentralized answer to the double-spend problem

Physical reality is decentralised answer to double-spend problem (the gold molecules 'exist' in your hand, no centralised god manifested it but physics worked on universal matter in a decentralised manner). The 'problem' is created when we assumed centralised trust is even possible.

A blockchain is decentralised answer to double-spending a 'non-physically interactable' good(don't mean 'virtual' because POW is real).

[0]https://ethereum.stackexchange.com/questions/9535/how-does-a...


The most natural follow-up to currencies on a blockchain are assets, like a ticket to a concert, shares in a company, or a deed to a car.

Once more assets are represented this way, many kinds of applications would be valuable. One simple and powerful example is escrow.

Enabling one-shot, instant escrow with strangers on the Internet has real-world benefits. For example, the current safest way to exchange Burning Man tickets is to meet someone in person, inspect the tickets and cash, and trade them by hand. If they were a blockchain asset, they could be traded nearly instantly and safely across the world. With a stable dollar asset, the official escrow service could even make it more difficult to sell above face value.


> The most natural follow-up to currencies on a blockchain are assets

Natural for marketing-team maybe but not for developers. They only seem natural because they both look like 'value' transfer. But there is a huge difference. The value in-case of currency-use is inherently generated using proof-of-work whereas there is no decentralised way to map a real asset to virtual token.

So NO, none of these 'assets on the blockchain' are decentralized or even need blockchain non-trivially.


I like your idea about using blockchains to represent assets. I have been thinking about something along those lines. But a whole set of interesting problem arises. That being the legal issues surrounding transferring ownership of assets globally. Not to mention issues of fraud and recourse when an agreement falls apart. I'd be curious to to have a chat with you about it. Send me an email.


I've got a team exploring the idea of executing a smart contract that transfers assets (be it crypto-asset or real world assets) upon a specific real-world trigger event (via oracles).

But you're right, the legal issues are a dime and a dozen. It'll take some time for the law to catch up (eg. digital wills). The technology is ready for this, we just need to right confluence of factors to make this a reality.


I think it is interesting if the technology did it, but I'd want to know what incentives people would have to use it, since it would just make things more complicated.

Maybe it lowers the cost of transferring assets, and there is the flexibility transferring to anyone on the planet. Maybe the use case is having funds in an escrow until both parties can verify that the transaction is cleared. I think there are trust companies that already do this. Maybe if people are motivated to deal with the legal(or private entities would exist to fill the need to simplify it) themselves it could work itself out.

It could be that through this method less lawyers are involved. If the transfer of assets can be standardized or at least abstracted away for all/most countries in one system I could see why people could be interested in it.

Also if your looking to sell an asset, or looking to buy an asset that you expect to increase in value, it might be interesting to have a global market to purchase/sell these assets with price signals for less risky or higher return assets.


You hit fun new issues like - how do you transfer assets when somebody is dead? No private keys, no hope.


Deadman switch?


This looks like the start of slockit conversation proposing a DAO


How does the blockchain help? The important issue is the dispute between humans as to whether the tickets and money are valid. You can only do that if the transaction is atomic, which requires that the tickets and money are on the same blockchain and exchanged in the same transaction.


> You can only do that if the transaction is atomic, which requires that the tickets and money are on the same blockchain and exchanged in the same transaction.

Yes, they should be on the same chain, so that the transaction is atomic. This is trivial to do in Ethereum (and other blockchains, presumably).


Yes, the comment is premised on the future representation of assets in the blockchain.

If the tickets were on the blockchain, they could be exchanged in the way that you describe.


It doesn't. His example is nonsensical.

The best use cases for smart contracts are gambling apps (i.e., financial markets, exchanges), escrow services (collateral-based trustless loans), and perhaps some identity services


People always seem to come up with gambling. No on in the gambling industry would want to have their business on top of a public blockchain so good theory but nope.


There are already new gambling apps on the block chain. That existing players don't want this is irrelevant. Classic innovator's dilemma.


Given US bans on online gambling, it's already been a market for crypto.


No, there isn't one. The reason is that you can do everything the blockchain data structure can without using blockchain by just putting it in a traditional database with more ease.

If we take a look at Bitcoin, think how much easier it is to implement if we just didn't use blockchain -- it's literally just a single SQL table of transactions and some sort of API to be able to submit transactions. From an application development perspective, all the extra cruft that Bitcoin needs to work makes blockchain less useful for normal application development.

The point of a blockchain is to essentially be able to do what we do normally in a centralized application in a decentralized way with a different set of controls in terms of trust. It also acts as a specific secure by design architecture that allows us to build these distributed applications using an established model.

Don't get me wrong, though, having a different trust model is significant. It can allow us to make applications which we otherwise couldn't make before because of non-technical reasons. For example, an application like secure voting isn't done (or is discouraged) with an immutable database because we don't trust the central authority -- but with blockchain, we can better trust that all votes are valid.


I doubt you will find many that cannot live without a Blockchain system. Instead see it as a tradeoff between performance and where you place your trust. Centralized systems are performant, but the burden is managing the security/trust of that system. A decentralized system of trust removes this burden, but it comes with a performance penalty.

An example I'm working on right now is a system of authentication using Ethereum to replace passwords. The decentralized identity of addresses, combined with the cryptographic primitives provided, paves the way for a whole new way of managing identity and authentication even in the "old web" world. Hopefully I'll finish my demo by the end of the weekend.


Blockchain is to crypto what AOL was to the early web.

We've had hashing, dencentralisation, public key cryptography etc for years, but all of it was kind of academic, kind of out of reach.

Similarly AOL brought email, the web, IM together into a nice package that people could get behind and use even though there wasn't obvious inherent value to those who were using the internet beforehand.

AOL brought the news homepage, Ethereum has brought crypto-cats. AOL gave 8-year-old me an interest in dial-up connection sounds, bitcoin gave me an interest in staring at financial graphs.


AOL was a company, not a class of applications or a technology. It's totally incomparable to a distributed blockchain.


he means philosophically, not literally/technically

i actually think it's a pretty good simile

its bringing a new tech development to the masses in a very clunky way - just what AOL did.


The technology here is far greater than the sum of the parts (public key cryptography, hashing, etc). The innovation of the blockchain is distributed consensus, and none of the component technologies can provide that alone.


huh?

you're missing the point here dude; me and the other guy are just saying that it's a similar situation:

> X brought Y together into a nice package that people could get behind and use even though there wasn't obvious inherent value to those who were using the Z beforehand

that applies to AOL and blockchain.


"huh" doesn't really tell me anything about your understanding of my point. If you could specify what part of my statement doesn't make sense for you, I could at least try to clarify it.

>>X brought Y together into a nice package that people could get behind and use even though there wasn't obvious inherent value to those who were using the Z beforehand

If AOL provided a major innovation not available in either X or Y, then it would be analogous to the blockchain. The reason why AOL faded away and the blockchain won't is that the latter solves a major problem that could not be solved by any previous technology, including any of its component technologies alone, while the former did not.


Why does it have to be something that can't be done without it? I think the idea is it does it in a different way that might be beneficial in some ways. In dev work there's not a lot of single ways to do anything. It's more just choosing which tool would be best for the current task.


They don't really talk about it on their website, but IIRC the Brooklyn Microgrid project uses a blockchain to keep an immutable ledger of transactions between net consumers of power and net producers and handle transactions between the two. The website is directed more toward potential neighbourhood participants, so it doesn't really get too technical. Heard a talk last spring on the subject by a professor from Ryerson (Toronto. I can't recall his name off the top of my head) who went into detail on how the project works.

http://brooklynmicrogrid.com/

I'm not sure this necessarily couldn't be implemented otherwise, but it is a core part of how it has been functioning as far as I know.


To me the most obvious one is sharing economy without a completely useless money grabbing central authority (see virtually any popular sharing economies like uber, lyft, airbnb etc). These all can be created in a decentralized manner with blockchain tech, especially Ethereum.


A cross-CA transparency log for certificates.


Bitcoin?


Thanks for sharing, also the Solidity Smart Contract are not bad for getting started: https://solidity.readthedocs.io/en/develop/introduction-to-s...

Also for anyone starting Ethereum or Blockchain development, I'd recommend learning and understanding The DAO Attack of 2016: https://www.coindesk.com/understanding-dao-hack-journalists/


I remember 2015 or 2016, everyone was hyped about Deep Learning. Everyone was talking about DeepDream, Tensorflow, etc.

I guess 2018 will be the year of blockchain and cryptocurrency.


Amara's Law still holds, though - technology is overestimated in the short run and underestimated in the long run.

I don't think Tensorflow et al have been busts, or have even fallen short of what experts expected from them. They were just never consistent with the slavering hype they got from university press offices, tech journalists, and startup hucksters.

I'm less convinced that blockchains will have a major long-run impact, but I expect solving the double-spend problem will prove useful one way or another.


Don't forget Big Data and Data Science. Sometime in 2017 cryptocurrency really blew up in popularity, and suddenly everyone in my LinkedIn network went from being a Data Scientist to Cryptocurrency Expert or Blockchain Developer. People love bandwagons.


People are still hyped about Deep Learning, I think.


There's also an LLL (Low-level Lisp-like Language) introduction here: https://media.consensys.net/an-introduction-to-lll-for-ether... with links to examples.


Yep, I think LLL is much better than Solidity: http://ecc-comp.blogspot.com/2017/12/comparing-solidity-to-l...


Seeing this on the front page of HN, my first impression is "wow, people are really desperate for information on this!" Can anyone with experience point to a better starting point?


I have finished Solidity tutorial on CryptoZombies.io. It was fun but it did not teach how to setup or to deploy Ethereum project on the Ethereum network.

Right now, I am enrolled in https://www.udemy.com/ethereum-and-solidity-the-complete-dev...

It looks good but I haven't finished it yet.


I like Stephen Grider's classes, but I also use them to measure when the hype for a given technology has reached its peak.


B9 Lab has a series of various blockchain development courses. Here's the Ethereum 101 course: https://academy.b9lab.com/courses/B9lab/X16-0/2016/about

This course feeds into a 12wk paid course with certification: https://academy.b9lab.com/courses/course-v1:B9lab+ETH-21+201...


Thanks for the links! Can you share any additional feedback on your experience with either of these options?


I've slowly started tracking tutorial articles like this, and also automated setting up an Ethereum/Solidity development environment and tooling in a VM, with Vagrant. This has been my starting point, but I haven't gone much further yet.

Both the tutorial links and Vagrant setup is here -

https://github.com/mmccaff/vagrant-ethereum-dev


Cool ! Thanks for your vagrant setup I will have a look and maybe make a video out ot it :)

Btw this is my utube channel of tutorials for ethereum / blockchain development:

https://m.youtube.com/channel/UCZM8XQjNOyG2ElPpEUtNasA


Many of the ethereum projects are extraordinarily well documented. I would recommend skipping the blog posts and just use truffle and the ethereum official docs.

http://truffleframework.com/

https://solidity.readthedocs.io/en/develop/

https://web3js.readthedocs.io/en/1.0/


Here's a tweet (I know, right?) with a bunch of resources: https://twitter.com/JimmyRagosa/status/953667960681443335


Thanks! There are a lot of resources out there, many with recommendations from key figures in the community. I would love to hear more about how HN users are progressing up the learning curve -- how effective these tools are in practice.


Checkout my site \newline [1]. The introduction to Solidity course is a walkthrough on how to write and deploy your first smart contract locally. It's free.

[1] https://www.newline.co/


If you are a web developer and looking into making useful products(not just to raise money) you should first look into public-key infrastructure applications. Once you have made your first PKI application you might find ethereum redundant and irrelevant even.


> Solidity reads a bit like Javascript. It has a lot of quirks and pitfalls, though, especially when it comes to moving money around.

But isn't that, like, the whole point of the language? It was literally written for moving money around. Cripes.

> Be very careful if writing real money-transfer code; do your security homework, get others to review your code, and seriously consider an official security audit or even formal verification.

Amen.


Ethereum's "quirks and pitfalls" are a result of people coming into it thinking that their mental execution model of most normal programming languages will suffice, when the execution model of the Ethereum VM is quite different (precisely because it is "written for moving money around", but also because its computations are only run by the will of random miners, who like to get paid.)

Once you understand the Ethereum abstract machine (i.e. the thing described in the http://yellowpaper.io), the "quirks and pitfalls" of the programming languages built on it (Solidity, LLL, Serpent, Mutan) become more like obvious design constraints.


Agreed. I'm not a JS fan by far, but I don't see anything wrong with Solidity (nor am I a huge fan). The Solidity pitfalls are just the pitfalls offered by the EVM. I agree that tooling should improve to highlight potential failures, but to treat Solidity like JS is a mistake.


What's an official security audit ? You mean pay a 3rd party to do it / sell off the liability.


The link should point to the (I guess) original source:

https://happyfuncorp.com/whitepapers/webthereum

Way more readable, links to github etc.,


Thank you. I wanted a downloadable version without having to sign up to Scribd or whatever it was called. This isn't a PDF or e-book, but I can easily turn it into one.


The repo https://github.com/HappyFunCorp/Webthereum has the original RTF if you just want to pull that down.


Thanks! I saw the title and the source of the post and thought "I'll bet someone has a way better link in the comments" and came straight here.





Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: