Skip to main content

Command Palette

Search for a command to run...

My Web3 Learning Week AMMs, LSTs, Wallet Security & On-Chain Experiments

Published
3 min read
My Web3 Learning Week  AMMs, LSTs, Wallet Security & On-Chain Experiments
H

I am a software engineer with a strong background in competitive programming and backend focused development.

I graduated in IT from Army Institute of Technology, Pune (2025) and currently work at NxtWave, where I build and review technical content around data structures, algorithms, and problem solving.

My recent work is focused on smart contract and protocol development using Solidity and Foundry. I enjoy building systems where correctness, security, and clear invariants matter such as token vesting, staking mechanisms, and upgradeable protocols.

Earlier, I spent several years in competitive programming (Codeforces Expert, 5★ CodeChef), which shaped how I approach problem solving, edge cases, and testing.

On this blog, I write about the design and implementation of smart contracts, testing strategies, and engineering tradeoffs I encounter while building Web3 protocols.

Over the past few days, I decided to revisit Web3 properly not just by watching concepts, but by understanding how things actually work under the hood, writing code, and building small experiments along the way.

This article is my recap of everything I learned.
If you're learning Web3 too, this might help you connect the dots.

🔹 Solana vs Ethereum Understanding the Core Difference

I started by revisiting something basic but extremely important:
How Solana and Ethereum think about accounts and execution.

Ethereum → a state machine; every transaction processes one after the other

Solana → parallel execution where accounts define what can run in parallel

This difference explains why Solana is fast and why Ethereum’s architecture led to things like gas auctions, MEV, and rollups.

Understanding this once again helped me appreciate how both chains solve the same problem in completely different ways.

🔹 Automated Market Makers (AMMs) & Impermanent Loss

Next, I jumped into AMMs. Even though I had seen this before, re-explaining it to myself made the ideas much clearer.

💧 Liquidity pools

AMMs use a simple formula:

x * y = k

Where:

x = token A reserve

y = token B reserve

k = constant product

This formula keeps markets functioning without an orderbook.

🔄 Impermanent Loss

This is the part LPs hate but must understand.
When token prices change, the value of your tokens inside the pool changes compared to holding them normally.
It’s called “impermanent” because if prices return to the original ratio, the loss disappears.

Seeing this with actual numbers made it click better.

🧪 Creating a CP Pool

I also tested creating a constant-product AMM pool myself — seeing the math update in real-time made everything more intuitive.

🔹 Staking & Liquid Staking Tokens (LSTs)

Staking sounds simple from the outside, but there is a lot going on:

✔ What is staking?

You lock your tokens → validators use them → you earn rewards.

✔ What is an LST?

It's a token that represents your staked position, allowing you to:

stay staked

AND still use your tokens in DeFi

I also built a simple centralized LST flow:

accept SOL

track deposits

give user a receipt token

allow them to unstake

This helped me understand protocols like Lido and Jito at a conceptual level.

🔹 Private Key Management A Deep Dive

This was one of the most educational parts of the week.

How wallets usually store keys

Most wallets simply encrypt the private key locally and store it on-device.
Simple, but if someone gets access to your machine → game over.

MPC (Multi-Party Computation)

This blew my mind.

Instead of one party holding the private key, the key is split into multiple pieces, and no single party ever sees the full private key.

Perfect for bots, institutions, or apps like BonkBot.

Shamir’s Secret Sharing

Another clever method:
You split a key into multiple shares, and only when enough shares are combined can the key be reconstructed.

🔹 Building a Cloud Wallet

To put the security concepts into practice, I built a basic cloud wallet:

generated a key

stored it server-side

serialized transactions manually

signed them

submitted them on-chain

This gave me a much deeper understanding of:

transaction structure

how signatures tie everything together

why serialization matters

how dApps interact with the chain under the hood

Doing this by hand (instead of relying on libraries) was extremely helpful.

🔹 Putting Everything Together

This week wasn’t about building a big project — it was about strengthening my foundations:

the math behind AMMs

how staking turns into LSTs

security models (MPC, Shamir, cloud wallets)

creating tokens and pools

raw transaction signing

and how Solana + Ethereum differ fundamentally

These concepts show up everywhere in Web3 — and understanding them well will make dApp development MUCH easier going forward.

Next Steps

I’ll continue building small on-chain experiments and share them publicly.

More from this blog

Untitled Publication

17 posts