---
# System prepended metadata

title: Encoding and Encrypting

---



# **Encoding**

Encoding is the process of converting data into a different format so that it can be properly and safely used or transmitted. The purpose of encoding is **not** to keep information secret, but to ensure that it is **readable and usable** by different systems.

For example, Base64 is an encoding method used to turn binary data (like images or files) into plain text so it can be sent over text-based systems like email.

Anyone who knows the encoding method can reverse it and get the original data back. So, encoding is **not secure** it’s just a way of preparing data for transmission.

---

# **Encrypting**

Encryption is the process of converting data into a secret format to **protect its confidentiality**. The purpose of encryption is to make the data unreadable to anyone who doesn't have the right **key**.

Only someone with the correct decryption key can convert the encrypted data back into its original form. So, encryption is all about **security** it's used to keep information safe from unauthorized access.

For example, if you encrypt a message using AES or RSA, no one can read it unless they have the key to decrypt it.

---

### Key Difference

* **Encoding** is for data formatting and system compatibility. It’s reversible and not secure.
* **Encrypting** is for protecting data. It’s also reversible, but only with the correct key, and it is designed to be secure.

**SHA-256 vs Keccak-256: Simple Difference and Security**

SHA-256 is part of the SHA-2 family, created in 2001 by NIST. It works by breaking data into 512-bit blocks and running them through 64 rounds of bitwise operations. It is used in Bitcoin, SSL certificates, and checking file integrity. It is still safe to use today, but because of its design, it can be affected by a type of weakness called a length-extension attack.

Keccak-256 is the winner of the SHA-3 competition in 2012. It uses a “sponge” design, which takes in data and squeezes out the hash in a more flexible way. It runs 24 rounds of mixing steps and is naturally safe from length-extension attacks. Ethereum uses Keccak-256 (a slightly different version from the final SHA-3 standard) for addresses and transactions.

Both are safe right now, but Keccak-256 has extra protection and is built to be more secure in the long run. The one you use usually depends on what system you are working with: Bitcoin uses SHA-256, Ethereum uses Keccak-256.
 



## **1. DApps (Decentralized Applications)**

* These are applications that run on a **blockchain or peer-to-peer network** instead of a single centralized server.
* They often use **smart contracts** on Ethereum or similar platforms.
* Example: Uniswap (DeFi), OpenSea (NFT marketplace).

---

## **2. Web2 vs Web3**

* **Web2**: The internet we mostly use today – centralized platforms like Facebook, Google, YouTube.
* **Web3**: The next generation of the internet – decentralized, user-owned, and built on blockchain.
* Key difference: In Web3, **users own their data** and interact directly with smart contracts and decentralized networks.

---

## **3. JSON-RPC**

* **RPC** means *Remote Procedure Call* – a way for one program to request data or perform actions on another.
* **JSON-RPC** is an RPC protocol that uses **JSON format** for communication.
* Ethereum clients like Geth expose JSON-RPC so you can send requests like:

  ```json
  {
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }
  ```

---

## **4. Account**

* In Ethereum, there are **two types**:

  1. **Externally Owned Accounts (EOA)** – controlled by a private key (user wallets).
  2. **Contract Accounts** – controlled by smart contract code.
* Accounts have:

  * **Address**
  * **Balance**
  * **Nonce** (number of transactions sent)
  * **Storage root** (for contracts)

---

## **5. Transaction Object**

* A transaction in Ethereum contains:

  * **Nonce**
  * **Gas price & gas limit**
  * **To** (address)
  * **Value** (ETH amount)
  * **Data** (for contract calls)
  * **Signature** (v, r, s)

---

## **6. Block Object**

* A block contains:

  * **Block number**
  * **Timestamp**
  * **Transactions**
  * **Miner**
  * **Parent hash** (previous block)
  * **State root**
  * **Logs bloom** (for event filtering)

---

## **7. Consensus Mechanism (PoS)**

* **Proof of Stake (PoS)** – Ethereum’s current consensus.
* Validators stake ETH and are randomly chosen to propose and validate blocks.
* Safer and more energy-efficient than Proof of Work.

---

## **8. Syncing**

* When a node joins the network, it needs to **download blockchain data** from other nodes to be up-to-date.
* Types of syncing in Ethereum:

  * **Full sync**
  * **Fast sync**
  * **Light sync**

---

## **9. Full, Light, Archive Nodes**

* **Full Node**: Stores full blockchain and verifies transactions.
* **Light Node**: Stores only block headers, relies on full nodes for details.
* **Archive Node**: Stores everything full nodes do plus all historical states (huge storage).

---
