Decentralized Social Media.
Centralized Social Media websites such as Facebook and Twitter have full control of all content published by their users. This leaves a significant amount of power left in the hands of such companies, as they are able to control what is shown to users and what users are allowed to say on their platforms. This application is a direct response to such censorship by giving power back to the users instead of giving it all to the platform owners.
- User - Can refer to Publisher or Follower.
- Blockchain - The complete record of a publisher's posts.
- Post/Block - Each 'block' in the block chain contains the 'post' and other information to maintain blockchain integrity. In this document they will often be used interchangeably.
- Publisher - Owner of a public/private key pair. Has a blockchain they can post to and share with peers.
- Follower - Keeps a copy of a publisher's blockchain. Will receive and send new blocks with other peers. Followers will only see posts from publishers they "follow."
In Critter, the blockchain is the cornerstone of the platform. Instead of having a central authority/server manage the publications of an individual, the publisher and peers that 'follow' the publihser maintain/store posts. Each publisher has their own blockchain in which they are the only ones able to add new posts to. This is upheld by using digital signatures that users can verify with the publisher's public key. If a malicious user wished to append a post to a blockchain they do not know the private key for, peers will reject their addition because it will not pass verification. Instead of traditional user accounts with emails, usernames, and passwords, Critter users have a Public Key and Private Key generated with RSA SHA256 Encryption. These keys are the user's identity and is solely maintained by the user. Should the private key be lost or stolen, a user should no longer associate oneself with the corresponding public key and make a new Key Pair. There is no lost password option. If you lose your private key, the corresponding public key and blockchain should no longer be trusted.
Unlike cryptocurrencies that need to keep a global ledger of all transactions, Critter is only interested in keeping a trustworthy log of all posts made by a publisher. Since there is no consensus needed, followers only need to be sure that they are seeing authentic messages from the publisher.
With the all the strengths of the blockchain, there are drawbacks
- Publishers cannot delete posts once other peers have received the post
- Publishers cannot edit posts once other peers have received the post
- Once a private key is lost, the publisher has lost all authority over the corresponding public key and blockchain
- Publishers are able to post anything. "Followers" should be certain of who they follow!
- CryptoJS https://github.com/brix/crypto-js
- ursa https://github.com/JoshKaufman/ursa
- Peerjs https://github.com/peers/peerjs
Block Based on naivechain https://github.com/lhartikk/naivechain
Field | Description |
---|---|
index | integer |
previousHash | hash field of previous block |
timestamp | time of block creation |
data | generic |
hash | SHA256 of index, previousHash, timestamp, and data |
signature | Digital Signature produced from private key |
Genesis Block
Field | Value |
---|---|
index | 0 |
previousHash | "0" |
timestamp | 916214469948248064 |
data | "Genesis" |
hash | {PUBLIC KEY} |
signature | "0" |
Chain Each user (or more precisely Public Key) has an associated block chain. Only the owner of the private key is able to publish blocks to the the chain that will be accepted by other users. Digital Signatures allow others to verify integrity/authenticity of blocks.
Table Using Javascript Maps we make a table of key value pairs like this
Key | Block | Block | Block | Block |
{PUBLIC KEY} | Block 0 | Block 1 | Block ... | Block N |
A separate PeerJS server which must be hosted others will handle pairing peers together. Peers will recieve lists of all other Peers using the same PeerJS Server. may change
On connecting to a peer, peers will exchange chains they are 'following'. If the total length is different, the peer with the smaller chain will add new blocks, one-by-one, verifying each message to ensure authenticity.
- Julian Assange https://twitter.com/julianassange/status/916214469948248064
- Senior Software Design Team (Decentralized Spotify)
- Facebook, Twitter for censoring, inspiring this application