Ask HN: Resources to learn blockchain and smart contracts?

526 points by nepger21 ↗ HN
What resources are available to get into these two and related topics?

Would be also better if there are papers/books that introduces to these concepts (and toy implementation)?

118 comments

[ 4.2 ms ] story [ 137 ms ] thread
I quickly checked the syllabus, however didn't find smart contracts? Do they go into that in some of the videos? How much time do you think this course takes?
No smart contracts - it's a Bitcoin course. Some of the authors also released a tutorial on Solidity and smart contracts, which you can find on Andrew Miller's webpage.

The Coursera class took around 20 hours end to end.

Would also like to recommend this course. The lectures are good, the tasks are ok. It assumes familiarity with cryptographic hash functions and signatures, allowing to keep the focus on bitcoin. In some places it delves into some interesting variations of implementations, like Zcash.
If you're interested in Ethereum Smart Contracts I wrote: http://ethereumdev.io/
Clearly written articles, thx!

I’m n00b in Smart Contracts but they seem like interfaces to reading/writing to a data store.

If I didn’t totally botch what they are. Then I don’t really get why they’re “smart”. The pitfalls of regular programming, seem to apply to contracts. Seems like I could easily code a bug in a smart contract and have it t deployed to the network?? Or did I miss something?

You didn't miss anything, it's very easy to deploy a bug in a smart contract and why anyone using it for anything important should have their contracts be audited by a third party professional(s).
It's really just a marketing name.
Also an important question: How to get quickly tokens for a ETH test network to be able to do anything. Last time I tried I wasn't successful because all these places where you could get some free tokens didn't work and the only thing possible was to mine them yourself which still took a day or two.
For a test network, can't you just modify the code to give yourself however many coins you want? Why would you need to mine?
I loved Decypher.tv for getting going with Ethereum Smart Contracts as well as other requirements for a complete DApp
Seems expensive, currently $60 USD. Worth it?
Yep. I went through all of them and they are great
The book "Mastering Bitcoin" really helped me to understand the blockchain and bitcoin properly. It's available free online here~

http://chimera.labs.oreilly.com/books/1234000001802/index.ht...

The author is putting out a similar book called "Mastering Ethereum" in February, also through O'Reilly.

This book helped me understand the basics of bitcoin as well. Great read.
Ditto. This book is excellent, and is in it's second print
I second this. It's good both as an introductory book for someone new to blockchain and for someone with more experience looking to round out their knowledge.
I just read the preface and have to ask... is this heavy on marketing, cheerleading and kool-aid? First the author makes it sound like the Nakamoto paper was sent from the heavens and then this:

> I became obsessed and enthralled, spending 12 or more hours each day glued to a screen, reading, writing, coding, and learning as much as I could. I emerged from this state of fugue, more than 20 pounds lighter from lack of consistent meals, determined to dedicate myself to working on bitcoin.

To me, this seems a little dramatic for what should be a technical topic.

It's the Hollywood version of the events.
Once again the autistic, asocial programmer clise gets autoconfirmed.
Why so hateful? What does having autism have to do with this? I don't really like the quoted piece from the preface either, and even if the author has autism, what does it matter? Isn't it more fair to people with autism and more powerful with regards to your dislike to the author to just not like the author based on that you don't like him as a person? That way you don't insult everyone with autism and you insult him more.

Also, your diagnose does not make much sense; you state that the dramatised telling in the preface means that the author has autism? In that case that would mean that people like Jimmy Fallon and Stephen Colbert or in that case most Americans (compared to us reserved Dutch people) would have autism.

On top of this you seem to suggest that you have to have some sort of mental condition to do things 'wrong' (as far as you want to call the preface wrong). What disorder do you have that led you to write cliché as 'clise'? Or did you mean 'sexy young man'?[1]

[1]: http://www.urbandictionary.com/define.php?term=clise

> Or did you mean 'sexy young man'?

So 4chan is invading HN now? I thought they considered us too intertwined in the cargo cult botnet.

Skip intro, jump right in the technical chapters, it really goes into necessary details as an introductory book.
there is no marketing etc in this book. it is by far the best book on the topic. it covers only bitcoin, i.e. no etherium/smartcontracts etc, but it does that really well. and in fact all the other blockchains are more or less the same
Ignore that -- the meat is in the inner content. Very technical, and gets into all the gory details of nearly all aspects of Bitcoin.
That's what prefaces often sound like. It's the author introducing themself and their claim to authority that will make you take their following content seriously. This author is just explaining why they cared so much as to write a book.
> is this heavy on marketing, cheerleading and kool-aid?

I haven't looked at the book, but the author is, a bit. Here's a somewhat banana-pants talk he recently gave. https://www.youtube.com/watch?v=FyK4P7ZdOK8

Gold-bug has at times been used as a pejorative against people who criticized central banking and favored gold.

I wonder what pejorative will be coined for cryptocurrency enthusiasts. Banana-pants is just too broad. /s

The preface maybe a bit dramatic but the contents are really good for a beginner.
Is this available in Mobi/Kindle format?
There's this course by the people who wrote `Bitcoin and Cryptocurrency Technologies`

It covers the basics pretty well.

http://bitcoinbook.cs.princeton.edu/

I can second this. It's a book written by capable people who do some research in the area too and they don't unecessarily hype the technology like so many resources you find about cryptocurrencies.
I read the book, and it was incredible. It went in depth into the data structures of bitcoin, while also providing high level overviews of various cryptocurrency ideas. It really helped me to understand exactly what cryptocurrency is and how it works.
I compiled some of the resources I used to start understanding it.

It it a bit focused on ethereum, but I guess it is useful for starting to understand blockchain and smart contracts in general regardless

---

Watching

- "GOTO 2017 • Blockchain: The Slowest (and most Fascinating) Database in the World • Stefan Tilkov” https://www.youtube.com/watch?v=li3rfBAP_fE

Explains how the blockchain works and walks through most of the technical terms you will need to know

- "Ethereum Vs. Bitcoin: What Sets Them Apart? | CNBC” https://youtu.be/0UBk1e5qnr4

Uses the blockchain explanation to give you an idea of how the smart contract idea differs Ethereum from Bitcoin

- "Vitalik Buterin explains Ethereum" https://youtu.be/TDGq4aeevgY

3 minute macro explanation of what is Ethereum from its inventor Vitalik Buterin

- "DEVCON1: Ethereum for Dummies - Dr. Gavin Wood” https://www.youtube.com/watch?v=U_LK0t_qaPo

Ethereum's CTO Dr. Gavin Wood explains in a very macro way the Ethereum concept with an idea of how the “Global Computer” works and what is the “Ethereum Virtual Machine”

- Devcon2: Ethereum in 25 Minutes https://youtu.be/66SaEDzlmP4

Vitalik Buterin give and overview of the Ethereum protocol and shows what is an Ethereum transaction, what is Gas (and how computation time is actually paid for miners), how the state machine works and what you can do with it

- DEVCON1: Ethereum in the Enterprise Environment - Taylor Gerring https://youtu.be/HXNWhXuMNpw

Expose core concepts about the blockchain and the Ethereum platform that are valuable to enterprise and how companies can leverage that using web technologies

---

Reading

- Coinbase - A beginner’s guide to Ethereum https://blog.coinbase.com/a-beginners-guide-to-ethereum-46dd...

- Fat Protocols http://www.usv.com/blog/fat-protocols

- The difference between App Coins and Protocol Tokens https://blog.0xproject.com/the-difference-between-app-coins-...

- What’s the Difference Between an ‘ICO’ and a ‘Token Launch’? Coins vs. Tokens (What is a SNGLS token?) https://medium.com/@SingularDTV/whats-the-difference-between...

---

Source of links, links and more links

- /r/ethereum - getting started https://www.reddit.com/r/ethereum/comments/61y5ix/welcome_to...

- The Quiet Master of Cryptocurrency — Nick Szabo (Scroll to "Selected Links from the Episode”) https://tim.blog/2017/06/04/nick-szabo/

- What The Fuck Is Ethereum? ("I am a total nerd" option)

Could someone offer a quick explanation as to what kinds of things there even _are_ to learn about blockchains? I mean from a conceptual user perspective of "let's use blockchain for my next product", not from a Bitcoin-dev perspective of "how do we fix this thing in our blockchain implementation".
Disclaimer: I've mostly absorbed this stuff through osmosis and lazy web searching, but I thought I'd take a shot with my understanding and someone can correct me if I'm mistaken.

Blockchains are designed to solve a certain set of problems. Understanding those problems and their relation to your product will help you determine whether a blockchain is a reasonable solution.

1. Do you need a distributed ledger? (https://en.wikipedia.org/wiki/Distributed_ledger)

2. Do you need proof of work? (https://en.wikipedia.org/wiki/Proof-of-work_system)

3. Does your distributed ledger need to record things such that one block follows the next, as opposed to blocks of data being saved independently of each other? (https://en.wikipedia.org/wiki/Blockchain)

If the answer to all of the above is yes, using a blockchain probably makes sense. Otherwise, you probably want to use something other than a blockchain (for instance, if you just need a distributed ledger, just use a distributed ledger. No need to chain each block together unless that's actually useful for your product).

Not all blockchains use proof of work.

A better single question would be: do you need a distributed ledger with immutability guarantees (i.e. security against an adversary that might want to tamper with the history of your ledger).

Those are in line with my understanding too, but I'm asking what is there to learn about blockchain technology, not what the use cases are. (That's actually also a question I have, but a separate question to me.)

To me a blockchain is just a tree, where the "parent pointers" are just hashes of the parent nodes rather than their addresses. And I guess to pick one as the "correct" one, you just choose the one with (say) the longest chain. End of story? What else _is_ there to learn about this that people are looking for? (Btw, isn't this just a Merkle tree, which has been around since at least 1979? What's so revolutionary or even different in a blockchain?)

Based on my cursory understanding of the topic, The Merkle tree has been around for a while, but Satoshi figured out how to use that to achieve decentralization, and consensus building. If you ask me, that's quite revolutionary. Yes, the blockchain is just a gigantic DAG, but adding and deleting nodes on the graph is where the crux of the matter is I guess. I am starting to understand the logic from a currency perspective. Still trying to understand how the same translates to smart contracts.
Is there more to consensus and decentralization than just pinging a few other computers and picking the longest chain you find?

And proof of work is literally just the hash having a certain number of zero bits, right? Definitely a neat idea but hardly revolutionary if that's all there is to it.

Something can be "revolutionary" and made up of pieces not in themselves groundbreaking. Linux was revolutionary and it was just a Unix clone for IBM PCs.
It's also the same thing with the git commit tree. You see commit IDs change when you rebase because of the parent pointers.
> What else _is_ there to learn about this that people are looking for?

This is where it gets a bit interesting. While Merkle Trees are great for ensuring, immutability, most cryptocurrencies need more than just that. They need to have a way for records to be inserted into this immutable ledger and an incentive to keep adding records to the ledger. This is where Proof of Work and mining rewards come into play, and this is where a lot of altcoins (non-Bitcoin cryptos) have a lot of different opinions. A decent amount of work has also been put into making sure that there isn't an incentive for a miner to mine on two different chains (and cause the ledger to fork) and other concerns.

The answer to point 2 (proof of work) is irrelevant with regard to block chains. Those are separate class of problems.
Here's a piece demystifying what a blockchain can be used for (vs. not) with intro references: https://blog.andreacoravos.com/myth-busting-can-a-blockchain.... It's written using healthcare use-cases as frame of reference, but applies to most industry implementations.
So (as I said in a sibling comment) my question wasn't "what can it be used for", but rather "what concepts are there to learn about it that could help me decide what to use it for".

But regarding the topic of what it can be used for... yes, I see people talking about doing healthcare with blockchain, or BP using blockchain, or archeology using blockchain, and people asking about how to learn to use blockchain for their next random startup ideas, and I start wondering if I'm going crazy. To me it seems basically like asking "could linked lists revolutionize healthcare?", or "could Dijkstra's algorithm help end global warming?" which sounds like a completely nuts question to ask. Am I just missing a huge, fundamental part of the picture? The whole thing just doesn't make sense to me.

Imagine someone asking "Could APIs revolutionize healthcare?"

Well, yes, they certainly could, even though that's an extremely vague question from someone who might not even understand what they're asking.

If you're interested in hearing about blockchain's potential from a business and society perspective, there's a bunch of material, but for example the latest Andreesen-Horowitz podcast episode was about "why crypto tokens matter".

Also this recent interview with someone deeply knowledgable about the supply chain world: https://www.youtube.com/watch?v=dla42bY7k90

You should ask the people doing healthcare with blockchain, or whatever it is you're confused about. I agree, oftentimes they just have no idea what they're talking about. Sometimes they do though. It's worth noting that I think a few of them expect to depend on not-yet-completely-implemented "infrastructure" projects (off-chain computation, off-chain storage, prediction markets, private transactions, cheaper transactions). However since these infrastructure projects are still in a research stage I don't think it's reasonable for you to be able to cleanly split the "conceptual user perspective" from the "bitcoin-dev perspective".
The key concepts to think about when trying to decide whether you need to use a blockchain are:

  - consensus between trustless systems
  - failure tolerance between trustless systems
  - immutability of data
  - verifiable audit trails
  - cryptographically secured ownership of data/resource/etc.
For each of these areas there are more specific considerations, e.g.:

  - access control (public, private, federated)
  - type of consensus (proof-of-work, proof-of-stake, etc.)
  - type of data (ledger, map, log) and implementation
With blockchains, there are now huge classes of problems that can be dealt with, that were impossible or impractical with traditional databases (where trust is required between multiple parties.)
If blockchain concepts are new for you, here are my favorite starting places to learn:

Why Bitcoin Matters (2011, NYT) - https://dealbook.nytimes.com/2014/01/21/why-bitcoin-matters/...

What is blockchain, really? An intro for regular people. (2017, Medium) - https://medium.com/@wen_xs/what-is-blockchain-really-an-intr...

Re: “Smart contracts” - here’s a few 101 pieces on ethereum:

A Beginner’s Guide to Ethereum (2017, Coinbase blog) - https://blog.coinbase.com/a-beginners-guide-to-ethereum-46dd...

Ethereum is the Forefront of Digital Currency (2017, Coinbase blog) - https://blog.coinbase.com/ethereum-is-the-forefront-of-digit...

Dan Romero has compiled an excellent "reading list" for digital currencies: https://medium.com/@dwr/digital-currency-reading-list-6219f1...

And here's a 101 for developing a decentralized app (dApp): https://medium.com/@AndreaCoravos/dapps-101-how-do-i-start-d...

Start out with Bitcoin, and make sure you understand it well. For example it has its own stack-based language (mini smart contracts of sorts), you need to understand how that works, the different types of payments such as P2SH, etc.

The O'Reilly book is good, you should also look at code in your preferred language, ideally the C++ in which Bitcoin core is written.

Last but absolutely not least - you should buy some Bitcoin and send it to someone, or buy something with it. I'd also recommend going through the trouble of running Bitcoin-Qt and downloading the whole blockchain (which takes several days and requires lots of disk space).

Once you understand all this, the smart contracts thing will be a lot clearer, and you might even have a different opinion on it.

....advising learning bitcoin....smart contracts...don't think these two belong in the same sentence.
> For example it has its own stack-based language

You can create "smart contracts" with bitcoin.