Alex Lazar.

How I built a blockchain account PoC in a weekend


How I built a blockchain account PoC in a weekend

Intro

If you get paid in crypto, you know what I mean when I say it’s hard to keep track of transactions. I use diff addresses, and accounting it all is a shit show. 💩

So I built http://nymnio.com. It’s a tool that sifts through your USDT, USDC, and DAI transactions and churns out monthly reports on revenue, expenses, profits, and balance.

It’s still a proof of concept; not sure where it’s headed. But it’s making my life easier.

Nymnio screenshot

The tech behind Nymnio

I’ve been following this guy Theo for almost 1 year. He creates content on frontend/backend dev (mostly TypeScript, React, Next). But he doesn’t just post generic tutorials or “how I made XYZ$” like most tech content creators. He actually talks about architecture and shit that an engineer becomes interested in after their first 2-3 years.

Now he and his community made create-t3-app. It’s a CLI that builds your app, just like create-react-app would but better. Better why? Because it comes with a few preconfigured libraries that I would want anyway. We’re talking Next.js, strict TypeScript, Tailwind, tRPC, Prisma, NextAuth. If you love being type-safe most of the time, you’ll love this stack. And the CLI saves you time configuring it all.

Now, I added one important big thing on top of the above. ioredis with infra by https://upstash.com/. It’s Redis. Now, if you don’t know what Redis is, in super simple (and somewhat technically wrong) terms: it’s a rudimentary database that stores key: value pairs in memory (as in RAM). RAM is faster than writing to the file system or SQL db.

How does that work?

  1. user comes on the website, puts their (Ethereum) address in
  2. app queries etherscan for transactions data and processes it to create a report (this can take a few seconds)
  3. app saves the report in Redis & displays it to the user
  4. if the user comes back, the app will check if the report is in Redis, and if it is, it will display it to the user (loading times well under 1 second)

Of course, I have the data go stale after 1 day. So if the user returns after 1 day, the app will query etherscan again and create a new report.

Long term, the way this could work is that I could have a cron job that queries etherscan for all users and creates reports for them. Then, when the user comes to the website, the app will query Redis for the report and display it to the user. This way, the user will never have to wait for the report to be created.