a blockchain! ◦ About shared objects ◦ Required import packages for P2P ◦ BlockChain specific functions ◦ Host to deal with incoming data steams • Demo
public keys, ◦ check: multihash(other.PublicKey) equals other.NodeId. ◦ If not the connection is terminated. ➢ What is multihash? ◦ Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, ◦ and allow multiple hash functions to coexist. ◦ varint hash function code(tag: multihash) ▪ https://github.com/multiformats/multicodec/blob/master/table.csv
Routing table ▪ where each peer holds a set of k-buckets ▪ each of them containing several PeerInfo objects from other peers in the network. libp2p architecture
a distributed hash table for decentralized peer-to-peer computer networks designed by Petar Maymounkov and David Mazières in 2002 • Kademlia stores values in nodes whose ids are “nearest” ◦ using XOR-distance to the key. • The ID uses the hash value of the IP address. • see: https://libp2p.github.io/js-libp2p-kad-dht/ libp2p architecture 001
to identify if local area network peers have a given key or they are simply present. ◦ other-routing-mechanisms ▪ other Peer Routing mechanisms can be implemented libp2p architecture
MultiConn-a set of connections to a single Peer ▪ SecureConn-an encrypted (tls-like) connection ◦ Swarm-holds connections to Peers ▪ multiplexes from / to each MultiConn ◦ Muxer-Multiples between Services and Swarm. Handles Request / Reply. ▪ Service-connects between an outside client service and Network. ▪ Handler-the client service part that handles requests libp2p architecture
distribute records. ◦ Records are small entries used by other systems for signaling, establishing links, announcing peers or content, and so on. They have a similar role to DNS in the broader Internet. libp2p architecture
that uses mDNS over local area networks. ▪ It emits mDNS beacons to find if there are more peers available. ◦ Random-Walk ▪ Random-Walk is a Discovery Protocol for DHTs (and other protocols with routing tables). ▪ It makes random DHT queries in order to learn about a large number of peers quickly. ▪ at the expense of a small load at the very beginning. ◦ Bootstrap-List ▪ Bootstrap-List is a Discovery Protocol that uses local storage to cache the addresses of highly stable (and somewhat trusted) peers available in the network libp2p architecture
library module description github.com/libp2p/go-libp2p libp2p dial / listen, network package github.com/libp2p/go-libp2p-net github.com/libp2p/go-libp2p-host swarm protocol/stream muxer github.com/libp2p/go-libp2p-peerstore distributed record store an object to manage peers, their addresses, and other metadata about them. github.com/libp2p/go-libp2p-peer utilities PKI-based identity management github.com/libp2p/go-libp2p-protocol utilities type for protoco github.com/libp2p/go-libp2p-crypto utilities various cryptographic utilities