Block Shots - Blockchain in 5 minutes!

Oct 05 2020

Block Shots is a podcast for blockchain beginners that provides a basic understanding of the most important blockchain concepts in five minutes. Learn blockchain, consensus, hashing, signing, governance, nodes, etc. and many more concepts while having that morning coffee, or while walking towards your car in the parking, or whenever you have those five minutes. Episodes are published weekly on Mondays.

Episode 25 - Multi-Signature Wallets (MultiSigs)
Sep 21 2020 4 mins  
Every transaction in a blockchain is signed by the sender. The signing of transactions is done using cryptographic signing algorithms, as described in episode 6 of the podcast. In some scenarios, to perform an operation on the blockchain, there is a need to have more than one signatures on a transaction. Think of bank accounts with joint holders. Similarly, blockchain wallets could also be owned jointly by a group of accounts. These wallets are called multi-signature wallets or multi-sigs. Multi-signature wallets are generally implemented using smart contracts. One of the smart-contract function acts as a gatekeeper for other functions and keeps track of the number of accounts needed to call a function. Once enough accounts have called this gatekeeper function, it then forwards the call to the intended function. This is how, in simple terms, multi-sigs work. Because they are implemented using custom logic on the blockchain, multi-signature wallets can have any combination of signatures configured to use. We can have a threshold, majority, super-majority, specific accounts, and many other kinds of signature configurations in multi-signature wallets as per the need of our application. Multi-sigs are useful in scenarios where a joint decision is needed to make a transfer or execute a function on a blockchain. For example, the transfer of funds from an organizational account where all or some of the board members must sign the transaction individually. Music:

Episode 24 - Initial Coin Offering (ICO)
Sep 14 2020 4 mins  
Generally, to start a technology business, there’s some initial funding required to build the product. Generally, this is done using conventional ways like VC funding or bank loans. The VCs give money and they take some ownership in the company. There is another way of funding, called crowdfunding. Instead of asking a few VCs and/or banks to give you money, you ask a large number of people to fund your startup and in return, you either give them stake or a right to use your application. One way of doing crowdfunding is by doing an Initial Coin Offering, better called ICO. In blockchain applications, the developers create tokens so that their users can spend them to use the application. Selling these tokens is a way for the developers to get paid for their work. In an ICO, these tokens are offered in advance, as a future right to use the application when it is ready to use. To do an ICO, the founder of a blockchain startup generally writes a white paper to detail their idea and its implementation. If the users find the application useful, based on this whitepaper, they purchase tokens to use this application in the future. This purchase of tokens helps the founders to get initial funding to build the application. If the application becomes successful then the tokens have a lot of demand. The users who acquired these tokens in the ICO can then make profits by selling them at higher prices because of the demand. Music:

Episode 23 - Tokens
Sep 07 2020 4 mins  
Tokens are digital assets representing a user’s right to use a system/service/application or to participate in a process based on blockchain. Tokens are similar to cryptocurrencies in terms of issuance and distribution, but they are different in terms of value. A cryptocurrency can be used as a medium of exchange, while a token has value only utility or security value. Tokens are mainly of two types — utility tokens and security tokens. Utility tokens are used to represent a user’s right to use a decentralized application. In general, to make sure that the DApp developers are paid for their work, utility tokens are used as a paywall for using DApps. The users have to purchase tokens for an app in order to use it. The value of utility tokens is based on the actual utility and popularity of the underlying DApp. Security tokens don’t have a utility associated with them, but they are seen more as an investment into a project to make profits. When the market value (users, usage, popularity) of a project or a company increases, the value of securities also increases and the investors can make a profit. Tokens are created and issued using smart contracts. In token smart contracts, there are specific functions that mint and issue tokens to users. Users can buy the tokens by calling these functions, and by making payments in native cryptocurrency of the blockchain on which the smart contracts are deployed. Music:

Episode 22 - Proof of Stake
Aug 31 2020 4 mins  
Proof of Stake is a blockchain consensus algorithm where the nodes put an economic value on stake to participate in block production. The problem domain is the same — to find out who should produce the next block for the blockchain. In PoS networks, the block producing nodes are called validator nodes. The reason being — the consensus on blocks is reached via validation and voting and not through winning a race (as in the proof of work networks). In PoS, the solution is two-fold. First of all, a pool of validators is created. Any node that wishes to become a validator, puts some economic stake in the network. This stake is in the native cryptocurrency of the network and generally has a minimum value threshold. All or a selected subset of nodes who put their stake in the network become part of this pool of validators. To produce the next block in the chain, one of these validators in the pool is chosen using a round-robin or a pseudo-random algorithm. This selected node then proposes a new block. The other validators validate and vote on this block. If the majority of validators vote in favor of this block, then this block is accepted by the chain. In case the proposed block is bad or it doesn’t follow the rules of the chain, then the block producing validator is punished by the network and their stake is taken away (slashed). Proof of stake has an advantage over proof of work that it does not waste all that energy in mining. Music:

Episode 20 - Double Spend
Aug 17 2020 4 mins  
In the case of fiat currency, when you spend it, you physically hand over the currency note to the other party. Also, in case of a bank transfer of fiat currency, the update of balances in sender and receiver accounts is done by a centralized server having full control of the transaction and the accounts. In both scenarios, in fiat currency, it is made sure that what is spent is actually spent. But in the case of a decentralized system with digital currency, there could be scenarios that the already spent currency could be spent again. This is called the problem of double spends. Before we go further into double spends, it would be good to get a refresher on transactions, blocks, finality, and consensus. Let’s take an example — if you have a balance of 10 coins on a blockchain. Now you send these 10 coins to a user in a transaction. Then you send the same 10 coins to another user in another transaction. You send both these transactions to two different nodes in the blockchain network. What you have tried to do here is a double spend because you tried to spend the same coins twice. In a normal situation, one of these transactions will be marked invalid as soon as another one is already included in a block. However, in a rare situation, a network delay could cause a temporary fork on the chain and both of these transactions could be included in different blocks at the same height. In such a scenario, the blockchain could take some time to recover from the fork. Once the canon chain is decided using the consensus and finality rules, one of the blocks would be considered final while the other one invalid. In the interim, both transactions would be considered valid by different nodes and that could cause confusion between the receivers. When transacting on a blockchain, you must wait for the block, having your transaction, to be finalized before you buy/sell any goods/services based on that transaction. Music:

Episode 19 - Transaction Fee
Aug 10 2020 4 mins  
In a blockchain, the transaction fee is the fee paid to blockchain nodes to include the transaction in a block. Generally, the transaction fee is paid in the native cryptocurrency of the blockchain. For example, in the Bitcoin blockchain, the fee is paid in satoshis which is a smaller denomination of bitcoin. Nodes — software and hardware. Each transaction execution and verification is consuming CPU and memory on the node. The cost to keep the node running with the optimal hardware needs to be recovered from somewhere. Hence transaction fee. To get their transactions included in a block, the user “offers” an amount of transaction fee that he can pay for that transaction. The node then decides whether they accept that fee and include the transaction or not. This approach keeps the market open and the transaction fee is decided on the average fee being offered by the users. Some users offer high fees to get their transactions included quickly, others offer a nominal fee (close to the market average) and wait for a node to accept and pick up that transaction. In blockchains where the size and complexity are not the same for all transactions, the transaction fee depends on the byte size of the transaction and it’s execution complexity. For example, in the Ethereum blockchain, the transactions can also be smart contract calls. Smart contract functions could be of different sizes and complexity. Hence, when a smart contract function is called, the transaction fee depends on the execution complexity of that function. In such cases, the user offers an upper limit for the transaction fee. When executing the transaction, whatever fee is used is taken by the node and the remaining is returned to the user. All of this is done using the algorithms implemented as part of the protocol. Music:

Episode 18 - Blockchain Economics: Part 2 (Rewards)
Aug 03 2020 4 mins  
The blockchain grows when new blocks are added. The creation of new blocks requires validation of transactions and including them in blocks by the blockchain nodes. Block rewards are a way to incentivize the nodes for creating new blocks and contributing to the decentralization and security of the blockchain. Another reason for block rewards is the need to have the cryptocurrency in circulation. For any financial system to work, there must be enough currency in circulation so that the goods and services could be easily priced and bought/sold. The balance of supply and demand for currency is essential. Block rewards are a mechanism to pump newly minted currency in the system. For example, in Bitcoin, for every newly added block, some new bitcoins are minted and given to the miner of that block. This way, while the nodes are incentivized for adding blocks, new currency also comes in circulation. The block rewards are not constant forever. Their value depends on the amount of currency currently in circulation, and the amount that needs to be in circulation (demand). Based on the supply and demand of the currency, the block rewards can change. Over a period of time, the block rewards are reduced and tend to go towards zero. When the block rewards reach zero, the transaction fee becomes on the only incentive for the nodes. Hence the value of the transaction fees is also impacted by the value of block rewards. Transaction fees will be detailed in the next episode. Music:

Episode 15 - Block Finality
Jul 13 2020 4 mins  
When a centralized system stores all the data, it is pretty straight forward to find out the “final” state of data at a particular point in time. Whatever the centralized system has committed to the storage is deemed final. However, when it comes to decentralized systems, it is not that straight forward to determine the final state of data. In a blockchain, transactions are proposed by calling functions on one of the nodes. They are then broadcasted among other nodes and included in a forthcoming block when one of these nodes chooses to do so. Once included in a block, the transactions, along with the whole block, are verified and committed to the state of the blockchain by all the nodes. This entire process from the proposal of a block to getting it committed to the blockchain takes some time. Also, blockchain nodes are generally not located at the same place, there communicate with each other via the internet. This also causes network delays in the sharing and replication of data among all the nodes in the network. Because of these two reasons —time taken by the block production process and network delays — not all the nodes have exactly the same state all the time. For example, when the block with number 5 is proposed by one of the nodes, some other nodes might be having blocks 2 or 3or 4 as their final state. Block 5 might reach all the nodes after some time (a few seconds or even minutes if they have slower bandwidth). There could also be scenarios of temporary forks when a subset of nodes starts building the chain on a different block and when these sub-chains merge some of the intermediate blocks become irrelevant/invalid. This is why the concept of block finality becomes important. The finality of a block means that the majority of the nodes in a blockchain network have verified and accepted that block and their state has been updated accordingly. Finality assures that the transactions included in a block will not become invalid because of any reason. Finality could be of following three types: * Probabilistic Finality: When a convention is followed about finality. For example, in the Bitcoin blockchain, a block is considered final when 6 more blocks have been added to the chain on top of it. * Deterministic Finality: When an algorithm is used to determine the finality of blocks. This is a novel approach that some blockchains use to get faster and more reliable finality. * Instant Finality: There are some consensus algorithms that work in such a way that any block produced is considered final. Finality is achieved as soon as the block is produced. Music:

Episode 14 - Fork
Jul 06 2020 4 mins  
Blockchains are decentralized systems. It means there is no single point of control or failure. This also means multiple parties store the data and continuously trying to reach an agreement (consensus) on the state of the blockchain. For multiple parties to reach consensus, they must follow some rules. Rules regarding how to decide who would produce blocks and when, the interval between blocks, how big or small the blocks could be, and so on. These rules are together part of the consensus algorithm of the chain. These rules are updated from time to time to introduce functional optimizations to the blockchains. At this time, when an update is supposed to happen, it is up to the parties to begin following the new rules by updating their nodes (software) or not. When some of the nodes decide not to update to the new rules, then a fork happens on the chain. Forks are of two types — soft and hard. A Soft Fork happens when the new rules are compatible with old ones. Even if some of the nodes chose not to update, they could still be part of the chain and participate in the consensus process as per the old rules. A Hard Fork happens when the new rules are not compatible with the old ones. When some nodes don’t update in this case, they don’t participate in the consensus process on the updated chain. In such cases, depending on how the communities decide (old rules vs. new rules), there could be two different blockchains each following old and new rules separately.

Episode 13 - Blockchain Governance
Jul 02 2020 4 mins  
Blockchains are decentralized systems. There is no single point of control or administration. In contrast to other IT systems, there is no admin in a blockchain. Instead, blockchains are governed. To make any update to the rules of a blockchain, every participant must agree directly or indirectly. Blockchain governance comprises the processes to coordinate this agreement. In general, there are three main stakeholders of a blockchain: * Developers who implement the blockchain protocol rules. * Node hosts who run the blockchain nodes to provide decentralization to the network. * End users who use the blockchain to process their transactions. Also, there are a few things that need agreement on how the blockchain would work: * The consensus mechanism and associated rules. * The economic incentives for node hosts. * The transaction fee for users. All these things must be agreed upon by all three stakeholders in one way or the other, and then coded in the blockchain node software as the core rules. When there is a need to update any of these rules, blockchain governance processes are used to get the opinion of stakeholders and enact the new rules accordingly. In different blockchains, different governance processes could be followed. For example, the initial proposals for a change are generally written as an RFC on which the community comments and votes. Once there’s enough discussion and refinement on a proposal, it is then coded in the node software. The node hosts then update to this new version of the node software, and the blockchain as a whole is updated. In some cases, some of the node hosts decide not to update the node software because of their disagreement on the new rules, and in such scenarios, a fork happens on the chain. Music:

Episode 12 - Public and Private Chains
Jun 29 2020 4 mins  
Blockchains, depending on who can read the state and who can participate in block production (updating the state), could be classified in mainly two ways: * Private or Public state * Permissionless or Permissioned block production In a permissionless blockchain, anyone can participate in the block production process, while in a permissioned blockchain, only selected nodes can produce blocks. In a public blockchain, anyone can read the state (data), while in a private blockchain, only the intended users or nodes can read the data. For example, the Bitcoin blockchain is a public permissionless blockchain. Anyone can read the balance of any account and any node can mine blocks. There is absolutely no restriction. On the other hand, there are blockchains where only interested parties host nodes in a closed network and are allowed to read the state of the chain. These blockchains are private permissioned blockchains. They are popular among large enterprise use-cases. For example, a supply chain blockchain in which multiple parties like manufacturer, warehouse, retailer, etc. exchange information with each other on the state and value of goods. There are also scenarios where public permissioned blockchains are deployed. These are popular in governments and NGOs, where the block production is done by selected nodes belonging to government agencies or departments, while the blockchain data could be read by all the citizens and third-party applications. In some cases, there are hybrid blockchain setups where one network is public while the other is private and they interact with each other to process transactions based on their state and user inputs. Public and permissionless blockchains provide the maximum amount of security and decentralization as they have a relatively larger number of nodes and it is almost impossible to hack or control a sufficiently decentralized network. Music:

Episode 11 - Decentralized Apps (DApps)
Jun 25 2020 4 mins  
Blockchains, just by themselves, are a collection of nodes sharing data and agreeing on its state. To make blockchains useful for the end-users, applications are built on top of them. Simply put, applications which use a decentralized backend (like a blockchain), are called Decentralized Applications or DApps. Any user-facing software application mainly has two primary components — Frontend and Backend. The frontend is what the user interacts with while the backend provides the data and processing logic. Similarly, DApps also have these two components, but their backend is a blockchain network instead of a server (or set of servers). DApps usually provide better ways of communicating with blockchains by adding an abstraction layer on top. One of the best practices with DApps design is that the end-user should get the same user experience as they would get with any other conventional application, while also enjoying the security and decentralization provided by blockchains. DApps are built in such a way that the frontend could connect to any node in the blockchain network. The business logic for DApps is generally written in smart contracts. In most scenarios, to enable scalability, only the critical business logic is put on the chain in smart contracts while the rest of it stays in conventional systems and services. Sometimes a DApp may have multiple decentralized backends for optimizations and better decentralization. For example, the business logic is written in smart contracts on a blockchain while the data is stored in decentralized storage systems like IPFS. The DApp frontend then connects to these systems to provide a unified interface to the user. A simple example of a DApp is software wallet applications that allow the user to query and transfer balance on a blockchain while interacting with a familiar user-interface. Music:

Episode 10 - Smart Contracts
Jun 22 2020 4 mins  
Blockchains are decentralized. Each node in a blockchain network validates and processes all the transactions and stores the copy of the data. Transactions are used to propose updates to the state of the blockchain. Transactions are initiated using function calls on the blockchain node. For example, in the Bitcoin blockchain, the node software exposes a function called ‘transfer’ which the users can call to transfer bitcoin from one account to another. This function call basically becomes a transfer transaction initiated by the user. Internally, the function, when executed, validates the user’s signature, checks their balance, and does the balance updates to transfer the indicated amount. When the transaction representing this function call is included in a block, all other nodes of the blockchain execute this function individually. This process is followed for each and every transaction. In essence, transactions are function calls and these functions execute business logic. Smart Contracts allow users to extend the business logic of blockchains. Just the transfer of bitcoin and ether might only help with a subset of financial use cases and cryptocurrencies. For blockchains to be useful in more scenarios, they should be able to execute any kind of business logic and not just transfer of cryptocurrency. This is exactly what smart contracts provide — execution of any kind of business logic on the chain. In simple terms, a Smart Contract is a collection of functions written in code — just like any other software. They are then deployed on the blockchain by using special transactions that take compiled code of the smart contract as input. Once deployed, users could call smart contract functions just like they would initiate any other transaction on the chain. For example, a supply-chain smart contract could have a function for recording the location and/or temperature of a shipping container. It could have logic that when the reported temperature goes below a certain value or when the location is within a geo-fence, some amount of cryptocurrency should be transferred from one account to another on the blockchain. This would then allow two parties to track a shipping container and settle payments based on its location and temperature, in the most trustless way possible. Hence making blockchains more useful than just balance transfers. Music:

Episode 9 - Wallets
Jun 18 2020 4 mins  
The term “Wallet” could have several meanings or interpretations in the context of blockchain. At the very basic level, a wallet is just your key-pair that can hold a token or cryptocurrency balance on a blockchain. In the previous episode, I explained Accounts and Keys. So, a wallet is basically an account and it’s associated keys that may or may not have a balance on a blockchain. In contrast to the physical wallet in which we keep currency notes, a digital or blockchain wallet does not hold digital currency. Instead, the wallet holds the cryptographic keys so that they could be used is a simpler way. So, another and more widely accepted definition of a blockchain wallet is a software program or a hardware device that could be used to store cryptographic keys associated with one or more blockchain accounts. Software Wallet A software wallet is a program or an application that generates and stores cryptographic keys for signing blockchain transactions. In addition, some wallets also allow the signing of transactions. These software wallet applications typically have three main functions that users could use. These functions are: Generate new account + keys using a password or a random seed. Sign transactions using the generated keys. Query and show the balance of an account from a blockchain network. Hardware Wallet A hardware wallet is a hardware device that does the function of a blockchain wallet. Hardware wallets are more secure than software wallets as they have the keys safely stored on the secured memory area of a purpose-built chip. Using hardware wallets, keys are safe as they can’t be accessed directly as plain text and transactions are signed inside the device itself. Hardware wallets generally connect with a computer using USB and have associated apps that connect to a blockchain network for balances and sending transactions. Music:

Episode 8 - Accounts and Keys
Jun 15 2020 4 mins  
Accounts are a way of representing users on the blockchain. Just like we have accounts in banks, generally represented by account numbers or IBANs, we have accounts in blockchains too. In a blockchain, accounts are generally a representation of a user’s cryptographic public key. Recall from the Transactions and Signing episodes of the podcast — transactions are signed by the users. Signing in a blockchain is done using public-key cryptography. Public-key Cryptography In public-key cryptography, a user has two keys — one public and the other secret. For simplicity, let’s say that these keys are mathematically obtained random strings that are associated with each other based on logic. This logic could be different for different cryptographic algorithms. Some of them are based on prime numbers and some are based on points on a function curve. Cryptographic Signing Using these keys, the user can associate their identity with their transactions by signing them. The public key is shared on the blockchain as part of the transaction. The transaction data is signed using the private key of the user and the resulting signature could be verified using the public key of the same user. Accounts The account of a user is represented by either hashing or encoding their public-key in one way or the other. Different blockchains represent accounts differently, using various hash functions. Accounts are used to hold balances of tokens or cryptocurrencies, on a blockchain. Users could then spend these balances by signing the transactions using the associated private key of the account. Spending a balance means sending it to some other user’s account, using transactions. This way, any kind of user — buyer, seller, etc. could have their accounts and could send tokens to each other. If you do not have an account and the associated keys, you can’t send transactions to a blockchain and hence can’t propose an update to the state of the blockchain. Music:

Episode 7 - Block Production and Mining
Jun 11 2020 4 mins  
Block Production is the process of proposing and appending new blocks to the blockchain so that the state of the chain could be updated. The state update happens when the transactions included in the blocks are executed on the chain by all the nodes. When there are several nodes part of the network, it is important for them to agree on some basic ground rules about how the state of the chain would be updated and how and when the blocks would be produced. In a blockchain, the block proposal, validation, and execution are done based on the rules part of the consensus algorithm being followed by the chain. In general, blocks are produced by nodes at fixed time intervals — slots. For each block to be produced, one of the nodes is chosen based on the block production and consensus algorithm. Also, not all the nodes in a blockchain produce blocks but only the nodes participating in the process of block production. For example, in the Bitcoin blockchain, the nodes race to solve a puzzle and the first one solving it gets to produce the block at the next slot. This process is repeated for each block. The puzzle is about finding a “hash” with a specific prefix and this requires a lot of trial and error using a lot of calculations. Arriving at a hash with the right prefix proves that the node has done the required amount of work to solve the puzzle, and hence the algorithm is called “Proof of Work”. The process of solving the puzzle and producing a block using the Proof of Work algorithm is called mining a block. The term “mining” is relevant mainly for chains following the proof of work consensus algorithm. In different blockchain networks, different types of consensus algorithms are followed to define rules for block production. Another way of finding out which nodes produces the next block is by simply following a round-robin approach. This is generally followed in a blockchain network with a relatively smaller number of nodes. Music:

Episode 6 - Signing
Jun 08 2020 5 mins  
Signing is the process of associating your identity with information so that it could be verified that the information is coming from you. In the physical world, we sign documents by putting our initials or signature in ink at the end of the text. When we have to fill a form or submit a document in a public office, this is generally the process for signing. Cryptographic Signing In the digital world, we sign the data cryptographically. The process of cryptographic signing involves hashing the data and then encrypting that hash with the user’s own private key. The ciphertext of the hash is the signature of the data and it is appended to the data (just like we sign the physical documents at the end). The signature could be then verified by the receiving party by decrypting the signature using the sender’s public key. The receiver would then hash the data at their end. These two hash values — decrypted signature and hash of the data — must match for the signature to be valid. Signing in Blockchain In the context of blockchains, signing is used for verification of transactions and blocks. The users sending transactions must sign them before submitting them to the nodes; also the miners or validators must sign the blocks before proposing them to the chain. The authenticity of the data in a blockchain is verified using cryptographic signing. Signing is not Encryption There is a small misconception that all data on a blockchain is encrypted. This is not correct. All the data on a blockchain is signed and signing is not encryption. Signing is used for associating identity with the data while encryption is used for hiding the data. Both have clearly different use-cases. Music:

Episode 5 - Hashing
Jun 04 2020 4 mins  
Hashing is the process of deriving fixed-length strings from arbitrary-length data. It is generally used to represent data in a more compact and consistent format. For example, a small string like the name of a person and a large file like their resume could both be represented by two different strings of the same length by hashing them (individually) using the same hash function. Hash Functions Hashing is done using programs called hash functions. There are several hash functions based on different algorithms. The main characteristics of good hash functions are: Deterministic — It should generate the same hash from a particular input on any system or hardware. Irreversible — The hashing process could not be reversed to get the input back. Fixed-length output — The outputs from a hash function are of the same length irrespective of the length of the input. Collision-free — The same hash must not be produced for two different inputs. Hashing in Blockchain In the context of blockchains, hashing is used in several places. Some of these are: The cryptographic signing of transactions and blocks. Hashing is generally part of all signing algorithms. All transactions in a blockchain are signed by users and all blocks are signed by their respective miner or producer nodes. Representation of transactions and blocks using their hashes. In a blockchain, the transactions and blocks are generally represented using their hashes. Merkle trees used for storage — all non-leaf nodes are hashes of their children. The storage root hash changes even if there is a slight change or update in any of the data stored in the blockchain. Music:

Episode 4 - Transactions and Blocks
Jun 01 2020 5 mins  
Transactions are small bundles of information that are used to propose updates to the state of the blockchain. Users sign and submit transactions to one or more nodes, and based on their validity, they are executed by all other nodes to update the state of the blockchain. Incoming transactions are validated by the nodes against the current state of the blockchain and also for the signature of the sender. For transactions to be executed on the chain, the miner or validator nodes charge a transaction fee from the user. The sender must decide how much fee they want to pay for the transaction, and based on that, the miner or validator nodes decide if the transaction should be executed or not. Blocks If blockchains processed transactions one by one, it would be pretty inefficient to process a large number of transactions, on a fairly decentralized network. Hence, transactions are grouped into blocks. Blocks are then processed one-at-a-time to execute all included transactions together. To be included in a block, the transactions are selected by miner or validator nodes of the blockchain. There could be one or more transactions in a block. This selection is mainly based on transaction fees paid by the user, the validity of the signature, and of the transaction data. Transaction Execution Once a transaction is submitted to one of the nodes, it is then broadcasted to other nodes. One of these nodes, depending on the block production algorithm, proposes a block that may include this transaction and several others. Blocks are created at regular intervals and all the transactions in a block are executed together to update the state of the blockchain when it is accepted by all the nodes. The proposal and acceptance of a new block are done using the consensus algorithm. Consensus and related concepts are explained in episode 2 of the podcast. Music:

Episode 3 - Blockchain Node & Network
May 28 2020 5 mins  
A blockchain has several core functions like storage, networking, consensus, etc. All these are coded and packaged together in the blockchain node software. This software is then distributed to the users willing to participate in the blockchain validation or mining process. Each such user runs this software on their physical or virtual machines. Blockchain node software running on a physical or virtual machine and accepting connections is a blockchain node. So, it is not just the software, it is a node when is it running and accepting transactions and connections from users and other nodes. The process of running the blockchain software with the needed configuration parameters is called running or hosting a node. In general, each node stores all the state of the blockchain. Network When several nodes connect with each other and exchange information like blocks and transactions, we get a blockchain network. So, in essence, a network is a collection of interconnected nodes. Types of Blockchain Nodes Miner and Validator nodes that participate in the block production process. Archive nodes that keep all the historical state of the blockchain for storage and analysis purposes. Non-Validator Full Nodes — Help with broadcasting tractions and store the state of the blockchain. Light Nodes or light clients — Store only block headers to allow for easy verification of the state. They require fewer resources so they could run on mobile devices. Chain Specification (Node Configuration) To run a blockchain node, we need to provide it some basic configuration parameters like — the network to connect to (chain), which type of node to run (full, light, miner, archive, etc.), and a few other things. This configuration is called chain specification, or in short chain-spec. Music:

Episode 2 - Consensus
May 25 2020 5 mins  
In general, consensus means agreement. In the context of blockchain, consensus is the agreement on the state of the blockchain among all the nodes in a network. The basic characteristic of blockchains is that there’s no single point of control and failure. This means users can query and verify the data from any of the nodes in a network. For this to work, the nodes must agree on the state of the blockchain so that users get the same results when querying multiple nodes for verification of data. Transactions are used to update state in a blockchain. For example, a transfer transaction can be used to update the balances of multiple users. Order of Transactions The main area where consensus is needed is the order of transactions, within a block. If all nodes could agree on the order in which the transactions happened, then they would individually arrive at the same state after processing the respective blocks. For example, if a user has a balance of 5 tokens and they transfer 4 tokens to one user and 3 tokens to another one. In total, they tried to spend more than they had. In this case, the order of these two transactions would decide which one would be accepted and which one would be rejected by the chain. One of these would be marked as an invalid transaction. If the order of transactions is not agreed upon by all the nodes, then the state of blockchain (balances for these users) would be inconsistent across the network. Consensus Algorithms To achieve consensus in blockchains, there are several algorithms. The basic idea is: Transactions are grouped and packaged together as blocks. Based on the consensus algorithm and its block production rules, one of the nodes proposes a block. This could be either using a round-robin fashion or by winning a race. For each newly proposed block, the order and validity of transactions are checked against the current state of the chain. When the new block is accepted by the chain, the order of transactions in this new block must be followed by all nodes, hence reaching a consensus on the state. Music:

Episode 1 - Blockchain
May 21 2020 4 mins  
Blockchain — A system that allows two or more mutually unknown parties to reach an agreement without middlemen. The agreement could be on the state of any kind of data: Fintech — accounts and balances (like in Bitcoin); Supply chain — the temperature of a shipping container at a point in time. Fintech Example — Buyer, seller, bank. The buyer wants to transfer money to the seller. Bank transaction. The bank is the middleman here. Single point of control and failure. If the bank is hacked, the outcome of the transaction could be manipulated. Blockchain solves this problem. There is no single point of control and failure in a blockchain. Data once written to blockchain could not be changed — immutability. Multiple nodes store and verify all the data. Even if some of the nodes are hacked or not working, they cannot change or control the state of data if a majority of nodes are working properly. How blockchains work? State changes are done using transactions. Transactions are signed by users to associate and record identity. Blocks are groups of transactions. Nodes produce blocks using various algorithms and if a block is accepted by all the nodes, then it is appended to the chain — hence blockchain. All transactions in the newly accepted block are executed to update the state of the blockchain. And the process continues. Blockchain Components Database layer: To store the data. Networking layer: To get the nodes connected with each other for exchange and broadcast of data. Consensus protocol: To reach an agreement on the state of data. Transaction queue: To accept, validate, and process transactions received from users. Business logic: Rules on how the transactions update the state of data. Music:

No review available yet...