whisper

29
Whisper What and Why

Upload: gavofyork

Post on 14-Jul-2015

83 views

Category:

Documents


2 download

TRANSCRIPT

Whisper

What and Why

Avoid use for pure comms

Consensus is Expensive

Comms patterns in MMUs

Static content publicatione.g. BitTorrent, FTP

Connection (betwixt identities)e.g. VoIP, RTC

Transient Datagramse.g. Twitter, IM, registries

Datagram patterns in MMUs

Wholly directede.g. IM, e-mail

Partially directede.g. Mailing list, usenet

Filterable globale.g. Twitter, registries, content-search

Static Content

DHT/Swarm

(See later talk)

RTC Connection

Raw P2P Connection

Thin layer over ÐΞVp2p

Encryption alone won’t keep your information safe

Routing privacy is

important

Whisper

Hybrid DHT and messaging system

Dark...probabilistic message forwarding

Subject-key orientated...no indication of encryption, no notion of recipient

Is it a DHT?

Multi-key...many ‘topics’ associated with entries

Multi-value...many entries can have the same key-set

Transient...entries have explicit expiry

Is it a Datagram Transport Layer?

Broadcast/multicast/unicast...always secure & authenticated

Asynchronous...packets have a TTL

Proof-of-work,good-behaviour incentivisation

Anti-DoS/SPAM

Endpoint is implementation detail

Always Identity,

Never Endpoint

User makes efficiency/privacy tradeoff

Configurable

Watch for topic subsets, act accordingly

Topic-based

Unicast vs broadcast = Encrypted vs plain

Secure

Origin vs anonymous = Signed vs unsigned

Authenticated

What it’s not

Point-to-point

High bandwidth

Low latency

Application-level

Connection-oriented

Two Routes to Routing

Passive...peer steering through rotation against past usefulness

Active...topic advertising through masks

Prioritised Forwarding

Serve your peers well or risk disconnection

Interesting Topics...prioritise messages in which peer has expressed interest

Lowest TTL...prioritise short-lived messages

Highest Proof-of-Work...prioritise messages for which a greater proof-of-work has been conducted

Masking/Filtering

Stacking the odds with topic masks

Configurable ...masks can use configurable number of bits to give info to peers

Customised per peer...more trusted peers can be better informed

Customised per ÐApp...more sensitive ÐApps can have greater privacy

Masking/Filtering

Forming the topic vortex

Consolidation of masks & forwarding...masks of all other peers are consolidated packaged and resent

log(N) distance for mask precision...information drops-off further away from peer as net increases

API

Three functions

newIdentity...create a new identity (i.e. key pair)

post...post an entry/message

watch...watch for new entries/messages on the system

newIdentity

var key = newIdentity();

post

shh.post({optionally "from": owned public key,optionally "to": public key,"topics": [ ..., ... ],"payload": ...,"ttl": integer,"priority": integer

});

watch

var w = shh.watch({optionally "to": owned public key,"filter": [ ..., ... ],

});

w.changed(function(m) { ... });

var ms = w.messages();

w.uninstall();

Example

var myIdentity = shh.newIdentity();

shh.post({"from": myIdentity,"topics": [ web3.fromAscii(appName) ],"payload": [ web3.fromAscii(myName),

web3.fromAscii("What is your name?") ],"ttl": 100,"priority": 1000

});

var replyWatch = shh.watch({"filter": [ web3.fromAscii(appName), myIdentity ],"to": myIdentity

});

replyWatch.arrived(function(m){

// new message mconsole.log("Reply from " +

web3.toAscii(m.payload) + " whose address is " + m.from;});

Example

var broadcastWatch = shh.watch({ "filter": [ web3.fromAscii(appName) ] });broadcastWatch.arrived(function(m){

if (m.from != myIdentity){

// new message m: someone's asking for our name. Let's tell them.

var broadcaster = web3.toAscii(m.payload).substr(0, 32);

console.log("Broadcast from " + broadcaster + "; replying to tell them our name.");

shh.post({"from": eth.key,"to": m.from,"topics": [ eth.fromAscii(appName), m.from ],"payload": [ eth.fromAscii(myName) ],

"ttl": 2,"priority": 500

});}

});

Not yet covered

Multicasting (shared-secret dispersal)

Plausible deniability of authoring (Daniel?)

Security, privacy and scalability modelling:

how good is it?

WhisperWhat and Why

Questions