Who's heard of blockchains? How am I doing? Okay? So in keeping with the spirit of having this class be a venue for new emerging technologies, there was a fabulous article in IEEE Spectrum about blockchains in cyber currency and I decided to include it because blockchains can be used for, as we'll see, more than just cyber currency. So if you can go sometime, you go to the library, they should probably have this copy, the October 2017 IEEE Spectrum and almost the whole entire thing is devoted to Bitcoin and blockchains and it's fabulous. I brought it in because we hired, a student that was in my class last year is working in security firmware at Micron and I said you need to read this. So I brought it in and I gave it to him so he's borrowing it from me for the time being. But it's a very good read, so if you get into it. In 2009, a hacker group or a group of hackers known as Satoshi Nakamoto unveiled the world's first digital currency. The technology works on the principle that, at its foundation, money is just an accounting tool and it took me a little while to get my head around that. It defines a method for abstracting value, and we know a $1 bill versus a $10 versus a 50. There's this notion of value associated with a bill or a coin. Assigning ownership - if it's in my pocket, I own it, if it's in your pocket, you own it. It provides a means for conducting transactions. So cash has been the historical means. Processing the physical tokens - the coins, the bills - equals ownership. It's up to individuals to negotiate transactions among themselves. We do it all the time. You walk into the store,want to buy something. It's eight dollars, we can give them a ten. We get two bucks in change back. We go do that ourselves. This works because as long as cash is sufficiently difficult to replicate, there is no need for a complete accounting of who owns what portion of the money supply, or for the details of all the various holders of, say, a single $10 bill going all the way back in time to when that bill was first printed. We don't have to have that accounting because whoever has it now has it and we don't really care about who had it before. If you could piece together a running tabulation of who held every bill from the time it was printed, then the physical representation would become unnecessary. Banks and payment processors like PayPal have partially sublimated physical currency into digital records within their closed systems. I have money in a 401K retirement account and I'm pretty certain that it's not a big stack of money sitting in a vault someplace. There's a database that says my account has this much value. It can be that value can then be converted into cash later, I can take it out as cash, but it's been sublimated away as digital records within a closed system. Bitcoin completed this transformation by creating a single, universally accessible digital ledger, called a blockchain. Everyone familiar with the term of a ledger? It's a list of something, a list of sequences, of transactions in this particular case. That's what a ledger is and it's called the blockchain. It's called a chain because the changes can only be made by adding new information to the end of the chain. There's some pictures coming up here. Each new addition (a block) contains a new set of transactions and these new transactions reference previous transactions in the chain. We've got a little cartoon picture here of this. So time is going from left to right. So these are blocks and each block contains a list of transactions. And this block contains a list of transactions and this would be a new block that gets added to the end of the chain. So this one in this block has a transaction where Vishvesh pays Helmut a Bitcoin. That transaction references a transaction in the previous block where Priyanka pays Vishvesh that Bitcoin. Then that transaction references back where Ted paid Priyanka that Bitcoin and back and back and back. Actually, I want to say one more thing about that. The reason this works is because it's computationally expensive to add a new block to the chain. If you want to try to mess with this and try to spend a coin twice or alter this, the farther back you go in time the amount of computation required to modify this to make the math work out with these interlocks that are in place from this block to the next block to the next block gets very computationally prohibitive the farther you go back in the blockchain. It's computationally expensive just to make this next block, let alone modify previous ones. So Bitcoin's blockchains, the ledger, is replicated on network computers around the globe. It's accessible to anyone with a computer and an Internet connection. There are this class of participants on the network called miners and they have responsibilities. They are responsible for detecting transactions, validating those transactions, and adding them to the blockchain as new blocks. Validation entails verifying that a person actually owns the Bitcoin in a transaction, verifying that those Bitcoins have not been spent anywhere else, and ownership on the Bitcoin blockchain is determined by a pair of public/private keys. So there again, we see the use of this asymmetric encryption, public/private keys. The public key resides in the block for anyone to see and the owner keeps the private key private. The owner would be the owner of the Bitcoin transactions. So for Helmut's transaction, the transaction is combined with the private key. Calculations are performed producing a very long number and anyone who has the original transaction and knows the public key can then do some calculations of their own to prove that the long number was in fact created with the private key. This long number has a requirement on it. So remember when we talked about hashing functions? Hashing function takes a message and produces a digest. It's a one-way function and it has a couple of properties, one of which when you have the digest, it's computationally very difficult to produce the original message. The second thing, the second property it has, is that a good cryptographic hash function, it's very difficult to find two different messages that hash to the exact same numerical tag at the output and that's what this is relying on. So there's this notion of irreversibility. So, these long numbers that get produced have to have a whole bunch of leading zeros. I didn't take the time to look how many bits or how many digits are in this long number, but it's a very long number and let's just say it's 2048 digits, for instance. It may have to have 1024 leading zeros. So the miners are doing these calculations constantly, adding nonces as we'll see, and then cranking the calculation and see if they meet the requirements for producing a legitimate hash, and it takes a lot of computation power to run through over and over to find a hash value that meets the rules. Then the first one to do that then can publish the block. Other miners validate the work, and then the miner is paid in Bitcoins for finding that long number. So again, the miners' role is to ensure the irreversibility of the new transactions making them final and tamper-proof. I copied this quote directly out of the article. They said, "The method used for doing so, this irreversibility is thought to be the most significant contribution that Satoshi Nakamoto ever made, whoever he, she, or they are, to the field of computer science." I thought that was a pretty profound statement. That jumped out at me, so I included it in here. So here's, Alice has got a stack of Bitcoins and got her cryptographic key. So Alice tells the network that she wants to pay Bob, so she uses a cryptographic key to digitally sign off on that transaction proving that she owns those coins or some number of coins are going to get transferred from Alice to Bob. Network operators called miners or block signers scoop up a bunch of transactions to validate them, and then they check the digital signatures are correct and that there are enough coins for the requested transaction. Then they put those transactions into a new data block to be added to the blockchain. So here's a block and a whole bunch of transactions within this block. What's going on here, you can't see it, but look at the slides, so this value is a hash value of the previous transaction. So that hash value is then used with the block of transactions as a run-through, and combined with a nonce, again, they showed it as a dice. Number used once, so we'll know what nonces are. As combined with the nonce, runs through a cryptographic hash function to produce a hash on this new block, then that hash is used again to do that same process, and so, this hash value is the output of this processing, is used as the input to the next one. So, the hash that comes out of that block process is then used as the input to the next one, and that's why it forms this chain. Like I said, it's computationally expensive to produce the appropriate hash value here. It gets really bad, the further you go back to where it becomes really impractical to try and go back too far and modify these transactions for illicit purposes. Since a point in time when blockchains were created as a way to create this irreversible chain of transactions for cyber currencies, digital currencies, other engineers and other folks around the planet have been thinking about different ways to use blockchain. So, there's another one called Ethereum. Unlike Bitcoin, Ethereum uses many programs called smart contracts that can be written with unlimited complexity. Users then interact with the many programs by sending them transactions loaded with instructions which then the miners process. So what this means is that anyone that can embed a software program into a transaction will know that it will remain there unaltered and accessible for the lifespan of the blockchain. In theory, this is again quoting from the IEEE Spectrum article, applications like Facebook, Twitter, Uber, Spotify, and other digital service providers, or any other digital service for that matter, with new versions that would be invulnerable to sensors with high integrity, so developer could take their code and put it in a blockchain and as a consumer, they would know that it hasn't been modified, then when the next version of it came out, it would be tied to the previous blocks through this overlapping hashes and nonces. It's a cool idea, so people are actually looking at that. There's this notion of building a world computer. All the programs in the world are available on hundreds and hundreds of servers all around the world, and all you have to do is go access a particular version of it, and you know that you can run it with high competence, it doesn't have spyware or viruses built into it. This isn't directly related, I thought it was interesting, so I wanted to share it with you. Everyone's probably heard of an initial public offering, and so a company starts out, they're going to venture capital to manufacturer of product or to generating sales. Then to generate some additional cash for them, they go through an initial public offering where they offer stock, and stock purchasers buy that stock and then the company gets that money to use in their operations. There is another use called initial coin offering. The way to think about initial coin offering is that it's specific like tokens. When you go to the laundry man to do your laundry, you put in your money and your tokens would come out or maybe at the car wash tokens would come out, and then you go, you spend those tokens for a particular service. Companies were offering employees instead of stock options, these initial coin offerings that then one day would be able to be converted into real money. I thought it was interesting. If I remember correctly, the SEC, I'm remembering back to the same IEEE Spectrum article, I think the US Securities and Exchange Commission said that initial coin offerings were security and therefore regulated. So the initial coin offerings that were happening in the US has dropped off, but you may see this notion of initial coin offerings be legitimate in other countries because the securities laws vary from country to country. I just thought it was interesting. So downsides, I talked about the computing power, it takes a lot of runs, the miners create a nonce, and they run the hash algorithm, and the number that gets produced has to have so many leading zeros on the front of it and if it doesn't then it's not a legitimate hash, so then they try another nonce, and another nonce, and another nonce. The computing power can become very high. These issues with privacy laws, banking, I think I said that. Like the financial institutions and medical records, these privacy laws vary from country to country. With a blockchain, all that information about a transaction, the person is out there in the blockchain. Some countries' laws say that that information can't be out there, so these laws and these restrictions act as a retarding force for the deployment of blockchains. I didn't mark my source down here and should have been on the ball, and I think this was a picture in that same IEEE Spectrum article. Banana Coin, the world's first blockchain option for investing in the production of organic bananas. So there's a use for it.