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.
Episode 25 - Multi-Signature Wallets (MultiSigs)
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.
Episode 24 - Initial Coin Offering (ICO)
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.
Episode 23 - Tokens
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.
Episode 22 - Proof of Stake
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.
Episode 21 - Proof of Work
Blockchains are updated by adding new blocks at the end of the chain. In a permissionless and decentralized network, it is hard to find out who (which node) gets to add the next block. This is like selecting something from a collection of things.
One way of selecting one thing from a group of things is to get them to race against each other. Whoever wins gets selected. This is also how proof of work is used for selecting a miner node from the network of multiple nodes to produce the next block.
Proof of work is basically about producing some data that can be verified easily, but it is hard to produce. In the Bitcoin blockchain, this data is a hash with a predefined number of zeroes as its prefix. As hashing is a completely random process, the only way to produce such a prefixed hash is by trial and error.
All the miner nodes race against each other to find our such a prefixed hash by repeatedly hashing the block data (with different nonce each time). Whoever wins the race and produces a block hash that satisfies the conditions, gets to add the next block and take the rewards.
Because all the nodes constantly hash so much data, they use a lot of computing power too. All this compute power needs a lot of electricity as well. This is why the Bitcoin blockchain consumes so much energy.
Episode 20 - Double Spend
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.