Skip to main content

Data Structure

A linked-list is a good way to order block of sequential data that can be validated by others. Countless real-world examples show that it scales pretty well.

In our apps, We are testing the use of a blockchain-like structure for storing "application data" local-only. The app is a work-in-progress proof-of-concept and experimental. It is an investigation into creating a distributed and decentralized app. This could be considered and over-engineered solution to CRDT.

the sole purpose of this approach is to keep messages between peers in sync via a CRDT solution. The implementation is far from finished. The CRDT is entirely in javascript running in a browser.

Tables needed:

  • device
  • profile
  • preferences
  • contacts
  • blockchain

device object:

  • id: unique identifier for the device
  • name: name of the device

profile object:

  • id: unique identifier for the profile
  • name: name of the profile
  • avatar: URL to the profile avatar image
  • devices: array of device IDs associated with the profile
  • publicKey: public key for encryption
  • privateKey: private key for encryption (stored securely)
  • symmetricKey: symmetric key for encryption (stored securely)

preferences object:

  • enable notifications: boolean to enable/disable notifications
  • theme: string to store the selected theme (e.g., "light", "dark")
  • language: string to store the selected language
  • privacy settings: object to store privacy-related settings (e.g., "show online status", "read receipts")

contacts object:

  • id: unique identifier for the contact
  • name: name of the contact
  • avatar: URL to the contact's avatar image
  • devices: array of device IDs associated with the contact
    • id: ID of the device associated with the contact
    • publicKey: public key for encryption
    • privateKey: private key for encryption (stored securely)
    • symmetricKey: symmetric key for encryption (stored securely)

blockchain object:

  • id: unique identifier for the blockchain entry
  • name: name of the blockchain
  • chain: array to store the blocks in the blockchain
  • storage: object to store the blockchain data (e.g., messages, transactions)

CRDT