Web3 basics
Understand the core concepts of Web3 and how CinaCoin fits into the decentralized ecosystem.
What is Web3?
Web3 represents the next evolution of the internet — a decentralized network where users control their own data, identity, and assets. Unlike Web2, where centralized companies control the infrastructure, Web3 is built on blockchain technology that enables trustless peer-to-peer interactions.
Key principles of Web3:
- Decentralization — No single entity controls the network.
- Ownership — Users own their data and digital assets.
- Trustless — Interactions don't require trusted intermediaries.
- Permissionless — Anyone can participate without approval.
Blockchain fundamentals
A blockchain is a distributed, immutable ledger that records transactions across a network of nodes. Each block contains a set of transactions, and once added to the chain, it cannot be altered without consensus from the network.
Block #1 (Genesis)
├── Timestamp: 2024-01-01T00:00:00Z
├── Transactions: [...]
├── Previous Hash: 0x0000...0000
└── Hash: 0xabc1...def2
Block #2
├── Timestamp: 2024-01-01T00:10:00Z
├── Transactions: [...]
├── Previous Hash: 0xabc1...def2
└── Hash: 0x1234...5678Wallets and identity
In Web3, your wallet is your identity. It consists of a cryptographic key pair: a public key (your address) and a private key (your secret). You use the private key to sign transactions, proving ownership without revealing the key itself.
// Your private key generates your public key
const privateKey = "0x..."; // Keep this secret!
const publicKey = derivePublicKey(privateKey);
// Your address is derived from the public key
const address = deriveAddress(publicKey);
// → "0x742d35Cc6634C0532925a3b844Bc9e7595f..."
// You sign messages to prove ownership
const signature = sign(message, privateKey);
const isValid = verify(message, signature, address);
// → trueSmart contracts
Smart contracts are self-executing programs deployed on the blockchain. They run exactly as programmed without downtime, censorship, or third-party interference. CinaCoin supports smart contracts across multiple chains.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract SimpleStorage {
uint256 private value;
function set(uint256 _value) public {
value = _value;
}
function get() public view returns (uint256) {
return value;
}
}