r/web3dev • u/Ok-Report8247 • Oct 21 '26
Help Needed Looking for architectural advice from devs who’ve been down this road!
Hey everyone! Lately I've been spending way too much of my free time tinkering with Web3 and decentralized infra, and an idea kind of took over my weekends. I'm trying to build a super simple open-source decentralized cloud storage MVP (basically a transparent, censorship-resistant "Google Drive" clone), and I honestly need a reality check and some architecture advice from folks who’ve actually built stuff in this space. Just to be completely upfront: I'm not launching a token, not selling anything, and there's no VC backing. I'm just a dev who learns best by breaking things and trying to build a protocol-ish thing from scratch.
Here is what my messy local setup looks like right now, and I’m pretty sure I'm walking straight into a few traps. The stack I’ve cobbled together uses a basic registry contract on an L2 like Arbitrum or Polygon to map wallet addresses to file CIDs and metadata. For storage, I'm looking at IPFS for quick testing and caching, backed by something like Filecoin for long-term persistence. Reading raw logs straight from the chain every time the frontend loads was painfully slow, so I’m hacking together a custom indexer in TypeScript that listens to events like FileUploaded and dumps pointers into a local Postgres database so the UI doesn't time out. For the frontend, it's just a simple Next.js and React dashboard where I'm definitely using AI to help wire up the boring boilerplate and Wagmi/Viem connections.
What's really keeping me up at night are a few specific things. Since I'm writing this custom TS indexer instead of using heavier frameworks right away, how bad are chain reorgs going to bite me in the ass for a simple MVP, and are there lightweight ways to handle them without overcomplicating things? I'm also struggling a bit with the mental friction for normal users like bridging the gap between a user wanting to upload a PDF versus having to wait for a transaction to clear and a storage deal to process. Plus, since IPFS is public by default, I'm trying to figure out a clean way to do client-side encryption using wallet keys or Lit Protocol without turning the folder structure into a total nightmare.
I'm still very much in the faffing around and finding out phase, so if anyone here has built something similar, what do you wish someone told you on day one, and are there any obvious anti-patterns I should rip out right now? Would love to hear your thoughts, criticisms, or even just repos you think I should read. Let’s nerd out about this stuff a bit. Cheers!
2
u/GrainElevator Oct 21 '26
hey, chris here from Lit Protocol.
I would have your server do these processes in a background queue. The user sees "uploaded!" instantly and your server works to get their txn / encrypted data where it needs to be, async. Don't have the user sign a txn directly, instead have them sign something (with an expiration) and then you should get it on chain using your server wallet. The smart contract can verify their sig, charge them, etc. This lets you avoid things like users not giving the txn enough gas, nonce conflicts, etc. You could use smart wallets for this (give each user a smart wallet).
re: encryption options. I would use something like Lit if I want things to be shareable when the creator is offline. If that's not a constraint, and sharing can be an online-only process, then you could have the creator self custody the encryption keys somewhere. Note that you should use something quantum proof, because once something is on IPFS, you have to assume it's there "forever" because someone could have saved it. Once quantum computers can break public key cryptography, people will presumably decrypt everything on IPFS that was encrypted using vulnerable algorithms. Our Lit encryption is quantum proof, so you could use that, or you could use something like X-Wing KEM if you do the encryption yourself.
For dealing with the chain reorg issue, I would simply not use Polygon which has a lot of reorgs. I think if you use Base or Arbitrum you can basically just ignore chain reorgs for your use case, and then see if they become a problem, and then fix it if there is one. Your async background queue thing can deal with them as needed by replaying txns if they get reorged out, as long as you use the design I suggested where you don't have users directly using their own EOAs to get txns on-chain, and instead use a server hot wallet.