decentralized consensus and the death of the server
DESCRIPTION
From Connect.JS Atlanta 2014. Trust nobody unless it's everybody. Gordon will be discussing the problems with the centralization of information and leading an interactive demonstration of how to implement a completely decentralized peer-to-peer voting system using Node.js.TRANSCRIPT
1
Decentralized Consensusand the
Death of the Server
2
sp0rkyd0rky
gordonwritescode
3
The Client-Server Model is Broken
4
Popular services become susceptible to targeted attacks
Use of software requires an active network connection
5
Your data is stored, handled, and secured by a third party
The remote server is a single point of failure
6
Necessitating Trust has Consequences
7
You are only as secure as the remote host and there is no means to audit remote software
Experience is controlled by a man behind a curtain
8
Using centralized social networking software is the most widely demonstrated
form of a MITM attack.
9
(centralization === tyranny)
10
Monetization becomes more important than user privacy and freedom
Software products begin manifesting as instruments of power
11
●Users are reduced into tools serving the interest
of the software.
12
Which, in turn, serves the interests of the
developer.
13
while(true) { resist() }
14
To say that anarchists subscribe to anarchism is like saying that pianists subscribe to pianism
15
Anarchy is simply cooperative self-determination – it is part of everyday life.
16
It is a mode of being, a manner of responding to conditions and relating to others, a class of human behavior.
17
Peer-to-peer networking undermines the necessity of authority.
Decentralized systems empower users to compute freely.
18
Trust is not vital to the operation of decentralized systems.
Cryptography replaces the need for trust with math.
19
Really, really hard math.
20
This enables you to restrict who can access information that belongs to you.
And can verify the authenticity of information shared with you.
21
Decentralizedor
Distributed(or the difference between agnostic and atheist)
22
23
24
The difference lies in trading some trust for some performance.
25
if (centralized > decentralized) process.exit(1);
26
Centralized application design is popular because it is easy to control.
Peer-to-peer problems are more difficult to solve.
27
Software should improve life by enabling users to solve problems they have in common, collectively.
Why do you write software?
28
Building Decentralized Consensus with Node.js
29
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
30
I mean, duh.
31
SmokeSignal is P2P networking in a box.
Tiny is an in-process key/value store.
32
The protocol defines how peers communicate.
Defining this is more than half of your application design.
33
{ message: JSON({ id: String(base64(sha1(pubkey)), key: String, value: Mixed, time: Date }), pubkey: String, signature: String(privkey.sign(message))}
34
The public key and signature allow peers to verify the authenticity and origin of the message.
The timestamp prevents old messages from taking precedence.
35
The message ID lets peers store the record under a namespace that is unique to the message author.
Key/value pairs are unique per identity.
36
Consensus can be defined as the aggregate of values for a given key.
This resembles a vote for a arbitrary topic.
37
When peers connect, they stream their record of history from each other.
This is used to synchronize the consensus.
38
All peers have the same record of history.
Trusting nobody unless it's everybody.
39
Streams are your best friend.
They are indispensable for both performance of nodes and maintainability of software.
40
var parser = new MsgParser();var handler = new MsgHandler();
node.pipe(parser).pipe(handler);
41
npm install -g dside
42
(decentralization === liberty)