Blockchain Lecture in Cryptanite Blockchain Technologies Corp.

Blockchain Lecture in Cryptanite Blockchain Technologies Corp.

Show Video

Okay. Hello hello everybody, I'm. Henry I'm the CTO co-founder. At kryptonite. 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 car Trax 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 note. 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 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 knots 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 tonight. 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. Hail, emoji 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 kryptonite. To, Krypton. 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 remind. It because I could just come back through I change. The data and then, I remind, it and then I go to the next one and. I. Remind 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 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 D'Arcy 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 Eli's 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 coin base 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 - mattis 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. The Toshi Nakamoto, did was he. Created an incentive, ization, structure, with Bitcoin so. For every block that, you mind 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 bit coin this. Coin based transaction, starts out with. $100. Us 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 on, 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 mind. 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 Toshi 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. ABCD. 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 hey 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 mind 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, ten 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 point for 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, point zero zero zero, zero one 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. Comm 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 10, 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 crypto, currency, or blockchain, in general, then, we can we can go to that yeah. Demo. Everyone. 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 mine or 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 ego, 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. 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 jet 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 crypt 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.

2018-08-22 14:32

Show Video

Other news