ecosistema-social-decentral.../protocols/hypercore.md

61 lines
4.1 KiB
Markdown
Raw Normal View History

2020-05-27 04:29:29 +02:00
# Hypercore
Hypercore, formerly known as Dat, is a distributed append-only log.
2020-06-13 04:33:33 +02:00
Dat was created in 2013 as a protocol designed to help data analysts collaborate on changes to data sets, but has since expanded to other use cases. Dat was renamed Hypercore in 2020 to reflect the extent of the changes. The older Dat protocol was "a p2p hypermedia protocol that provides public-key-addressed file archives which can be synced securely and browsed on-demand."
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
Hypercore has moved away from a distributed file system architecture. It focuses on the p2p distribution of an append-only log, and its main purpose is to be a building block for other applications. The switch to hypercore was motivated by performance and scaling improvements, and the addition of [mounts](https://blog.hypercore-protocol.org/posts/announcing-hyperdrive-10/) for nested hyperdrives. In addition, a DHT was added for peer lookup.
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Identity
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Networking
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
Hypercore uses the [Hyperswarm](https://hypercore-protocol.org/#hyperswarm) networking module. Hyperswarm combines a Kademlia-based DHT for global discovery with MDNS to discover peers on local networks. Users [join the swarm](https://pfrazee.hashbase.io/blog/hyperswarm) for a “topic” and query periodically for other peers who are in the topic. When ready to connect, Hyperswarm helps create a socket between them using either UTP or TCP. A set of bootstrap servers is used to help connect a new node to the network.
2020-06-13 04:33:33 +02:00
### Data
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
Hypercore's primary data structure is a signed append-only log. Hypercore focuses on mutable data by organizing content under keys. A cryptographic keypair is used to sign the root of the Merkle tree (tree log?) as data is appended to it. Files stored under a key can easily change at any time. To track changes, Hypercore keeps a version log of the dataset over time. Only the original creator of a Hypercore can append new data, making it a [single-writer data structure](https://mafinto.sh/blog/introducing-hypercore-8.html). Multi-writer data structures can be built by using multiple hypercores that reference each other's elements.
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
Hyperdrive is the filesystem implemented on hypercore. It is an append-only hash trie, which functions like a folder of files. An improvement added to Hypercore that was not present in Dat is the ability to mount hypercores like a folder of files, giving others access to subsets of data.
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
A node must be actively sharing a topic for it to be available. To ensure persistence, nodes can [pin their own data](https://docs.dat.foundation/docs/dat-server) on a server that stays online, or can pay a pinning service to host it.
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Moderation & Reputation
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
### Social & Discovery
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
Nodes create keys for topics. Data they want to associate with that topic can be added to the signed log.
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
Hypercore optionally uses DNS to give short-names to keys, so that users can have a "foo.com" address.
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Privacy & Access Control
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
By default, Hyperswarm connections are unencrypted. Hyperswarm does not hide user IPs or mask metadata. However, once Hyperswarm has established a connection, Hypercore wraps it in a [Noise protocol](https://noiseprotocol.org/) stream to add end-to-end encryption.
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Interoperability
2020-05-27 04:29:29 +02:00
### Scalability
2020-06-13 04:33:33 +02:00
Study on scalability of Dat vs HTTP for video streaming: http://www.diva-portal.org/smash/get/diva2:1318896/FULLTEXT01.pdf
### Metrics
2020-05-27 04:29:29 +02:00
2020-06-13 04:33:33 +02:00
### Governance & Business Models
2020-05-27 04:29:29 +02:00
The Hypercore protocol's development is coordinated through the Dat Foundation nonprofit, and led by two companies, Blue Link Labs (which develops Beaker browser), and Hyperdivision consulting.
2020-06-13 04:33:33 +02:00
### Implementations & Applications
2020-06-13 06:19:04 +02:00
The [Beaker browser](https://beakerbrowser.com/) is a p2p web browser for Hypercore sites.
Applications using Hypercore include:
- [Mapeo](https://www.digital-democracy.org/mapeo/), an offline-friendly mapping software to support indigenous land rights
- [Cabal](https://cabal.chat/), a p2p chat platform
- [Peer-to](https://peer-to.peer-to-peer-web.com/), an online art exhibition only available on the through the Beaker browser
2020-06-13 04:33:33 +02:00
### Links
2020-05-27 04:29:29 +02:00
2020-06-13 06:19:04 +02:00
[Hypercore Protocol](https://hypercore-protocol.org/)
[Comparing IPFS and Dat](https://medium.com/decentralized-web/comparing-ipfs-and-dat-8f3891d3a603)