 Well hello everyone and welcome back to CS120 Bitcoin for Developers. This is our Unit 5 review. If you haven't been following along, this is a supplement to Sailor Academy's course. You can find a link to the course in the description below. Sorry, as well as a playlist of the previous videos we've done. We've done a review for the last four units and I just, I'm going to hand it over here to Hannah and get us started because we're running a couple minutes late. But if you guys have questions as we go through any of this, feel free to leave them in the chat below. Or if you're watching later, you could leave a comment. But I'll be back when I'm needed. All right. Thank you very much, Mike, and welcome everyone. We are going through Unit 5 today, so we'll get right into it. The topics, because again, as Mike said, this is a supplement to the course. So the topics that were covered in Unit 5 of the course are how Bitcoin transmits data on the network, how Bitcoin addresses and keys, and hex encoding, and how Bitcoin stores data in the block structure. All right. So basically all about data, and that's what we're going to be talking about today, data, data and more data. So specifically different types of data formats, how to recognize them, how to convert between them, how to make use of them. And so, again, this course is designed to help prep people to work with Bitcoin, right? So this is sort of to prepare you to encounter these different data formats and these different data types to help you to be able to recognize them, to know what you need to do with them, et cetera. Because as you're working in this space, if you're building an application that is talking to a Bitcoin node, and I've done a lot of that sort of type of work, that type of building, and you'll definitely come across situations where you're receiving some data from a Bitcoin node, a wallet, an application of some sort, and you're like, and then you have to deal with that in some other system over here, right? So you're going to need to be able to look at that data, be like, is that base 64? Is that base 58? Is that X? Is that PEM? Is that DER? Like what type of data is this so I can know what libraries and what functions I need to use over here to handle this data and to communicate back and forth. So if you wind up building applications that talk to the Bitcoin blockchain, that talk to Bitcoin nodes, et cetera, this is very, very helpful information, right? If you're not aware of things like, you know, nd in this and these different formats, you can definitely wind up scratching your head and trying to find people on forums and all sorts of different stuff to sort this out. So as we go through, I think it's important kind of to, with that in mind, like you don't need to necessarily, you know, memorize some specific details about the ASN one, you know, data standard and formats, right? You more it's I think prepping you to work with this stuff. So it's the goal is to help you recognize, like be aware of the different data formats that are out there, be able to recognize them. So then, you know, when you run across something, then, you know, you can go Google the specifics of what you need to know, find the right, right libraries and functions, et cetera, for managing that type of data. So that sort of the goal here is to prep you to recognize and start working with these different data formats and understand why they're used. Please do ask questions all throughout the session as we go, drop them in chat and Mike will relay them to me as we pause periodically in the session to do a bit of Q and A. All right. So what data formats does Bitcoin use? So this is kind of what we'll discuss today. It's not meant to be completely comprehensive of everything that Bitcoin uses, but these are some major ones that we'll discuss today, right? So we're going to talk about base 58 and base 58 check encoding. We're going to talk about WIF or WIF or however you want to say it. It's wallets in point import formats. PEM, we're going to talk about ASN one briefly and we'll talk about DER a little bit as well and of course talk about HEX and don't forget the envy in this, right? This is what we will go through today. We also have three possible exercises that we could walk through today. So I think we'll kind of go through some of this. See, you know, we won't have time to get through all of them. I don't think so. We'll kind of go through this, see where the Q and A takes us. And maybe you all, whoever's on the live stream today, can tell me which one of these exercises we have that you'd like to do, but we'll get there in a minute. OK, so we've talked about some of the different formats right here. We've noted some of these data formats that are very relevant to Bitcoin. And then we'll want to talk about why has Bitcoin chosen these particular formats? Right, why are these formats used? And so here are some themes that as we go and talk about why we're using this, why we're using that, you know, all, you know, as we go through each one of these formats. A theme that's going to pop up a lot is compression, right? So space on the public blockchain is very scarce and valuable, right? So you want to be really, really mindful of what you actually put onto the blockchain. So in many, many cases here, these formats were chosen to compress data as much as possible so that we can be really mindful of what we're putting on the blockchain. Not just so, you know, we can help our fellow Bitcoiners out, not bloat the blockchain, but because anything we put on there is potentially expensive to then use and work with, right? So space on the Bitcoin blockchain is a scarce and valuable and sometimes very expensive resource, right? Or it could potentially be. So I always want to keep that in mind, compress the data as much as possible. Like you only want to put absolutely the data that you need onto the blockchain in nothing less, or sorry, nothing more than that. So only what you need. So as we go through these, we'll see that compression is a really common theme in these formats. We'll save on block space. Error prevention is another one, right? And especially when it comes to Bitcoin addresses, these aren't very, right? There's this sort of trying to walk this line between making something really compressed that a computer can read, but also making something that a human can work with without too much error, right? So trying to walk the line on some of those things. So we'll look at a bit of formats that are used to prevent errors and then security, right? Obviously, we want to make sure that whatever we're using here is secure. So that's also a common theme and concern for why you choose certain formats. All right, so let's go ahead and get into the first of these. We'll tackle base 58 and then we'll stop and do questions after base 58, I think. OK, so this is you'll see this one a lot, right? And one of the things that I hope we'll all achieve by the end of this session is being able to just look at some data and spot it and be like, that's base 64. That's base 58. That's hex and just being able to spot those things will be pretty handy with you if you wind up working with Bitcoin data a lot, right? All right, so base 58 is a text-based binary encoding format, right? So it's a compact representation for readability and error detection and prevention, right? So it is base 58. So we think of decimal, right? It's base 10, right? And then we'll talk about hex, which is base 16. And base 58 uses 58 different characters, right? So each, you know, digits, right? That can be one of 58 different characters. And this is a subset of base 64, right? So base 64 is a data encoding format that's been in use for a while. We'll see it in some of the, you know, private key formats. We're going to see some base 64 here today. So base 64 existed and was used, you know, long before Bitcoin, right? But base 58 was created specifically for Bitcoin. And this, again, is, you know, base 64 is a very good method for compression, right? So storing a lot of, you know, storing data in a very dense way, right? So it's good for a compact representation, but also because we care about making it, you know, making sure humans can work with this. We want there to be readability and that error detection and prevention. So you started with base 64, right? And that is what base 64 is, is taking all the letters in the alphabet, both uppercase and lowercase, and then taking all of the numbers 0 through 9. And then it also has a couple of symbols in there, like a slash or a plus sign. And so then you take all of those characters, right? And that's where you get base 64. So Bitcoin took, you know, base 64 and then made it more human readable, right? So it removes base 58, removes characters that are frequently mistaken for one another. So you can see base 64 and base 68, it took out, what was that, six characters. So it removes things that are easily confused, such as in uppercase O and 0, right? Or Ls and I's, things that can commonly be confused for each other. And then I believe it also took out those couple of symbols that were in base 64, right? So you're not going to see those, the slash or plus sign or something in a Bitcoin address, right? So it does that to make it a lot more usable for humans. So I don't know if any of you have ever had, thankfully, the UI on Bitcoin wallets is much, much better these days. But back in the day, you know, you might have to like try and copy a Bitcoin address from, you know, one thing to another, you know, give someone your Bitcoin address over the phone. And it's, you know, it's, you know, uppercase A, the number two, you know, it can be very tedious and it's easy to mess those things up, which is why some of these characters were removed. Okay, so that's base 58, right? And that's just taking that base 64 and removing some of those characters. So we have a bit more easy for humans to communicate with base 58. But what's commonly used, what's the standard for Bitcoin addresses is to then not use base 58, but use base 58 check encoding, right? So here you can see on this graphic, this is taken out of the mastering Bitcoin book. So you have this, you know, payload, right? So this, let's say, is our Bitcoin address, right? In this base 58 format, then you add a version prefix to it. And we'll talk about that again. So you should have some familiarity with the versions to help you read data as you're seeing it and you work with these programs. So you add a version prefix to it. Then you take the version prefix with the payload and you hash it. So we basically do SHA 256 twice. Then you take the first four bytes of that hash and you stick it on the end of that payload. So you have check some and the idea here, right? And then you take that all together and then you have, you know, your address. That's your Bitcoin address. Now, the idea is, is let's say I have a Bitcoin address and I'm trying to tell say I'm trying to type it in to, you know, a web wallet or something, right? So it's an exchange account that I have, right? And I'm trying to type in, I'm reading, you know, this address off my phone and then trying to type it in to, you know, an exchange account, right? To have that exchange account send me those funds, right? We want to try and prevent someone from just entering the wrong thing, right? Hitting, you know, the wrong, just, you know, hitting P instead of zero on my keyboard as I type that in, right? Because, you know, we're humans. We can do this sort of thing. So the idea is, is once I type that whole address in, whatever program is in, is receiving that data is going to know to check and make sure this is valid. So it takes those last four bytes as the checksum. It takes the rest of it, right? And it's going to run it through this hash, this double hash. And check the first four, I think, yeah, first four bytes. And check it against these, these, this checksum received off the address, which is those four bytes right at the end of that address, right? So it does this, and if it doesn't match up, then it will reject that as an invalid address. So it's a way to prevent funds from being lost just by me having a typo and hitting the wrong button on the keyboard as I input this information, right? So this, I have no doubts, has saved millions of dollars and lost funds, right? Because it's very, very easy when typing these addresses just to hit the wrong button. So this is how we prevent errors or help to prevent errors in Bitcoin addresses. So base 58 and base 58 check. And let's go briefly through the version prefix before we do questions. But if you've got any questions on that, please type them in the chat now is a good time. All right, so that version prefix that gets added to this stuff can help us to identify different types of addresses on the Bitcoin blockchain, right? And again, when you're working with this data, it's very handy for you to be able to look at that address and spot what's going on there, right? So the most common type is just to add this version prefix zero, right? And then when you run it through all this formatting, that means that Bitcoin address is going to start with the one. And this is just a standard, you know, pay to pubkey hash, right? Then for, you know, we won't go through all of these, but you can see this different version prefix. So the zero five is added to a pay to script hash address. And that results in that address starting with the number three, right? And so, you know, you don't necessarily if you're going to be working with this a lot, then it's probably a good idea to have some of these memorized. So you know what they are. If it's the Bitcoin test net, it's going to start with like M or N. We're going to talk a little bit about this private key format. That's going to start with five K or L X pub. That one can be really handy. We're not going to talk about X pub keys now, but just being aware of what that is when you see that it's extended public key. That can be really handy as well. Also, we'll take a moment to note here on the hex column. You see every all those numbers there starts with zero X, which we'll see again later on. But that's just a way that like hex tells a computer that, A, there's a big long number coming after this. So when you see that zero X, probably like a hex number. All right, we'll stop here before we dive into key formats. Mike, do we have any questions on just data encoding in general and base 58 or base 58 check? Yes. First of all, we had some hellos from from around. We got it some UK. Hello, a couple of Illinois's, it looks like. Oh, nice. So we have a question here. About the sim, about the four, the 58. Sorry, were the. Were the symbols for the base 48 chosen based on a specific font or is there a recommended font? Ah, this is a good question, right? So in some fonts, right, you might be able to tell the difference between like, you know, an uppercase I and a lowercase L and in other fonts, you cannot, right? So I don't think I don't know that there was like a specific font in mind, but definitely the idea was that in some fonts, you know, telling the difference between uppercase I and a lowercase L is like, they're the same, right? So because there are some fonts where you can't tell the difference, those are removed. So I'm not sure I couldn't name offhand what the offending fonts are that won't let you tell the difference between uppercase I and a lowercase L. But they're certainly out there. And yes, they were the motivation for base 58. It's crazy to me they still make fonts where you can't tell the difference between an I and an L. But we're not seeing any more questions in the chat right now. But again, if you guys have any questions as we go along, please. Write them down in the chat below or next year, however, it works for your setup and and we'll get them out there. So I'll hand it back to you. All right, thank you. OK, so we've covered base 58, why that exists. This is a very, very common one. We'll see it everywhere. Now we're going to talk briefly about key formats, right? And again, what's often happening with key formats is we are trying to preserve the data, right? It needs to be exact, right? It's very specific information needs to be exact. But we also want to condense it down as much as we possibly can. OK, so here again, we don't, you know, we don't want to get into things on the level of we need to know exactly how these different formats work, right? This wallet import format with like you can go dive into that if you want to. But the idea here is you're going to if you're working with the stuff you're going to run across these formats. And I would like you to be able to spot them and recognize them and know what to do with them. So first we have again, this is pulled from the Mastering Bitcoin book and some of the chapters that we covered for unit five. And so we have different sort of formats that can be used for keys, right? For public and private keys for transmitting those when necessary, you're storing them, right? First one is just raw, right, binary, right, 32 bytes. We're not going to display that here because it's not really displayable. Second is Hex, right? So we'll talk about Hex in a minute and then you could display a key in 64 hexadecimal digits, right? Then we're going to do this with this wallet import format. And this is where a key is stored in base 58 check encoding. So again, you would have that little bit at the end here. This checksum that would be at the end of that. And that has a version prefix. So you can see that hex 80 and a four byte checksum, right? So again, important to know, right? Because you might be, you know, trying to get, you know, one wallets to talk to another wallet or make it such that you're the wallet you're working on can import keys from another wallet or a node or something of that variety. And so you need to know, OK, this format is what we're going to use. I need to have, you know, I need to find a library for the programming language that I'm using that can work with this particular format. I know that this is going to have a checksum on it. I'm going to have to write some code if it, you know, it doesn't exist already in this library I'm working with, then I'll need to write some code to make sure that I check that checksum, right? And so we don't need to go through exactly the details here. You just need to know what's out there and what they look like. So when time comes, you know what tools you need to work with them. All right. So we have two different types of formats for this with two different varieties of the with format. We won't get in two into the woods with that. But, you know, there's, you know, just a regular one and a compressed one. And, you know, standard starts with five and the compressed starts with K or L. So here we have some examples down here and this can help us a lot in just getting used to looking at these things and seeing what they look like. We'll talk about hex in a minute. But when we go down here to the wallet import format, first of all, we can see it starts with a five. So we can remember that's the uncompressed version. And down here, we can see that this one starts with the K and we know that compressed you're going to start with K or L. So that's the compressed version. So again, if you were working with this data, you would need a library. And if you're seeing this data come in as K or, you know, you might need might get that data, then you're going to have to have some sort of library that can work with with compressed, right? And we can see here, we just talked about base 64 base 58. And we can see what's going on here, right? We can see that we have letters, all different kinds of letters in the alphabet, letters from the beginning of the alphabet. Here's an A letter from the end of the alphabet. Here's a W. We have uppercase and do we have? Yeah, there's a lowercase J and M, so we have uppercase and lowercase and we have some numbers. So looking at that, we can, you know, after a while I get used to it, you can look at that and go, aha, that's base 58, right? So I can see that. I kind of know what I'm going to have to do with that. All right. Key compression. We're not going to get too in depth with this, but I just want to show you this to show you how much Bitcoin and all these formats we use, try to compress data. The idea being that you only want to ever broadcast to the blockchain or put into a block. Absolutely, this is the bare minimum of data you need. So without getting too deep into the math, we can see that a public key is sort of comprised of like two different numbers. And in certain what you can do here is because if you have some bit of information about this, right, if it's even or odd, we won't get too in depth with it. But if you have some information about it, then you can derive the second number from the first number, right? So you kind of in some situations, you only need to store like one part of this public key, right? So you really try to only store exactly the data that you need to if we have just this information, we can recreate the whole thing. Therefore, we're going to store just this information and expect anyone working with this data to be aware of that and know that they're going to have to take this information and then run it through a program to recompile the or recreate the whole bit of the whole information, right? So very important to know that, you know, Bitcoin is expecting you to know what to do with this data. It's only going to give you absolutely the bare minimum and you need to know what that data is and then recreate the whole thing because you'll have to use that in other parts of whatever program you're working on. OK, now let's look at this again. And here is just another example of how we can store private keys. Here's Hex. We'll come back to Hex in a minute and learn how to spot that. Here's this with format. Again, look at that. That starts with the five that's non-compressed, right? All right, here's some Hex compressed. You know, I won't touch that too much today. And then there's this with compressed and you can tell that because it starts with a K, B was it a K or an L, right? So again, just getting familiar with being aware, getting familiar with what data formats are out there and getting comfortable with spotting them so we can know what to do when we see them. All right. Mike, do you have any questions on that before we dive into PEN? Or maybe you're on mute. Sorry about that. That wasn't the setup anyone wanted. No, no, no questions coming in right now. We got we got a hello from North Central Pennsylvania. The geography is coming out today. Maybe they can see the little map. I didn't. Excellent. Well, hello, Pennsylvania, but I'll let no question right now. Again, if anyone has any questions, feel free to leave in the chat and I'll be back if we have some for you. OK, cool. We'll go through this next section. All right. Now we talk about when we're working with keys and if anyone's, you know, a developer who's worked with public and private keys in other situations, you might be very familiar with this public key block here. Specifically, if maybe even you're just like FFHing into different servers, you know, would have to generate a key pair and then perhaps you have to like. Sorry, Hannah, I meant to. We just got a question in real quick and I figured before we get going, maybe we should let's hear it. We should hop back real quick. Yeah, we have it here. Do other cryptocurrencies have these complexities of encryption? So this, yes, encryption isn't really quite the right word here because we're not actually encrypting data. We're using sort of we say more data formats, right? But yeah, I think most crypto, so any crypto that sort of a fork of Bitcoin or based off Bitcoin is going to be using, you know, base 58 and all this stuff. And there are far too many other ones out there for me to be aware of what they're using. But I would guess in the vast majority of cases, if you're familiar with these data formats, you're going to run across them in any other sort of cryptocurrency that you'd be working with. So short answer there is yes. Yeah, all right, awesome. Hopefully that answers your question and I'll be back if we have any more. All right. So here I have a question for you all in a second here, you know, saying you may be familiar with this. If you've ever done something like you had to set up some keys to be able to SFH into like an AWS, you know, EC2 instance, or something of that sort, right? You would generate a key and you might have had to generate this on your machine, you know, cat it out and then just like copy and paste over, you know, to some AWS UI, right? A lot of you might have had that experience. Let's look at this key or this, you know, public key as it's formatted here. And all the questions for you all, who can tell me what format this is that we're looking at, right? So I did put the link here, but, you know, maybe don't cheat and go there just yet. Let's have a look. And we can see we have letters, right? So we have letters from, you know, the English alphabet. Here we have uppercase. Here we have lowercase. We also have some numbers, nine. That looks like zero. And we have a, we have a guest in the chat. All right. Base 64 from David Cooper. Base 64 is the winner. So good job to whoever that was. Yep. David Cooper, there you go. And we can tell this is Base 64 too, because look at these symbols. So here we got a slash and we have a plus and we're not going to see that in base 58. Like, you know, not going to see slashes or pluses in a Bitcoin address. So here we go. This again, Base 64 existed long before Bitcoin. And it was, it's a format commonly used for keys. All right. So, but also we have talk about PEM. And again, we're not going to get too into the woods with this. Just something to keep in mind a lot of times, you know, you'll have when you generate, you know, key pair to SSH into some server, you know, we'll say private dot PEM, right? This is a specific way of encoding that data. It uses base 64. And this is what it looks like. So again, we want to be familiar with this. We won't, you know, it's sort of outside the scope of this course to dive into the specifics of PEM, but something you want to be aware of. There is where you can go get more information. All right. So we're going to roll across to this is another one, ASN one. This is in old school formats. And this also is something you want to be aware of, but outside the scope of this course for you to get super in depth with. But also in working with this stuff, you want to be aware of what it is. So you're not surprised or confused when you see it, but probably don't need to know the details of it all, right? Maybe in some application, you might wind up having to dig into it. All right. So this is a cross platform standard for data transmission, right? You would like to dig into this or you ever, you know, come across this one day and need to really dive down that rabbit hole. Here's a good place to start. Originally defined in 1984. So this is, you know, one of the originals, right? OK, so that's all we're going to say about that. You might see this should know what that is. It's, you know, a long standing standard for data transmission. All right. And DER, let's roll right into DER. This is Distinguished Encoding Rules, and it is part of the ASN1 standard, right? And this is a binary format, right? So it's not human readable. This is binary. In this, we use a lot because when you need to be really, really specific, like binary level specific with data, DER is often used. So that means when you're generating and validating digital signatures, you need to be really, really specific, right? You don't want to get that wrong. You have to generate a signature properly so that someone else can validate it. And when you're validating it, you want to be really sure that that's either, you know, a valid signature and invalid signature. So when you need to be really, really specific, this binary level specific encoding is often used and this will be what it looks like. Now, DER is often shown to humans, right, in, I believe, its hex format, right? And again, we'll get two in depth. But if you want to, if you want to look at some DER data, you can actually spot in it these sort of this tag length value format that it uses, right? So you can say here's an example of like some DER encoded data. Zero two is the tag for integer. Zero one is the length of the value. And zero two is the value. So that's basically the DER way just to communicate the number two. But again, we'll get two in depth with that. But when you actually look at DER data, you can pull up all the different tags and kind of go through it and see where the tags are and what's going on. So that can be fun if you're like a big data nerd. OK, hex. Let's get into what's happening with hex because this is everywhere, right? And if you've taken any computer science classes or any of that, I'm sure you've dealt with lots of this. OK, so it uses zero through nine and letters A through F. And sometimes I see you'll see this sort of in lower case. Sometimes you'll see it in uppercase. But it's not like it's going to be like all lower or all upper, right? So it's just the zero through nine and A through F. All right. And it's a human friendly way to represent binary values. So something like DER, you're often going to see, you know, in hex. So it's readable for humans. So each hexadecimal digit represents four bits, half a byte, which means that a single byte can have values ranging from here to, you know, in binary 0, 0, 0, 1, 1, 1, 1, which can be much more compactly represented in hex as either zero is, you know, values from 0, 0 to FF, right? So you can see this is a more compact way to represent these values in a readable format or, you know, and sort of be able to communicate it in text in some some capacity. All right. So it's, you know, as I say, a human friendly way to represent binary values. And we'll see hex everywhere and we'll look at this again in a second and be able to sort of spot hex. All right. So now all of that being said, you might still be familiar with all of these different data formats. And let's imagine you have some Bitcoin node you're talking to, right? And then you have some application over here that you're busy building that's supposed to be taking data from the blockchain, right? And you might get some data and you look at it and I'm familiar with hex. I can see that there's the letters A through F and the numbers zero through nine. So as I'm receiving this data, I know I have to use some functions for working with hexadecimal data, right? So you go and you do the right functions and you run it through. But still, it's like you're getting gibberish out the other end, like something's just not right. What's going on? You can run into this and this might be an issue of ending in this. Now, I'll read this and we'll talk about it briefly. So a big ending in system stores the most significant bite of a word at the smallest memory address and the least significant bite at the largest. A little ending in system in contrast stores the least significant bite at the smallest address. So kind of think about this is like some languages are written left to right in some languages or you write them out right to left. And that's kind of what this is referring to. So it might be that you have the right data. And it's I'm kind of simplifying it a bit here. But just keep this in mind if you ever run into an issue, you know, where it's like, I think I have the right format. What's going on? Like don't forget to check the ending in this because that that can definitely be an issue when dealing with data, you know, blockchain data and, you know, how this stuff is stored. Because remember, it's always going to be stored and transmitted in whatever is the most efficient fashion. And it's your job as a developer working with it to be aware of that and then take that tiny bit of data and use that. And then you, you know, transform that data, how you need to work with it, because it's only going to be given to you in the, you know, a lot of times, you know, when you're working with the back end stuff, it's going to be given to you in the most efficient form possible. And it's your job to recognize that and work with that and make it usable in your system that you're building. All right. So that was a lot. We'll pause for questions. But before we do that, we have three possible sort of exercises we can do today. One is just generating some keys and looking at the formats of those keys and kind of converting them from one format to another. The second is to actually just take some, so that's the keys is the first one. The second one is to take some data and convert it like between, you know, base 58, we'll play with that and we'll play with hex two. So that's conversion is the second one. The third exercise we could do is actually go like get a little reg test node set up and go look at, you know, print out onto the screen some transaction data and kind of look at what data formats are being used there when we're actually looking at blockchain data. So those are the three options playing with the keys actually converting data to different formats or going and looking at that data in the blockchain. So you all please drop in the chat and tell me which one of those exercises you'd prefer to walk through today. And also, Mike, I'll ask now if we have any further questions. All right, yeah, we'll give everyone a little bit of time here. Oh, well, so it's getting people. We already have two votes. It looks like for option three for the exercise. OK, but we'll give people a little bit more time here. I should have I should have lined up some maybe some jeopardy some some royalty free jeopardy music, some some sound alike, I believe, is the term. All right, excellent. So I'll just remind people of three options we can play with key formats. We can convert some data just via Python or we can go look at blockchain data via just like a little reg test note. So those are the three options. And maybe I'll just talk through the different Bitcoin networks here briefly, because we'll need this for next week. Anyhow, while people vote and after I do this, we'll we'll tally the votes. Sounds like a good plan. Cool. So blockchain data, something to keep in mind are the different Bitcoin networks, right? So we've mentioned test nets on a number of occasions. I'm a huge fan of test net. Please use test net. Just, you know, like, like, like, I like, you know, proper structured development. Please don't ever experiment or develop on main net. Please always use test net while in development. See a lot of people, especially with lightning network, that's on the topic, people use main net and like, please don't do that. So let's walk through this. Main net is the real Bitcoin, the Bitcoin that actually has value. It's what we're referring to every time we've been talking here and saying Bitcoin and the Bitcoin network and Bitcoin, the units, you know, that's what we mean. But there's a whole nether. There we go. Use test net, please. There's a whole nether Bitcoin network, which is a separate Bitcoin network with a separate blockchain running the same software, but it's test net. And it's specifically made so that it does not have any real monetary value. You cannot anywhere you go, except maybe at like a developer conference somewhere, big test net coins are not going to have any value. You can't ever buy a cup of coffee with it unless you're sitting next to someone who's working on application is like, oh, I need more test net coins to test my app there. Maybe it might have a tiny bit of value, but otherwise it does not have any monetary value. It is purely for testing. Right. So if you something goes wrong and coins get burned or lost, it's not a disaster. Right. So please use the test nets. There's also another one called reg test or reg test. People say sometimes in this is where you create your own local blockchain network or your own your own Bitcoin network. So it's just for on your machine. You can also, some people use Docker containers to spin up five different nodes using reg test, all the same network on their computer. And it's what all of these things have in common is they're all running the same software. It's just about which computers are on the network. So as you're developing, I highly recommend start with reg tests, right, then graduate to test nets, then only once you're actually production ready and gone through all the tests, then move on to main net. So with that said, Michael, let's tell you the votes. What exercise should we do? Well, it looks like the the winner is still option three. We had someone say option two, but option three still has it, unless there's a bunch of last second votes coming in. But if polls are closed, if polls are closed, we'll officially close the polls. OK. All right. So option three, we'll also declare the winner. All right. So what I'm going to do here is we're going to go to this website because they have a nice little sandbox, right? So we're going to spin up a reg test node and we will walk through it. So I'm also going to I copy this tab. Hold on. I think I can. OK, hold on just a second. I know what I'm going to do. All right. Excellent. OK. I just want to have this on another screen here so I can follow along with what we're doing. All right. Let's close this here. OK. And I've got it all turned on. All right. So we got you. Excellent. We are booting up a Bitcoin node. And again, this is running on its own separate network, right? It's really only talking to itself, not at all useful for actual Bitcoin applications, but incredibly useful for what we're going to do here is just walk through, get familiar with some of these commands and walk through looking at some actual blockchain data, how the Bitcoin software stores this data and presents it to us via the command line. All right. So I'm going to kind of breeze through these commands just talking about them briefly as we go, because next week we're really going to go, we're going to set up a node properly and really going to go in depth with what's happening here. All right. So when we interact with Bitcoin on the command line, we use this Bitcoin dash CLI, right? So I'm just going to do get info. You can see I have a node running here. We got some version data. Oh, look at that. We have zero blocks, right? Because our own private network, we're not getting blocks from anywhere else. All right. So I'm also going to take texts. See if I have text editor. There we go. Boom. OK. Put this over here because I'm doing some copy, paste. Let's see where my text go. OK. Awesome. Cool. OK. So I'm going to generate a new address. I'm going to type this here. Now, why is my phone ringing? There we go. Off that goes. OK. Here we are. This is the coin address. Notes that it starts with two. That's interesting. Now I'm going to do get block count, right? So how many blocks do we currently have in our blockchain? We have zero unsurprising because we haven't made any because we're the only people on this network, right? Just me. So to make some blockchain data, we are going to tell this reg test node that it's got to generate some transactions here. So we're basically going to mine some blocks, right? Remember, we talked about mining right now. The difficulty level on this mining is at very, very low. So this little app running in this browser or on someone else's server can easily mine some Bitcoin here for us. So we are going to create, I think this, yeah, generate to address this mines 10 blocks and sends us all the block reward, right? Oops, we got hit enter. Boom. There we go. I believe these are the blocks we have just mined. I'm going to grab. I think that's what this is. Let's copy this. Holding on to that. OK, now we'll go on to the next one. All right, now let's do again. This I get block count. Boom, we have 10 blocks. But let's do get info. Our balance is still zero. Now, if you are not sure we discussed it, but certainly here, but certainly discussed it in the course that the block reward isn't spendable until another 100 blocks won't dive into why that is. But basically, we can't use this Bitcoin until it's 100 blocks deep into the blockchain. So let's generate 101 blocks. Boom, that's a lot of blocks. OK, cool. Now we'll go back and generate get block count. Look how many blocks we got. Excellent. Now we can actually start looking at some of this data, which is what we wanted to do. So we copied one of these block hashes. I think that's what I got here. So hold on just a sec. OK, copy all of this off my click board over here. All right, so I want to tell Bitcoin now to pull up this particular block. But first, before we do that, let's have a look at this data here. And let's again have someone try and tell me what format we're looking at here when we look at this data. So let's see, we have the number four. We have a lowercase a. We have the number six, seven, one, B, C, D, F. OK, so we've got a lot of letters from the alphabets. Do you see any letters from? We see all one case, though, when people look like all lowercase letters. Do we see any letters from the end of the alphabet or maybe just a through F? Right, we got here. So, Mike, do we have any guesses as to what format we're looking at here? We're working on it here. I'm trying to get them a bigger view. David Cooper has guessed the hex, also has explaining Bitcoin guessed hex. Oh, David, everyone's guessing hex. All right, then everyone is correct. Nice work, y'all. OK, cool. So there we go. Actually, let me see if I can do this. Hold on, Mike, this might solve our problems. Does that help or does that make it worse? Give me one second. I'll tell you. I think I can tell me whether it makes it better or worse. Now, I think it's smaller than I had it for them before in this view, but I'm not entirely sure. OK, then we won't do that. And then maybe we can just zoom in on you. So don't go back to where you were if you were going to zoom because I zoomed for us. OK, excellent. So I won't mess with it. All right, OK, cool. All right, now let's look through what data we have here. So we said, hey, please get this block. All right, so here's the hash of the block displayed in hex. We have lots of interesting information about it. Blah, blah, blah. Here's how many confirmations it has. Here's the size, weight. That's another topic. Merkle roots, hey, we've gone over that. And here we have transactions. Here is a transaction ID, right? This is what we want. Let's take a look at that. All right, now let's also look at that transaction ID and say what sort of format is that? Well, this also looks to be hex as well. OK, cool. So we can see what Bitcoin's doing there. Now let's go and dig into that specific transaction. Here, I'm going to use this Bitcoin CLI command called getTransaction. Let me just copy and paste this. All right, there we are. Bitcoin CLI, please get this transaction. Boom, cool. All right, so now it makes this kind of human readable for us. Look at that amount, 50 Bitcoins. I'm reg test rich, right? All right, so we've got some confirmations. This is the half of the block it was included in. Here's the transaction ID. So what Bitcoin does here, Bitcoin CLI, is it makes a lot of this human readable for us, right? And here it's laying out, here's the timestamp on it, giving us all kinds of details. Here's the address that we've used. Here's the amount. Again, we talked about inputs and outputs. We can see that. But then here's the transaction, the whole thing bottled up in hex, right? Just some raw hex. So what may happen is that when you're working with data, like if you're actually trying to see what's going on in the blockchain, you're building some sort of application. You may run across a situation where you're getting transaction data and it's being delivered to you like this, just in hex, right? And then you're going to have to look at that. Like this is a transaction. Oh, crap, what is that? Oh, that looks like hexadecimal, right? So now, thankfully, in the Bitcoin software, right, you can pull out the, well, you can use the Bitcoin software to then translate this into something that you can much more easily pull out the data. But it's going to be your job to look at that. You might just be handed this information, and it's your job to then deal with it appropriately and pull out perhaps you want the amount. Perhaps you need the exact input used in this transaction, whatever the case may be, whatever application you're working with. You might get handed this data and then have to work with that appropriately. OK, so I think that's where we're going to stop there for this particular exercise. And it looks like pretty good timing because we only have about five minutes left. So let's just switch back to our question slide. There we go. And Mike, do we have any questions about this? I'm not seeing questions yet, but we'll give everyone a second. I did see a question about posting the sandbox link. I'll add that to the description of this video after we're done here. I tried to share it, and I think I shared the wrong one. So I'll share that out. Come back a little bit later today, and I'll add that to the description of this video. Cool. I also believe there may be more than one of these. This is just one that I found that does a nice job. So I'm not particularly familiar with this website or what they do, but thank you for the sandbox. So if you also, if you Google your search for Bitcoin, Reg Test, Sandbox, you could probably find some other ones as well. But this one has worked well for me in the past. So shout out to them. Thank you. All right, awesome. And let me just, while we wait here to see if any more questions, I'll just pass the shout out back to you. Thank you for taking us through this. Again, we'll be back here again next week doing the next unit. And of course, if this is your first time joining us, there's a playlist with the links to all the other videos we've done prior to this. And of course, these videos are a supplement to the Sailor Academy's course. So of course, go up there, start taking the course, catch up with us. Yeah, but I'm not seeing any questions coming in. So again, just want to thank you, Hannah. And thank everyone for joining us while we just wait and see if any last questions coming in. All right, cool. All right, well. I think I will see you all next week then. All right, excellent. Thank you all so much for joining us. And we'll see you the same time next week.