whisper
TRANSCRIPT
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
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
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
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?