okay hello hello everybody I’m Henry I’m the CTO co-founder at Cryptanite we’re gonna do

okay hello hello everybody I’m Henry I’m the CTO co-founder at Cryptanite we’re gonna do a talk today just a little bit about blockchain how it’s created how it works just so everyone can have an understanding I know that we have some some new faces now from three months ago when I was here so some of the talk is gonna be a little bit repetitive or redundant from the last talk that I did but we want to make sure we can bring everybody up to speed so we’re gonna go through kind of a high-level overview a little bit about myself I’ve been in the medical tech space for maybe 11 years now I’ve built several companies medical companies tech companies medical tech companies I’ve built some I’ve sold some this is probably my fifth or sixth company that I’m working on now and so pretty much throughout that time we worked on artificial intelligence we work on big data we work most recently with blockchain with crypto currencies and I’ve been doing talks for the last couple years basically across the United States this was a talk in Colorado this is also in Colorado for one of my other companies this is out in San Francisco I was helping to host an event where we judged startups to help with investments for accelerators this is another just you know just so you get an idea some different talks I’ve done I’ve also done some talks at universities I’m involved with University of California system for teaching blockchain I’ve also taught and been involved with Stanford so I work with the students there I help with some of the the courses on smart contracts so I also do some investment I’ve been through a Y Combinator for their investor startup school and we’re kind of taking some of that into the company so that we can invest into other blockchain companies too as we grow so we’ll just get started with blockchain so the first thing to know about blockchain are the the key components of it so we’re just going to start off very simply learning about what a hash is so a hashing algorithm is basically a function that allows you to put information in to an equation and always receive an arbitrary output the arbitrary output is always going to be exactly the same length so if you see right now we have zero data and the hash is this long string so whatever we put into here if we put hello it changes the hash and we get something that’s unique it doesn’t matter how long we put this in we can put in you know a book the entire Bible we can put all the data for an image a video gigabytes terabytes of data and we’re always going to get an output that’s going to be this long so this is the SHA-256 hash it’s basically the algorithm to produce this what’s important to to note about this is that the data that you put in will only uniquely produce this hash so nothing else that you put into the field can ever produce that same number the second point to note is that from the hash you can never go backwards so from whatever this number is you will never know what this data is but you can always know that this data is connected to here by putting this data into the hash so that’s the first thing to know so we hear a lot about the blockchain so before we get to the blockchain we have to have a block so this is basically the block and the block builds upon the idea of the hash by basically taking data putting it all together formatting it and then producing a hash output of that data so basically before we said we can put hello we can put text we can put anything that we want in it in this block we’re gonna say that we’re going to put a nonce which is going to be a random number and then we’re gonna put whatever data that we want so if we put this data in here we’re gonna come out with a hash this hash that’s generated it needs to be the hash that is from this input currently the hashes don’t match up in order for this hash to correlate with the data we’re going to have to do we’re going to have to change the data to make sure that it matches this in order to do this we don’t want to change the data so we use the nonce basically we’re going to start guessing numbers that then are added into this data to produce a hash and we want to guess the number that combined with this data will produce the valid hash so in order to do this this is what we call mining and basically what you’re doing is you’re just randomly inputting numbers a hash as fast as you can until you can make a match so that’s what’s happening here and then when you see it’s done now the nonce is 2-2-2-6-4 so that’s the number that when combined with the data produces the proper hash so this is how you construct a block in the Bitcoin blockchain this is the data that is inside the block so there’s a lot of stuff in general we don’t need to know about this it’s pretty technical for now and it’s since it’s a company talk just know this is the general data that’s stored in it this is kind of parsed out so you can see a little bit more this is the Bitcoin blockchain this is the first block that was produced on the blockchain so you can see here there’s also a nonce there’s only one transaction and there’s a block reward of 50 BTC of 50 Bitcoin so we’ll go into how how that comes about to so we talked about the hash the hash is basically a function that shows describes the data within a block so now what we do is we’re gonna take several blocks and we’re gonna put them together and we’re we’re essentially chaining the blocks together so we have a chain of blocks or a block chain so what we do is we’ll take data something like hello and we have to mine it to make sure that we can find the right nounce to produce the this hash output so now we have this number the interesting thing about the block chain is we have to connect the data into a chain so what we do here is we’ll take this hash and then we’ll put it into the new data for the next block so here we have the nonce that we had before we have the data that we input but we also put in the previous hash into here to produce our new hash so in this way this data is then connected to this data if this data changes at all this hash will then have to be changed and then this hash will not match into this so going forward the data is not going to be synced up we’re going to know that there’s there’s been corruption or there’s been a a modification to the data so let’s put Cryptanite here so now you can see what it’s done is it’s taken the nonce the data the previous hash and then we’ve generated this new hash so now we’re going to take this new hash and we’re going to put it here into the previous hash block we’re going to say you know and Halomoji so we do this we mine it and we basically again we’re just guessing the nonce the random number that’s going to make sure that we can get the proper hash okay so now we have we’re building a valid block chain where we take the data from the first block we take its output and we use it to form the data in the next block and then we take all of that data we hash it and we use that data into the next block so it happens over and over and over again if anyone tries to come back and change any of the data so say we come back and change Cryptanite to Crypta new something like this that’s going to affect the hash and then because of that all the other transactions ahead of it are going to become invalid because it’s not able to incorporate the proper hash into it so everything breaks so this is a way to validate all the data that you input into essentially a sequence it’s like a ledger of data so this is great but if we have one blockchain and one person putting all this data in we don’t know if they make any changes to it if they’re trying to alter it if they’re trying to change the data and then they just remine it because I could just come back through I change the data and then I remine it and then I go to the next one and I remine it again so eventually everything is going to look right so what we have to do is we have to do consensus we have to have multiple people agree that all this data is the right data so what we do is we move to what’s called a distributed blockchain so this is distributed consensus everybody we have pure A pure B pure C so in this instance we have three people or three computers verifying the data on the blockchain all of them will enter in the same information and all of them will go through and they’ll mine this is gonna take a little while to mine mining actually takes a lot of power so let’s just start here let’s just say this data in here everything is mined we have the hash rate if one person tries to change the blockchain what you do is you have to have the consensus two out of the three block chains agree that this data here is valid so in this case the majority is winning the consensus 51% or more of the network this is where you hear about 51% attack on the blockchain so this is a type of hack if if there’s multiple miners on a network so say there’s a hundred thousand miners if one person owns you know five hundred over five hundred thousand more than half of the miners they can just put in whatever transactions they want they can then remind the transactions and everyone on the network is going to agree because they have more than 51% of the network so they control the consensus so that’s a very I guess dangerous consequence of having a distributed consensus like this so we always want to make sure that as many people as possible are utilizing the blockchain and are running you know their own consensus so they’re running their own miners to validate the transactions we don’t want one central bank or one central person or one central company to have too much of the hash power otherwise they can do whatever they want okay so how does cryptocurrency play into this so blockchain and cryptocurrency there are two different things the blockchain enables cryptocurrency to be possible so let’s see how that happens so in the same way that we had the blocks before we have our nonce we have our data we have the cache then we have the hash because it’s the first transaction it’s always going to be it’s called the coinbase transaction the first one that occurs we have no hash so we just have an arbitrary set set hash here we’ve replaced data with transactions so this is the transaction twenty-five dollars goes from Darcy to two Bingle four dollars and twenty seven cents goes from Eliza to Jane so we’re just creating accounting we’re showing where the numbers where the money is who it goes to and then we store that data we mined it we make sure that it’s validated we continue to move on and we run this across you know a distributed system so we go across multiple peers that are all doubting validating the transaction if someone tries to change it then of course we can see that the majority is going to always win so we can see two out of three agree that these are the transactions so this would be the valid state of the block the block chain and these transactions would be rejected okay so now we’ve put money on the blockchain we’ve kind of shown how the money gets transferred through the data through a consensus mechanism through blocks that are then hashed to verify the data so the next step now is where did this money come from who has how do you know that Darcy has twenty five dollars how do you know that Eliza that has four dollars so what we have to do is we have to create a coinbase transaction so this is a special transaction it’s the first block on the network and within this transaction what we do in the coinbase is we define how much money there is to begin with for our blockchain so on this blockchain we have $100 that Anders has so going from here we can now have Anders donate or pay or whatever ten dollars to Sophia we can then know that Anders can pay twenty dollars to Lucas fifteen dollars to Emily fifteen dollars – Madison and then from here Emily has her ten dollars she can pay to Jackson and we can see does Emily have ten dollars we can just go back here and say yes she has fifteen dollars that was given to her by Anders in the previous block so in this way we can make sure that all the transactions on the network are valid we can make sure that only the amount of currency that’s available on the network is spent so it’s not that difficult it’s just accounting but by using the verification we can tell again if a bad actor tries to change the data then we can immediately know and what’s interesting about this is if we see that you know $400 the cent from Emily to Madison we don’t have to go we don’t have to go all the way back to the very first transaction we can tell basically immediately that something is wrong and that’s because we’re changing the hash that then goes into the next transactions so we only have to go so far back as the time and date of that transaction to verify it okay so from here we have the Genesis block that’s that’s essentially all the blockchain is and that’s essentially all how how cryptocurrency functions for Bitcoin here we can see the first block again we have the 50 BTC block reward so what is the block reward in order for people to verify these transactions why would you ever want to run your computer all day 24 hours a day to make sure that everyone is is doing the right thing to make sure that all the transactions are real you have to incentivize make sure you have to give people something so that they want to do it so what’s Satoshi Nakamoto did was he created an incentive ization structure with Bitcoin so for every block that you mine every time that you can figure out you know this nonce the code or the the number to validate the hash on the block you receive a block reward so he set the block reward at 50 bitcoins this is completely arbitrary when if we’re talking about bitcoin this coinbase transaction starts out with $100 USD for Bitcoin Satoshi Nakamoto the creator of Bitcoin created 21 million Bitcoin that’s the supply he created it he decided that’s how much she wanted and then that’s how much will be on the blockchain and in order to get a block reward on the blockchain you have to mine validate and find the nonce value for this data for the newest block in the blockchain it’s it started out at 50 every two hundred and ten thousand blocks better than mined we have the block reward so the minor that puts it in puts the block in by by validating the transaction they’ll receive 50 Bitcoin as a reward since it’s begun in 2009 it’s already had a halving so at this point it went from 50 Bitcoin 210 transactions occurred then you get 25 Bitcoin as reward 210 transactions occurred and then you get 12.5 Bitcoin per block that you can add to the blockchain by guessing the nonce and that’s where we’re at now if you mine a block you’ll get 12.5 Bitcoin for validating the transaction and putting it on the block okay this is the code for the having we don’t need to go over this so this is a Bitcoin block reward having count down so based on the current hash rate based on you know the number of blocks that are being mined we have 676 days before we go from 12.5 Bitcoin as your reward to 6.25 bitcoins so the reward is going to half by then there’s 21 million bitcoins 81 percent of all Bitcoin in the world has been mined there’s only three million 3.8 million Bitcoin left to obtain so what happens when all the Bitcoin is gone why would people still want to run their nodes to validate transactions on the blockchain so that takes into account another incentivization that’s a Satoshi Nakamoto added and that’s a fee structure so any time you want to send a transaction on the network from one wallet to another anytime Alice wants to send to Bob Bob wants to send to Cathy you have to pay a fee the fee is somewhat arbitrary you can put whatever you want so you can pay the lowest fee or you can pay a very very high fee and why would you do this the higher the fee that you pay the more likely that a miner will want to put your transaction data into a block and try to mine it as the next one as fast as possible because you’re paying the most obviously this is kind of an example so here we have multiple transactions we have multiple transaction data A, B, C, D we have people sending money back and forth for each time they want to send this transaction they have to submit it and broadcast it on the network so all the miners on the network will then see okay you know A – Alice wants to send money to Bob we need to verify this transaction they’re willing to pay as 10 10 whatever units 0.0 10 satoshis to verify this transaction this person Bob he has data he’s sending money he really wants to make sure his transaction goes through to verify it so he says you know what I’m gonna put I’m gonna pay 30 as my fee rate so that the miners are gonna try to mine mine first so that they can earn this all the transactions are gonna fit in one data block if we say that the data block can only go to here then that means we can only fit these three transactions in even though we can fit a little bit of this we have to fit the entire thing so what the miners do is they’re gonna start out by taking the highest one say this one is 40 and then they’re gonna take 30 and then what they’re gonna try to do is fit the highest fee rates into one block that they can mine that way they can maximize the payment that they’re gonna receive if you mind the block you receive all of the fees all of that becomes yours plus the block reward the 12.5 Bitcoin that you can currently get so in a situation like this what you would expect to end up seeing is something closer to this every miner is going to try to first mined the 40 payment block then they’ll try to mine the 30 and then they’ll try to mine the 20 but if the 20 doesn’t fit in the block size in the data that you can put into that block then you’d have to move something like the 10 into here and not mine the 20 so all of this is about optimizing how much you’re going to get paid and there’s no rules for it basically everyone tries to do this and fit it in but there’s no rules you can do whatever you want to to mine the block currently the maximum block size on Bitcoin is a one megabyte so you can store one megabyte of data on the block this was a question that I had earlier from one of our developers Gleb was asking about transactions and how the transactions are sent deep down within Bitcoin core the way that you would send a transaction if you’ve received 0.6 Bitcoin and 0.4 Bitcoin and you wanted to then send one Bitcoin to somebody what you would do is you would say I’m gonna send 0.9999 999 Bitcoin to that person that person will receive that but it will imply that the remaining 0.00001 Bitcoin is going to be your transaction fee so this is what you’re saying the miner can have if they put your transaction on the next block so that you can be verified and this is how it works with Bitcoin core but in practice it really depends on the wallets it really depends on the you know the website that you’re going to use to send money they basically decide everything about the transaction and whether they wants you include it as part of what you’re sending or add it on top as a network fee that you’re then going to send out sites like blockchain blockchain.com they allow you to broadcast your transaction so once you create your transaction you’re gonna get a hash that hash basically shows you all the data everything about the transaction if you were to paste it into here it’s gonna pull that data and then it’s gonna broadcast it out to all the miners so that the miners can then see oh this guy’s willing to pay you know ten satoshis this guy’s willing to pay sixty satoshis and then you can pick and choose what you want to fit into a block based on you know trying to get paid as much as you can okay so difficulty the blockchain the Bitcoin blockchain was uses the SHA-256 hash algorithm where you’re trying to guess the hash it’s very difficult to try to guess one specific hash but you can adjust the difficulty you can make it easier or harder Satoshi Nakamoto he decided that he wants one block mined every ten minutes so how can you do this you have to change the difficulty you have to make it harder or easier to find the hash in order to do that this is basically the formula for the difficulty difficulty equals difficulty one target over the current target basically in practice what this is is we restrict the types of hashes that you have to find so right here we have four zeros if we have it as one zero it’s going to be easier for us to try to guess hashes if we want to make it harder we can say two zeros three zeros four zeros five zeros we can say the hash is going to be ten zeros and then the rest of the number and that’s going to be a much more you know it changes your ability to try to guess the hash when there’s also an additional requirement about what you have to get so every every I think 216 blocks what they do is they take the calculation of how long did it take to mine a block and then they figure out how can we change the difficulty to make it ten minutes so we adjust the way that you have to calculate the hash we adjust the hashes that you’re allowed to try to find so that it stays right around ten minutes and that’s an arbitrary setting of the Bitcoin blockchain okay and this goes back to the 51% attack but essentially that’s blockchain in a nutshell with some of the characteristics and features of the Bitcoin blockchain so I guess we have some time if anyone has specific questions about this or just about Bitcoin any cryptocurrency or blockchain in general then we can we can go to that yeah, Dima How different miners decide how to form these blocks? everyone decided both transactions they want to put in these blocks? How do they do it equal? they so they don’t actually do it equally so everybody is trying to let’s see maybe I can film this so everybody is trying to mine the next block whatever the next block looks like nobody knows everybody can decide what the next block is going to look like so you could submit a transaction right now I could submit a transaction ten minutes after you but I might validate my transaction first because I’m I’m deciding to pay the miner more so the miner might not even care about your transaction because your fee is so low so he’ll say you know Max has a higher transaction fee Henry has a higher transaction fee George has a higher transaction Lisa adds higher so all of us even though we submitted our transaction after you we might validate our transaction first because the miner wants to make more money so in order to do that they’re going to take the ones that pay the most when deciding how to do that it there’s there’s no rule set for it so I could be trying to mine a block of these three people on the couch you could be trying to mine a block of you know Igor or Misha you know everyone over here we don’t know which one will happen first whoever guesses the nonce and correctly hashes that data is going to get to mind the block does that make sense There is a public key and private key please show it on your diagrams Where are they on your presentation? okay so the public and private keys are a way for you to control the flow of your in this sense in bitten cryptocurrency and when we’re speaking about cryptocurrency we have public and private keys that’s basically how you store your ledger amount and control your ledger amount of crypto or tokens or credits whatever it is that you’re able to send every transaction on the blockchain is broadcasted publicly it’s validated publicly so by looking up the hash or by looking up a wallet you’re able to follow the transactions you can see everything that’s been written what you can’t do is you can’t control anything in those wallets the only way you’re able to move anything is to sign a transaction with your private key so everyone can access everyone’s information essentially you may not know who owns the wallet so you can just see this person has a million dollars with the Bitcoin and he’s transferring it you won’t know who it is necessarily that person is the only person who can move funds out of that wallet so an example of that is Satoshi Nakamoto he mined the first block and he mined a lot of the blocks so we know that that first wallet that was generated the public key that was generated that’s his if anyone ever wants to prove that there’s Satoshi Nakamoto they should be able to move one tiny portion of that money into any other wallet and if they can do that they own that wallet so it’s most likely them unless they somehow were able to obtain that private key so that’s probably as a user the most valuable thing that you can have so in our Crypta Wallet application we generate public and private keys for the users and we pass it to them to store on their phones they have full control of everything we don’t know what their private keys are but we know what their public keys are so within our application we’re able to show balances we can look on the blockchain we can see transactions we can see what’s happening in terms of the flow of movement of the of the crypto that’s in there let’s see if there’s no questions I also want to bring up a mining pool because we didn’t get a chance to talk about that and we may be also we’re starting a mining operation we’ve had one going for for a little while now actually since we any of the year but in the next month or so we’re gonna be scaling it up very very big so once we do that it’s still gonna be difficult if now if you were to try to mine Bitcoin with your computer it’s going to be almost impossible because you’re gonna be guessing cash rates at such a slow rate you’re not going to be able to get it to guess the right nonce to to achieve the hash rate you might it’s still possible but mathematically statistically it’s very unlikely it’s like winning the lottery you know you might guess it but people who have all the hash power the people who are building systems to hash as fast as possible and they’re more likely going to get it so even if we set up a mining operation compared to what’s out there now the hash rate is so low that we’re not going to be able to mine that block so what people have done is they’ve created mining pools one company will create a pool and everyone will mine on behalf of that pool so everyone is guessing hashes together everyone in that pool and when someone in that pool finds the the block then all the reward is split between everyone in that pool and it’s split proportionately to your contribution of hash rate into the pool so what this does is you don’t have to wait you know right now if you’ve mined something maybe it will take like five years to possibly get one block and get 12.5 Bitcoin or 6.25 if it’s even less by then but if you’re in a mining pool you’re more likely because the block will be found every ten minutes so if everyone’s mining a block is found then you can split it you’re not going to get the full 12.5 but now you can kind of calculate how much money you’re gonna make and the money is gonna come a lot more smoothly because you’re just more likely to get it and you share in the reward so we’re most likely going to start out with our mining operation even though it’s very large it’s not large enough so we’ll have to join a mining pool we’ll have to pay fees to the pool we’ll share in the block reward eventually if we have enough mining power we can start our own pool and then bring more people in also and we can you know charge fees to maintain that Network and and also bring that into the business any other aspects yeah Eve on the queue of confirmed transactions what what do you mean so when you so when you are confirmed when you’re confirming the transactions that’s how many miners are then confirming the transaction so once you initially mined the block you have to have the consensus of confirmations and the number of confirmations when you’re sending it across the network like coinbase bit tracks all these different ones somewhat different confirmation number before they allow you to have that value basically it’s just how certain are you or how comfortable are you that this transaction is valid based on the distributed consensus I don’t know if that’s your your question but