Merge branch 'gossipsub'

master
rairyx 4 years ago
commit 35d73ee70b

@ -1,12 +1,15 @@
# Raven
## Anonymous decentralized messaging network
Blockchain has enabled decentralized value transfer. A bigger future is decentralized messaging. One unresolved area is anonymous message broadcasting which provides metadata privacy(who is sender, who is receiver, who send to whom, IP address, location, et cetera).
Blockchain has enabled decentralized value transfer. A bigger future is decentralized communication. One step forward is anonymous decentralized communication which provides a censorship resistence privacy preserved communication network that anyone can send/receive, broadcast messages anonymously without revealing message metadata(sender, receiver, who send to whom, etc). It will find broad use cases, e.g., whistleblowing, anonymous group chat, anonymous survey, privacy preserved messaging in Dapps etc.
Raven is an anonymous message broadcasting network which is decentralized, censorship resistance, privacy preserving and scalable. Anyone can send/receive, broadcast messages anonymously without revealing message metadata.
Anonymity is achieved by implementing Dandelion++ protocol on top of libp2p's pub/sub module, Dandelion is a privacy preserving protocol to make message sender anonymous, it has 2 phases, the first phase is stem phase, where messages go through a psuedo-random path, the second phase is fluffing, at a random time of the stem phase, the message is diffused to its surrounding peers, so the third party observer cannot track back the node original node who send the message, because the message is relayed through an anonymous graph. Message broadcasting is implemented by libp2p floodsub. Dandelion++ is an improved version of Dandelion.
It has two main use cases, one is decentralized messaging applications for humans, e.g., whistleblowing, anonymous group chat, anonymous survey, privacy preserved message broadcasting for decentralized applications. The other use case is for protecting blockchain against deanonymization attacks thereby DoS attacks in which network adversary links transaction/block/attestation to IP addresses and other sensitive metadata.
**Dandelion++ implementation on libp2p-pubsub**: https://github.com/rairyx/go-libp2p-pubsub/tree/dandelion++
Anonymity is achieved by implementing Dandelion++ protocol on top of libp2p's Gossipsub module, Dandelion is a privacy preserving protocol to enable message sender anonymity, it has two phases. The first phase is stem phase, where messages go through a psuedo-random path. The second phase is fluffing. At a random time during the stem phase, the message is diffused to its surrounding peers, so the third party observer cannot track back the message to the original node who send the message, because the message is relayed through an anonymous graph. Message broadcasting is implemented by libp2p's gossipsub. Dandelion++ is an improved version of Dandelion.
**Dandelion++ implementation on libp2p-pubsub**: https://github.com/rairyx/go-libp2p-pubsub/
## Demo

@ -13,13 +13,13 @@ import (
host "github.com/libp2p/go-libp2p-core/host"
inet "github.com/libp2p/go-libp2p-net"
peerstore "github.com/libp2p/go-libp2p-peerstore"
libp2pdht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p-crypto"
logging "github.com/whyrusleeping/go-logging"
gossipsub "github.com/libp2p/go-libp2p-pubsub"
gossipsub "github.com/rairyx/go-libp2p-pubsub"
ma "github.com/multiformats/go-multiaddr"
)
var logger = log.Logger("raven")
var ho host.Host
var TopicName string = "RDEpsjSPrAZF9JCK5REt3tao"
@ -34,6 +34,7 @@ func parseArgs() (bool, string, int) {
usage := fmt.Sprintf("Usage: %s PRIVATE_KEY PORT [--bootstrapper] \n\nPRIVATE_KEY is the path to a private key like '../util/private_key.bin'\n PORT is port to listen on, default is 6000\n--bootstrapper to run in bootstrap mode (creates a DHT and listens for peers)\n", os.Args[0])
var bBootstrap bool = false
var privKeyFilePath string
var listenPort = 6000
var args []string = os.Args[1:]
if (len(args) == 0) || (len(args) > 2) {
fmt.Printf("Error: wrong number of arguments\n\n%s", usage)
@ -42,21 +43,21 @@ func parseArgs() (bool, string, int) {
privKeyFilePath = args[0]
if (len(args) == 2) && (args[1] == "--bootstrapper") {
bBootstrap = true
}else if (len(args) == 2) {
listenPort, _ = strconv.Atoi(args[1])
}
return bBootstrap, privKeyFilePath
return bBootstrap, privKeyFilePath, listenPort
}
func main() {
log.SetAllLoggers(logging.DEBUG)
log.SetLogLevel("raven", "debug")
ctx := context.Background()
bBootstrap, privKeyFilePath := parseArgs()
bBootstrap, privKeyFilePath, port := parseArgs()
fmt.Printf("Starting up in ")
if bBootstrap {
fmt.Printf("bootstrapper mode (port 5555)")
} else {
fmt.Printf("peer mode (port 6000)")
fmt.Printf("peer mode : %d", port)
}
fmt.Printf("\nPrivate key '%s'\n", privKeyFilePath)
@ -97,6 +98,11 @@ func main() {
panic(err)
}
logger.Info("Host created. We are:", host.ID())
kademliaDHT, err := libp2pdht.New(ctx, host)
if err != nil {
panic(err)
}
// Bootstrap the DHT. In the default configuration, this spawns a Background
// thread that will refresh the peer table every five minutes.
logger.Debug("Bootstrapping the DHT")

@ -20,7 +20,7 @@
parent = ""
position = 71:55
size = 734, 451
title = PubSub Demo (Go, JS, Rust)
title = Raven Demo (Go)
type = Window
[[[child1]]]
order = 0
@ -42,7 +42,7 @@
type = HPaned
[[[terminal3]]]
profile = default
command = 'pushd .. ; ./raven ../util/private_key.bin.bootstrapper.Wa --bootstrapper; popd ; bash'
command = 'pushd .. ; IPFS_LOGGING=debug ./raven ../util/private_key.bin.bootstrapper.Wa --bootstrapper; popd ; bash'
order = 0
parent = child2
type = Terminal
@ -56,14 +56,14 @@
uuid = a551b167-2da7-4994-ac12-5063852055da
[[[terminal6]]]
profile = default
command = 'sleep 1 ; pushd ../js ; node index.js /ip4/127.0.0.1/tcp/5555/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa; popd ; bash'
command = 'sleep 1 ; pushd .. ; ./raven ../util/private_key.bin.peer.w6 6001; popd ; bash'
order = 0
parent = child5
type = Terminal
uuid = 8358280f-49da-4a74-bb27-7a3c7e472fe9
[[[terminal7]]]
profile = default
command = 'sleep 1 ; pushd .. ; ./raven ../util/private_key.bin.peer.vy; popd ; bash'
command = 'sleep 1 ; pushd .. ; ./raven ../util/private_key.bin.peer.d9 6002; popd ; bash'
order = 1
parent = child5
type = Terminal

Loading…
Cancel
Save