• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

cyphernet

secure replicatable tree database.

a README Project

Currently, this is a readme project. Really, cyphernet will be many projects that fit together. Please check the issues to take part in discussions on aspects of this project.

Synopsis

cyphernet is a abstraction of ideas present within various distributed systems such as git, bittorrent, and bitcoin. There are three key aspects:

  • objects are just binary blobs identified by their hash. This is known as a content addressable database.

  • hashes inside an (e.g. JSON) object are pointers or "links" to other objects. thus, the database is a tree of hash pointers, called "cypherlinks".

  • arbitary subsets of any two databases may be exchanged via merkle trees. (merkle trees allow two remote nodes to rapidly compare two sets of objects, and may then replicate by merging their sets)

interesting properties

Database is a tree, not a graph.

It is not possible for a cycle to form within a graph, unless there is a hash collision (highly unlikely). So the graph must be a tree, and it is not necessary to check for cycles.

Hashes always point backwards in time

You cannot create a hash, and then the object that produces the hash. Instead, you must have the object, and then hash it. Therefore cypherlinks always point backwards in time to things that already existed before the document that they are contained within was created.

Immutability, Security, Distributability.

Since every object is referenced by it's hash, it's impossible to change (immutable). If any one changed a piece of data, then it would change the hash. If you have the hash of a document, then you can always verify it. So, if you ask for a particular document ("follow a cypherlink"), then it doesn't matter who you receive that document from!

This is the reverse of the security model of the www. In most network applications, security is implemented by authorizing the connection. But in a cyphernet, you use cryptographic hashes to authorise the documents, but it is not necessary to authorize the connection.

This is rather like "authenticating" your friends by the sound of their voice, not just because the call has come from the correct phone number. You can still verify your friends identity if they call from a different phone, or even if you see them in person.

Replication Partners

The cyphernet is still potentially secure when completely distributed. There is no need to replicate via a central, or known server. However, how to track peers, and initiate connections is out of scope of this project. cyphernet is focusing on datastructures, security, and replication. Network topology is another problem. There are other projects that deal with creating connections between remote peers. peerjs, cjdns and ZeroTierOne

Defining a subset to replicate

The set of documents that define an "application" or "service" could be defined in any number of ways. In git, a repository contains the data for just one project, but you can replicate (checkout) just the branches you require. With a blog, you'd want to replicate the text and images on each post, plus the comments. On a social network, you'd want to replicate your mutual friends.

When two nodes connect, they will exchange a handshake that describes the set of objects they wish to exchange. Then each pair traverses their database for objects in that set. Then the difference between the two sets is found via merkle tree. Finially, only the objects each node is missing is sent over the wire!

How a set is defined is up to the application, but most will involve traversing the tree, or querying the indexed properties.

Users & Authors

Using asymmetric key cryptography it is possible to verify the authorship of documents. A user uploads an object, and then creates another signature object, which links to the first object, the user's public key, and a signature (of the object, with the key)

Signatures, and Keys, be replicated and stored within the database like any other object.

License

MIT

More Repositories

1

event-stream

EventStream is like functional programming meets IO
JavaScript
2,189
star
2

JSON.sh

a pipeable JSON parser written in Bash
Shell
1,996
star
3

JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
JavaScript
1,913
star
4

scuttlebutt

peer-to-peer replicatable data structure
JavaScript
1,310
star
5

rc

The non-configurable configuration loader for lazy people.
JavaScript
995
star
6

crdt

Commutative Replicated Data Types for easy collaborative/distributed systems.
JavaScript
836
star
7

through

simple way to create a ReadableWritable stream that works
JavaScript
667
star
8

your-web-app-is-bloated

measuring memory usage of popular webapps
514
star
9

npmd

JavaScript
450
star
10

split

JavaScript
346
star
11

curry

simple curry module, with nothing *too clever*, and full test coverage
JavaScript
313
star
12

random-name

JavaScript
296
star
13

hashlru

JavaScript
240
star
14

wifi.sh

Shell
216
star
15

level-sublevel

no longer maintained, sorry!
JavaScript
194
star
16

mux-demux

mutiplex-demultiplex multiple streams through a single text Stream
JavaScript
179
star
17

noderify

official fork: https://github.com/staltz/noderify
JavaScript
157
star
18

feedopensource

Iteratively Fund Open Source Projects With Bitcoin
JavaScript
142
star
19

excel-stream

JavaScript
137
star
20

stream-spec

executable specification for Stream (make testing streams easy)
JavaScript
125
star
21

map-stream

JavaScript
122
star
22

map-reduce

async map-reduce functions for nodejs
JavaScript
121
star
23

observable

A Mutable Value represented as a Function.
HTML
111
star
24

stream-combiner

JavaScript
103
star
25

rpc-stream

JavaScript
98
star
26

bench-lru

JavaScript
87
star
27

pull-box-stream

One way streaming encryption based on libsodium's secretbox primitive
JavaScript
84
star
28

level-live-stream

JavaScript
79
star
29

stack-expression

inspired by regular expressions but can do nested structures
JavaScript
76
star
30

hipster

JavaScript
72
star
31

snob

distributed version control system implemented in javascript.
JavaScript
71
star
32

xdiff

diff complex javascript objects
JavaScript
70
star
33

from

Easy way to create a Readable Stream
JavaScript
70
star
34

scalable-secure-scuttlebutt

HTML
68
star
35

explain-error

JavaScript
67
star
36

fsm

Finite State Machines in javascript
JavaScript
66
star
37

r-edit

JavaScript
64
star
38

readme

JavaScript
62
star
39

tiles

JavaScript
61
star
40

indexhtmlify

JavaScript
59
star
41

tacodb

JavaScript
57
star
42

adiff

diff and patch operations on arrays.
JavaScript
57
star
43

map-filter-reduce

JavaScript
57
star
44

browser-stream

open pipable streams to and from the browser, with Socket.io
JavaScript
55
star
45

reconnect

JavaScript
53
star
46

level-replicate

JavaScript
51
star
47

electro

JavaScript
51
star
48

d64

JavaScript
50
star
49

on-change-network

JavaScript
49
star
50

lock

lock asynchronous resources
JavaScript
48
star
51

crypto-bench

HTML
47
star
52

mynosql

JavaScript
44
star
53

monotonic-timestamp

JavaScript
44
star
54

pause-stream

JavaScript
43
star
55

json-select

JavaScript
43
star
56

json-buffer

JavaScript
41
star
57

coherence

JavaScript
41
star
58

bittodo

JavaScript
40
star
59

stream-punks

discussion repo for streams
39
star
60

charwise

JavaScript
39
star
61

proxy-by-url

custom logic for node-http-proxy to proxy based on incoming url
JavaScript
38
star
62

sentimental-versioning

version numbers with meaning
HTML
38
star
63

level-hooks

JavaScript
37
star
64

sodium-browserify

JavaScript
37
star
65

secret-handshake-paper

TeX
36
star
66

browselectrify

create browserify bundle that also works in electron
JavaScript
36
star
67

kv

simple kv store for streams
JavaScript
35
star
68

c2wasm

C++
35
star
69

level-trigger

triggers for levelup
JavaScript
33
star
70

deploy

scripts to setup continuous deployment with git push
Shell
33
star
71

presentations

JavaScript
32
star
72

rumours

Intergration of scuttlebutt family.
JavaScript
32
star
73

web-bootloader

HTML
28
star
74

what-is-scuttlebutt

spec for defining "scuttlebutt" as a living changing protocol
28
star
75

remote-events

connect EventEmitters through Streams.
JavaScript
28
star
76

indexes-of

JavaScript
27
star
77

mpg123

JavaScript
27
star
78

level-master

JavaScript
27
star
79

h

JavaScript
26
star
80

testbed

continuous integration for nodejs
JavaScript
25
star
81

canvas-browserify

HTML
25
star
82

it-is

assertion DSL based on functional idioms.
JavaScript
25
star
83

level-merkle

JavaScript
25
star
84

semver-ftw

Simple Description of SemVer
HTML
25
star
85

level-inverted-index

JavaScript
24
star
86

computer-modern

CSS
24
star
87

hyperaudio

JavaScript
24
star
88

level-search

JavaScript
24
star
89

level-scuttlebutt

leveldb persistence for scuttlebutts (scuttlebutt/crdt/append-only and friends)
JavaScript
24
star
90

level-couch-sync

JavaScript
23
star
91

simple-xlsx

maintained fork is at https://github.com/zeke/simple-xlsx
JavaScript
23
star
92

shasum

JavaScript
23
star
93

content-addressable-store

JavaScript
23
star
94

ticket-auth

JavaScript
22
star
95

ssh-key-to-pem

JavaScript
21
star
96

private-groups-paper

21
star
97

scuttlebucket

JavaScript
21
star
98

looper

JavaScript
20
star
99

deterministic-tar

JavaScript
20
star
100

npm-browserify

JavaScript
20
star