WHAT IS CRYPTOCURRENCY?
Cryptocurrency is a reward system for storing and securing digital transactions without a centralized authority. Cryptography technology used in cryptocurrencies make sure the transactions are secure and tamper proof.
WHERE IS CRYPTOCURRENCY STORED?
- Crypto currency is stored as transactions in a network of computers which are called nodes
- Nodes are spread across the world
- Nodes can communicate with each other using any networking technology like the internet or bluetooth
- Nodes will have a copy of every transactions made on the network
- You can send a transaction to any node and nodes will update each other
- Anyone can run a node software
ONLINE BANKING SYSTEM - COMPARISON
- In the online banking system, you will get a username and password to login to your bank account.
- When you do a transaction, the bank authorizes your transactions by checking if you have sufficient balance to commit a transaction. All data is controlled and kept in the bank server
- The bank can update your balance or can block your account
- Online banking is a centralized system where bank has total control over your account
CRYPTOCURRENCY SYSTEM
- In a cryptocurrency system, you generate your own account using a wallet software. The private key is like your password or key for authorization and the address is like your username.
- The private key is generated by a cryptography software like wallets in your computer or mobile and every private key generated whenever by anyone will be unique.
- This private key will be used to digitally sign your transactions and have to be kept secret. If you lose your private key, another person can steal your cryptocurrency by signing a transaction with this key.
- A public key is generated from the private key which is used to validate the digital signature
- Address is generated from the public key so everyone will know the owner of the address has created this transaction
- Whoever holds the private key is the owner of the address
- The transaction is send to nodes where they validate, store and broadcast it to other nodes
- Once majority of nodes accept this transaction, it is considered a valid transaction and is stored in the blockchain system
KEY POINTS ABOUT WALLET
- Wallets can work offline
- Online wallets are available as services
- Wallets do not store cryptocurrency
- Wallets create cryptocurrency address
- Wallets create & store private keys securely
- Hardware wallets are electronic devices that creates and stores private keys
- Wallets sign and broadcast transactions
POPULAR WALLETS
- Coinbase Wallet
- Trezor Model T
- Ledger Hardware Wallet
- Exodus Bitcoin & Crypto Wallet
- Trust Wallet
- Metamask - Browser Plugin
WORKSHOP
- Install a wallet
- Connect to a blockchain network
- Check balance
- Make a transaction
CORE TECHNOLOGIES IN CRYPTOCURRENCY
- Transactions
- Hash
- Digital Signature
- Blockchain
- Consensus Algorithm
- Network of nodes
TRANSACTIONS
- Transactions are the digital formats for transferring money
- Different blockchains uses different transaction formats
- Every cryptocurrency system will have transaction data
- Transaction data is publicly viewable (New updates might be able to hide this)
- Depending on the blockchain system, transactions fees will be deducted on each transaction
- Transaction formats vary in different blockchain systems
HASH
- Hash function coverts data of arbitrary length to a fixed length. This process is often referred to as hashing the data.
- Bitcoin uses SHA-256
- SHA-256 is 256 bit long (64 characters)
- Ethereum uses Keccak-256
DIGITAL SIGNATURE
- A digital signature is a cryptography technique used to validate the authenticity and integrity of any digital data.
- Digital signature can be used to validate softwares, documents, files or plain text.
- In cryptocurrency system every transaction is digitally signed to prove the authenticity of a transaction.
HOW DIGITAL SIGNATURE WORKS
- A digital data is converted to hash
- Using the private key and cryptography algorithms the digital signature is generated
- This signature can be verified using the public key
- Public key can be distributed openly so everyone can verify the authenticity of the signature
- The private key is kept secret
HOW DIGITAL SIGNATURE WORKS IN CRYPTOCURRENCY
- Transaction data is converted into hash
- Digital signature is created with the hash, private key and cryptography algorithm
- Transaction is send to the network
- Network verifies the digital signature using the public key
- Since address is generated from the public key, everyone in the network can confidently say this transaction is conducted by the owner of this address.
BLOCK
A block contains a list of transaction hashes
BLOCK HEADERS
- Version provides the version number of the block protocol
- Previous block hash contain the hash of previous block
- The merkle root hash is derived from the hashes of all transactions included in this block
- Time stamp denotes the block propagation time (which must be on average 10 minutes in bitcoin), so the timestamp must fall within the allowable time that is within this range.
- Difficulty is the mining difficulty of the block. Mining difficulty will change based on network
- Nonce is the answer derived from the mining process
CONSENSUS ALGORITHM
- A consensus algorithm is a procedure through which all nodes of the Blockchain network reach a common agreement about the present state of the balances in every address
- The consensus protocol makes sure that every new block that is added to the Blockchain is the correct block that is agreed upon by all the nodes in the Blockchain.
SOME CONSENSUS ALGORITHMS
- Proof of Work
- Proof of Stake
- Proof of Burn
- Proof of Capacity
- Proof of Elapsed Time
- Proof of Activity
- Proof of Weight
PROOF OF WORK - POW
- Proof of work is colloquially known as mining
- PoW is hard to compute but easy to verify
- Pow is done by finding a condition that matches consensus algorithm difficulty with the root hash of the block
- Proof of work makes it extremely difficult to alter any aspect of the blockchain
- Any change in block or transactions would require re-mining all subsequent blocks
PROOF OF STAKE - POS
- Unlike proof-of-work, validators don't need to use significant amounts of computational power because they're selected at random and aren't competing
- Validators stake some coin
- They don't need to mine blocks; they just need to create blocks when chosen and validate proposed blocks when they're not.
- If validators attest malicious blocks, the lose their stake
CRYPTOCURRENCY EXCHANGES
- A crypto exchange is a platform on which you can buy and sell cryptocurrency.
- You can trade between crypto and fiat currency as well as between other cryptocurrencies
- The exchange creates a wallet for you or need access to your private wallet to do a transaction
- All transactions are not necessarily committed to the blockchain
- Since blockchains are decentralized, anybody can start an exchange