<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: shivi28</title>
    <description>The latest articles on DEV Community by shivi28 (@shivi28).</description>
    <link>https://dev.to/shivi28</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F260064%2F59d65484-633b-4a5e-b038-da80d9baecd5.jpeg</url>
      <title>DEV Community: shivi28</title>
      <link>https://dev.to/shivi28</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shivi28"/>
    <language>en</language>
    <item>
      <title>OSS-Fuzz ?? Setup Cluster API on OSS-Fuzz</title>
      <dc:creator>shivi28</dc:creator>
      <pubDate>Wed, 20 Apr 2022 15:30:10 +0000</pubDate>
      <link>https://dev.to/kcdchennai/oss-fuzz-setup-cluster-api-on-oss-fuzz-111l</link>
      <guid>https://dev.to/kcdchennai/oss-fuzz-setup-cluster-api-on-oss-fuzz-111l</guid>
      <description>&lt;p&gt;&lt;strong&gt;Open source software&lt;/strong&gt; is a software with source code that anyone can inspect, modify, and enhance. They have multiple advantages like high quality software, no vendor lock-in, lower software cost and most important &lt;strong&gt;ABUNDANT&lt;/strong&gt; support.&lt;/p&gt;

&lt;p&gt;But with more flexibility comes more responsibility and that’s why we need something that can assure us that our software is free from programmatic errors, and have no serious security threats.&lt;/p&gt;

&lt;p&gt;So to make our open source softwares more secure and stable, Google has introduced OSS fuzz in 2016 with three primary goals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Finding security vulnerabilities, stability issues, and functional bugs at scale.
2. Making the platform easy to use for open-source developers and encouraging them to take security testing into their own hands.
3. Getting the bugs fixed quickly (OSS-Fuzz has a 90% fix-rate!)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OSS-Fuzz does Fuzz testing which is a well-known technique for uncovering programming errors in software. Many of these detectable errors, like buffer overflow, can have serious security implications, but with OSS-Fuzz we aims to make common open source softwares more secure and stable by combining modern fuzzing techniques with scalable, distributed execution.&lt;/p&gt;

&lt;p&gt;Currently, OSS-Fuzz supports C/C++, Rust, Go, Python and Java/JVM code. Other languages supported by LLVM may work too. OSS-Fuzz supports fuzzing x86_64 and i386 builds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpac9bcu3pqxzzhz77n1s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpac9bcu3pqxzzhz77n1s.png" alt="Oss-fuzz flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To know more, read &lt;a href="https://google.github.io/oss-fuzz/" rel="noopener noreferrer"&gt;this&lt;/a&gt; detailed documentation to learn how to use OSS-Fuzz&lt;/p&gt;

&lt;h2&gt;
  
  
  Cluster API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cluster API&lt;/strong&gt; is a Kubernetes sub-project focused on providing declarative APIs and tooling to simplify provisioning, upgrading, and operating multiple Kubernetes clusters.&lt;/p&gt;

&lt;p&gt;Started by the Kubernetes Special Interest Group (SIG) Cluster Lifecycle, the Cluster API project uses Kubernetes-style APIs and patterns to automate cluster lifecycle management for platform operators. The supporting infrastructure, like virtual machines, networks, load balancers, and VPCs, as well as the Kubernetes cluster configuration are all defined in the same way that application developers operate deploying and managing their workloads. This enables consistent and repeatable cluster deployments across a wide variety of infrastructure environments.&lt;/p&gt;

&lt;p&gt;To know more, visit &lt;a href="https://github.com/kubernetes-sigs/cluster-api" rel="noopener noreferrer"&gt;this&lt;/a&gt; github page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Cluster API on OSS-Fuzz
&lt;/h2&gt;

&lt;p&gt;As Cluster API is a widely used open source project, so community decided to setup Cluster API on OSS-Fuzz.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is the following &lt;a href="https://github.com/kubernetes-sigs/cluster-api/issues/6059" rel="noopener noreferrer"&gt;PR&lt;/a&gt; to track this setup process in CAPI project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once we initiate the setup of any open source project on &lt;code&gt;Oss-Fuzz&lt;/code&gt;, we also raised one corresponding PR in &lt;code&gt;google/oss-fuzz&lt;/code&gt; repository.&lt;/p&gt;

&lt;p&gt;This is the corresponding google/oss-fuzz &lt;a href="https://github.com/google/oss-fuzz/pull/7292" rel="noopener noreferrer"&gt;PR&lt;/a&gt; for CAPI setup `&lt;/p&gt;

&lt;p&gt;Once all these steps are executed, then we are done with initial integrations. In above steps we have mentioned some email IDs in the PR, and these people will get the automatic email notification if any bug is found in the mentioned project.&lt;/p&gt;

&lt;p&gt;Once we received a mail, next action item is to reproduce this issue locally and resolve it in the project.&lt;/p&gt;

&lt;p&gt;In next section I will list down few steps to reproduce the issue in your local system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to reproduce it locally
&lt;/h2&gt;

&lt;p&gt;Files and variables required to run it in local&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/path/to/downloaded/minimized/testcase&lt;/strong&gt;:&lt;br&gt;
this is the path for a file which every issue has. It's called a reproducer file (also know as a "testcase" file). This you can get from mail with a name as Reproducer Testcase&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take checkout of OSS-Fuzz in local&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;git clone https://github.com/google/oss-fuzz&lt;br&gt;
cd oss-fuzz&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pull the latest Docker images&lt;/strong&gt;&lt;br&gt;
Docker images get regularly updated with a newer version of build tools, build configurations, scripts, and other changes. In some cases, a particular issue can be reproduced only with a fresh image being used. Pull the latest images by running the following command:&lt;br&gt;
&lt;code&gt;python infra/helper.py pull_images&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build the image and the fuzzers.&lt;/strong&gt;  Run following command&lt;br&gt;
&lt;code&gt;python infra/helper.py build_image kubernetes-cluster-api&lt;br&gt;
python infra/helper.py build_fuzzers kubernetes-cluster-api&lt;br&gt;
python infra/helper.py reproduce kubernetes-cluster-api fuzz_conversion_of_all_types /path/to/downloaded/minimized/testcase&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After running all the above commands you will see something like this in your local:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fij6ydyfujvhk8kvadafs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fij6ydyfujvhk8kvadafs.png" alt="output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this way, you can reproduce the bug locally.&lt;/p&gt;

&lt;p&gt;To know more on reproducing the bug locally follow &lt;a href="https://google.github.io/oss-fuzz/advanced-topics/reproducing/" rel="noopener noreferrer"&gt;this&lt;/a&gt; official doc.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Blockchain Terminologies</title>
      <dc:creator>shivi28</dc:creator>
      <pubDate>Mon, 18 Apr 2022 06:36:48 +0000</pubDate>
      <link>https://dev.to/kcdchennai/blockchain-terminologies-eif</link>
      <guid>https://dev.to/kcdchennai/blockchain-terminologies-eif</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JHvt9v8B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ilmetf6edm189rebm5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JHvt9v8B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ilmetf6edm189rebm5q.png" alt="Blockchain" width="435" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Addresses
&lt;/h2&gt;

&lt;p&gt;Address or bitcoin addresses are unique identifiers that are composed from 26 to 35 alphanumeric characters. They are used in blockchain transactions and they are responsible for denoting senders and recipients. For every transaction, users can use a new address, but they can reuse old ones if they wish. Reusing the same addresses can lead to easier identification of the user that created it. Addresses can also be case sensitive and created offline. it is also possible to create multi-signature addresses that require more than one private key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transactions
&lt;/h2&gt;

&lt;p&gt;Transactions are the main units of blockchain technology. They are used for transferring values from one address to another&lt;/p&gt;

&lt;h2&gt;
  
  
  Transaction Fee
&lt;/h2&gt;

&lt;p&gt;Miners that choose to include a transaction in a block collect a transaction fee. The fee is calculated differently for every transaction based on variables like the size of the transaction and amount of resources (electricity and hardware) required to process it. Generally, the bigger the transaction, the larger the fee. Miners choose transactions from memory pools by checking their priority. Those with a higher priority for the block that is being built should be picked up first. Anyone wanting faster processing of a transaction would need to offer a higher incentive (more money) in order to make a miner want to pick it up sooner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turing Complete
&lt;/h2&gt;

&lt;p&gt;Turing complete is a computability theory that is used for abstract machines. Computability theory says that any system of data manipulation rules that can simulate a Turing machine is called Turing Complete. Turing complete programming language is in a high demand when it comes to blockchain technology but security issues are still a problem. Virtual machines are used to run Turing complete code on blockchain&lt;/p&gt;

&lt;h2&gt;
  
  
  Block
&lt;/h2&gt;

&lt;p&gt;A block hash, timestamp , nonce and at least several transactions make a block. once a block is completed, the records about transactions can not be modified or deleted. Multiple blocks added together form a blockchain network. block contains information about past, present and future transactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Explorer
&lt;/h2&gt;

&lt;p&gt;Block explorer is a web tool used for viewing information about addresses, transactions, transaction histories, and individual blocks in a blockchain network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Height
&lt;/h2&gt;

&lt;p&gt;Block Height represents the number of blocks that are ahead of the given block in the blockchain network. Every block contains a header containing the current block height.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Reward
&lt;/h2&gt;

&lt;p&gt;Block rewards are rewards for the miners which solve some type of mining puzzles. When Bitcoin was started, for example, the reward for successfully mining a block was 50 Bitcoins. The reward is contained in Coinbase transactions that miners receive after solving a puzzle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Central Ledger
&lt;/h2&gt;

&lt;p&gt;The central ledger represents records about all financial transactions of an organization. Centralized ledger means that there is a main ledger which contains all information in. one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Peer-to-Peer Network
&lt;/h2&gt;

&lt;p&gt;A P2P is a type of network where each peer can contact other peers and exchange information. In this network topology, there is no need for a central server. The peers need only to join a peer-to-peer network before they can send and receive messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Smart Contracts
&lt;/h2&gt;

&lt;p&gt;A smart contract is a computer program or protocol that is used to set the rules of a contract between two parties. Smart contracts are also called crypto-contracts. They can also, apart from setting rules, take control to enforce those rules and transfer the digital currencies between parties if conditions of the contract are met. The main advantage is that smart contracts don't require a third party.&lt;/p&gt;

&lt;h2&gt;
  
  
  Oracles
&lt;/h2&gt;

&lt;p&gt;an Oracle is a third party information source and is a part of the smart contract system. Smart contracts are unable to access external data which might be needed for a rule to be executed. Oracles can deliver that external data to smart contracts. They use a secure channel when transferring data and they are considered secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consensus
&lt;/h2&gt;

&lt;p&gt;Consensus is a type of agreement and means that multiple parties have agreed on the same value or goal. When talking about blockchain technology, Consensus means that nodes have agreed on the same state of a blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirmation
&lt;/h2&gt;

&lt;p&gt;Confirmation happens when a network has successfully processed a transaction. It also means that the transaction can not be reversed. When talking about trade life cycle, Confirmation means that both opposing parties have agreed to the details of trade. For a transaction to be finalized multiple confirmations are often needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cryptocurrency
&lt;/h2&gt;

&lt;p&gt;Cryptocurrency is considered to be a digital form of money. It uses high-end encryption techniques to create funds and to verify their transfer. Without blockchain, cryptocurrency would not exist. They use a decentralized control system which works through distributed ledger technology, like a blockchain. The most famous cryptocurrency is Bitcoin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cryptographic Hash Function
&lt;/h2&gt;

&lt;p&gt;Hash functions are functions that take an input value of some length, and extracts from it another value of a fixed length. No matter how many characters are fed into the hash function, the output will always be of the fixed defined output length. even if 2 input values differ by only one character, their output hashes will be totally different. Characteristics of a cryptographic hash functions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Computationally Efficient:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic:&lt;/strong&gt; For some input, output should always be same&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collision Resistant:&lt;/strong&gt; no 2 inputs could have same output&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-image resistant:&lt;/strong&gt; input can not be revealed by looking at the output&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  DAPP
&lt;/h2&gt;

&lt;p&gt;DAPP stands for Decentralized Application. This is an application whose backend runs on multiple computers that are part of a decentralized network. This differs from a standard app, whose backend runs on centralized servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  DAO
&lt;/h2&gt;

&lt;p&gt;DAO stands for Decentralized Autonomous Organization. A DAO is computer software that runs on top of a blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed Ledger
&lt;/h2&gt;

&lt;p&gt;Distributed Ledger are identical databases that are distributed to each of the participants. They are often confused with blockchain but they are not the same thing. The records of these ledgers are not placed in blocks like in a. blockchain, but rather stored contiguously. Each participant node is first updated individually. After that, they all collectively vote on the update and prove it or not. When all participants reach an agreement, the ledger then gets updates to the latest change and all participants' nodes save the same version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed Network
&lt;/h2&gt;

&lt;p&gt;A distributed network is a kind of network that expands across several networks. This way, these networks can function and operate together as a coherent unit, or separately as individual units.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difficulty
&lt;/h2&gt;

&lt;p&gt;Difficulty represents how hard it is (how long it takes) to find the hash needed to add a new block to a blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Digital Signature
&lt;/h2&gt;

&lt;p&gt;A digital signature is used for identifying an entity which is sending a message. Every electronic document contains a digital signature. They are also used for nonrepudiation because they are authentic, non-forgeable and non-reusable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Signature
&lt;/h2&gt;

&lt;p&gt;A multi-signature is a a digital signature type used for situations where a group of entities need to sign a document. One combined signature composed by using a multi-signature scheme from more entities is considered more secure and compact than a collection of signatures from entities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Double Spending
&lt;/h2&gt;

&lt;p&gt;Double spending is an attack where an entity tries to spend the same crypto coins in more than one transaction at the same time. blockchain tries to prevent double spending attacks by using timestamps on transactions, and then by broadcasting them to the nodes that are in the network. Various cryptocurrencies have developed ways for their networks to be immune to double spending attacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ethereum
&lt;/h2&gt;

&lt;p&gt;Ethereum is a blockchain technology product that is based on the Turing complete programming language called Solidity. The difference between Ethereum and other cryptocurrencies is that there is no limited scripting. Ethereum is not only a platform and cryptocurrency, but also a programming language. It uses smart contract technology, and it has smaller blocks then Bitcoin and other better known cryptocurrencies. The average size of an Ethereum block is under 2KB.&lt;/p&gt;

&lt;h2&gt;
  
  
  EVM
&lt;/h2&gt;

&lt;p&gt;Ethereum virtual Machine is a network of machines that run the same software and are public nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solidity
&lt;/h2&gt;

&lt;p&gt;Solidity is a high-level programming language that is based on contracts. Smart contracts can be implemented with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testnet
&lt;/h2&gt;

&lt;p&gt;TestNet is a software that is used for testing out new features and changes to the blockchain, without disrupting the primary blockchain software. TestNets are identical to the original blockchain being tested. Ethereum and bitcoin both use testnets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fork
&lt;/h2&gt;

&lt;p&gt;A fork represents an update to a blockchain, and in essence they are a change to a cryptocurrency protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Soft fork
&lt;/h2&gt;

&lt;p&gt;soft forks are backward compatible protocol changes. This means that any nodes running an older version of the protocol are allowed to add new blocks to the blockchain as long as they respect the new protocol. If a node tries to process a transaction that does not fall into the new protocol, it will not be successful. This kind of principle makes nodes running an older protocol version to update to the new version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard fork
&lt;/h2&gt;

&lt;p&gt;Hard forks are protocol changes that are not backward compatible. this means that nodes which are running an older protocol version will not be able to process new transactions even though the transactions might fall into all protocol requirements&lt;/p&gt;

&lt;h2&gt;
  
  
  Genesis Block
&lt;/h2&gt;

&lt;p&gt;A genesis block represents the first block inside of a blockchain&lt;/p&gt;

&lt;h2&gt;
  
  
  Hash Rate
&lt;/h2&gt;

&lt;p&gt;A hash rate is the speed of computing hashes per second. Hash rates were much slower when bitcoin miners mined with CPUs. Later, hash rates increased when ASICs replaced CPUs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mining
&lt;/h2&gt;

&lt;p&gt;Mining is the process of inserting a transaction into a blockchain's ledger where all previous transactions are also recorded. Mining ensures the security of a blockchain and it is a method of achieving blockchain decentralization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wallets
&lt;/h2&gt;

&lt;p&gt;Wallet is a digital wallet software that holds essential information related to users' cryptocurrency. These are things like private and public keys and bitcoin addresses. They can perform different functions that are important for manipulating cryptocurrency, such as sending and receiving bitcoins.&lt;/p&gt;

&lt;h2&gt;
  
  
  CPU mining
&lt;/h2&gt;

&lt;p&gt;CPU mining is the action of executing computations with a computer's CPU for the purpose of mining an asset of value. In most cases, these are cryptocurrencies like bitcoin. CPU mining was the first way bitcoins could be mined. But this technique isn't as profitable now, so more advanced methods are used.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPU mining
&lt;/h2&gt;

&lt;p&gt;GPU mining is the action of executing computations with a computer's GPU for the purpose of mining an asset of values, usually cryptocurrencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nodes
&lt;/h2&gt;

&lt;p&gt;In the context of blockchains, nodes are parts of the blockchain network that carry out different functions (such as transaction validation, mining or other tasks), depending on the kind of blockchain and its purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  ASIC Application Specific Integrated Circuit
&lt;/h2&gt;

&lt;p&gt;ASIC are a type of ICs created significantly for some application or other specific intent, instead of being built for general use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ledger
&lt;/h2&gt;

&lt;p&gt;A ledger is a digital record of all transactions that an organization has performed.&lt;/p&gt;

</description>
      <category>kcdchenna</category>
      <category>kcdblogathonchennai</category>
      <category>blockchain</category>
      <category>terminology</category>
    </item>
    <item>
      <title>Blockchain Architecture</title>
      <dc:creator>shivi28</dc:creator>
      <pubDate>Mon, 18 Apr 2022 05:34:00 +0000</pubDate>
      <link>https://dev.to/kcdchennai/blockchain-architecture-3643</link>
      <guid>https://dev.to/kcdchennai/blockchain-architecture-3643</guid>
      <description>&lt;p&gt;In this article we understand basic blockchain block structure and learn about the fields by taking example of a real block with &lt;code&gt;block-number=#601439&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TW9yc8yQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sk37za0j5f08xihhojwd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TW9yc8yQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sk37za0j5f08xihhojwd.jpg" alt="block601439" width="880" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Block we have following fields:&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Number/Block Height
&lt;/h2&gt;

&lt;p&gt;It represents the number of a block in line, so the first block would be 1, the second 2, and so on to our block 601439.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block size
&lt;/h2&gt;

&lt;p&gt;Maximum limit for the amount of transactions. It is not the actual number of transactions allowed instead it is the size of transactions that is allowed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block Hash
&lt;/h2&gt;

&lt;p&gt;A block hash in this case, which is created from the block header with SHA256&lt;/p&gt;

&lt;h2&gt;
  
  
  Version
&lt;/h2&gt;

&lt;p&gt;This is a protocol version. Miners need to know protocol versions in order to be able to properly process blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  hashMerkelRoot
&lt;/h2&gt;

&lt;p&gt;If all the transactions are used to create a single hash, this would be simple, and not what we have here!. This principle is not used because if we wanted to run a verification of a particular transaction we would need to know all of the other ones as well. This is doable, just less efficient than the Merkel tree approach.&lt;/p&gt;

&lt;p&gt;In this approach , we only need some of the “hashes”. We go slowly, we first take hashes in a set of 2 transactions till we reach just one hash.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3dppOwta--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/beh3ojrdozo27f2a4b9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3dppOwta--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/beh3ojrdozo27f2a4b9z.png" alt="Merkel tree" width="339" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Number of Transactions
&lt;/h2&gt;

&lt;p&gt;Each block contains a number of transactions. Usually a maximum size is defined, but the number of transactions per block varies.&lt;/p&gt;

&lt;h2&gt;
  
  
  TimeStamp
&lt;/h2&gt;

&lt;p&gt;This is the time when the hashing actually took place. It can be in a different format but for all blocks with the same number it should point to the same time. Notation difference is ignored.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transactions
&lt;/h2&gt;

&lt;p&gt;In this example transaction refers to payment, but different protocols can define transactions in different ways. Yet it does not always have to be an individual transaction. Instead it can just be observed as an event defined by a given protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bits
&lt;/h2&gt;

&lt;p&gt;It can be a hexadecimal number. This is just another representation of difficulty&lt;/p&gt;

&lt;h2&gt;
  
  
  Difficulty
&lt;/h2&gt;

&lt;p&gt;When the hashing process takes place, the difficulty is determined by the targeted number of zeroes that the hash needs to begin with. As more people involved in mining we need to increase the difficulty&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Difficulty = expected/actual(available computation power)
if D &amp;gt;1 then increase(0.25, 4)
if D &amp;lt; 1, then decrease(0.25,4)
want no sudden change that’s why keeping this threshold
so newDifficulty = oldDifficulty * expected/actual
targetDiff = targetMax(=Bits)/difficulty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so, &lt;code&gt;blockHash &amp;lt; targetDiff&lt;/code&gt; always.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nonce
&lt;/h2&gt;

&lt;p&gt;This is the data that we need to the block data to make block hash &amp;lt; targetDiff&lt;/p&gt;

&lt;h2&gt;
  
  
  hashPrefixBlock
&lt;/h2&gt;

&lt;p&gt;This is the hash of the previous block, and is embedded into the current block. Hash should have a certain number of zeroes before it.&lt;/p&gt;

</description>
      <category>kcdchennai</category>
      <category>kcdchennaiblogathon</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Go: nil == nil is true or false? Na tum jano na hum…</title>
      <dc:creator>shivi28</dc:creator>
      <pubDate>Sat, 16 Apr 2022 08:23:54 +0000</pubDate>
      <link>https://dev.to/kcdchennai/go-nil-nil-is-true-or-false-na-tum-jano-na-hum-1n7a</link>
      <guid>https://dev.to/kcdchennai/go-nil-nil-is-true-or-false-na-tum-jano-na-hum-1n7a</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7yAaYB68--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz0vkmmn15wl0h9feaim.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7yAaYB68--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz0vkmmn15wl0h9feaim.jpeg" alt="Go image" width="627" height="225"&gt;&lt;/a&gt;&lt;br&gt;
In this article, we will understand how to use &lt;code&gt;==&lt;/code&gt; the operator in Go to compare object values. We will also look at scenarios where the behaviour of this operator looks like a bug in the language but it is due to a lack of understanding.&lt;/p&gt;

&lt;p&gt;Let's go through the below example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a *string = nil    
var b interface{} = a
fmt.Println("a == nil:", a == nil) // true 
fmt.Println("b == nil:", b == nil) // false 
fmt.Println("a == b:  ", a == b  ) // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To understand the above example lets start with a simple one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a int = 12
var b int = 12
c:= 12
fmt.Println("a == b :", a == b) // true
fmt.Println("a == c :", a == c) // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is very obvious.&lt;br&gt;
&lt;strong&gt;Let's twist the example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a *string = nil
var b interface{} = nil
fmt.Println("a == nil:", a == nil) // true
fmt.Println("b == nil:", b == nil) // true
fmt.Println("a == b:",   a == b) // false (even though the value is
                                           nil for both a and b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To understand the last case, let us dive deeper into it.&lt;/p&gt;

&lt;p&gt;In Go, every pointer variable has two values associated with it &lt;code&gt;&amp;lt;type, value&amp;gt;&lt;/code&gt; The fact that every variable needs a type is the reason why we can not have a nil value assigned to a variable whose type is not defined. That's why we can not write &lt;code&gt;x := nil&lt;/code&gt; because we don't mention the type of x and we get the following error &lt;code&gt;use of untyped nil&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now let's see our problem again&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a *string = nil      // a is &amp;lt;*string, nil&amp;gt;
var b interface{} = nil  // b is &amp;lt;nil, nil&amp;gt;
fmt.Println("a == nil:", a == nil) // true
fmt.Println("b == nil:", b == nil) // true
fmt.Println("a == b:", a == b)    // false &amp;lt;*string,nil&amp;gt;!=&amp;lt;nil, nil&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our case variable &lt;code&gt;a&lt;/code&gt; actually represent &lt;code&gt;&amp;lt;*string, nil&amp;gt;&lt;/code&gt; and &lt;code&gt;interface{}&lt;/code&gt; default type is &lt;code&gt;nil&lt;/code&gt; so variable &lt;code&gt;b&lt;/code&gt; is &lt;code&gt;&amp;lt;nil, nil&amp;gt;&lt;/code&gt;.&lt;br&gt;
So that's why when we say &lt;code&gt;a == b&lt;/code&gt; then we are actually comparing &lt;code&gt;&amp;lt;*string,nil&amp;gt; == &amp;lt;nil, nil&amp;gt;&lt;/code&gt; which is false.&lt;/p&gt;

&lt;p&gt;Now come back to our main example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a *string = nil     // a is &amp;lt;*string, nil&amp;gt;
var b interface{} = a 
fmt.Println("a ==nil:",a==nil)//true(&amp;lt;*string, nil&amp;gt;==&amp;lt;*string, nil&amp;gt;)
fmt.Println("b == nil:", b == nil) //false (&amp;lt;*string,nil&amp;gt;==&amp;lt;nil,nil&amp;gt;    fmt.Println("a == b:  ", a == b  ) // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we do &lt;code&gt;a == nil&lt;/code&gt; , &lt;code&gt;==&lt;/code&gt; the operator compares type as well as value. Here the value is nil for both LHS and RHS, but what will be the type of nil ???&lt;/p&gt;

&lt;p&gt;When nil(hard-coded value) is compared with an object, the type of nil is the same as the declaration type of object with whom it is compared.&lt;/p&gt;

&lt;p&gt;So in the case of &lt;code&gt;a == nil&lt;/code&gt; we are doing &lt;code&gt;&amp;lt;*string, nil&amp;gt; == &amp;lt;*string, nil&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the case of &lt;code&gt;b == nil&lt;/code&gt; , RHS is &lt;code&gt;&amp;lt;nil, nil&amp;gt;&lt;/code&gt; because the declaration type of &lt;code&gt;b&lt;/code&gt; is interface{} which is nil (default). Hence when we did&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var b interface{} = a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we assigned the value of &lt;code&gt;a&lt;/code&gt; to variable &lt;code&gt;b&lt;/code&gt; which means &lt;code&gt;b&lt;/code&gt; now refers to &lt;code&gt;&amp;lt;*string, nil&amp;gt;&lt;/code&gt; . Hence &lt;code&gt;LHS != RHS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;code&gt;var b interface{} = a&lt;/code&gt; does not change the declaration type of &lt;code&gt;b&lt;/code&gt; variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This issue occurs frequently in industrial code like below code snippet is very common in Go where we can face such error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var resp string
var err error
resp, err = CallFunction()
if err != nil{
   // code inside this if statement will be executed if return type  of CallFunction doesn't match with error
}
func CallFunction() custom.Error{
 // return pointer variable
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the playground for more experimentation &lt;a href="https://play.golang.org/p/BnPPXEs9_Oq"&gt;https://play.golang.org/p/BnPPXEs9_Oq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it's always better to check that the return type of called function and type of receiving variables in the caller function should match.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
