Web3 & Blockchain/Basics/Concepts

Blockchain Concepts

The fundamentals — what everything actually is before you write a single line of code.


Wallet

A wallet doesn't store your crypto. It stores your private key — the cryptographic proof that you own an address on a blockchain.

TermWhat It Is
Private KeySecret number. Anyone who has it controls your funds. Never share.
Public KeyDerived from private key. Used to generate your address.
AddressWhat you share publicly to receive funds.
Seed Phrase12 or 24 words that regenerate your private key. Backup of everything.

Wallet types

  • EOA (Externally Owned Account) — controlled by a private key. MetaMask, Phantom, etc.
  • Smart Contract Wallet — controlled by code. Safe (Gnosis), ERC-4337 account abstraction.
  • Custodial — exchange holds your keys (Coinbase, Binance). You don't actually own the wallet.
Not your keys, not your coins.

Network / Chain

A blockchain network is a distributed ledger maintained by nodes around the world. Key concepts:

ConceptEthereumSolana
ConsensusProof of StakeProof of History + PoS
Block time~12 seconds~400ms
Smart contract languageSolidityRust (via Anchor)
Native tokenETHSOL
Account modelBalance modelAccount model

Mainnet vs Testnet

  • Mainnet — real money, real transactions, permanent.
  • Testnet — fake money, for development and testing.
  • Devnet — local or semi-public chain for dev, no value.

Common testnets:

ChainTestnet NameFaucet
EthereumSepoliasepoliafaucet.com
BaseBase Sepoliafaucet.quicknode.com
ArbitrumArbitrum Sepoliafaucets.chain.link
SolanaDevnetsolana airdrop 2 or faucet.solana.com

Token

A token is a digital asset that lives on a blockchain. Two categories:

Native Token (Coin)

The chain's built-in currency. Used to pay gas fees.

  • ETH on Ethereum
  • SOL on Solana
  • BNB on BSC

Contract Token

Created by a smart contract. Follows a standard interface.

StandardChainWhat It Is
ERC-20EVMFungible token (currency, governance, utility)
ERC-721EVMNon-fungible token (NFT)
ERC-1155EVMMulti-token (fungible + NFT in one contract)
SPL TokenSolanaBoth fungible and NFT on Solana

Gas

Gas is the fee you pay to execute operations on a blockchain. It compensates validators for computation.

How gas works on Ethereum (EIP-1559)

Total fee = (Base Fee + Priority Fee) × Gas Used
  • Base Fee — set by the network based on demand. Gets burned.
  • Priority Fee (tip) — you set this to incentivize validators to include your tx faster.
  • Gas Limit — max gas you're willing to spend. Unused gas is refunded.
// ethers.js — estimate gas before sending
const gasEstimate = await provider.estimateGas({
  to: contractAddress,
  data: contract.interface.encodeFunctionData("transfer", [to, amount]),
});

// Send with manual gas settings
const tx = await contract.transfer(to, amount, {
  gasLimit: gasEstimate * 120n / 100n, // 20% buffer
  maxFeePerGas: ethers.parseUnits("20", "gwei"),
  maxPriorityFeePerGas: ethers.parseUnits("1", "gwei"),
});

Gas on Solana

Solana calls fees lamports (1 SOL = 1,000,000,000 lamports). Fees are tiny (~0.000005 SOL per tx) because computation is measured differently — by compute units.

// @solana/web3.js — add compute budget instruction
import { ComputeBudgetProgram } from "@solana/web3.js";

const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({ units: 200_000 });
const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 });

Transaction Lifecycle

  1. Construct — build the tx object with to, value, data, gasLimit
  2. Sign — wallet signs with private key (never leaves the device)
  3. Broadcast — send to a node via RPC
  4. Mempool — tx waits to be included in a block
  5. Confirmed — included in a block. 1 confirmation.
  6. Finalized — enough blocks built on top. Safe to treat as permanent.
// Full lifecycle with ethers.js
const tx = await signer.sendTransaction({ to: recipient, value: ethers.parseEther("0.01") });
console.log("Broadcast:", tx.hash);

const receipt = await tx.wait(1); // wait 1 confirmation
console.log("Confirmed in block:", receipt.blockNumber);

RPC / Node Providers

Your app talks to the blockchain via an RPC endpoint. You can run your own node or use a provider.

ProviderFree TierChains
Alchemy300M compute units/monthEthereum, Base, Arbitrum, Polygon, Solana
Infura100K requests/dayEthereum, IPFS, L2s
QuickNode50M credits/month60+ chains
Helius100K req/daySolana only, best DX
// Connect with ethers.js
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider(process.env.ALCHEMY_RPC_URL);

// Connect with @solana/web3.js
import { Connection } from "@solana/web3.js";
const connection = new Connection(process.env.HELIUS_RPC_URL!, "confirmed");

IPFS & Metadata

NFTs and on-chain assets often store metadata off-chain on IPFS — a content-addressed decentralized file system.

{
  "name": "Phantom #001",
  "description": "A dark phantom from the void.",
  "image": "ipfs://QmXxxx.../image.png",
  "attributes": [
    { "trait_type": "Background", "value": "Dark" },
    { "trait_type": "Eyes", "value": "Glowing" }
  ]
}

Upload services: Pinata, NFT.Storage, web3.storage.


See also: Faucets & Testnets | Deploy: Testnet → Mainnet

Last updated · September 2026