
How Blockchain Works - dsr12
http://blockchain.mit.edu/how-blockchain-works
======
thedancollins
Over the past year I have gone from Blockchain enthusiast to more blockchain
gadfly. The concept is truly revolutionary but the use cases I typically see
trotted out are not compelling in any significant sense and could be solved
without blockchain. I believe the reason for this is due to the fact that the
true value of a blockchain solution is not in the data aspect of it (which
everyone gravitates to and can quickly grasp and understand) but more in the
transactability that a blockchain solution can offer. And the value of radical
transactability requires much less of a myopic understanding of a person's
business vertical than many professionals possess. In energy for instance,
much talk about the financial aspect of a blockchain-based energy solution but
absolutely zero talk of how the physical grid and infrastructure would engage
to support the financial activity.

~~~
prostoalex
> The concept is truly revolutionary

In what way? Publishing a DB dump with a checksum has been around for decades,
and doesn't require a new user to download an entire history of deltas from
day 1.

~~~
romaniv
I'm curious about this as well. No one seem to be talking about specific
attacks mitigated by blockchains as opposed to authorities signing current
state.

The definition implies that if someone says "I'm on block 1000" they cannot
create altered version of history without touching all the blocks after the
change.

But how is this useful? If there is a disagreement about the last block,
majority wins, right? So couldn't majority simply have the most up-to-date
version of the database with a single signature?

~~~
decentralised
The attacks that blockchain can protect against are:

\- Fraud

\- DDoS

\- Censorship

The usefulness of a consensus protocol is that no one party can be trusted to
have the most up-to-date AND valid blockchain. Every node has the incentive to
cheat and the consensus rules define a method of evaluating the proposed chain
of blocks and determine it's "trustworthiness". In PoW this is often an
algorithm like Greedy Heaviest Observed Sub-Tree (GHOST) which favours the
fork with the highest accumulated work.

This is why it's important that mining is an expensive activity, to discourage
attackers from wasting thousands of euros in electricity and then losing the
block reward payment.

~~~
romaniv
_> The usefulness of a consensus protocol is that no one party can be trusted
to have the most up-to-date AND valid blockchain._

Consensus protocols do not require mining. You can simply poll X random nodes
and compare what they tell you. I don't understand what mining adds to the
equation. Okay, instead of "I need to control 50% of all nodes" it becomes "I
need to control 50% of all mining capacity". Is that the point of mining? To
make inserting hordes of _cheap_ lying nodes impossible?

~~~
decentralised
I didn't say that consensus protocols needed mining, only PoW which is a
consensus protocol uses it.

You can poll multiple nodes and each one will give you a different answer
because of message propagation times.

Mining fulfils two roles:

\- identity management: To identify who is a trustworthy block producer in an
anonymous and trustless network, mining introduces a cost to the block
generation process and we use a game theory assumption that it serves as a
barrier for attackers. This doesn't mean there aren't validation checks
performed by other nodes in the network and the consensus forming rules
themselves of course.

\- consensus formation: In a distributed network, nodes are bound to disagree
on which is the canonical chain out of two or more competing forks. The most
common algorithm calculates the accumulated computational effort of each chain
of blocks and picks the "heaviest" one, ie the one with the most work done on
it. This has the nice side effect of ensuring economic finality for the
transactions in those blocks.

------
mathnmusic
I used this blockchain demo to teach a class this weekend. Many thanks to
Anders Brownworth for creating this:
[https://anders.com/blockchain/blockchain.html](https://anders.com/blockchain/blockchain.html)

~~~
s_dev
Even the MIT URL in the source uses Anders demo -- it's that good.

Edit: Oh wow -- Anders is the author of the MIT demo. All the same stuff
really.

------
geraldbauer
A great way to learn about blockchains is building your own from scratch /
zero in Python, Ruby, JavaScript, etc. Find many starter samples and articles
in the Awesome Blockchains [1] collection. [1]:
[https://github.com/openblockchains/awesome-
blockchains](https://github.com/openblockchains/awesome-blockchains)

------
dsco
For the Javascript lovers out there, I wrote a client-side project which
conceptually demonstrates how a blockchain works. It runs in your browser and
uses web workers to concurrently mine blocks, showing how miners, transactions
and addresses fit together.

[https://github.com/sunmer/lightchain](https://github.com/sunmer/lightchain)

------
Moodles
Now explain to a technical audience why some people say nonsense like how it’s
the next internet or how it’ll change the world please.

~~~
gibsons77
Well.. It will change some aspects of our world. Particularly financial assets
at first, but increasingly it will play a role in any peer to peer exchange
requiring trust. Simple past examples are systems like OpenPGP that bind
public keys to owners. Programmable blockchains allow generalized applications
requiring decentralized trust. A good example of a use of blockchain outside
of financial assets is in trust management of vehicular networks. In order for
vehicles to communicate amongst each other, they need to trust that the
messages they are receiving are authentic using a decentralized consensus
mechanism and some sort of Bayesian Inference Model.

So in short, it is an extension of the internet (trust layer) and it will
change the world. So I don't think that's nonsense to say, but I can see how
these claims would appear to be exaggerated to someone with limited exposure
to Bitcoin and other cryptocurrencies.

~~~
Moodles
I have a PhD in cryptography. Please be precise. _Exactly_ what problem will
blockchain solve for vehicles? You can't just hand wave and say stuff like
"decentralized trust management" and expect us to nod along.

~~~
the_snooze
Yeah, I'm quite skeptical of it as well. If I'm being really charitable to it,
then it's a way to synchronize data between parties without relying on a
trusted intermediary. That said, it's unclear what practical value that has
outside of purely digital applications like cryptocurrency. When you roll it
into things in the real world (e.g., supply chains, health records, etc.) then
you necessarily have to trust the data sources and sensors, at which point
what good is a blockchain?

~~~
easymodex
Say you initiate a contract to sell a yacht for 1 million $. You and your
buyer go to a notary where all 3 of you sign the contract and all the proper
procedures. You give the buyer the yacht and he says he will transfer you the
money tomorrow. Meanwhile the buyer and the notary strike a shady deal to
screw you over and make new contracts that say you sold it for 1k$. It's 2
against 1 and you will lose a costly court battle and your yacht and so on.

Solution: blockchain smart contracts where code is law, more secure,
trustworthy and transparent than any individual, bank, government or company.

~~~
Moodles
You are trying to solve a problem with a blockchain that does not exist. Also,
exactly how does your blockchain even know "this yacht now belongs to this
person"?

~~~
easymodex
How is this not a problem if the court system is filled to the brim with
situation that could have been solved with smart contracts in place.

As for the yacht it's easy, the ownership is transfered from your address to
the buyers address on the government's blockchain. :)

~~~
Moodles
hey everyone lets record every transaction from everyone on a big government
database so we can solve trade disputes if someone steals my yacht and crashes
it.

------
p4bl0
This is a very good and clear explanation of how bitcoin type blockchains
work. It could easily have been made simpler and more general at the same time
by omitting the proof of work aspect, which is not even discussed actually.
The "begin with four zeros" rule is completely arbitrary, it could be any
prefix of any length depending on the necessary amount of work that you want,
including zero. And with an empty prefix we still have a blockchain with all
the properties presented here that hold.

~~~
abraham_lincoln
Is it necessary to be based on the prefix, or can it be implemented by
pattern, for instance, every even byte is zero, or the 4 bytes after the first
3 bytes must be all 7s, etc?

Is it simply brute-forcing hashes, looking for matching patterns that are not
yet known?

~~~
lmpostor
I don't see what prevents you from adding complexity.

And yeah, but it also requires valid transactions if you want to collect fees,
as well as the knowledge of the valid previous block.

------
thallukrish
After a long time of procrastinating understanding block chains, I could watch
the whole video and understand it finally. Thanks for the great visual
explanation.

------
jondubois
I remember that a lot of people were saying that cryptocurrency is not
revolutionary but that blockchain is. I think the opposite is true.
Cryptocurrency is revolutionary and blockchain is just one of several known
technologies that make it possible. Cryptocurrency is the most important use
case for blockchain tech.

What I like most about cryptocurrency is the fact that it financially
incentivizes massive collaborative behaviour without requiring participants to
actually own any capital at the beginning. It lets you create financial
incentives out of nothing. Before cryptocurrency, this kind of collaborative
game-rigging behaviour was only accessible to people who owned a lot of
capital (e.g. 'activist' investors).

For example, I could launch my own cryptocurrency tomorrow and then use it to
air-drop (aka bribe) journalists to write about my project in a positive way -
This is pretty standard behaviour among Silicon Valley startups but now you
can do it without VC money.

It sounds bad but it's much better than what we have now.

It levels the playing field for everyone. For the first time ever, regular
people have the power to change the world together through incentivised
collaboration.

~~~
aklemm
But if those cryptocurrencies keep never amounting to anything, then the
bribing won't keep working, right?

~~~
jondubois
It will but maybe it will be harder to do it.

It's like if you could give some shares of your startup to a journalist in
exchange for writing an article about your startup. Cryptocurrency can act
like shares without central authority. If enough software services rely on a
specific cryptocurrency as payment, then it has actual intrinsic value

~~~
aklemm
"If enough software services rely on a specific cryptocurrency as payment,
then it has actual intrinsic value"

I wish I'd seen this earlier. Pretty sure this is false, but it is an
excellent summation of the thought behind what's run up digital currencies.

------
Isamu
Question: the video explains that you can't just change a bit in the middle of
the blockchain without having to fix all the subsequent blocks, making
tampering labor intensive, but not impossible. Is it supposed to be VERY labor
intensive, depending on the length of the chain?

Then ultimately a chain that is consistent might have been manipulated, but
you can check it against other copies. At this point you could be just
comparing plain text ledgers (but blockchain comparison could be easier by
just comparing hashes.)

~~~
kybernetikos
The reason it's VERY labor intensive is because in a PoW blockchain, each
block also includes a value that combined with the previous blocks hash hashes
to a number less than the difficulty (the value labelled nonce in this demo).

The difficulty can be adjusted to ensure that finding such a number is very
hard. Obviously in the demo, it was not so very difficult - your machine was
able to work out a value for the nonce very quickly by itself, but in the real
network, the difficult is set so that this is hard. So hard that the whole
network of miners working together will only find one, on average every x
minutes (configurable depending on how you update the difficulty). This means
that creating another block is difficult.

The whole network has the rule that longer chains of blocks are preferred over
shorter ones, so as more blocks are added to a chain, the amount of
computation required to overtake the main chain and have your modified chain
accepted as the truth becomes very large. To rewrite history, you don't just
need to modify the data and recalculate the hash for each subsequent block,
you need to find a nonce that works for each of the subsequent blocks, and you
need to be doing this faster than the main chain is adding new blocks, or your
chain will never be as long as the main chain, and it will never be considered
the 'truth'.

That's why people talk about 51% attacks - the idea is that you need to have a
majority of the hash power of the network working on your dodgy chain if you
want it to overtake the main chain. Now there are things you can do with less
than 51% of the network hash power, but for the naive approach, you're going
to need a phenomenal amount of computing power to stand a chance of having
people accept your version of history. For alt-coin chains with very few
participants, there have been real attacks along these lines. It's hard to
imagine attacks like this succeeding against any of the main blockchains
though.

And yes, comparing two blockchains for equality is very easy - the hash of a
block includes the hash of the previous block, as you can see in the demo, so
the hash represents the entire history. If two blockchains have a different
hash for the top block, they have different histories.

------
beefman
Original site:
[https://anders.com/blockchain/](https://anders.com/blockchain/)

~~~
tim333
And original discussion from back when ETH was $11 or so a year and a half ago
[https://news.ycombinator.com/item?id=13566951](https://news.ycombinator.com/item?id=13566951)

------
brighton36
You know, I used think the technicals mattered. Then I realized how the
technology behind the technology behind bitcoin works:
[https://twitter.com/mikeinspace/status/1043577578357952512](https://twitter.com/mikeinspace/status/1043577578357952512)

------
WC3w6pXxgGd
This is the best explanation of blockchain I've found.

------
aklemm
Is there any interesting work going on with blockchain for identity management
(Internet or other, I guess)?

------
abraham_lincoln
Why is it assumed a blockchain is always distributed?

I think that distinction needs to be made (centralized vs distributed).

------
Razengan
I have yet to watch/read the link, or catch up on the hype, but why is
"Blockchain" referred to in the singular? As in "the blockchain" or just
"blockchain" (often capitalized.)

Is there only one of its kind?

Is "How Internet Works" grammatically correct?

EDIT: I didn't see this was already asked in another comment.

~~~
fartcannon
I too want to know this. You'd think it would be "How (a) blockchain works" or
"How blockchains work"... The way this is written feels like they're
suggesting there is only one.

------
olalonde
<rant> This ship seems to have sailed already but I feel like it really should
have been "How blockchains work". We don't say "How relational database
works", "How operating system works", "How computer works", etc. We do say
"How Linux works" or "How Bitcoin's blockchain works".

~~~
blowski
Just to play devils advocate here, I drink “milk” not “milks” despite the fact
that it might be from soya, cow or goat.

~~~
stolenmerch
Because 'milk' is an unmarked plural. 'Chain' is not.

~~~
zepto
Blockchain is an unmarked plural

~~~
hannasanarion
No it isn't. Nobody says "one blockchain, two blockchain, oh hey look I found
a bunch of new blockchain".

Blockchain is here being used in reference to the technology itself, not the
collection of its manifestations. Just like you might say "how the internal
combustion engine works" or "how insertion sort works"

~~~
supersock
Does anyone say "here's one water, two waters"?

~~~
chaosphere2112
When ordering at a restaurant, yes.

~~~
jnordwick
I think that is an example of synecdoche, using a part (the water) to
represent the whole (the glass of water).

