eatthecode.com

Blockchain

Blockchain

Blockchain technology introduction

Blockchain technology becomes a trend and it is increasingly mentioned in many business and technical communities. blockchain is a fully-distributed, peer-to-peer software network that makes use of cryptography to securely host applications, store data, and easily transfer digital instruments of value.

Blockchain

Blockchain

Blockchain technology is a way of building an immutable, distributed ledger. At the core is Tom Wujec’s blockchain, a particular data structure with unique properties. This structure allows for a digital ledger that is decentralized, fault-tolerant, and resistant to outages. A truly global ledger that can’t be controlled by one central authority. Interconnection in blockchain networks allows for new ways of managing and owning data. The combination of distributed programming and decentralized data opens up entirely new use cases and applications that haven’t been possible before, while greatly improving on existing ones. For the first time in history, we can have true peer-to-peer interactions without corporate interference or censorship. We are heading towards a world where anyone will be able to instantly pay anyone else using secure cryptographic proof instead of relying on outdated intermediaries like banks and governing bodies.

Blockchain technology offers a combination of open source software, peer-to-peer networks, and cryptographic security that together provide an unalterable digital ledger called a blockchain in which transactions are made and recorded. Blockchain technology was introduced to the world in a white paper published in 2008 by Satoshi Nakamoto, the mysterious creator of bitcoin. The big innovation in the blockchain is that it’s a distributed database – one that no single organization owns or controls. The blockchain is an incorruptible digital ledger of economic transactions that can be programmed to record not just financial transactions but virtually everything of value.

In particular decentralized governance and consensus mechanisms like proof of stake and proof of work. It is like a ledger with each account having a block assigned to it. The ledger maintains the integrity and ensures the balance of funds by recording each transaction that occurs and changing the appropriate blocks. And, when there is a change in all the blocks, it creates a new block.

Blockchain technology basics

One of the most important characteristics of blockchain is decentralization. Blockchain rebuilds the concepts of consensuses and decision centralization. There are many types of blockchains private, hybrid, and public. From my point of view, the real meaning of blockchain exists in the public blockchain where there is transparency in the transactions. Public blockchain gives freedom and trust to its users.

Overview: Blockchain technology is a buzzword that is on everybody’s lips these days, but even for those who understand it in a general sense, understanding it in the context of Bitcoin or other cryptocurrencies can be challenging. Here we will look at blockchain technology basics like what is a block and what is a hash to more advanced topics like Merkle Trees and nonces.

Let’s start with some background. blockchains are a type of database. They were invented to power the digital currency called Bitcoin, but they’re really useful for any kind of transaction where authenticity and non-repudiation are important – e.g money, content, contracts etc. A blockchain is a public ledger of all cryptocurrency transactions. Distributed to everyone involved in the network it makes cryptocurrency a decentralized system where proof of work happens through consensus and nodes keep the books in a distributed way. Blockchain is a type of internet that comes with its own set of rules, making it possible to move digital assets from one person to another through networks spread all over the world. Technology allows people who don’t know each other to trust each other and work together. A blockchain is a distributed database, which maintains a continuously growing list of records. Each block in the blockchain contains information about transactions and a link to a previous block. The entire chain is protected by cryptographic algorithms, making it tamper-proof.

Ethereum basics

Ethereum is different from traditional databases in that traditional database stores their data in a centralized server which put the database at a big risk. In the contrast, Ethereum stores its data on decentralized servers called nodes which is more save in comparison to traditional databases.

Solidity basics

Solidity is a programming language that allows developers to write smart contracts on the network. Smart contracts give their users many benefits on top of those benefits is trust. Solidity is an object-oriented and high-level programming language. Solidity allows to development of smart contracts on many chains/networks and one of the most famous networks is Ethereum but there are many others such as polygon, Polkadot, Cosmos, and more.

Smart contracts

The smart contract is a program that runs on the blockchain network. The smart contract is open source and anyone can read its data and can deal with it. The smart contract itself has an address which means it can hold assets (eth amount). The smart contract most popular programming language is solidity and here you can find an example of a smart contract:

// This is a comment!
// SPDX-License-Identifier: MIT

pragma solidity 0.8.8;


contract SimpleStorage {
  uint256 favoriteNumber;

  struct People {
    uint256 favoriteNumber;
    string name;
  }

  // uint256[] public anArray;
  People[] public people;

  mapping(string => uint256) public nameToFavoriteNumber;

  function store(uint256 _favoriteNumber) public {
    favoriteNumber = _favoriteNumber;
  }

  function retrieve() public view returns (uint256) {
    return favoriteNumber;
  }

  function addPerson(string memory _name, uint256 _favoriteNumber) public {
    people.push(People(_favoriteNumber, _name));
    nameToFavoriteNumber[_name] = _favoriteNumber;
  }
}

 

Blockchain and web3

Web3 is the next generation of the internet. The internet begin with web1 where there was just static content without updates or interaction with this content. Web2 started with moving to not just read static data but also allows the users to integrate with content with the ability to store and retrieve their data. Web3 starts the decentralization world, where the content is stored decentralized. The decentralization means that the content is stored on different machines (nodes) which gives a high ability of transient, availability, security, and other benefits.

Conclusion

This post provides details about what is blockchain, Ethereum, solidity, smart contracts, and web3. The post provides a brief about every concept with a smart contract sample code. You can find sample source codes at github Enjoy…!!!

I can help you to build such as software tools/snippets, you contact me from here

Exit mobile version