BlockchainAddress (Sender or Receiver)

Public, Private key pair is calculated for user. Public key of user is treated as User Address
Bitcoin address of node is calculated using Hash of Public key. Public/Pvt keys generated using secp256k1 ECC Algorithm.
Hash is generated using RIPEMD160 + SHA256.

K(public key) = k(pvt key) * G(constant)
K --> |SHA256| --256bit--> |RIPEMD160| --> 160bit(Address)
160bit(Address) --> |Encode(Base58 Check)| --> Bitcoin Address      //Base58-Check(RIPEMD160(SHA256(K)))
        

Block

Blockchain is composed of blocks(Header + payload). Block stores the transactions. Header is metadata, while payload is actual transaction data.
Block creation: The only way to add new information to the blockchain is to add a block to the end of it. Only Qualified users create blocks and send them to other nodes. If the block is valid, other users accept it. If it’s invalid, they ignore it and may punish block creator. The valid block propagates through the network in a few seconds.

Genesis Block. Bitcoin block#0

1st block in blockchain. This is hardcoded at time when blockchain started. This is same as other blocks, just it does not have pointer to prev block

Header/Metadata => |block number | timestamp (when the block was created) | block hash | nonce |
Data/Payload =>  |Sender address | Recipient address | amount of transaction | fee |

struct block {
    struct block_header* bh;
    struct block* prev_block;   //This is Hash pointer(not normal pointer)
    long timestamp;
    long nonce;
    long transaction_counter
    struct transactions* t;
    struct other_attribute* oa;
}
        

Transaction

1 block can store 1 or multiple transactions. Whenever a transaction(s) happens on blockchain, a block is created and stored on chain. Transactions are used to record various activities, such as cryptocurrency transfers, smart contract executions, and other changes to the blockchain’s state.

POW(Proof of Work)

There are 2 types of blockchain systems: POW & POS(Proof of Stake). In POW system, to add a new block mining needed to be done. Miner who solves the puzzle(finds hash of transaction) is rewarded some bitcoins and transaction fee.
Problems with POW: 1. Energy efficiency: Miners compete to solve complex mathematical puzzles using huge computational power.
2. Centralization Concerns: More power more chances to solve 1st, this means more bitcoins goes with people/companies who own huge machines.
3. Accessibility: Only those having specialized mining hardware, have more bitcoins.

POS(Proof of Stake) (Ethereum uses it)

Why POS came in? Due to problems in POW(Proof of Work)
How POS Works?

    Proposer                                  Validator-1                  Validator-2
                                        (Hold coins to stake)
1. Create block
(having transaction)  -|--broadcasted---->  block is Good
                        |------------------------------------------------> block is good
Block included on chain
Reward distributed to both
      
1. Validators/forgers/stakers(same as miners in POW system) validate transactions based on:
  a. Number of coins they hold
  b. And how many coins they are willing to "stake" as collateral.
2. Validators are selected in a deterministic manner, often based on factors like the amount of coins staked and the length of time they’ve been staking.
3. Validators are incentivized to act honestly because they have "their coins" – if they validate fraudulent transactions, they risk losing their staked coins.
4. Validators are rewarded with transaction fees and sometimes a portion of the transaction fees paid by users.
Advantages of POS:
  1. Less power consumption wrt POW system: The need for solving computational puzzles is eliminated, which significantly reduces energy consumption compared to PoW.

BlockChain Clients

There are two main types of Bitcoin clients:
1. Full Node: These clients download and validate the entire Bitcoin blockchain
2. Lightweight Node: These clients do not download the entire blockchain. Instead, they rely on full nodes to verify transactions for them. Examples:
  1. Bitcoin Core (Fullnode Bitcoin client): Holds complete blockchain in local system. Requires ~500GB of space.
  2. Electrum (Lightweight Bitcoin client): It allows to interact with the Bitcoin network(bitcoin network is blockchain). With client we can send and receive transactions, and manage your Bitcoin holdings.
  3. Kukai (Lightweight Tezos client): This is wallet service on Tezos blockchain. Tezos is based on Proof of stake, while Bitcoin core, electrum are Proof of work blockchains

Mining

Let’s suppose Alice wants to send 1 BTC(bitcoin) to Bob, alice sends message on network.
Miner Nodes(Verfiers of transaction) recieve the Alice’s message and starts a race to find HASH of desired diffculty(defined by software).
Node(Miner) who solves it 1st is rewarded with some transaction fee(0.001 BTC) + bitcoin reward.
Miner-1, solves the puzzle and sends to network for verification. Other miners verifies it using consensus and transaction is added as a node to ledger=blockchain.
As more and more miners join the network, the total hash rate — the combined computing power of all miners — increases

Smart Contract

These are the programs that run on blockchain having business logic. This get automatically executed when certain conditions are met. These are secure and unstoppable.
Represents aggrement b/w 2 parties & allows parties to securly conduct business.
SC Properties:
1. Immutable logs: SC creates logs which are immutable, those cannot be changed.
2. Distributed: Output of contract is Validated/verified by other nodes on the network.

Solidity

High level Object oriented programming language for writing smart contracts.
Features: Based on C,C++,python, Statically typed: Checking happens at compile time, Supports inheritance: 1 smart contract can be used by other

Wallet

In the context of blockchain(eg: bitcoin, tezoz), a wallet is a digital tool that allows you to store, manage, and interact with your Bitcoin holdings. It’s used to create and manage Bitcoin addresses, which are used to send and receive Bitcoin transactions. A Bitcoin wallet consists of two main components:
1. Public Addresses(Hash number): These are account numbers in blockchain network. You share these addresses with others when you want to receive Bitcoin. They are derived from your wallet’s public key.
2. Private Keys: These are secret keys that helps control/access bitcoins associated with your addresses. Whoever has access to the private key has control over the Bitcoin at that address.

Web3

Web1.0: 1991-2004. Most sites were static. Most were consumers
Web2.0: Users have started producing content using forums, social media. 2004 - Till Date
Web3.0:Proposed next stage of the internet, which is decentralization, increased user control over data, ownership via blockchain.
Aim: shift power from large corporation to users