Exploring the fundamentals of blockchain technologies and concepts.
Blockchain is a distributed and immutable ledger that allows you to track anything, including tangible or intangible goods. This enables users or organizations to digitally and securely record entries that are, in turn, endorsed and secured by a community of users.
In my latest lightboarding video, I’m excited to get into the fundamentals of blockchain technology, and I’m going to cover everything from smart contracts to permissioned and permissionless blockchains.
I hope you enjoy the video, and make sure to subscribe to the IBM Cloud YouTube channel to see more videos like this one.
Learn more about blockchain
- Rewire your industry with IBM Blockchain
- IBM Blockchain Platform
- Public versus private: What to know before getting started with blockchain
The fundamentals of blockchain
Hi everyone, my name is Sai Vennam, and I’m with the IBM Cloud team.
Today, let’s talk about blockchain. I’m excited to talk about this because I feel like there’s a lot of misconceptions out there about the technology, and, in addition, there’s a lot of concepts that can be difficult to grasp.
In this video, I want to dive into the fundamentals of blockchain.
What is blockchain?
We’ll start with the definition. Blockchain is a distributed and immutable ledger allowing me to track almost anything—tangible or intangible goods.
Most of us are probably familiar with cryptocurrencies where blockchain is used to track transactions.
Understanding how blockchains are distributed
So, to better understand how blockchains are distributed let’s start with an analogy.
Let’s say I am with a group of friends and I lend my friend Pat $10.
Now, the friends see the transaction go down, and they know that I have the correct amount of money. In addition, they’ve essentially endorsed the transaction, and they made a record of it.
Now, next week when Pat comes back to me to ask how much money had initially lent her, we could easily go to any one of my friends that have a record of that transaction.
Blockchains are distributed in nature
Now blockchains are distributed, as all of the nodes that are running in that blockchain network have a record of every transaction that has ever taken place.
That kind of lends itself to the distributed nature of blockchain. So, although ledger technology that has been around for some time, and even simple ledgers, blockchain takes advantage of it by having a single source of truth and has a distributed nature where everyone has the same copy of that blockchain.
Blockchains are immutable
Next, let’s introduce the fact the blockchain is immutable. To do so, let’s dive into the pieces that make up a blockchain.
So, in a block, we have three major pieces. First, we’re going to have the transactions. So, these are going to be all the transactions that occurred when that block was created.
In addition, there’s going to be a hash. A hash is, essentially, a digital fingerprint. So, it represents the transactions that are in the block and is completely unique. If any of the transactions were to be changed the hash would also change.
So, let’s pick a couple letters for the hash—”3c”—generally, it’s an alphanumeric sequence and is usually a lot longer, more secure.
The previous hash
It’s also going to have the hash of the previous block in the chain. So, let’s say we’re, you know, right in the middle of the blockchain here, and we’ll pick something for the previous hash—maybe “2a”—and so now, let’s move on to the next block.
The next block is going to have its own set of transactions, as well as the previous hash, which corresponds to this one right here, as well as its own hash. And so on, and so forth—we can kind of extrapolate on all of the hashes and previous hashes.
Blockchains are tamper-resistant
So, you can imagine that if you were to want to tamper with any of the transactions that occurred or change it—for example, to change one of the transactions—this one hash would change, and because of that, the previous hash of the next block in the chain would now be incorrect.
So, to fix that you would have to tamper with every single block in the chain and that would immediately become apparent. So, in this sense, blockchains are immutable and very tamper-resistant.
Now, the next thing I want to talk about is the idea of a permissioned versus a permissionless blockchain.
So, we’ll start with the permissionless Blockchain.
Now, when most of us think of blockchains, we’re probably thinking of cryptocurrencies, which are public and permissionless. Now, that means anyone can see all the transactions that have ever taken place. Identities are not exactly revealed, it’s only the addresses that people have, but regardless, all the transactions are public, and, in addition, anyone can register themselves to be one of the nodes in the network. Essentially, having a copy of the blockchain, and anytime it gets updated and new transactions are made, they would get a new block.
The consensus algorithm
So, you have to imagine, it’s quite a problem for all of these nodes to have a copy of that blockchain. When new transactions come in, how do they reach a consensus on which transactions will make up the next block? That’s done so using a consensus algorithm.
Let’s break down how this works for a permissionless, public blockchain.
So, a client will first submit a transaction. That transaction will join a list of other transactions that have been made on the network.
And then the next thing that will happen is the node is going to start picking up those transactions, and it’ll validate by looking through all of the transactions that have happened in the blockchain so far—that those are also valid.
It’ll kind of emulate a block and then start something called a proof-of-work algorithm. Now, this is the consensus algorithm that public, permissionless blockchains use, and, essentially, this is how they’re able to reach a consensus on which block should be next.
Essentially, it’s going to be a very complex algorithm—cryptographic hash puzzle—that all the nodes are working together to solve.
As soon as one of the nodes solves it, they have essentially unlocked the position of the next block. And what they’ll do is they’ll broadcast that position of the next block to all of the other nodes in the network as well as adding it into their own blockchain.
So, a proof-of-work algorithm is actually quite consuming on the processing and electricity on a global scale. So, although it’s kind of required for supporting public, permissionless blockchains, where anyone can be a node and anyone can submit transactions or submit their hardware to kind of enable the adding of new blocks, you don’t want to take advantage of those kind of algorithms when you’re working with blockchain for business.
This would be something like a permissioned blockchain.
Pluggable consensus algorithms
So, in a permissioned blockchain, this would be something like hyperledger fabric. You have the idea of pluggable consensus algorithms; now, you don’t want to do something like proof-of-work because solving those complex algorithms just to find the next block is not necessary when the nodes within a blockchain network are trusted. So, that’s one of the first concepts here—so pluggable consensus.
Now the nodes in a permissioned blockchain are trusted, so they generally know each other. In addition, they don’t always just represent users but entire organizations. So, in this case, it’s actually very important that our privacy is one of the main tenets of a permissioned blockchain.
Let’s take an example. Let’s say that there’s a retailer that purchases 100 pounds of produce at $1,000. So, we’ll say it’s a Buy order for a 100lbs at $1,000.
Now, the manufacturer receives the order from the retailer, and says, “Okay let’s approve it, let’s make sure we have enough in the warehouse, and let’s work with the shipping company.”
So, they go to the shipping company, and they say, “Okay, let’s ship this hundred pounds,” and it’s going to cost them $100 to actually make that shipment.
Privacy concerns—who needs to know what in the transactions?
Now, there’s some privacy concerns here. The manufacturer has to have all the information—that’s fine they need to know about the buy order that was placed as well as the shipment order that they’ve placed. But the retailer, although they need to know information about the buy order as well as the amount, as well as the price of it, they don’t necessarily need to know how much it costs to ship it—but they might want to know when it was shipped and how much it was for.
On the same hand for the shipper, they need to know that they’ve placed the shipment order, the amount and the cost of it, and they need to know maybe when the order was placed, but they don’t necessarily need to know how much the retailer spent.
Now, the same goes for perhaps more retailers that the manufacturer might be working with. Now, if the manufacturer is offering a different price for the product for one retailer rather than the other one, it doesn’t make sense for the retailers to know about the competing prices. So, in this case, although all of the organizations are part of the blockchain, only the retailers that are part of the transactions that took place should be able to see that information.
So, in this case, in blockchain for business, it is actually pretty important that privacy is part of the Blockchain—being able to control who can see particular transactional information.
Transaction efficiency and smart contracts
The last thing I want to touch on here is the fact that in permissioned blockchains, you can really make transactions more efficient.
I think one of the most successful applications of blockchain technology is something called smart contracts. Essentially this is code that’s running on the blockchain, and whenever certain conditions are met, they are automatically executed.
So, in this particular example, whenever that retailer made that purchase order to the manufacturer for this amount of goods, there’s probably a manufacturing agent that double-checks that the order has all the necessary information in it. They then probably go to the shipping agency to make sure they can cover the shipment and that the warehouse has the correct amount of goods. They’ll then make a shipment order.
Now, imagine if we could automate that whole process.
That’s what you can do with smart contracts—essentially, code that will make sure that all the necessary information is met, the warehouse has the correct amount of goods, and then it’ll automatically create the shipment record. If any one of those conditions is not met, it could automatically release a refund to the buyer. This greatly speeds up the process of the contract for everyone involved—the retailer, the shipper, as well as the manufacturer.
Thanks for joining me for this quick overview of Blockchain technology.
We really only scratched the surface, so if you want to see more videos like this be sure to subscribe.