Giter Club home page Giter Club logo

web3-blockchain's Introduction

Understand basics of Web3 and Blockchain

Watch the complete video: https://youtu.be/UsHFccUk13U

Why do we need blockchain?

Web1 meant reading - web2 was about reading and writing - web3 is about ownership. When you use the current applications like Social Media, all the data gets stored on the company’s servers, and well the majority of big platforms are handled by only a handful of companies.

We trust these companies with our data and have faith in them. We do it because we don’t have any other options yet. Artists never really own the things that they make. You don’t ‘really’ have control over your own money - banks do. Banks have the power to freeze someone’s account and well in history it has happened where the withdrawals had stopped multiple times.

This was a gist for you about how we live in a centralized world.

There are plenty of other examples on why this is important and we need the world of decentralization and web3.

Think of sound.xyz and how it’s helping artists be independent and make more money through ownership.

Centralized platforms have been dominant for so long that many people have forgotten there is a better way to build internet services.

Crypto Networks are a powerful way to develop community-owned networks and provide a level playing field for 3rd-party developers, creators, and businesses. We saw the value of decentralized systems in the first era of the internet. Hopefully we’ll get to see it again in the next.

Resources

How does the blockchain work?

Blockchain is a chain of “blocks” or a shared ledger of data - everyone can see what is going on and all the transactions happening in real time.

If trust can be set by code, then creators don’t have to rely on middlemen. They:

  • Don’t have to trust banks to get paid

  • Don’t have to trust lawyers to draft a contract

  • Don’t have to trust social networks to make a living

Blockchains are:

  1. Decentralized: Transactions are stored on a network of computers (nodes).

  2. Immutable: Transactions cannot be changed once committed to the block.

  3. Open: Transactions can be viewed by anyone.

Bitcoin uses blockchain and therefore is decentralized, immutable, and open. It’s also:

  1. Hard capped: There will only ever be 21M bitcoin.

  2. Single-purpose: Many holders just want it to be a digital token that stores value.

From a developer perspective, think of a backend which never goes down and people can see what you’re doing anonymously with an address. You can deploy your product and use it to create a decentralized app where everyone owns what they make.

Blockchain provides:

  1. Decentralization

  2. Trustless System

  3. Security

Resources

Explore the blockchain

  • There are many tools that you can use to explore the world of blockchain.

  • Etherscan, mempool are 2 such tools where you can see what people are buying, selling, and doing on the chain.

  • You can look up any particular address or transaction on the blockchain.

  • You can also explore other things like whale movements - the accounts which hold massive amounts of cryptocurrencies.

Full stack decentralized app

Watch the complete blockchain developer roadmap here: https://youtu.be/CJhUed6msJA

Decentralized applications (dApps) are digital applications or programs that exist and run on a blockchain or peer-to-peer (P2P) network of computers instead of a single computer. DApps (also called "dapps") are outside the purview and control of a single authority. DApps—which are often built on the Ethereum platform—can be developed for a variety of purposes including gaming, finance, and social media.

Let’s see how a decentralized app works and looks like behind the scenes.

  • A decentralized application is similar to a centralized web app with slight changes.

  • We use smart contracts to do things on the blockchain where the transactions get logged into.

  • The frontend is similar: HTML, ReactJS, React Native, Next JS, or anything else.

In the context of cryptocurrencies, dApps run on a blockchain network in a public, open-source, decentralized environment and are free from control and interference by any single authority. For example, a developer can create a Twitter-like dApp and put it on a blockchain where any user can publish messages. Once posted, no one—including the app creators—can delete the messages.

Smart contracts

Unlike Bitcoin, Ethereum has a complete programming language inside it, so programmers can write code and make apps on Ethereum.

Bitcoin is a digital gold. It's a store of value & a medium of exchange. Ethereum is the infrastructure of a digital city. It was imagined as a foundation for businesses and applications to be built atop.

You can use Solidity Language to code smart contracts and then build decentralized apps (dapps) on top of the ethereum blockchain. There are other (and faster) chains that you can develop on - like polygon, solana. Think of the blockchain as a big backend database which runs all the time and can store things for you!

For the coins, we see coins everywhere - shiba inu and dogecoin are going to the moon according to some people. Unfortunately, they don’t have any logic behind those products! They are just meme coins.

There is a lot of thought behind real projects like ethereum and a complete structure of ‘tokenomics’ is defined before launching the product.

There are other stablecoins which you can buy to earn passive income through staking, yield farming, lending, etc. Examples are DAI, USDT, etc.

Resources

Create your own coin

  • Let’s see how to make our own coin using simple smart contracts on Ethereum.

  • You can simply write a smart contract and deploy it to have your coin.

  • Open Zeppelin has this awesome tool Contract Wizard (https://wizard.openzeppelin.com/) which has a very simple UI to frame your basic smart contract.

  • Click on the functions you require in your smart contract, they currently support all the popular protocols, ERC20, ERC1155, ERC721

  • Github code


// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

  

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol";

  

contract MyToken is ERC20 {

constructor(string memory name, string memory symbol) ERC20(name, symbol) {

// Mint 100 tokens to msg.sender

// Similar to how

// 1 dollar = 100 cents

// 1 token = 1 * (10 ** decimals)

_mint(msg.sender, 100 * 10**uint(decimals()));

}

}

  

Layer 1 vs Layer 2 explained

Layer-1 is the term that’s used to describe the underlying main blockchain architecture. Layer-2, on the other hand, is an overlaying network that lies on top of the underlying blockchain. Layer-2 refers to a network or technology that operates on top of an underlying blockchain protocol to improve its scalability and efficiency. This category of scaling solutions entails shifting a portion of a blockchain protocol’s transactional burden to an adjacent system architecture, which then handles the brunt of the network’s processing and only subsequently reports back to the main blockchain to finalize its results.

  • These are like cake layers, the deeper you go, the tastier it gets.

  • Layer 1 chains are the first working concept of blockchain, they have their own infrastructures.

  • Layer 2 chains are built on top of Layer 1 and work similarly to them.

  • These layer 2 chains solve the underlying problems of layer 1 like high fee and scalability.

  • Layer 2 chains need not follow the same consensus mechanism as layer 1.

Resources

Wallets

On Blockchain, your wallet is your identity. There are no names, there are just wallet addresses.

An online wallet is just like the one in your pocket - we need that to store money.

These wallets are either software (e.g., Coinbase, Metamask, Rainbow) or hardware (e.g., Ledger).

Easiest way to get started is to just experiment with things. Find an exchange where you can purchase some crypto. Setup a wallet like metamask, transfer the money to that wallet, and then see if you can swap some tokens.

Every wallet has a security key that you need to keep safe with you. Make sure you don’t lose that. In the majority of cases, most people will just use an exchange to manage their money like binance and coinbase.

A consensus algorithm is a process in computer science used to achieve agreement on a single data value among distributed processes or systems.

Proof of work and proof of stake are 2 major consensus algorithm. Let’s discuss those.

POW: Nodes (miners) try to solve a problem - first one that solves it gets the reward - other nodes check if it’s correct.

POS: miners stake their share to solve the problem - other validators check it and get a share if it’s correct - eventually add the block to the chain.

Resources

EVM vs non-EVM

  • The Ethereum Virtual Machine is the software platform that developers can use to create decentralized applications (DApps) on Ethereum. This virtual machine is where all Ethereum accounts and smart contracts live.

  • The role of the EVM is to deploy a number of extra functionalities to the Blockchain to ensure users face limited issues on the distributed ledger. Every Ethereum node runs on the EVM to maintain consensus across the blockchain.

  • EVM works like a large decentralized or master computer to complete all types of tasks on the blockchain.

  • The EVM is Turing complete, meaning that if asked, it will find an answer. Users can write smart contracts in Solidity, Ethereum’s programming language, and send it to the EVM to interpret and execute. The Ethereum protocol works as the consensus architecture for these contracts.

  • Every project is working towards making transactions faster, adding multi-chain functionality, and more. Polkadot has added Moonbeam, Near launches Aurora, and soon (announced but not released), Evmos will be live on Cosmos and Neon will be implemented on Solana, eg: https://aurora.dev/

  • Solana is an example of a non-EVM project.

  • Cardano is now EVM compatible!?

  • https://coinwut.com/cardano-evm-compatible/

  • https://medium.com/coinmonks/cardano-determinism-e-utxo-ledger-model-ef183d1e88ce

Intro to Solana

Solana was founded in 2017 by Anatoly Yakovenko and is an open-source project that implements a new high-performance, permissionless blockchain. Solana’s mission is to support all high-growth and high-frequency blockchain applications and to democratize the world’s financial systems.

Proof-of-History is a high Verifiable Delay Function (VDF). Solana requires validators to solve these VDFs continuously. A VDF requires a specific number of sequence steps to evaluate but also produces a unique output that can be efficiently and publicly verified. VDFs can only be solved by a single CPU core applying a particular set of sequential steps.

Solana runs a Tower Byzantine Fault Tolerance (BFT) consensus mechanism on their Proof-of-History protocol.

Resources

ERC protocols

  • ERC is essentially the acronym for Ethereum Request for Comments. ERCs are Ethereum application-level specifications, such as token standards, name registries, library/package formats, and more. Anyone may make an ERC token with Ethereum Blockchain app development, but the author must explicitly clarify their standard and gain community approval for it.

  • Non-fungible Tokens (NFTs) are well-known in the collectible and gaming industries, and they are one of the most hyped markets in the blockchain and crypto industries. NFTs have applications that go way beyond games and collectibles. The ERC-721 and ERC-1155 smart contracts are being used by developers all over the world to build whole virtual worlds

Resources

NFTs

Fungible tokens are interchangeable (e.g., the US dollar, bitcoin). Non-fungible tokens (NFTs) are unique (e.g., art, music, domain names).

NFTs are much more than just images. Think of ownership. You own your house -> you want to sell it -> every time you sell it -> you get some ownership royalty on it. Now think of owning an art piece or something. You sell that and get royalty on that.

Artists have been selling things they made for years without ownership. Now they’re turning to their true fans to make much more money off of the work they do.

For gaming: Checkout the game zed run and how it’s played - you own a horse NFT just like in a real world horse gambling scenario.

How to buy, mint, sell? Go to opensea, connect your metamask wallet, and purchase your first NFT. Want to upload an art that you have? Go to the profile section and then upload your image to the blockchain through their dashboard.

There are many many other use cases for NFTs, checkout the resources.

Resources

DAOs

DAOs are decentralized autonomous organizations - they run without a captain. This automatically reduces the risk of corruption and other malpractices.

Example 1: token holders of MakerDAO building a decentralized stablecoin are able to govern the system and vote on parameters such as fees charged.

We’ve also seen DAOs emerge that are catered for more specific investment opportunities such as owning NFT art and virtual gaming items.

There are a number of tools built for creating and coordinating DAOs such as Aragon, DAOStack, DAOhaus, Llama, and MyCo so that members do not have to build everything from scratch.

DAOs work on relationships and it’s important to iterate on ideas regularly to maintain the integrity of the ideas

Resources

IPFS

  • At its core, IPFS is a distributed system for storing and accessing files, websites, applications, and data. It is transport layer agnostic, meaning that it can communicate over various transport layers—including transmission control protocol (TCP), uTP, UDT, QUIC, TOR, and even Bluetooth.

  • IPFS uses content addressing the way HTTP uses URLs. This means that instead of creating identifiers that address artifacts by location, we can address them by some representation of the content itself.

Resources

web3-blockchain's People

Contributors

hack-parthsharma avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.