learnings

things that shifted my understanding

7 entries · newest first

solana wallet signature verification without a heavy SDK

crypto

You don't need @solana/web3.js (which is enormous) to verify ed25519 signatures server-side. tweetnacl provides nacl.sign.detached.verify which takes three Uint8Arrays: message bytes, signature bytes, and the 32-byte public key. bs58 decodes the base58 Solana address to the key bytes. Total overhead: ~6kb for tweetnacl + ~3kb for bs58.

async params in Next.js 15+ route handlers

next.js

In Next.js 15 and 16, the params object in dynamic route handlers is a Promise, not a plain object. Await params before reading its fields.

bs58 v5 vs v6 import differences

js

bs58 changed export style across major versions. A defensive import handles both CJS and ESM boundaries without guessing the installed version.

tailwind CSS v4 setup is different from v3

css

Tailwind v4 uses @import "tailwindcss" at the top of globals.css. Custom CSS belongs in layers or stable component classes so utilities keep behaving predictably.

solana wallet injection patterns across different wallets

solana

Phantom, Backpack, and Solflare expose slightly different globals, but all implement the standard Solana wallet interface. Destructure signMessage results carefully.

supabase RLS with anon key - insertions and the update policy gap

supabase

For atomic increments, a SECURITY DEFINER SQL function is cleaner than read-then-write from the anon key. The logic stays self-contained and avoids races.

force-dynamic with fs.readFileSync in server components

next.js

To read a file on every request, add force-dynamic and read inside the component function instead of module scope.

see also: errors · thoughts

← back