100daysofweb3 challenge ... day 2

100daysofweb3 challenge ... day 2

·

6 min read

i have started with this book to grasp the basics.

The Blockchain Developer by Elad Elrom

Chapter 1 : Blockchain Basics

Definantions

  • Cryptoeconomics: This is the combination of cryptography and economics to provide a platform to pass digital assets.

  • Cryptography: This is using the techniques of encryption and decryption to send and receive messages.

  • Cryptocurrency: This is using cryptography the same way as the earlier SSL or video example but specifically to fit the needs of a digital asset.

A digital asset can be anything of value, such as the combination to your home safe, a secret password, a list, a message, electronic cash, a document, a photo, and so on.

Digital Assets + Cryptography = Cryptocurrency

cryptocurrency is wrapping a digital asset with a strong cryptography such that no algorithm can break the public-private key

Bitcoin was invented in 2008 by Satoshi Nakamotoi with the publication of a white paper called “Bitcoin: A Peer-to-Peer Electronic Cash System” (bitcoin.org/bitcoin.pdf). The actual complete open source software was released a year later in 2009 (github.com/bitcoin/bitcoin).

Cryptography + Economics = Cryptoeconomics

Cryptoeconomics is the combination of cryptography and economics to provide a platform that gives an incentive to maintain the platform, its scalability, and its security; in addition, it is absent of central or local government control. In other words, it’s decentralized. The network is made up of a collection of multiple computers instead of one central computer.

Decentralized is the opposite of central control; it means without central or local government control.

What is blockchain?

A blockchain is a digital decentralized (no financial institutions involved) and distributed ledger. In layperson’s terms, it is a database that stores records and transactions on multiple computers without one controlling party and according to an agreed policy. The data that is stored is a block, and the blocks are linked (chained) together to form a blockchain.

what is double spending problem?

in actual world if u have a currency note as paper then its valid once and once u do a transaction u wont be able to re transact. where as in digital world there might arise situatation where hackers transact the same asset twice at same time with same signature this is called double spending problem.

Blocks that hold keys are not enough to provide security and solve the double-spending potential issue to form a digital currency.

how it is solved?

bitcoin make sure that every computer on the network is aware of the transaction being happened thus avoiding double spending problem.

“A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution.” — Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System

Cryptomining by Cryptominers

the computers in same network are called peers, a peer has a copy of shared ledger and it can help add records or verify transactions this process is called cryptocurrency mining or cryptomining . a peer who helps doing this are called miner Each miner helps to verify and add transactions to the blockchain digital ledger. The miners are often rewarded with a fee for the work, and to stay competitive with other miners, the miner usually needs a computer with specialized hardware.

Cryptocurrency Wallet

A cryptocurrency wallet stores one or multiple public key and private key combinations and is used to receive or spend cryptocurrency. A good analogy is to think of a wallet like your bank account. Cryptocurrency can be created by getting a reward by doing the miner work, or it can be purchased.

cryptocurrency types

  • bitcoin
  • tokens: they are decentralized product offering ex.ethereum
  • altcoins (alternative coins): which uses bitcoin fork to create new coins with different features ex. litecoin- faster transaction dogcoin- unlimited supply

Blockchain P2P Network

P2P network in broken down to 5 layers

1. Consensus layer

consensus definition :a general agreement.

In banks we have central system where computers in a bank handle the transactions and are secured. where as in P2P we need to have some rules which takes care of security and avoiding duplication or some other hacks. data should be consensus in blockchain so that there is deterministic and proper transactions. this is achived by consensus mechanism such as

  • Proof of work (PoW)
  • Proof of stake (PoS)
  • Delegated proof of stake (DPoS)

Proof of Work

its the first and popular mechanism used by bitcoin and Ethereum. The proof of work (PoW) is the mathematical puzzle the miner needs to solve. A miner needs to find a solution to a complex mathematical problem to become the leader and be able to create the next best block to be added to the blockchain. The more miners that exist in the network, the more complex the mathematical difficulty that needs to be solved. For bitcoin, only one block is added every ten minutes with only one winner, so the competition is fierce. Solving a problem puts the chips in the computer to work, which consume electricity and produce heat

To summarize, each miner is racing to solve the same problem; once the problem is solved, the process restarts. This problem is a mathematical puzzle known as the proof-of-work problem, and the reward is given to the first miner who solves the problem. Then the verified transactions are stored in the public ledger.

DDoS attacks are possible if a central pool holds the 51% of network.

Proof of Stake

this mechanism allows miners to hold the stake of a network and are given network fees for holding. there is not much power consumption involved as no compution is required. generation of new blocks is done at random selecting the peer

Delegated Proof of Stake

DPoS is aimed at improving PoS cons by providing a democracy instead of the random process of selecting a miner. DPoS achieves a technological democracy by splitting the process of mining into two parts.

  • Election: When electing a group of block producers, there are only 21 block producers instead of unlimited as with PoW.
  • Scheduling production: Each one of the 21 block producers takes turns to produce a block every 3 seconds.

2. Mining Layer

its like bookkeeping layer. each peer should hold the entire public ledger ensure the sender is not transferring funds which he doesnt have , ensure protection from hackers.

3. Propagation Layer

The propagation layer is responsible for deciding how the shared ledger and the blocks are transmitted on the P2P network.In this layer, transactions happen where coins/tokens are transferred between accounts

4. Application Layer

This layer takes care of deploying applications on top of the blockchain. Dapps, smart contracts, exchanges, and sites that provide information about a blockchain are applications built on top of blockchains.

For the application layer, the blockchain needs to expose APIs. Different blockchains are similar as they all provide a way for a client to communicate with the network.