webrtc in a decentralized environment · matrix.org + webrtc standard for decentralized...

20
WebRTC in a decentralized environment Kaustav Das Modak | @kaustavdm

Upload: others

Post on 09-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

WebRTC in a decentralized environment

Kaustav Das Modak | @kaustavdm

Page 2: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

De-centralizedNo single control

Page 3: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

ResilientIntent to survive worst possible conditions

Image: Sapling by Jason Scragz. CC BY 2.0

Page 4: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Privacy-awareHarder to control and snoop on user data

Image: All YOUR data are belong to U.S. by Imamon. CC BY 2.0

Page 5: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

SecureEnd-to-end encryption to avoid unauthorized access

Image: Secure Cloud - Data Security - Cyber Security by Perspecsys Photos. CC BY-SA 2.0

Page 6: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Re-decentralizeAsk for a decentralized, secure and private internet with open access for

everyone.

Image: Grumpy Cat builds a GNU Internet by Frerk Meyer. CC BY-SA 2.0

Page 7: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Internet has centralized partsUndersea cables, root name servers, web servers

Page 8: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

We can decentralize enough

Page 9: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Can we build a decentralized communications application?

Page 10: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

matrix.org + WebRTCStandard for decentralized communication

JSON API over HTTP Specifications for secure distribution of data

Data persistence Open federation of servers

Page 11: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

How matrix works

Page 12: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Peer-to-peer WebRTCUse matrix for signalling. Distributed discovery.

Once connected, use data channels to exchange data.

Page 13: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

About data channelsRTCPeerConnection.createDataChannel() -> RTCDataChannel Uses SCTP (message-oriented, flow and congestion control)

Send files as blobs Works with JavaScript primitives, like ArrayBuffer.

Page 14: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Using RTCDataChannelvar pc = new RTCPeerConnection();

// Connect to peer through matrix... Then... var dchannel = pc.createDataChannel("hello", options);

dchannel.onmessage = function (evt) { console.log("Received:", evt.data); };

dchannel.onopen = function () { dataChannel.send("Hello, World!"); };

Page 15: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Trade-offsCannot initially support more than 3 users in a call.

Cannot directly record stream on the server. Needs significantly more effort that a centralised signalling server.

Page 16: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

matrix.org + SFU + WebRTCUse matrix rooms for grouping participants

Use SFU to mix and broadcast traffic Use WebRTC to build clients across platforms

Quick Fix: multi-party environments

Page 17: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

The SAFE networkA decentralized internet

Alternatives?

Page 18: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Just decentralizing is not enough You need to deliver value.

Page 19: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Read more: “Why decentralize technology?”

https://kaustavdm.in/why-decentralize-technology.html

Page 20: WebRTC in a decentralized environment · matrix.org + WebRTC Standard for decentralized communication JSON API over HTTP Specifications for secure distribution of data Data persistence

Thanks!

Tweet to @kaustavdm | https://kaustavdm.in