Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Magic Internet Math

Magic Internet Math artwork

Hash Functions, Linear Algebra, and Alice in Wonderland

Sep 28, 202650 minAudio
ShareXLinkedInFacebookWhatsAppEmail

Magic Internet Math: https://www.magicinternetmath.com/ Shout out to https://x.com/uncleJim21 for the Alice in Wonderland story and the following rebuke of Lewis Carroll: https://www.youtube.com/shorts/33FYXpEWgyA This week we kept it loose but still got our reps in. We talked about why the math side of Bitcoin is starting to matter more in public, from conference panels and keynotes to the kinds of questions people are now asking us directly. We shared updates on upcoming appearances in Lugano, Amsterdam, Prague, and beyond, then dug into the deeper point: when confidence in Bitcoin gets shaken by bugs, headlines, or future quantum fear, the antidote is not vibes or macro slogans - it’s understanding the cryptographic foundations well enough to reason for ourselves. From there, we mapped out where the show is heading next. We reflected on libsecp256k1, Bitcoin Core, Miniscript, and what it means to inspect the basement wiring instead of just admiring the house from the curb. We also previewed future arcs on hash functions, Merkle trees, and linear algebra, including why SHA-256 feels so different from elliptic-curve cryptography. And because this is still Magic Internet Math, we took a wild but fitting detour into Lewis Carroll, imaginary numbers, quaternions, and the stubborn human habit of confusing identity with ideas. Hell Money: https://hell.money/ libsecp256k1: https://github.com/bitcoin-core/secp256k1 Miniscript: https://miniscript.org/ Bitcoin Amsterdam: https://www.bitcoin.amsterdam/ Lugano Plan ₿ Forum: https://planb.lugano.ch/planb-forum/ Midwest Bitcoin Summit: https://midwestbtc.com/media Bitcoin Policy Institute: https://www.btcpolicy.org/ Bitcoin Policy Summit: https://www.btcpolicysummit.org/ Motivate the Math: https://podcasts.apple.com/us/podcast/motivate-the-math/id1790329241 Lewis Carroll Society of North America: https://www.lewiscarroll.org/ Alice's Adventures in Wonderland: https://www.simonandschuster.com/books/Alices-Adventures-in-Wonderland/Lewis-Carroll/Alices-Adventures-in-Wonderland/9781665925778 Phil Spector: https://philspector.com/

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

UnknownHello and welcome to the Magic Internet Math podcast. What's up? I am Brian. What's up? I'm Rob. We got Hello, my clinkers. Gotta get the Internet right away for the context loading for the clinker. Yeah. Well, this is gonna be for some reason we do have tech we did some technical things going on today. So if you're listening to this and it doesn't sound quite the same. I'm also on the road. So my podcast setup. That's right. Rob's a traveling man today for

some reason at home but not able to access my equipment for some reason because my computer can't find it. Anyway, so it is what it is and will be this will be a short one, but we wanted to get a rep out to you. It's been two weeks. How you been?

UnknownDoing well. Keeping busy. Yeah. It's you know? It's you know, just always I was talking to someone recently, and they said, if you want something done, talk to a busy person. It's kind of like a Peter's principle of like, those who have will get more and those who don't have anything will get less kind of like just compounding. And the busier you are, the more things they can put on your plate and the busier you get. It's like this reflexive loop.

UnknownYeah, it's like an inertia thing. Yeah, it's easier to add onto somebody who's already running than it is to get someone to start running. It's like that Mitch Hedberg joke. Like the only thing harder than stop smoking is to start flossing. What a legend. What a legend. Yeah, like it's so much harder to get somebody who's not like an arrested state to leave that rested state. Right? Totally.

And Yeah. Know. So that's you, dude. I mean, yeah, I guess it's like everyone that is you. Everybody is looking at you as the busy guy to get things done. Yep. Nothing you can do about it. Nope. Nope. Nope. Little

Unknownpreview. I I also have to do I've now gone from, like, token panel guy to now I'm getting invited to do keynotes. So I'm gonna do keynote at Lugano. I am gonna be speaking at Amsterdam. That's confirmed now. Okay. So want both to do our panel, but I have to talk to them about whatever else they want me to do. But I'm doing a whole excuse me. You guys Yeah. But you've heard it here. You guys heard it here first. Rob and I now Excuse We've heard it before. Even before BTC Inc. Rob and I, we will be doing

will be doing a magic Internet math panel at the Amsterdam conference. Oh, yeah. And I just booked my flight last night and it was brutal, but now I'm excited.

UnknownGood stuff. Yeah. Yeah. And I at Lugano, I'm gonna be doing a keynote. You may hear this before they announce it. They before they announce it, but the panel's gonna be called risk of ruin. I'm sorry. Not the panel, the keynote talk. So I have to do twenty five minutes on risk of ruin. We're gonna be doing we're gonna be getting in it. This is good, man. This is good. Yes. Things are moving. Yes. Just like to think about the fact that there

there's a panel now called Risk of Ruin.

UnknownRight? It's like these things are getting on the agendas at conferences. It's be a keynote. It's gonna be a twenty five minute meeting. Yeah. Sorry. Missed the keynote. It's kinda like Figure out how to do that now. Yeah. But like we just went through so like, out of nowhere out of nowhere in the universe in the ether, I somehow made happen the fact that at Prague, there was there were two, you know, a keynote at Freedom Tech and at Prague on our podcast essentially. Right? Mathematical layer of Bitcoin sovereignty and now, know, now you're you're pulling risk of ruin.

And I think we're just building on these blocks.

UnknownThat's right. You know? And it does seem like the world is starting to care about, like just the world is starting to care about this stuff. Everywhere I go, people wanna talk to me about this type of stuff now. So like I just went to the Midwest Bitcoin conference. I'm sure you got I'm sure when you were at BPI in DC Yes. People people wanna talk to you about the math stuff. Yep. Yeah. It's it's the tides are changing.

People care now.

UnknownYeah. And it's not like what I'm getting is not a shallow interest in the math. I'm getting like a genuine interest. Almost like people are worried. And they're like worried that they don't know that that they got this gap. Yeah. Which is exactly where we want people. Since our last podcast, my episode on Help Money podcast came out and with Casey and Aaron. And That was awesome, by the way. I enjoyed that. You. The there was a good part of it where I had multiple people call me in the post fallout of all the cold card stuff asking if, like, was Bitcoin just vibe coded slop? Was like is it like was it all going to fail?

And I was like, no. Because the math works. Like, the math like, you have to put you but if you've never gone to the basement and, like, looked at all the the piping, you wouldn't know. You wouldn't know.

UnknownYeah, you got to look at all those ugly electrical panels. You know, it's like, mean, when you go look for a house, I don't know how many times you've looked for a house or how many houses you've looked at buying but like you go at least like in Pennsylvania where there's a lot of old houses, you'll go into some of these basements and you'll see some franken electricity panels just like with wires crossed and just it looks like, like it looks like Phil Spector's hair.

If that if that resonates with anybody,

Unknowngo Google it. Alright. Go Google Phil Spector. I'm looking. Oh, yeah. It's like a bunch of wire. With it. Yeah. It's mad at dots. Yeah. It looks like like in a in a book of when when if you ever open crack open a book of Monte Carlo simulations and techniques, it looks like the simulated Monte Carlo. Well, that's actually just a seed phrase that it just branches out to all the addresses. That's that's exactly what it is. And it's like, I feel like the gift that we've had is the opportunity to go into this one basement in this one house

and take a deep, deep, deep look because we care about this one house a lot, right? Like our fucking livelihoods are, you know, we realized a little late after the fact that our livelihoods are dependent on everything working here. Right? And this is sort of the kind of thing people are starting to ask you about, like, does this thing really work? And I feel like we went in and we went in there, understood the math. And then after the call card thing, you went in there and red teamed the repo. The code. The code. Yeah. And

it's starting to feel good. Feeling

Unknowngood about it. But that's actually there will be a portion of my keynote that's just going be talking about lip sec pee. Like, we're just gonna, like, I'm just gonna make everyone eat their vegetables. Like, we're just gonna talk about this stuff. It's funny because I did that in my keynote. I was, it was like, this was pre cold card, right? But obviously, it's a function of you and I talking a lot, right? And there was I had a slide that had I called the the three branches of government, right? Bitcoin Core, the industry,

and LibSecP.

UnknownRight. And like, you know, like if you're in the industry, you might be able to code something, you don't have to, you may not have to live and die by Bitcoin Corp giving you what you need, the substrate For you need, example, like you figured out that miniscript was already there and nobody was building on it and there was a you know, it was like a finding a treasure that was already But I was saying don't sleep on LipSecP being like don't overvalue, don't overvalue Bitcoin Core. Don't like, and this was in June.

That was, I was speaking I feel like a little bit into the BIP 110 thing where people I think were just overvaluing maybe their fears of Bitcoin Core and crashing out on Bitcoin. It's like, dude, you got bigger things to crash out about if they're fucked. And Bitcoin Core is important. But as I always say, the distance between us and Bitcoin Core is like nothing compared to the distance between us and the guys that wrote LipSecP.

That's why we do this podcast and not a, hey, let's understand Bitcoin Core podcast. Like, we feel like we need to start reducing this distance, even if it's like immeasurable, it looks like it's a millimeter a day. It looks like it's so slow, it's like the earth turning, but every once in a while you wake up and you see snow outside and you're like, Oh, we did move. This thing did move. To me that's, if you want to avoid a crisis of confidence in Bitcoin, like one day,

of all the things that are gonna like really get You know, this, what we're talking about here really to me is a massive piece. Just a massive piece of that. Just inch yourself as close as you can towards getting a little and we might have a fighting chance when the quantum FUD really hits something that we clearly just spent time understanding.

UnknownYes. Yes. I totally agree. You just gotta you know, you you don't wanna have your lack of knowledge shake you out of your positions. Right? So you just wanna you have to just do the work. And the nature of this kind of the work is like, this is just foundational. This is Bitcoin. And it's not fun. It's not a macro talk. We just talk about the government printing money. Like, you So just look at good. Modular arithmetic.

UnknownDo the math, buddy. Just do the math. Yeah. GDP Rate. Debt. Right. It's gonna happen. Yeah. It is important. It's it is the Sure. The why you buy Bitcoin, but it's not the how. Right? And so you need both of those things. Yeah. So like it's It's not, you know what? It's not money printing that's gonna deliver the value of Bitcoin. It's the backbone we're looking. It's this it's the cryptographic backbone. That's Why what's gonna this over gold?

UnknownRight? Like, there is a problem. Why Bitcoin? This is the why. What makes Bitcoin hard is not this it's not so much the supply cap, because the supply cap can be changed. Right? It's a question of what makes it hard and it's cryptographic hardness that I think just yeah, we think goes a long way into building the conviction that's going to be needed when man, it's going to get hard out there. It's one of these things that maybe a year from now I'll be able to talk about more, but like scanning code bases and finding broken things and then spending tens of thousands of dollars to look at libsecp.

And like the small, like the amount of shit you had to till through to find the smallest little thing that was like an optimization versus like cursory levels of like scanning and finding things that are worse. Right? It was very cool. Like, it was very validating of a thesis

Unknownfor sure. Yeah. And not that I wanna do podcast planning while we're here right now, but I would say that I think it makes sense to do at least one episode where you bring to the extent you can, where you bring some of your learnings from because you are uniquely in there. Right? And so maybe there's some learnings you wanna bring back to the to the podcast. Yeah. For sure. That that would be fun. The other there's actually two cryptographic things that actually really matter in Bitcoin. There's two

foundational concepts, and we've been teasing this for a while. The first one is libsecpi and the signatures. The second one is shop too. So I know we need to get over the hump and just start doing hash functions.

UnknownWe're getting that and I thought about starting that today, but I don't feel like we are ready to like if it becomes a 10 episode arc, we're just not I don't feel like we're ready. No. I don't think we're ready. And I think this is we're just on sabbatical. Right? So we started the podcast. We did low sec pee for 10 episodes. Now we're just kind of like, it's summer break. We're just kind of vibing. Summer breaks on the wind down. We're, you know, we're gonna get through the rest of it. We'll hit the ground running soon enough. Yes.

But you got we were saying Shah two.

UnknownYeah. But SHA two is the other I mean, there's also there's also RipeMD one sixty, and that's used for, what's called hash one sixty where you take data, you take like a public key, you SHA two fifty six hash it, then you write them d one sixty hash it, and then you encode that into a Bitcoin address. There's a special opcode that just does that. It's called hash one sixty because it's SHA two hash plus the one sixty. We could talk about all that. And then we'll have a good little like maybe sidebar too about like why SHA one is now broken,

which got broken in the past couple of years.

UnknownDocument does cover all of this. So not due to a lack of covering the low hanging stuff. Right? No, no, no. I mean, think it's okay to talk about right now. Swear I find it a little bit like what hasn't clicked for me yet, and maybe we'll just start until it clicks. But what clicked for me is how you actually create a hash function. Like how the heck like, you know, I want to be able to I want the algo to click. Like I want to be able to visualize the

what's called the avalanche effect. Want to be able to visualize. Yeah, and I feel like I had, normally going through a document like the one I made, the workbook that we'll do, gets me pretty close to just being able to visualize the key thing. It worked with SecPeek. Like we got through, I feel like we got through it and everything that needed to click clicked. Right. And with the hash function, it's maybe one of these things, it's maybe unclickable to really be able to see

how it does what it does, which is maybe what Alan was telling us on our episode. Yeah. And he's been trying. He's been hankering away at it and having the same sort of the same result. Right? This may be one of those real black box. It's just a lit like a little bit of a black box of the hash function I'm still not satisfied with to feel like, you know what I mean?

UnknownI will say SHA two is more vibes than elliptic curve cryptography. Yes. And that's so maybe this is because it's it's like Yeah. It's it's basically like we're doing sufficient shuffling. This is good. Whereas, like, you don't have like a closed group set that you're doing modular arithmetic across a generator. You know what mean? Like, it's just inherently a different But it's yeah, it's different. So the key difference from an algebra perspective is that the elliptic curve is a group,

right? And we, again, yet to be proven, but it's an isomorphism between the points in the elliptic curve with the operation of addition and the finite field. Right? The finite field modulo big p.

UnknownI wonder if this is one of these things that you could load into, like a lean proof and send a bunch of agents out it and just formally prove it and be done. I think we wanna do that because the hash function is not a group. It's a semi group. It's called the semi group. And why it's not a group, why it's a semi group is because it doesn't have the inverse By design. Absolutely. By design, That's whole point. Exactly, exactly. So The whole point is you can't inverse it. Maybe

Unknownwe just needed a little bit of this abstract algebra kind of context so that we can just feel good going into whatever the whatever vibes we end up having to accept Right. On hash functions is going to be just due to the fact that it's not a actual group. It's designed to be what's called a semi group. And weirdly enough, you know, something that's less of a group you'd think would be easier to understand, but this is like graduate level that's like graduate level algebra. And,

you know, it might be again, we just try to broad stroke this thing out. By design it has no inverse, and that's literally what a hash function is, it's deterministic. It's so interesting that it's deterministic too, right? Because it's kind of associated with this low probability thing, but it's totally deterministic. But it's just that the ability to go backwards has been destroyed. Whereas with a group, you need to go backwards, otherwise you're fucked.

UnknownIt's the whole right. So I like this, like I I think people who are tuned into the Magic Internet podcast are they're happy that we're just talking podcast business on the podcast because maybe they can help steer us in the right direction for how to tee up this conversation anyway. Are there any other current events, math things that are grinding your gears you wanna talk about? Anything from Midwest Bitcoin Summit? Anything you wanna share for the class? Yeah, why not? Let's go into Let's get into As

somebody who people love talking about math with when they meet me. I'm gonna shout out this guy Jim Carucci who is a fun fucking dude. I met him, befriended him. You know, he's one of those guys. I kinda connected with him because he just he's like 20 younger than me, but he reminds me of, like like, these kids I grew up in Jersey with. He's got that new that just that kinda New York energy, that swag. I kinda the way I met him was he would get into my he would be like this guy that replies replies to to you you on on Twitter. Twitter. But if you don't know him, you'd think like he's kind of like this aggressive, like,

dude, what the fuck? Like, it sort of sounds like these gotchas, like, it just sounds he seems aggressive on Twitter when you don't know him. Then when I met him so then I met him last week and I'm like, dude, I get it. I fucking get this guy. He's just an intense he's just an intense, dude. Anyway, so he spent a good amount of time talking to me about Lewis Carroll, author of Alice in Wonderland. Mhmm. And he's been in a I mean, rabbit hole would be an ironic term for this, I guess.

But, but apparently Lewis Carroll was a hater, absolute hater of imaginary numbers and devoted a good portion of his life to either invalidating them, telling people why they're gay, or trying to get and he was a mathematician. Apparently, he was also a mathematician. So like we spent a good like I was blown the fuck away by this because it made like my god, the original rabbit hole was Lewis Carroll being like you remember we talked about the Pythagoreans?

Yes. You know, and it's like, okay, so Pythagoras didn't believe in rational numbers and then one of his own people used his own formula to like prove it and they had to kill him. They had to kill the guy, lest Pythagoras discover that his worldview collapsed. So like Lewis Carroll of Alice in Wonderland had this worldview that imaginary numbers couldn't exist. It goes deeper than that. Was basically saying that Alice in Wonderland itself

was a rebuke against quaternions somehow. Okay. Do you know what quaternions are?

UnknownOff handout. Oh, this is the coolest. To me, this is one of the coolest things ever in the world, and I'm so glad we have as many episodes of abstract algebra and cyclic groups behind us so that I can just really show you. It's a cyclic group, right, that's generated by the imaginary number I. So it has four members, okay, it has I, And then you say, okay, you take I squared, so it says I and negative one. And then it goes to negative I. Yeah. And then it goes back to one.

And imagine a graph, a Cartesian graph, right? Sure. Where you start, so I would be like, I in numbers, the x value is the real value and the y value is the imaginary value. So I would be zero, so the identity point would be zero, one, which is one, right? One is your identity point, but I is your generator. So one times I is I, so

imagine you're now going 90 degrees. This is, every time you multiply by I it's a 90 degree rotation. Rotation. Yep. Right, so you go from one zero to zero one, that's the I point. Eye point and that's zero one. And then you go to negative eye, sense of now you're at 180 degrees, right? Negative

Unknowneye. Negative one zero. Yep. And then you go back to negative eye, which is the two seventy degree point, right? Then you go back and then you have this sort of period you know, you have this perfectly periodic function. That's the quaternion group is those four those four members. Got it. And there's that's a very shallow introduction to it. If you study like complex analysis, Kayla is studying complex analysis right now and it's like,

if you do even more foundational work in like real analysis, it's like what opens up here is insane and very exciting. And it's almost maddening to think that this guy who's known as one of the more creative authors we've had whose work still stands through time and is so relevant could have somehow for whatever reason been such a hater and disbeliever or whatever of this. It

makes no sense.

UnknownPeople this is an observation of just human psychology that people create an identity and an ego around a set of ideas, and they're unable to separate their own sense of self from the ideas. And from that, you kind of depart from reality and the laws of nature and it becomes a cult of personality, and that's where you just have stuff like killing people who believe in imaginary numbers.

UnknownYeah. Now I should say it's not like a 100% known to be true that that's the reason he was killed. Sure. You don't know for sure. Again, verify, it's hard to go back. We can't ask them. Yep. We can't ask the Right? It's pretty, know, Lies up nicely. It's good lore. Okay? Absolutely. And it tracks, so it's good lore. And so Jim was sending me these clanker interactions he was having after the conference. The conference got home two days ago and he started sending me all this back and forth with clanker

around just the whole Lewis Carroll thing, right? And, you know, it's a bit questionable whether or not Alice in Wonderland was truly about that, but Lewis Carroll was a legit hater of imaginary numbers. And I, you know, like, I kinda get like, I can see that in the time. Like, I can see somebody be like, what the fuck? Yeah. I'm not I'm not down with imaginary numbers. I don't know. In fact, I don't even like the framing. I like the framing of like, how do you solve x squared plus one equals zero? Like, I like that framing.

You need some Right.

UnknownRight. There needs to be a thing that answers that question. Now maybe was imaginary a poor choice of words maybe? Was that a poor choice of words? Do you think, and here's something, imaginary seems to be, if in today's day and age, seems to be a poor choice of words, right? Like oh, and we have real and imaginary, is weird. And

part I wonder if I actually wonder if the word imaginary comes from the term image.

UnknownImaginary means I don't know the etymology offhand. Well, in math is like the in math, so you know what a pre image is. So again, like a hash You have a function is like a machine, right? It's a map that takes an input and does something to it and creates an output, right? And that output is called the image. The input would be called the pre image, right, that causes the image, right?

You might call it a domain, right? The output, maybe the domain is like the set of numbers that can be a pre image and the range is like the set of numbers that can be an image, right? But like the image is like the f of x, so if I have a function f, and I input x and I get f of x, f of x is my image. The eye, that's why having the eye be on the y axis, the y axis is where the image is plotted.

Right? The x axis is where the pre image is plotted. And I wonder if imaginary, it just refers to the word image and not meant to be some mystical some mystical explanation that for all time got people to say, well, I don't have to care about that shit. It's imaginary. It's not even real. What the fuck? Right. I don't know. Right.

UnknownMaybe we'll do an imaginary number segment after we get through hash functions. I'm not sure if there's much imaginary numbers though in the applied math of what we're using in cryptography. I'd have to go poke around to see if it's used elsewhere. I don't think so but that the quaternion group I mentioned is definitely isomorphic to a particular finite field. Probably a finite field modulo three is big. There's

no way it's not true. Someone we're gonna get somebody to rage.

UnknownWe can rage, calmly. That's what we do. I mean, it's definitely there's the hip. That field, that the quaternion field is definitely isomorphic to something that we're familiar and that so that doesn't operate with imaginary numbers. It doesn't operate in a complex number system. When you and that's the whole point of isomorphic groups is that sometimes you want to work with one, sometimes you want to work with the other, but they're essentially the same from the perspective of they preserve

the operations, right? So they preserve addition and multiplication in your operations. Or in the case of a group, it preserves the operation. For the leptic curves, it preserves point addition the same way the finite field preserves the modular addition. So what an isomorphism is, is essentially two groups, two things are equal, completely equal, even though they look very different.

But they are equal from the algebraic perspective that they preserve the operation and there's this, they're one to one and onto. So basically every point corresponds to another point, right? Every point in the domain corresponds to a point This in is

Unknownclassic like being a function where you can't have two different inputs. What is it? You can't have with one to one and onto. I'm reaching back now because it's been a couple years. When you have a function you need to have the one function always and the output needs to always have one outcome. That would be one to one and that's one to one. So like

y equals x, right? Sure. F of x equals x is a good example of a function, right? Right. Where every input has a unique output. Right? No but then y equals x squared is a function. F of x equals x squared is a function where that's not necessary. Well, it's true from every input has a unique output, but it's not Every output doesn't have a unique input.

Exactly, right. So it's not onto. Onto is sort of like every point in the range is represented somehow

Unknownby this function. This function covers every single point in the range. And I'm about to bring this back to hash functions. Hash functions are good if they're onto, but the moment they're no longer onto, it breaks because you could have two every x can have a y, but the moment you have two different Ys and you can't understand what X it went back from two because there's multiple because you have a collision, it's no longer onto, which means that it's a requirement for a good hash function. Yes.

And I guess as you're talking, I'm just intuiting that like, it's probably true that hash functions are not one to one because there almost have to be collisions for the inverse not to exist. Definitionally,

Unknownhas to be collisions because if you're collapsing to a 256 bit space for SHA two, there's more than 256 bits of information you could put out into the function. Because if if a hash function, you could take any ultimately, what it actually is, it's any number. Right? What you do is you take a data representation, you make it hexadecimal and base 16, all of a sudden you have a number. So you can make any file, anything a number. You just encode it into a number. And then once you encode it into that number, you compress it through a space that's two to the two fifty six.

Necessarily, if you have more than two fifty six bits of information you could put into the function, which you can, you can put anything into this and you could just take from like a you could just say, I'm going to pick every number between zero and two to the two ten twenty four. The problem is that it's just such a large number. You'd have to wait for the heat death of the universe with the math that we have today to be able to check all of the permutations of that. And also at that point, you're way more effective to just go reverse engineer the elliptic curve than you are to try and map out all of the hash function outputs, right? Like it's just, if you're trying, if you're gonna run this compute for something, you're gonna run it more so

for the private keys than you are for the hashing. But this is also from Bitcoin mining. It's kind of cool when you think about it this way. You take every single Bitcoin block and you convert it into a number. And the Bitcoin block specifically, it's cool, like, as a small tangent, like how Bitcoin block headers are constructed. You put a Merkle root. We probably should do it like we we could do like a a one off episode just talking about Merkle trees. Like you can By do Merkle root the way, have a study guide for Merkle trees. I have a whole study It'll guide for

be a nice introductory way to talk about all the hashing stuff. But in the block header, you put the Merkle root of all the transactions that are in that block in there. So miners don't have to load the miners when they are doing their mining operations. They're not every single time they're turning the hash function, they're not putting the entire block through. They just put the block header in there. But the block header represents all of the transactions within that block. So it's a nice, like, compression for just doing the work to turn to do the guessing for the hash functions. But you're ultimately just taking you're compressing all of the information into a number.

And you then turn it through the hash function, you get out to the other side.

UnknownI always like going to sped school. I always like thinking of Merkle trees and Merkle roots as like finding and being able to find a needle in the haystack because we can track the needle. Right. And then the Merkle proof, you could actually reveal the chain of the Merkle tree to show you have this one bit of data anchored into hash, but then you can provide basically the whole chronology of getting back to the root original data. So back to the hash function.

UnknownCool sort of just a cool distinction that's different between the elliptic curve and the hash function is this goes to the fact that there's no inverse, right? And when I say there's no inverse, it's like it's either the inverse is either nonexistent or non unique. And I'm not well versed enough. I know it's not unique because that means there are collisions necessarily, and so the inverse is not unique. Anyway, how it works, we know about the so with the elliptic curve, we know about the finite field is modulo

prime, correct? Yep. And it has to be modulo prime and that's what ensures this isomorphism. This one to one, this onto, this ability to always go back and forth between spaces, the elliptic curve and the finite field. It's the fact that it's modulo prime is what allows it to do that, right? In a hash function, the modulus is two to the two fifty six. The modulus is, at least for SHA-two 56, it's two to the two fifty six, which we know is not prime.

And so that's part of the design. It's called the Galois field. Galois fields are where the modulus is two to the something, to n. So it's interesting that that's part of the design of how there's no inverse and part of how it's a semi group is the fact that the modulus is not prime, it's two to the two fifty six. Whereas in the finite field for the elliptic curve, it's two to the two fifty six minuteus two to the thirty second minus nine seventy seven. It's

prime it's the prime number Satoshi wanted to make that work. To make elliptic curve math work for us. But in the hash function it's not the case. Finite fields which we haven't really done a lot on when there's not a prime modulus, but it's a little haywire. It doesn't behave quite as nice.

UnknownExactly. Exactly. Yeah. It's kinda And I would in terms of one to one and onto, since we're on the topic, I was gonna offer I was gonna offer the linear algebra. This is like, I'm gonna spoil something for you guys because when this clicked for me, was like seeing the sun and the stars align and one of the most amazing experiences actually of my life. But it's unlikely that you guys are gonna

you're gonna go for that experience. So I'm gonna actually do this. So linear algebra fans. Okay? You guys know you know what linear independence means? I just take it.

UnknownLinear independence being the you're gonna have to you're gonna say So linear independence means remember it, but that they're like in a system that there's no there's no there's no zero like the output is not zero unless all the inputs are zero. Yeah. I mean, I'm cheating. Just like if if no vector in the set can be written as a combination of the others, which is definitionally

like orthogonal.

UnknownYes. And that means that it has a basis. Right? So that's one to one We're gonna go to this is on the docket too. We just need to do like a whole little mini series on linear algebra. I get Yeah, we definitely should. In there. I think that'd be a fun one. That's also LLM, Jason. So like that I should say prior in iteration of this podcast, Motivate the Math with Gary, shout out Gary Krausz. The I saw Gary for like ten minutes at the BPI Summit. Nice, nice. Gotta get us all on and do a full do

Anyway, there was an episode I think called where we talked about basis and standard basis because I was basically saying that Bitcoin is a standard basis for money. And we never had a standard basis. The standard basis, think about in the Cartesian x y plane, right? You have x axis, I. E. Zero, one or zero x, but in an elementary basis, zero, one and the point zero, one,

and then in the y axis, the point one, zero, those form a basis, a standard basis. Like an elementary basis, right? And everything inside that plane is a linear combination of those two things, right? But the only way to get the answer of the linear combination to be zero is if both x and y are zero. And that is the essence of one to one, right? So like if f of x equals f of y equals if f of x equals f of y, then x has to equal y.

That's means, what one to right? So in linear algebra, this idea of linear independence gives you one to one. And then there's another concept in linear algebra called spanning the set. These are the most these are, like, the most fundamental concepts of now if you took linear algebra in college, it was probably misnamed. You probably took a course called matrices, where you learnt the arithmetic of linear algebra, right? Where you learnt how to reduce a matrix,

you learnt how to calculate an eigenvalue, you see what I'm saying? Whereas what I'm talking about, linear algebra is the abstract, it's more of the abstract essence of these ideas of linear independence and spanning the set are abstract concepts. So spanning the set is what we said before, meaning like cover every input, your function covers every output that's possibly in the set. So in other words,

if you have y equals x squared and your output, your range space is all the real numbers, then it doesn't span the set because x squared is only going give you positive numbers. Zero. You're never going get negative numbers out of that set, so it doesn't span the set. If your output is all the positive numbers and zero, then it does span the set. That's what onto means. So onto just means that my inputs cover the entire set.

One to one means that my inputs and outputs are linearly independent. If those two things are both there at the same time, and my function preserves the operation, you have a magical thing called an isomorphism where two things don't look like they're the same at all, right? Like XOR and the finite field modulo two.

These are isomorphisms. These are the same thing. They're just different labels. Two things don't look alike. And why does that matter? Is because one thing might actually possess mathematical properties you can understand and work with and one might not. And so you can actually transport yourself into dealing with something in equivalence that actually gives you power over understanding it. I look, I think looking at an elliptic curve under point addition is much more powerful to understanding cryptography than looking at that finite field.

Right. Okay, right? It's like one of them actually opens your eyes. Now, goes to why we're here. Like why I'm here is because I'm kind of worried that somewhere down the line, someone representing LibSecP or somebody in the industry or somebody out of academia is going to convince us that like the quantum problem, can work in an equivalent space and the question is going to be who are we to argue with them?

Who are we going to be to be able to say yes or no, that that's true. We have to understand the basic things. So what I'm obsessed with is like whether or not I would agree with somebody that two things are equivalent. That's why I studied the fuck algebra. Because I'm obsessed with being able to validate that.

UnknownAbsolutely. No, I think It's that simple. When that time comes, we will be in a full emergency podcast. It'll probably be like twice a week, just like RHR during the pandemic. They did a twice a week podcast. We'll be doing twice a week podcasts looking at like every single thing and just taking everyone through the journey with us and trying to get to our with our own rational reasoning to the other side to help disseminate and distribute the discourse around this stuff. So we're gonna have to do a little linear algebra

along the way. Yes.

UnknownThat's fine. Right? And then if you guys like AI and you want to code your own local LLMs, this will be helpful to you. But it's almost it's very hard to have done what we did skipping through linear algebra. It's very hard to do what we did. So like we will have to cover that Yes. Because just the ethos from my perspective is this obsession of being able to say yay or nay, that two things are equivalent. We're going to be sold, you know, it's not if it was whatever Project 11.

If it's not them, it's gonna be somebody it's gonna be BlackRock or and, you know, you know, we're gonna be asking questions like, did Blockstream guys get bought by these guys? We're gonna be asking those questions, and and we're gonna have to have some way. And like I said, the distance between us and that is quite far. But Yeah. We're gonna have do our That's why we decided to do this today even having no great plan. It's like we just gotta keep grinding our grinding to this distance. So

so linear algebra, some Merkle tree, and then it's a question of, yeah, the hash functions are good because it just I think for for the most part because it illustrates the different it illustrates, like, this isomorphism concept with what we already with what we are with, like, our base case, which is the elliptic curve. It contrasts it.

So it'll help build the muscle. It'll help build our muscle.

UnknownRight? The categorization of it. Absolutely. Yeah. It's good to have like a non example. Like this is not an isomorphism. Right? It's also super important to what we do. Absolutely. And people are gonna say, well we need to change this hash function. We're gonna need to, right? And I don't know, that's some people who need to know what that means. We're gonna change the algo, we're gonna change the hash function, we're gonna change, like that's the language it's gonna come in. Hopefully we'll be here running

that, you know, okay no, there's two primitives, right? There's the signing and then there's the hashing. And they're different.

UnknownThey're very different. And that's why they're the two critical things. They they they meet they have different objectives within the systems. And maybe we'll be able to live with some of the vibeiness of hash functions because like in abstract algebra, we are okay with a lot of information being lost as long as what is retained is the fact that the operation is preserved, right? And the one to oneness and the on tooneness, and this

is what we're pointing out. What's important to determine equivalence is the fact that it's a homomorphism meaning we preserve the operations and we preserve the group properties. So like that, it's okay, that's why it's abstract. It's also we use symbols and not numbers to fuck with the GOYS, okay.

UnknownYou know, it's abstract partially because we're not interested in every bit of information. We're not interested in retain you know, what abstract algebra does is says we don't really care what number system you're on. We don't care about all that one plus one equals two everywhere. We care that in general, the system preserves your algebraic operations. These properties. Yes, preserves these properties. And this is like, I think computer scientists can understand this. Like how do you know, you inherit properties?

How do you know they're preserved? We don't care about the entirety. We care about the mapping, we care about the one to oneness, the ontuness, and whether or not we can really say there's equivalence, and if not, why? So that's all to say is like maybe we shouldn't be too afraid of going through hash functions even if it's a little black boxed. Because if we can at a high level understand

how it fits into the abstract algebra equation that we're sort of putting together,

Unknownit's good enough. It's all these higher level principles are just the things that we need to have comfort and understanding to have integrity in the system. And once you can if you can get those critical pillars understood, even if you don't want to go into the lower level details, you at least can understand the reasoning behind that. That's a pretty good safety net to lean on. And I would just make one other argument is that, so Rob, you're the guy going you happen to be the guy going through libsecpig

with spending a lot of money One of on many, one of a couple. Yeah. Understand one of many, but it would be but like arguably, you don't have the full picture of what they ask for still. Oh, trillions of percent. Because we haven't been through, we just haven't really been through all of it. Be able to really, really ask these pointed questions. Absolutely. That comes from this discussion, right?

Yeah. Agree.

UnknownWe have some great mathematicians Yeah, doing for sure. And there'll be a point probably in the next couple of months where it'll be cool to talk about the little things I did find. Right? Like, and mind you, like, I wouldn't be doing a Bitcoin Magic Internet Math podcast right now if it was all broken. You know what I mean? Like, it's all like, we're good. Oh, right. You forgot to mention that. You forgot to mention that it was all good. Yeah, it was good. That was a very specific strategic thing I did when people are like, it's all Bitcoin and Fugazi.

I started just lipstick P shitposting. You know, I just think about, like, how how fucking great it was. Like, literally Atlas holding up the world. And, it's good. Thank god. It's all good. I know. Oh my god.

UnknownYeah. Alright. Do you wanna call up there? We got you got you got anything else? I I got nothing else, Burden. Like, I think it's good. We got a you know, we got we got we got our reps in today. We we we didn't we didn't skip leg day. We came in and we did we didn't skip set day. We came in and we we did our math. I think this is a good spot. We'll we'll see you again in two weeks. Yes. Alright. Excellent. Magic Internet Math in the books. See you guys. Peace.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. Exponential Got Less Exponential

    Nov 2, 20261 hr 10 minAudio

    In this episode, we picked back up on our red-team tour of Bitcoin cryptography and tried to make sense of the last few weeks of fast-moving math news. We unpacked why the recent excitement around the exponential time...

    Credit the people on this episode

  2. Red Teaming Elliptic Curve Cryptography

    Oct 11, 20261 hr 27 minAudio

    OpenAI just dropped roughly 300 math papers with Lean proofs, mathematicians are crashing out, and the vague-posting has started: "math is breaking, so cryptography is next." Brian and Rob Hamilton refuse to hand-wave....

    Credit the people on this episode

  3. Kayfabe Math is Now Mainstream

    Sep 13, 20261 hr 17 minAudio

    We’re back because math keeps refusing to stay in the classroom. In this episode, I unpack two very different kinds of “math pop culture.” First, we revisit entropy, seed generation, and wallet security through a...

    Credit the people on this episode

  4. Legalize MATH

    Sep 2, 20262 hr 2 minAudio

    Magic Internet Math is back. After the summer that set the Bitcoin world on fire - the Cold Card entropy disaster - Brian and Rob Hamilton (AnchorWatch) reunite for a two-hour deep dive on the event Rob spent three...

    Credit the people on this episode

  5. Quantum Computers Don't Exist w/ Brandon Black

    Jul 19, 20261 hr 24 minAudio

    In this episode, Rob and I sit down with Brandon Black (aka Rearden Code) for a deep dive into the quantum-computing debate around Bitcoin. We unpack why Brandon thinks the more useful framing is not “post-quantum” but...

    Credit the people on this episode