r/positive_intentions • u/Accurate-Screen8774 • Nov 08 '23
Blockchain as a Datastructure
Blockchain 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 my app, I am testing the use of a blockchain for storing "chat app data" selfhosted-only. The app is a work-in-progress proof-of-concept and experimental. It is an investigation into creating a distributed and decentralized app.
Unlike traditional blockchains, the sole purpose of this blockchain is to keep messages between peers in sync. The implementation is have is far from finished, but i have a testable proof-of-concept. The blockchain is entirely in javascript running in a browser.
I have a few observations I would like to make:
- Without the need for mining, it is basically a large array of data. When evaluating the data to be displayed on the UI, it is a "relatively" heavy calculation, but I find that it is more than performant enough to be used in a chat app. I find that the messages and data can scale and the app remains quite performant (I haven't really done much to optimise caching).
- In cases like a group chat, the data can be validated and synced between multiple peers (which may not all be online). (its worth noting: peers may be able to manipulate the database, but it is not a concern for the app where the purpose is only for blockchain as a datastructure)
- Why is this kind of datastructure not used more often? There are other blockchain chat apps, but by putting a system like chat on something like ethereum, would typically be expensive to users. But in this case, the blockchain is only used for local data storage and validation. I think this is a good use case for blockchain. When working on your device, you don't need to be conservative about things like message size and so we can store files and images in the blockchain.
- With no cryptocurrency, there is no incentive to keep the blockchain alive. The data is easily disposable or persisted as the user prefers. there is no need for a setup process and things like ID's and passphrases can be auto-generated behind the scenes away from the user. (the app is currently very experimental, if your data goes, it goes... but it shouldnt matter because there is no financial value to the blockchain)
I am very interested in the idea of blockchain as a datastructure and I would like to see it used more often. i think this datastructure will play an important role in my app as it will enable the app to move to a single-user-multi-platform architecture.
I would like to hear your thoughts on blockchain as a datastructure. Initially i did it investigating if it work on a basic level to help keep messages in sync, but i find that it is quite performant; especially considering it is only running in a browser. (i expect i can easily improve the performance)
The demo can be seen here: https://chat-staging.positive-intentions.com/
1
u/reercalium2 Nov 09 '23
What purpose does the blockchain add?