Programming Throwdown - Cryptocurrency
Episode Date: June 30, 2017Today we explain how cryptocurrency works and why it is possible to buy and sell electonic currency. Show notes: http://www.programmingthrowdown.com/2017/06/episode-67-cryptocurrency.html ...★ Support this podcast on Patreon ★
Transcript
Discussion (0)
cryptocurrency take it away patrick i have a not so fun topic well i guess it's interesting but i want to talk a little i was mentioning to jason
uh sort of consumerism this idea that uh i mean it means lots of things but to me just the fact
that you tend to want to buy things which don't last and then you you have to like kind of keep
buying for various reasons and being in the in the tech industry i think this hits a lot that
we keep hearing about the new phones that come out every month every week and it in the in the tech industry i think this hits a lot that we keep hearing about
the new phones that come out every month every week and it seems like all the time and it's
always oh now my phone is outdated i could buy this one that's a little bit better but
if that's your criteria you sort of always have to keep buying new phones and new phones and you
know always upgrading your stuff and and of course you know like we use a lot of our technology
to do our work you know
having a laptop having a computer sort of necessary to doing work so some of that's understandable
but as sort of a um just in general i try to be somewhat frugally minded in order to conserve
the money that i i get for doing my work by not spending all of it um yeah i look at it yeah go ahead the same way i mean i look at money as as uh as as work so it's
like you know is this new phone going to be worth you know x amount of hours of work and like if you
think about it in that way it's often you know like not necessary to get the very latest phone
if you have the second latest yeah so so that's one way i've heard described which actually there's
several apps i know of where you can sort of calculate based on how much you expect to make this year, what your sort of hourly rate is.
If you're paid hourly, it's, of course, easy.
But if you're not paid hourly, you can sort of figure out what your hourly rate is and actually see sort of how many hours of work this is yeah the other part of it is and
and maybe this is i don't know if this is good or bad but i actually use the the hourly rate of my
first job like my first real job and i haven't really changed from that so that way it's like
you know as if i get any raises or anything um that like hopefully i can save that or that that
tends to get eaten up by like family
things that you can't really control.
So, so how much, yeah.
How long you'd have to work to earn this thing?
I mean, I guess I had a pretty low paying first job, so that might be really depressing.
Um, for, for some things I thought, well, I guess, I mean, your first full-time job.
Oh, first full-time job.
Okay.
All right.
Oh yeah.
I don't count like, you know, in high school I, you you know sold popcorn or something yeah i don't really count that okay okay okay
i was gonna say that's gonna be pretty bad um so another way of doing that i've heard someone
describe which this is i guess a slightly nerdy way is if you talked about putting how much money
would you have to put aside as like a sort of, you could talk about like an annuity or an investment.
Like if you say the stock market returns on average 7%
as like a gross simplification of this guy's scheme.
If you say the stock market on average returns 7%,
if you wanted to put enough money away
so that you didn't use the capital for a purchase,
but just the interest,
how big would it need to be
relative to how long you'll use the
item? So if you say, I'm going to buy a car and I expect to drive my car five years, then in a car
costs $10,000, how much money would you have to put away so that you would earn $10,000 over five
years off of that investment? Oh, I see like passive income. Like what would you have to do
to get $10,000 of passive income?
That's right.
So if you put, you know, $100,000 and earn 5% on it,
I'm simplifying the numbers just to make them easier.
Then you're saying that's $5,000 a year.
So if I put $100,000 in an account that earned 5%,
then I could use that money to buy something that costs $5,000 once a year.
That makes sense. And if you could get all of your expenses in passive income, then you don't have to work anymore.
Bingo. That's part of it. Yes. So for people who don't know, passive income means like a
active income is your, is your W-2. Like, you know, in high school I went, I sold popcorn
and at the end of the day I got a paycheck for that work. Sorry, we have foreign people.
They won't know what a W-2 is.
Oh, yeah, yeah.
Sorry.
Like, it means you actively went out and you did a job and you got a salary and your boss
or somebody paid you for that work, right?
Passive income is, I mean, it's really, it's investing, but it's more than that.
Basically, any way where you can put in money
and take out more money without doing any work
beyond just-
Well, it's something that doesn't take your active attention.
So like if you made a website that earned advertising revenue,
you put in, it isn't really earning active income
because you worked on it,
but the amount you make isn't really per se related
to how much work you put into it's
it's sort of earning it passively yeah that's a good point there's a lot of ways to sort of think
about that you see you earn for you could earn for many many years off of some website article
that you wrote um even though you only spent you know a couple hours working on it and if that
ratio is pretty good like if you spent you know a thousand hours working on it and earned only a few pennies over the lifetime, obviously that's still passive income, but it was not a very good return on your investment.
Right. Yeah, that makes sense.
Okay. So that's the second way of looking at is sort of this passive income sort of like investment strategy so that you get all your expenses covered.
So like Jason said, you don't have to actively work anymore that would be awesome but that's also pretty scary because you for expensive things you pretty quickly figure out
you need sort of a large amount of money saved up to afford it yeah um then the other sort of way
that i was just talking to jason about this before the the show is i ran across an article many years
ago unfortunately the the original article hasn't actually been updated because it's become even worse.
But it says it had a list of all of the Apple products
up until that date, their initial price,
and then what would you have in value of Apple stock
if you had bought that many dollars of Apple stock
instead of that item?
So, you know, the example here I found that's updated
is if you bought the first iPod, which came out in 2001.
So for some of you, you'd be like,
oh, that was forever ago, but some of us remember that.
In 2001, if you bought the first iPod,
it cost $400 at the time.
But now if you had bought $400 of Apple stock
at that time instead of the iPod,
you would have had basically $39,000, almost $40,000.
Keep in mind, I mean, it's a bit of survivor bias.
Yes, no, there's a ton of survivor bias.
Like if you had bought the Motorola stock
for the Motorola Zoom instead of the iPod,
then you would have, I don't know,
probably close to nothing.
Well, the one I use is, I used to have this,
I don't even know if the brand's around,
Rio, Rio MP3 player.
Oh yeah, I remember that.
So I bought like this, it used to be pretty popular,
all these Rio MP3 players. If you bought Rio stock, it'd be worthless. But at least you would rio mp3 player oh yeah i remember that i bought like this there used to be pretty popular these rio mp3 players we bought rio stock it'd be worthless but at least you would have had an mp3 player instead it's absolutely survivorship bias totally but yeah just kind of
an interesting but yeah even if you bought like an index or something um you know you would be
you'd probably double your money by now uh depends on when in 2001 for that specific instance.
That's a really good point.
But in general, I mean, this is just saying if you buy the consumerism topic, you know,
you buy an iPod, you buy an iPhone, you buy an iPad, you buy an Android phone and you
use them for only a couple, three years.
And then you might sell them to somebody else and you get a little bit back.
But I mean, they're mostly worthless after that versus if you sort of, you know, save
up that money or invest it, you know, it sort of is continuing to earn
and becomes worth more and more. Um, interesting ways of sort of, I tried to limit because I think,
I think our culture, well, some people say sort of, it's important for our culture to have people
spend a lot of money. That's how the economy grows. But as an individual, it's also very
dangerous because this isn't, this is like some PSA or something, as an individual, it's also very dangerous because this isn't like some PSA or something.
But, you know, it's also very dangerous to spend a lot of money, right?
Spending money you don't have, you know, being forced to have to continue to work for more years than you would like to because you spent instead of saved.
And those things didn't last.
Yeah, exactly.
I mean, I mean, it's there's a bit of a tragedy of the commons, right? Like if if everyone starts becoming frugal, I mean, basically, you know, if you bought stock in Apple, Apple went up. Why did Apple go up? Because people because other people bought iPhones. Yeah. And why did the stock keep going up? Because people kept buying iPhones like like the stock wouldn't have kept going up after 2007 or 2008 if everyone had just stuck with the first iPhone for three or four years.
So it's sort of like, you know, you need people to keep buying things so that you can profit on your investments.
But as an individual, like you don't want to get caught up in it yourself, so to speak. One thing I found kind of interesting is the cost of living across countries.
And even for just bare essentials, the cost varies just enormously.
And I found this thing called the Purchasing Power Parity Index, the PPP.
And it'll show you, you know, for basic, you know, milk and all sorts of other things,
how much those things cost in other countries, right?
And it just kind of boggles my mind, like, why there's such an enormous difference.
Like, why should, you know, milk or water or just simple, like, rice cost just, like, 10 times as much in one country than another um i mean i talked to someone at work
about this and they were saying things like oh you have to ship it or or you have to grow it
and the land is more expensive and the labor is more expensive and and i can kind of see it but
but uh it still kind of boggles my mind like i still um i still don't understand why you couldn't
just ship just a ton of rice from a place where it's cheaper to grow and ship it to the U.S.
And, like, I don't really understand where the 10x comes from.
But does it include things like taxes and tariffs?
I'm sure it does, right?
Because it's what the consumer pays, so it includes everything.
But, yeah, I mean, maybe that's the answer.
I mean, I'm under the impression that there aren't really a lot of tariffs on on food and there's and food isn't
taxed at least i don't think so um like when you go to the grocery store you don't pay taxes at
least well i mean i don't know like in europe like do you pay like the vat tax even on like food and
stuff i don't know yeah i don't know either i know in the u.s you don't
but but either way it's like you know 10 times as much it just doesn't really make any sense
um and uh yeah i just it's one of these things that kind of always boggles my mind because you
know we hear a lot about people saying uh like outsourcing right like like people are gonna do
work in this other country because it's cheaper, right? And, I mean, obviously some of that is maybe there's, like, certain luxuries that people have in one country and not another.
But even just the basic staples of, like, just the basic food and things like that are just massively different across countries so somebody could potentially have like a more luxurious life with far less
income in another country uh uh than they can in one country than they can in another
and it just that part doesn't really make sense to me it seems like there need there would be some
kind of arbitrage there well but for some stuff like food there's probably also regulation about
testing and quality control and stuff.
Right.
So like you brought.
Well, milk has like perishable problems.
But if you took something like rice, like it might be that the rice you find in one of these things, that's one tenth of what it is in another place.
The quality control.
Now, you may argue that it doesn't matter. Like you don't actually end up with a better product.
But it might be that there are certain certificates required and testing to be
done and all of that things adds costs.
And that prevents someone from easily sort of taking the cheap rice in country
a and just bringing it to country B because country B has essentially
deliberately made that not possible in some way,
or else somebody would arbitrage it,
right?
Somebody would,
if the transport costs and all
that stuff lined up would take stuff from place a and sell in place b yeah that makes sense yeah
it must be like regulation also there are things that i don't know if they even can be so for
example um i have a lot of family in europe and they'll go to different countries for medical
procedures right but in america that that doesn't happen like like
if you need you know some kind of surgery you're not going to go shopping around at different
countries and the reason why is because it's like so heavily regulated like you basically need to
have you know your insurance subsidize your health care and they're not going to subsidize a procedure
in another country and so so in this
way it's kind of regulated i mean the legal system is also in the same way regulated right like
there's and it's not it's not a malicious thing it's just the nature of it like there's a set of
u.s laws that's different and so you can't just go to another country you can't outsource your like
legal department um and so maybe these things just add like cause like the fact that you can't outsource your like legal department um and so maybe these things just add
like cause like the fact that you can't really outsource legal and medical stuff
that that cost percolates into everything else like even if you run a rice farm or even if you're
a rice importer if someone in your ship gets sick or something you have to pay like an extraordinary
fee or something all right well is it time for the news?
Food for thought.
I found this stuff interesting.
I don't have any good answers.
My news is way less high concept.
It's basically, I won't go into a whole bunch of detail.
There's this thing called a Mandelbrot set.
It's a recursive equation.
And because it's a recursive equation you can plot this equation and and it's
a generative equation which means it's it's like the Fibonacci sequence right it builds on itself
and somebody just kept building it and building it and calling it and calling it many times
and they zoomed into the Mandelbrot set by a factor of 2 to the 760th power.
That is a lot of zoom.
And you can literally watch for, I think it's 10 minutes,
of just you entering this Mandelbrot set and just this vortex of different patterns.
And I think it's kind of cool.
Yeah, if you've never seen fractals in the Mandelbrot julius julia set stuff like that before
like it's a rabbit hole to go down i guess um but it is pretty interesting that the sort of
crime scene zoom in on this image and enhance you really can't do here because it's all
mathematically defined so you just keep running the equation for sort of arbitrary levels of, I guess, precision.
And then you can just keep going further and further and further, smaller and smaller things.
If you sort of try to do one of these naively, you run into a lot of problems with arithmetic, like stability, because you start getting into really tiny numbers. So you have to be very careful in how you represent them.
Yeah, exactly.
Yeah, you have to do this sort of shift where all your numbers are like, you know, E to the negative 200.
But you're not even storing that anymore. You're just kind of storing all the numbers relative to each other.
And yeah, I can only guess at how to do that.
But it's super interesting.
It's kind of fun to watch.
Wow, this video really does just go on.
And I'm watching it now i'm so distracted it's like legit it's 10 minutes of just diving into a fractal i've
seen ones where they sort of move move it around but in this one they're not even moving it around
they're zooming in on exactly the same like there's no translation it's just straight zoom
yeah it's wild oh interesting okay i'm gonna stop this all right 10 minutes later
i'm gonna be here for 13 minutes so we did a previous episode just recently on code reviews
and there was a post recently on google's testing blog which uh says it came from their testing on
the toilet episode um that they had to sum up code health and
talking about steps that you can do before you send out a code review. So we talked about a lot
of how code review should be done, why it should be there. And only part of it is actually to kind
of, I saw some other sort of discussions where online after that episode where people were
talking about, you know, does code review really improve your code? But I think actually improving your code is only one small aspect of what a code
review is for. You know, yes, it's good to try to catch bugs, but that's not really, I don't want
to say it's not the main purpose, but it is really not the only purpose. Almost, I would say, I'd have
to think about it for a while. but close in importance is also the fact
that you're getting someone else familiar with what you're doing. Uh, you know, having a second
opinion, uh, just engaging with other people on your team, right. And sharing what everyone's up
to and what they're working on. Um, and, and also allowing for easy sort of learning and mentorship
between, between people. Um, all of those are useful purposes. But here, you know, the Google blog was talking about
that the best reviews are probably the ones
where you don't get a lot of feedback
or you don't have to, you know, iterate through many times.
And so I had a bunch of tips about things to do
before you start and then things to do
when you're sort of addressing comments
to prevent things from spiraling out of control.
And I thought it was pretty good.
I'm not gonna read all of them because they'd be kind of boring.
You can just go read the blog post yourself.
But a couple of them don't make it great.
Yeah, don't make them too big.
And then the ones that, you know, everyone probably says they should do, but doesn't
always do, which is I tried to do sort of upload if your tool supports it, upload the
review and go through it yourself first and make sure you didn't miss any obvious things like leaving in test code or, um, you know, having a file where you were changing
some stuff and decided to do something different and you forgot to revert it. Uh, you know,
that kind of stuff. Yeah. For people who don't know, testing on the toilet is this thing that,
um, I think, I mean, I'm sure other companies do it, but I first heard about it at Google, from Google.
And basically, apparently in their bathrooms,
they have instructions on how to be a better software engineer.
So while you're sitting in the restroom, you can look at it.
Giving you tips. Okay, interesting.
Yeah. Reviewing tips.
Yeah. Okay, so my my news is uh second news
is 3d bin packing for 3d printer mass production so the idea is um let's say you uh have a 3d
printer you want to make a bunch of little trinkets maybe you want to make a bunch of cool
uh toys for all of your cousins um but you want to do it in one print job. You want to set it,
you want to do something else, come back in 12 hours and have it be done with 10 of them instead
of having to print one, take it off the machine, print another one. So this person did 3D bin
packing and kind of explored that and ways to do that efficiently, right? And so for people
who don't know, bin packing is where you have a certain space. So imagine like 2D bin packing.
So you have a square and then you have a bunch of things that are a bunch of polygons and you need
to fit as many of these polygons as possible into the square.
And there's different goals.
Some might be the number of polygons.
It might be you want the total area to be consumed as much as possible.
And so that's the bin packing problem.
And there's no, like, it's an NP complete problem, which means that there isn't a way to just do this fast right like like the only
way to do it uh to make sure you got the best answer um guaranteed is to literally try like
every possible arrangement right um you know that is pretty extreme it's gonna take a long time it's
never gonna finish so there's all sorts of bin packing algorithms that give you, you know, you know, approximately the best solution,
as long as it's not some degenerate case. But there's no guarantee. But they run very fast.
So one is simulated annealing. Simulated annealing is very simple. You start off by
just randomly putting things in the box. And then you start swapping. You start off by just randomly putting things in the box and then you start swapping.
You say, okay, take this piece out and see what I can put in its place. And if it's better,
then do it. Like if you could take a piece out and put two in, then just do it, right?
But if you could take a piece out and you can't put anything in its place,
then sometimes do that anyways. Then they call this the temperature term.
So sometimes you change the solution and you make it worse. And with some probability,
you're going to take that worse solution. And the idea there is maybe it'll lead to anything
better solution. And so over time, you're constantly taking things out, putting things
back in. And as you do this, you're lowering taking things out, putting things back in.
And as you do this, you're lowering the temperature to the point where the temperature is zero and you're only making a swap if it's better.
That's called simulated annealing.
And this person implemented it in 3D.
And it's kind of cool. You can actually see it figure out different ways to arrange objects objects so that he can print you know eight of
them on it on one 3d print so yeah check it out it's pretty cool the problem with all that is my
3d printer isn't reliable enough that if i tried to do that it would likely mess up you know a
third of the way through and just ruin the rest of it oh no gotta get a new 3d printer oh that's always the solution we talked about this
that's consumer um oh that's true well yours is yours is broken so i think you're okay so um my
second uh article is a series of programming observations i know it's not great but i the
one i saw was was pretty good because specifically about the nature of our podcast I thought was applicable.
And apparently I'm in a very advice-giving mode today.
First I talked about testing tips and about consumerism and anyways, whatever.
It's a thing today. a quote from this webpage that every five minutes you spend writing code in a new language is more useful than five hours of reading blog posts about how
great that language is.
Okay.
That's fair.
So I saw this on Reddit.
Someone had posted this and I went to this page that,
uh,
also lists a bunch of these other things like the likelihood of Pearl being
involved in a system is directly proportional to the length of time the
system has been in maintenance.
Nice. Uh, and it was, they just have a you know like probably like 10 of these things i guess this is a little probably from a little while ago but uh i hear a saying uh links to the way
back machine 2007 but uh most of these are still applicable think twice before presuming that csv
is a nice little easy file format to use yeah that's true yeah so for people don't know like if you have a comma a quote go ahead oh i
was gonna say if you have a quote inside of a quote so so you know you use quotes in a csv
when you have let's say commas in the field and so you want to quote the whole field that way the
commas don't mess up the rest of the file right but what happens if you have a quote inside of the quoted string it turns out
you have to actually i think it's double quoted and so if if the csv you know parser sees two
quotes it interprets as a literal quote and uh that is just a very bad design decision. It turns into a total nightmare.
Yeah.
Time for book of the show.
Book of the show.
My book of the show is the first book I bought on Audible.
Now that I've been using Audible on my shuttle ride.
So it's called The Circle.
It was pretty good.
So I felt as if i have kind of a
mixed review um on one hand it started out amazing um the the basic premise of the book without
spoiling anything is uh um this lady joins this company and and the company is very progressive
and uh um they have all sorts of cool perks there's like a strong company culture
there's like a you know badminton team a basketball team there's all these different
organizations and it feels kind of like joining a college campus or something there's just so
much to do there's a lot of friendly people there's all sorts of different activities free food all stuff um and uh and and basically what she finds is that it's sort of uh taking over her life
and when she tries to pull back a bit um it things kind of go south and basically uh
it's an interesting book um the thing is i feel as if the writer kind of ran out of steam.
This is, I think, Dave Eggers.
And I think he ran out of steam kind of halfway through the book because it actually like I was really surprised because I had gone halfway through the book.
And then all of a sudden there was like a sex scene like described in the book.
And it was just really like it didn't really fit at all.
And then it just seemed like I don't know if like that just put a bad taste in my mouth.
It seemed like after that, the book just turned into like a romance novel. Like it's just everything was about boyfriends and stuff like that.
And the whole like thing about this company taking over this person's life was just kind of like it was still there.
But it's almost like there's all this extra filler um so you know it's a little bit of slog to get through um to get to the ending
um but uh it's a great story the overall plot is great um and i skipped like a couple of sections
uh and with that i i would definitely read it again or i would you know advertise other people
to read it but get ready for you know a little. But get ready for a little bit of mud to have to slog through.
But overall, it was a good book.
Yeah, I thought I was the only one who made these sort of like caveated recommendations.
I mean, well, the thing is like it's sort of like if you give any type of review,
you know, not everything is going to get five stars
or one star but I would say this is like a three or four star yeah that's fair it's fair so mine
is a book that I had actually tried to listen to before read before um and didn't make it through
like started it just kind of gave up so I went back because i've had so many people sort of like online recommend
this to me then at work actually somebody was telling me that they just think this thing's
amazing this book was amazing and then actually someone else who i didn't even know was into sort
of science fiction was chipping in that oh yeah this is a really good book um and it's always
interesting with co-workers you know like you know how people are but you don't necessarily know what their tastes and in books are or whether like sort of compatible with you like you have to
sort of calibrate against people um which sounds really weird i don't mean that anything like weird
i just mean that no i mean so people are into different types of movies yeah and some books
are like very popular and it's actually really hard and i know that netflix talked about this
in one of a blog post
i read from there's whoever knows how long ago but that like if you watch a popular movie like
the lord of the rings um that doesn't mean they can start recommending to you like another fantasy
movie because the lord of the rings was sort of like almost like a pop culture phenomenon
yeah it was like had mass appeal but that doesn't mean that you're likely like, what do they recommend to you?
They could recommend to other blockbusters.
But and they will probably recommend to you some probability of other fantasy movies.
But it's probably not a strong recommendation.
Yeah, it's kind of like saying, you know, if someone says they like the Beatles, you don't start recommending a bunch of indie music.
Yeah, yeah.
I don't I don't know that much about the beatles but i'll just i'll just say
yes are kind of like michael jordan or something where everyone just likes the beetle oh okay okay
yeah you can't learn much anyways so i don't think this is a super super popular book but it did win
the hugo all right cut to the chase this is the three body problem um by a chinese author who i
won't i won't uh attempt to pronounce the name because i'm terrible at such
things um but the apparently this is a like the best-selling or at least one of the best-selling
authors in china that it's a very very popular person there and this is not in chinese it's been
translated um and the translation was really good other than the fact that um you know the sort of
names are preserved as best i can tell and in sort of the english version of the chinese name um okay what i mean there is that it isn't that they gave
them like alan and bob like they use the original chinese name oh got it and it's and it's large but
it's written in english letters what is that called transcription transliteration that's
something like that something like that yeah that's what you're saying um and it did it was a good read because i felt like it was sort of inherently different than most of the
other science fiction i read which takes a sort of western view of things and so you sort of fall
into even if it's different authors with their own unique ideas you sort of fall into these common
tropes and common ways of acting and interacting with people. And so it was very nice to see something presented from a sort of different,
it felt almost kind of a,
it sounds bad,
like a foreign view,
something that isn't what I'm used to reading or what I'm used to experiencing.
And it was nice to read a book that way,
but it was still science fiction.
It still had some of those same themes,
but they were presented in sort of a fresh way.
And so I thought that was an
interesting read but i won't say that it was my like most favorite read ever um but it was
definitely and apparently there's i didn't so some people who i talked to didn't actually know
there was more books to this but apparently it's a trilogy and this is the first book of a trilogy
um and so i sort of expressed to to one of my co-workers who had read all of the trilogy
like yeah you know i wasn't super enthused overall about it uh and he sort of said but this is kind
of only the opening gambit that like the real meat of the story takes place in uh second and third
books which i always find to be interesting for things which are trilogies which is they really
do need to hook you in or you're not going to read the second book and so like what do you do after you read the first book do you say well i'm going to give it
a fair shake and read the second and third books am i going to give it a fair shake and only read
the second book because then it's sort of unfortunate not to read the third you know
like what do you do like i i probably wouldn't have actually i wouldn't have gone ahead and
tried again reading it if i had known it was going to be a trilogy that sounds terrible because now i'm in this awkward position yeah i see i mean it sounds
like yeah i mean it's really you really have to trust that person who told you to read the second
one you know but they really recommended the first book but they recommended it in light of the whole
trilogy but i didn't know i was signing up for a full trilogy commitment but they didn't tell me
that it was only because,
you know,
your memory is sort of skewed.
Like you remember the first book in light of what you learned in the second
and third books.
Yeah.
You know,
it's like when you rewatch the matrix movie,
oh,
this is a dated reference.
It's not the same as the first time you watch it.
Yeah.
Because yeah,
you kind of have the whole context of a mental model of what's the.
Yeah.
So, okay. That was a sort of a side tangent, but the three body problem it you know it was definitely a fresh day it was something that was different for me um and i enjoyed the experience of you
know trying something a little different to new i don't give it it's my my highest marks but i do i
do think it was a good book cool that makes sense and you can read you can read both these mediocre books oh man well you know the
thing is we uh uh you know we always report the the books that we actually read i mean i actually
saw recently a book that i thought was pretty cool um but i felt like i'm not gonna mention it
because i haven't read it yet and uh um you know one thing that we try and do is is we try to read
every single book that we recommend.
And we're sort of doing that on Audible.
So if you want to check out Audible, you can go to audibletrial.com slash programmingthrowdown.
If you don't want to go on Audible, you can still support the show by going to patreon.com slash programmingthrowdown.
And we have links in the show notes and we definitely
appreciate um all of you for checking out audible and supporting us on pet on patreon and you can
check out some of the other show notes for books we actually recommended maybe make those your first
try yeah exactly um so my tool of the show is um as everyone knows i got a 3d printer
and i've been super, super excited about
that. I've been printing just unbelievable amounts of stuff. A lot of it is just cluttering, you know,
our whole house. But some of it, the things that really went over the best were these screw puzzles.
So for people who don't know, a screw puzzle is basically um if you remember these
were really popular back in the day i don't know if they're still popular but remember that puzzle
where there are the horseshoes and the horseshoes have chain link connecting oh yeah yeah horseshoes
to each other yeah and there's a ring in like going around the chain like a metal ring and the
ring you know can't fit over each of either of the
horseshoes to get out but if you bend the the horseshoes and the chain link in a certain way
then you can actually you know create a surface that's narrow enough for the for the for the um
for the ring to escape and so screw puzzles are basically that they're ways for you to sort of
turn objects in a
way where you can either separate them or put them together. I mean, they're both effectively the
inverse of each other. So they're both interesting. And so there's actually a Thingiverse blueprint
for printing, I think, five screw puzzles. And they have different levels of difficulty.
So the easiest is it's basically
looks like a bagel but it's been cut in a certain way where you have to just screw the two pieces
together to to you get these two pieces are just very oddly shaped and if you just kind of try to
put them together like two halves of a bagel like it's just not going to look right but if you kind
of screw them into each other and you can actually create a bagel like it looks just not gonna look right but if you kind of screw them into each other and you
can actually create a bagel like it looks like a torus right um and they have a bunch like that
they're super super fun the only thing uh um uh you know you have to sand it down um i actually
cut my finger on one of them oh no yeah i know i mean not badly i mean it didn't even break the
skin but it kind of like stings and it's right on my fingertip so it them oh no yeah i know i mean not badly i mean it didn't even break the skin but
it kind of like stings and it's right on my fingertip so it like stings when i type
cutting edge of science that's right uh this is super super entertaining especially after i
sanded them down i was able to like you know give them to my family and let them try it out and
stuff um so yeah if you have a if you have a 3d printer or I think on Thingiverse you can actually
outsource it
to someone
with a lower purchasing parity
index or whatever
you can through Thingiverse
you can pay a certain fee
and they'll actually print it for you
or they'll figure out a way to print it for you
and send it to you
so either way if you have your own printer or if you want to just go on there and pay someone to print it,
I found them super fun.
And I'm going to definitely get more of them.
My tool to show, as usual, is,
although you did just present a, like, printed object,
but mine is weird.
So mine is Inbox from Gmail.
And I, you know, I know everybody knows about this,
but I just wanted to, I guess,
maybe rant a little bit for a second.
But I still, I feel spoiled by how nice,
I really resonate with the Inbox way of doing things.
I don't know what it is.
It works for me.
It makes sense to me.
I've also used the Gmail with tabs.
And I, you know.
That's the mail.google.com, right?
Yeah, I don't know.
My mail.google.com, I think, redirects to Inbox now. But, you know that's uh the mail.google.com right yeah i don't know my mail.google.com
i think redirects to inbox now but oh okay um you know i i really do like inbox i like the fact that
i can sort of do the there used to be a another project uh called boomerang that you could use
to do this in gmail but now inbox does it directly where you can sort of send an email message to go
sort of archive itself and then come back to you in a certain amount of time. Um, I use it all the time for like, you know, Hey, I need this to come back,
but not right now. So like, you know, get an email from, this is not true, but like, Oh,
my credit card is due at the end of the month. Well, I don't want to know about it at the
beginning of the month. So, you know, it's come back to me you know a two days before you're due um and then i can go online and pay this bill yeah whatever but i you know a couple
things one is like people who are still using the old school gmail it's just like oh man no i feel
like the inbox is so much nicer and the other thing is well i i know people like the way things
are because they're the way things are but it's really frustrating for me to use other,
like my work mail is just like,
ah,
I so much wish this would be more like inbox or,
you know,
whatever.
Like it just feels so stuck in a dated way of doing things.
Um,
my only gripe with inbox is that they haven't implemented filters yet.
So I actually have to go to regular.
I do.
I will say I do do that.
That's true. Man, you you're making me i'm like now i have to give a mediocre recommendation
for my 12th month too four star one star just got knocked off it's like okay so i do balance
and back off so i really do like the idea this is i'm not a show for google in some way they
don't pay me for this google.com is amazing but i do like the fact that you it's it's like
it's not like api compatible isn't the right word,
but the paradigm in inbox is perfectly compatible
with regular Gmail.
Like you can send messages to be snoozed in inbox
and then switch over to normal Gmail
and it'll still work fine.
Then in Gmail, you can set up all your filters,
switch over to inbox and it'll work fine.
Yeah, it's amazing. And it's sort of annoying that like all the features aren't available in Gmail, you can set up all your filters, switch over to inbox, and it'll work fine. Yeah, it's amazing.
And it's sort of annoying that, like, all the features aren't available in both.
But, like, it works.
It's like two views into the same data set.
It's really nice.
Yeah, totally.
Yeah, I think it's amazing.
It's, like, it's so powerful that everything else just feels like it's in the stone age like if you're using outlook
if you're using yes 10 male if you're using any any of these even thunderbird any of these things
it feels like you're living in the stone age because it's more than just the male client and
i know like you know there's a lot of concerns about google i i'm not dismissing those those
concerns are very legitimate about you know sort of honoring privacy and sure
what data they have yeah i i i'm sensitive to those as well but you know i i guess in this
thing it's just so good it's compelling um yeah and and that's sort of scary yeah i know i got it
but um the fact that when i you know my wife and i are looking at booking a trip and you know so
we made some reservations for,
you know, an airline and it sort of bundles those up together and creates, oh, you have a trip to this location. And then when we book our hotel, I know it'll bundle it into the same thing.
And so then when I go, oh, I don't have to keep those things sort of in my active inbox. Oh gosh,
like in the active display, I can send them away because I know I can go back to my trips and
sorted by location and by date.
I can just sort of click and it just has everything automatically organized without me having to do any work.
Yeah, it's unbelievable.
It's really nice.
So it's like that added intelligence that they're down on, say, AI, because I think that's overused.
But the sort of intelligence they're doing to sort of bundle up things in a in a smart way is is very
nice i'm surprised that nobody has come out with a like pure desktop version of this where it still
just uses imap or whatever but but once you get the email they do all sorts of this clever stuff
it seems like it should be like i don't i i can't think of any obvious reason off the bat why other than you know like making it monetized like i can't figure out any reason why it wouldn't be
possible yeah i feel the same way i mean one thing is the imap protocol is you know just not designed
you know it's just not a modern protocol but but you could do this with like putting stuff in
folders and then having like a special format for how to name the folders that your client like in the same way.
Like you put them in a folder, but those folders have a special naming scheme that your application understands.
Yeah, I think the issue is you either have to go all out.
And by go all out, I mean you have to make an iPhone app, an Android app, a desktop.
You have to do everything. Or you have to like
finagle everything into the IMAP protocol in a way where it doesn't look like garbage. It's not
horrible to use. Yeah, I think that's the sort of probably the reason why it hasn't been done.
But I mean, it's it's someone should try to figure it out. I mean, for the rest of our sakes.
Yeah. And I guess it is like, I don't know't know how like i say that i really want it but then since i already have it for free
like how much would i be willing to pay for you know like i don't know yeah that's true i mean
other than at work um you know yeah you're only you'd only be targeting enterprise but then there's
a lot of restrictions about that kind of stuff about where yeah it's a whole but anyways that's
true if you're not this is just like sort of my opportunity to like gush a little bit about how much i've realized i really
do enjoy inbox like there's a lot of weird stuff initially but it's really just kept getting better
and better and everything else just feels so bad to me yeah comparison yeah i agree i feel the same
way so at first i was i thought it was awkward that you don't actually delete emails but i've
gotten used to that.
Yeah, and there's been times where I'm happy I didn't delete emails.
Yeah, that's true too.
Someone's going to write in and tell us to just use text-based email, but yeah, it's okay.
That's right.
Use Pine.
So, all right.
Time for cryptocurrency.
All right, let's do it so i guess cryptocurrency is just the catch-all term for the the kind of new digital online currency that's backed by sort of cryptographic notions
but i guess it's not a completely accurate description but we'll go with it i think it's
a pretty commonly used one yeah i think it's it's the namesake um and and so the most common one the
grandfather of them all the father of them, the root of the family tree was Bitcoin.
There were previous digital currencies before that, you know, some famous, some infamous.
But using this sort of the important thing here and what we're going to talk about in all these cryptocurrencies is the distributed distributed notion the notion that it isn't held
by a central source um so if you took things like i mean yeah i mean like you could get credits like
i don't macy's gift card an e-gift card or an itunes gift card but even like paypal and previously
there was this like e-gold or whatever like you know i think on all of those cases i mean i'm not
that familiar with equal but like you know they were held by a sort of central authority who you like Jason saying you pay dollars and they give you a quote unquote gift card, which is some ledger that they keep that says, you know, this thing, this dollar value was converted to this IOU.
But if Macy's sort of goes away,
the IOU is worthless.
That's right.
And so that's not true for cryptocurrency.
They try to handle that in a different way.
And you'll hear that at the distributed ledger.
We'll talk more about it in a few minutes.
But Bitcoin was sort of the, I guess,
first one to get a lot of mainstream adoption.
We've talked about it over the years.
That sounds weird to say.
But over the years, we've talked about it um on
programming throwdown several times and in several different contexts and um yeah and you know how
much of it we bought zero no i have i have 0.05 of a bitcoin that someone gave me that's right
six years ago uh when i was like i created a wallet i was like i'm gonna try to mine a bitcoin
um and you know never managed to actually
mine a bitcoin on my laptop cpu um yeah and even at that time i don't know if it was even possible
but there was somebody who had a website where if you gave them your id they would uh send you
you know what at the time was i think i'd have to go look up i think it was like a penny
or a few cents um well today that's worth like 136
dollars so somewhat internet stranger thank you i don't know who you were but you gave me what is
now worth 136 dollars which is amazing i haven't even uh not an even but i have a maybe opposing
sad story which is um on my lab pc at university i set it it to mine a Bitcoin and I left it running for, I think,
like almost the whole winter break. But then I, by the time I came back, I'd already forgotten
about it. And I don't know if I even mined a Bitcoin or not. Maybe I mined 10 and I just
exited the process and I have no idea what i did oh i know right uh so bitcoin was
you know actually solves a sort of well-known set of problems that that didn't have good solutions
about how to do this consensus this distributed ledger stuff and it was written by a guy who's
uh not his real name and no one actually
to this day even as far as i know the public doesn't know who this this person is satoshi
i don't know that's how you say it but um and this person created they published a paper they
started doing this they actually mined you know a bunch of the first bitcoin and they sort of uh
for a while were stewarding the kind of rollout of Bitcoin and how things are working.
And then they sort of kind of went off the radar like they stopped doing anything.
Now, maybe they just changed their their handle, their username, and they still are active in the community, but not under the, you know, not acting as the founder and creator of Bitcoin.
But interestingly, like with Bitcoin's recent run-up which we'll talk about you know
why these have dollar values make sense or not later um but with the current value i mean the
the amount of bitcoin which is associated with satoshi is very i haven't looked at it recently
but i mean it's it's an astronomical sum of money that he's he has under his possession but as far
as people know they've never he's never actually exchanged any of those in for anything he's never transacted acted on the bitcoins that he has yeah that's
right isn't that wild that there's somebody who owns i don't know what percent but it's
significant of bitcoin and basically at any moment he could start selling um but yeah nothing has
happened yet which gets an interesting thing like i guess at some point he would uh if he started selling like maybe the price would go down if it was significant but i bet oh i was
gonna say i bet there's a bunch of people monitoring and if they see his wallet id they
immediately sell everything so someone's saying that they've estimated it like that because it's
not for certain for certain but about a million bitcoin wow which
at today's prices would be is two billion dollars yeah that's crazy uh assuming assuming that he
could actually liquidate all of it without causing the market to go down right right so let's talk
about let's talk about that without causing the value to go down so actually do you want to talk
about mining first and then well sure so briefly i
want to talk about so we're going to talk at a high level about you know a lot of this sort of
uh interchangeably but quickly i just want to talk about also so another one the other big one
besides bitcoin as far as market cap goes there's other things like dogecoin and litecoin and all
but the other big one by market cap is ethereum. And we won't talk a lot about it here,
but Ethereum has some interesting properties that are slightly different than Bitcoin and that you
can sort of run automated scripts as part of the system, as part of the blockchain that it uses.
And one of the most interesting experiments to me is this creation of the DAO, the Distributed Autonomous Organization, which was a series of scripts that allowed investors to sort of steal a ton of money from this DAO,
this autonomous organization that people were voting in that was this corporation,
steal many millions of dollars and hold the Bitcoin or hold the Ethereum sort of not hostage,
but hold it until they were going to presumably spend it.
And instead, the whole Ethereum community basically decided to make a fork of
the software to reach a consensus that basically those transactions were as if they never happened
so the dow was never created the guy never stole it everyone just got their money back as if nothing
happened um which is sort of crazy that is unbelievable yeah so so mining bitcoin or just you know sort of mining
cryptocurrency is the notion of sort of doing some some work on your computer um some people talk
about it's like searching for a prime number where you don't really know where a prime number is going
to occur next they are oh i'm gonna mess this up because it has strong statements in number theory but i
always um forget exactly what it's but the just the distribution of primes is sort of like
statistically known but you it's ran to the interspacing is random you never know how
close or far you are to the next prime yep that's right um oh good i did it yay and so to sort of
find a prime there's no good pattern.
You should obviously sort of skip the even numbers.
But aside from that, there's no real pattern.
You kind of have to check every number along the way and see if it factors or not.
And similarly, when you're mining Bitcoin, what's happening is a new Bitcoin is,
and we'll just use Bitcoin in this example,
a new Bitcoin is being created and the person who successfully mines it gets to own that Bitcoin.
And the Bitcoin itself is equivalent to trying to find a number which combined with a bunch of transactions that have happened in Bitcoin and some hashing and cryptographic signing but basically finding an
input that you modify finding a value that makes the results match a certain pattern and when it
matches that pattern that you reach a hash of a certain you know description then you've sort of
mined the bitcoin and so everybody is sort of working to try to mine the next Bitcoin block.
And whoever finds it first, because it's sort of random, you're just randomly trying numbers.
And whoever finds it first sort of gets that Bitcoin. And so it's like this big race to find
it out. And this all gets really confusing. So we'll have a link to a little tutorial like video
and description interactive, not of the full bitcoin protocol which
is quite in depth but of notionally how all of this works at sort of a simple level um right and
you can check that out at anders.com slash blockchain uh this was really helpful to me and
the first time i kind of really understood a lot of this was sort of going through this and
understanding ah this is how this works yeah i mean a lot of it comes down to what we talked about in our cryptography episode,
which is like these non-reversible mathematical operators, right?
Like, for example, let's say I told you, you know, what's 2 plus 2?
Or let's say, let's get down to the reason, what's 1 plus 3?
You'd say 4. It's very easy, right? Let's assume for a moment that there wasn't subtraction, like addition
was somehow not reversible. And I just gave you four and you had to give me the one and the three.
That's hard, right? Because it could be zero plus four. It could be four plus zero. It could be two
plus two. It could be three plus one. It could be one plus three. Or, you know, if you get a negative numbers, let's forget about negative numbers for now. But there's all these
different possibilities. And there's no way to know, like, if I'm holding the one and the three,
and I'm asking you, you know, hey, I have two numbers added up to four, what are they?
Or even if I give you one, if I say, here's a one, give me the number that, you know,
that plus one is equal to four. And again, let's assume there's no subtraction we're in a universe without subtraction, there's nothing you really do, you just have to try
all the numbers, is 1 plus 1 4, is 1 plus 2 4
is 1 plus 3 4, okay, now obviously there's subtraction
you just invert the addition, right
but there are some operators you cannot invert.
And so that's basically somebody gives you, you know, one, they give you two of the three parts.
They say, like, X, and then it's operator, and then Y is equal to this new number, Z.
But you don't know what Y is, and you have to kind of figure it out.
And there's no good way to do it other than just trying a bunch of numbers there's heuristics and things like that but there's
nothing like guaranteed um so so yeah you have to do a lot of work to to get a bitcoin right so you
have to solve this mathematical problem that's again it's easy to create but if you're not the
creator it's hard to solve um and so that's a cost. Like your
computer's gonna have to spend some energy to do that. And you're gonna have to spend some time.
The maintainer of that computer is gonna have to spend at least a little bit of time to do that.
And that means that that has value. So if you talk about, you know, what gives something value,
it's basically three things. The first is the
amount of labor. Like for example, uh, you know, diamonds are very hard to get. Like I can't just,
you know, go outside in the backyard and scoop up some diamonds. And so because of that,
there's going to be an intrinsic value there. Like even if diamonds were like smelly and looked ugly, you know, as long as
somebody needed a diamond for something and it's very hard to get, then that person's going to
spend a lot of money on it. Think of like a moon rock, like a moon rock is so hard to get. And so
even though it pretty much just looks like a regular rock, it's very valuable, right?
The next is sort of psychological value. Like a diamond is going
to be worth more than, say, an emerald. And it's really just because of, you know, humanity. Like
we've sort of decided on that, right? There are some things like an iPhone has a very large
profit margin, which means they could make it cheaper and still make money, but they don't
because they figure out that enough people are going to buy it at the high price. And that's
psychological, right? Another one is the historical trend. So, you know, if an iPhone is going for
sale for, let's say, $500, even if something kind of drastic happens, unless there is kind of like a widespread
panic, something that's public that really gets out there, things tend to just be worth what
they're worth. Like there are things that kind of tend to just hold their value to some degree,
or they depreciate, but it's kind of a known quantity. And the depreciation factor, there's some inertia there.
And so those three things pretty much describe why anything costs what it does.
It's some composition of those three factors, right?
And so Bitcoin has all three of them.
There is a certain amount of labor to get a Bitcoin.
The psychological value is is
you know it's been around for a long enough time and enough people have kind of agreed and enough
people have turned it into money and invite and back into bitcoin that that people are sort of
mentally they're comfortable with it and it has a trend like it has some upward trajectory it
didn't just you know become super valuable overnight and if bitcoin all of a sudden was worth you know a cent
and then it jumped back to its original price that would have a big impact like it would probably
never recover because because the trend is very important well so the um oh go ahead yeah the
value of bitcoin has shot up like you know because
of a lot of speculation people basically buying because they think it's going to go up because
it has gone up um yeah well that's true i guess i guess uh yeah by the historical trend i mean
like uh over the course of let's say a day or an hour or something like that. Okay. Like if you knew that you could get a Bitcoin for half the price tomorrow,
or even if you knew that there was just enormous volatility,
then you probably wouldn't buy one.
Unless you were like, at that point, it's basically gambling.
And gambling is kind of like a different sort of system, right?
Yeah.
And you didn't sort of mention, but I mean, there's also the notion here of the like use of a thing so like some stuff is
valuable because it has i guess you sort of set intrinsic value is is the way that captures but
like this thing is value to me because it gives me something it either helps me do something yeah
you're right actually i totally missed that but that is that is the fourth uh piece of the puzzle well so like i mean you said intrinsic value which is part of that is you know
it's like you know gold is used in some industrial processes and it's useful i mean it's more
expensive than it's only its industrial uses but even if they went away it would still be useful
to be able to like gold is not it doesn't tarnish and corrode very easily. So it's really great for,
you know,
contacts on like,
that's why I like the ends of headphone plugs are sometimes gold plated
because they don't corrode and get worse over time.
Right.
It has use.
And in that way,
you know,
you kind of do have use of Bitcoin,
which would,
you know,
talk about a minute,
but the distributed nature,
the way it works,
it has a value in that Jason and I can exchange money in a very low fee kind of way. And that has use and that does give
it value. Yeah, that makes sense. Yeah, it has some amount of utility, especially, yeah, Patrick
will talk about it later, but there's some times where Bitcoin is the only thing you can convert to.
And so that gives it even more utility.
So one thing people might ask is, like, how is the price figured out?
Right.
You know, there's some of these like psychological value.
Like, how do you measure that?
Right.
It turns out you don't.
So this is something that you cannot sort of there's no closed form equation.
You can't just plug in a bunch of things and get the value out.
Instead, what happens is it's a dynamical system.
So in other words, you might not know the equation for gravity,
but you know that if you throw a rock up, it's going to come back down.
And you might even be able to estimate like how many seconds it's going to take to come down.
You don't have to be like a physicist or even know the equations or anything.
You're just kind of observing and you have sort of a mental model, right?
So this is the same way.
So the Bitcoin is traded on an exchange similar to a stock or anything else.
And in the case of stock, it's on the New York Stock Exchange or the London Stock
Exchange or I think Shanghai or what have you. In the case of cryptocurrency, there's a variety
of exchanges. There's Coinbase and Gemini here in America. Actually, Coinbase probably, both of
those are probably international, but there are some countries that can't use Coinbase.
There's a list of different exchanges you can find online.
And the way all of these exchanges work is the same.
It's basically a double auction.
So what that means is every, let's say, millisecond, the system looks at its orders, like who wants to buy and at what price.
And it looks at its sell orders, who wants to sell and at what price.
And it matches those people up. And there's a variety of strategies, but basically,
you know, I think the person who wants to buy at the highest price right there at that millisecond
gets matched up with the person who wants to sell at the, I think at the highest price,
if I remember correctly. Yeah, that's right. So the person wants to buy at the highest price, if I remember correctly. Yeah, that's right. So the
person wants to buy at the highest price gets matched up with the person who wants to sell at
the highest price. And then that transaction happens. Those people, assuming that the person
who wants to buy, wants to buy at a higher price than the person who wants to sell that transaction
happens. And I think it happens at the seller's price um and then those two people walk
away happy with their transaction then we take them out and we look at what's left and we just
keep doing this until the person the people who want to buy all want to buy for less than the the
most expensive seller right so if i want to sell for a dollar least expensive seller uh they want
to buy for less than the least expensive seller then the least i get the right than the yeah so
if i well if i if i want to sell for a dollar and there's someone else wants to sell for two dollars
and there's someone who's willing to buy for uh1.50. Yeah, you're right. Yeah. So eventually it's
going to get to the point where there's a bunch of people who want to buy, but they all want to
buy for, let's say, $1 and all the people who want to sell want to sell for $2. So now nobody can
make a transaction. So then the system sort of ticks. It takes new orders and it starts a new
millisecond and it starts this whole process over again.
And so what happens is, you know, people put in orders and those orders can't be fulfilled.
And their reaction is to put in a higher order if they really want whatever the person is selling.
And so in this way, the double auction kind of self heals, it self regulates.
Nobody really knows what the price should be,
but it's this dynamical system that's constantly adapting.
But we say the price is the last successful transaction amount.
That's right, yeah.
I mean, this gets back to the trend part.
So that's the price at which we last knew
that a transaction took place,
and therefore two parties agreed that the value was that. to another one for a penny. Like let's say something's worth $1,000 and I make a bunch of fake agents
and I keep having them sell this product
to each other for a penny.
You know, if I own all the agents,
you know, it looks like something's worth a penny,
but it's really not.
It's really me sort of gaming the system.
And there's all sorts of like inertia terms
and things like that to compensate for that.
And that's where the historical part comes in.
That would have to happen at a very high volume for a long time
before they would say, oh, I guess this really is worth a penny.
The other thing, too, is there's always an opportunity
for someone else to be buying.
I can't guarantee that I'm going to buy my own thing.
But yeah, in this case, I mean mean this is the exchange being fair right it has actually nothing to do with bitcoin so bitcoin itself
doesn't facilitate exchanging into into dollars what you sort of need is if jason and via some
facility jason and I could agree in person
that Jason's going to give me $20 and I'm going to give him $20.
I'm going to send his wallet $20 worth of Bitcoin.
We could do that in person.
That's an exchange.
But there's a lot of risks there.
Like one of us has to go first.
Either Jason has to give me the $20 or I have to send the Bitcoin.
And that causes a problem, which is why you have these exchanges is because they act as a third party to sort of facilitate that transaction.
And so I don't I mean, I assume I don't actually I've not checked on Coinbase.
But I mean, I assume the way it works is basically I send money.
I send my dollars to Coinbase when I agree to something. I sort of hold dollars in my account and I agree to let Coinbase take some of those and give them to someone else.
Once that person has given the coins to Coinbase that they can give to me.
And so they act as a broker.
They broker the deal to make sure that no one has to deal with the fact of someone flaking out.
Right. So when they are doing this double auction at that
moment, they have power over both sides. I mean, they could theoretically take my money and take
the other person's Bitcoin. But, you know, we trust them. There's a variety of sort of social
systems in place to keep that from happening. And so why is why are people wanting to convert their hard-earned cash? We talked about
before Jason working his job selling popcorn. Why is he turning that into Bitcoin? And there's
a couple of reasons. We talked about that this being distributed, there's no big bank, right?
So Jason talked about like, oh, the exchange should just take all your money and run.
It turns out that banks could do that. And the u.s we have lots of different kinds of protections that
try to prevent a bank from sort of like going bankrupt oh dear um and and taking all of your
money but you know it has happened in the past that's why those regulations are there um right
but there's also lots of fees associated with lots of things that you do when
you work with a bank um and the bank gets to control and set a lot of that stuff because
you're sort of forced to in some ways in order to operate in society to kind of use that it's
very hard to go around spending actual dollars like storing dollars under your mattress and then
using them everywhere and even if you were to do that that's actually sort of dangerous because
if you get robbed and someone looks under your mattress, all your money's gone. And so all of
these things come into play. And so Bitcoin is nice because it's distributed. There isn't a
central bank. And so it's very, very easy if sort of one person, one Bitcoin was trying to charge,
there is a little bit of a, we won't go into it because it's complicated on how sort of
transaction fees work in the system. But they're much lower than sort of paying with a credit card for instance
and so if jason were to try to get like greedy and charge a higher transaction fee for me to use his
services to to transact bitcoin uh then other people would just sort of undercut him because
it's this very competitive decentralized thing um there's no reason to use jason versus just random other people um and so
exactly that makes it really resistant to sort of one person acting in bad faith like one person
doing bad you need a consensus of people you need very very large numbers of in this case we say
people but it's actually computers agents you
need a large number of them to be essentially agreeing to collude and commit commit bad things
and we're sort of trusting that because we think that lots and lots of different people with all
different desires aren't going to want to collude to cheat me that this is a safe thing um the other thing is that people say
oh bitcoin is anonymous and that's why um it's useful because it's really good for you know
buying drugs or whatever you know that you want to be anonymous but it's actually being very careful
it is not anonymous um so it is sued anonymous which is that no one sees, you know, my social security number or my name. It's just my, my wallet, my address, you know, my special series of numbers, um, that's unique to me, but no one knows that that is me. And so I can go online. I can have people send money to that address. I can send money from that address and no one knows it's me, but they do know it's that address. I can send money from that address. And no one knows it's me, but they do know
it's that address. Like, yeah, that's different than anonymous because anonymous, you wouldn't
know who it was. This, you don't know who it is, but you know that it's the same person between
any two given transactions. Exactly. And the reason why that's really important. So for instance,
like we said at the beginning, Satoshi, if he were to get rid of all his Bitcoin and the price
didn't go down, they'd be worth billions of dollars right the reason we know that satoshi
owns those is because they're the very first we know whose unique fingerprint created those first
bitcoins and we can see that fingerprint doesn't occur in subsequent transactions so those bitcoins
most of them weren't sort of moved around um and so we assume that must
be him and now we can monitor and say if any of those any bitcoins come out of that address then
he must be selling his bitcoin and in that way it's not anonymous but it is super anonymous you
know if the if if uh let's say hypothetically there's, there's a certain like Bitcoin address that's like buying, like being used in all sorts of like drug deals and stuff like that.
And the police catch a drug dealer.
And when they catch him, they get his computer.
They can like, you know, get his Bitcoin wallet ID and they can look in the history and see all the transactions he's done.
Well, I mean, it gets worse, right? wallet id and they can look in the history and see all the transactions he's done well i mean it
gets worse right so if someone were to you know these hackers like oh send money to my bitcoin
right um as long as if they continue to sort of move bitcoin around for purely digital other
pseudonymous or anonymous systems there's no problem but fundamentally ultimately jason wants
to buy an iphone uh or an android phone maybe one of those cool slick s8s uh or whatever he wants to buy a phone and so he needs hard cold benjamins you know
dollars and so at some point jason wants to after doing this massive hacking scheme he wants to
convert his bitcoin to dollars now it turns out this is this this becomes a dilemma because someone now has to give him U.S. dollars, U.S. currency.
And once you do that, you tend to be something that's more regulated by the government.
And so they probably have some sort of log.
So as soon as he tries to do business with a business.
Oh, that was confusing as soon as he tries to exchange his bitcoins with a business that either needs to mail him something send him u.s currency or foreign current most foreign
currencies have the same rules as soon as he needs to touch sort of physical goods then there if the
police go to that business and basically say you have to give us your records they have to comply
and now people will figure out they'll be able to match Jason's account with his person. Yeah, exactly. Uh, so yeah. So pseudonymous useful
in a lot of circumstances, but not a great idea if you really want to commit crime.
Yeah, yeah, exactly. Um, um, yeah. So, so how does it work? So basically, um, you know,
like what's to stop me from just saying, oh, Patrick gave me a million dollars, everybody.
So basically, it's similar to cryptography. It's similar to the the public private key stuff that we talked about in that episode.
So definitely go and check that episode out. But just to kind of rehash it, you know, everyone has a private key.
If someone gets your private key
they can take all your money right um so uh assuming that doesn't happen so i with my private
key you know i sign some some uh some package is it i guess it's a blockchain or no a message so
you create a transaction you create a transaction it says i want to pay patrick lots of money
right i want to pay pat lots of money. Right.
I want to pay Patrick all the money that I got for deploying this worm.
Oh, no, no, no.
I don't want that money.
So I want to give Patrick a bunch of money, and I sign it with my private key.
So one thing about this whole blockchain is that everyone has the entire state. So imagine if you went to Facebook.com or you went to, let's say, Yahoo.com.
And, you know, the first time you went to Yahoo.com,
they gave you the entire database, like with everything.
And they're like, hang on, hang on, buddy.
We need to give you the entire database.
It's like everyone's records, everyone's name, everything.
And then you would get all of that.
And then they would say, okay, now what do you want to do at Yahoo?
And you wouldn't even have to contact them anymore
other than just to get updates
because you have literally the entire back end of Yahoo.
And I know this to be true because my 0.05 Bitcoin
that I had on an old laptop that I recently got back out,
I downloaded the client
migrated my wallet and then had to wait for you know many i think it was like a day or two while
my computer basically downloaded the entire state of the blockchain and fast forwarded to make sure
that there was no transaction that so there was a transaction from anonymous kind internet stranger
to me five years six years ago and that there was no transaction anywhere in the blockchain after that, that sort of my 0.05 Bitcoin were sent somewhere else.
Right, exactly.
So imagine like, you know, you have, let's say, a SQL database or any type of database, right?
You're going to put commands on that database. You're going to say, like, insert a row, you know, alter this column, you know, insert this new row, you know,
delete this row. And just think of all these, like, SQL commands, right? Now, imagine if you
kept a history of all the commands you gave this database ever. Well, then you could recreate the
database, right? It's probably not the most efficient
way but but it works right if you took all the commands you ever sent to your database and you
ran all those same commands on another database you would end up with the same data on both right
hopefully unless there's like a rand or something um um but uh so so so that's basically what's
happening is everyone's getting all the commands
such that when they finished, they all have exactly the same database.
And that database has everything.
Like it has how much money everybody has at any given time.
That's right.
Um, as everything.
It's, it's a ledger, right?
Where, I mean, maybe ledger isn't a commonly known term anymore, but I mean, it's, so when
I say that someone sent me some Bitcoin, unlike actual, you know,
dollars, where if I say Jason gave me a dollar, then I typically mean he took a printed physical
piece of paper with a unique serial number and gave it to me.
When I say someone gave if if I were to give, you know, point one Bitcoin to Jason, I don't
actually give him a cryptographic hash or anything.
I don't I'm not transacting with him
a unique something. What I'm doing is sending a message into the globally replicated ledger,
this running account, this log, as Jason was describing. I'm saying there, hey, at some point,
my account has been tabulated to have one whole Bitcoin, maybe because of mining, maybe because somebody sent me something, because I did something, a service for them or whatever.
And I want to send, you know, whatever I said previously, I've forgotten my example.
I want to send however many worth of my Bitcoin I want to now send to Jason's address.
But I don't actually nothing goes to him.
Just now the ledger reflects that now he has some of the money that i had
previously so my account sort of says minus 0.1 bitcoin and jason's account says plus one bitcoin
and that's recorded in the ledger globally in this replicated state right and so when patrick
does that so because everyone has everything the only thing everyone doesn't have is all the private
keys of course right but everyone has everything else right so so patrick signs it with his private key um he encrypts it and he
encrypts you know the message and then also some some some way to to verify that um it's been uh
to some way that we're when you decrypt it you know that you've decrypted it correctly
right i forgot what that's called um but some set of bits there right some magic bits. Then that message goes out to everybody
and it spreads like virally like everyone just starts sending it to each other and then everyone
starts using their Patrick's public key to decrypt his message and read it. And so the decrypted message will say something like, give Jason a dollar or give Jason a
Bitcoin, but it'll also have some way to verify that it was decrypted correctly, right?
Because what you wouldn't want is someone to encrypt it incorrectly.
And when you decrypt it, it says, give someone a million dollars and you just do it, right?
So there's some secret key, some secret set of bits that have to be encrypted a
certain way. Um, so if people get it, they decrypt it and it seems legit, they apply it, right? If
they decrypt it and it's just total garbage, then they reject. They say like, we're not accepting
this, this, this like a transaction. We're not accepting this transaction.
We're not accepting this message.
And then at that point, it's kind of like a democracy.
So, you know, it happens extremely quickly.
And if you've signed it correctly, a ton of people are accepting it.
And in the opposite case, a ton of people are rejecting it.
And so in that way, it sort of heals itself.
Oh, go ahead. I was going to say, just as a sort of side topic, you were talking about databases working that way it sort of heals itself so along oh go ahead i'm sorry i was gonna say just
as sort of side topic um you were talking about databases working that way um actually a whole
class of modern databases do work that way they're called log replicated storage um and so cool they
actually do work by essentially record and it's a way to distribute to other people for exactly
those reasons that what the current state of the database is and so you sort of send out a proposed change as a log and then once other people confirm they've
received that then you actually reflect that in your current state and there's ways of compacting
the log so you don't have to keep the whole transactional history anyways it's a side topic
but if you're interested you can look it up yeah log replicated
databases um so so yeah there's this question of like what happens if i try to be really clever
and i say um i go to two different machines and i say uh you know uh give this other account that
i also own a dollar from this other account.
Like I have account A and account B.
And I go on two different machines and I say, hey, A gave B a dollar.
And I do it both at the same time.
And in this way, I think I can somehow double my money.
Well, that's not going to happen.
What's going to happen is, and Patrick, if you could correct me on this,
but basically there's going to be some type of master election process.
So a bunch of computers are going to get the first command,
a bunch of computers are going to get the second command.
There's going to be some kind of banter back and forth.
But at the end of the day, there's some kind of Byzantine resolution system
that's going to eventually, it's like an unstable equilibrium,
that's going to eventually cause one of those two transactions to fail um and uh and that's that's basically the
gist of how that works so it's there's a lot of good things there's also a lot of kind of
uh bad and ugly parts of uh of bitcoin so i mean yeah everyone hears this like the silk road was
famous it's what it's called yeah the silk road um and you know just ways of sort of extorting
people for money moving the money around uh and then if you can find you know like i said it's
once you try to convert to something physical there's sort of an end point but this is a common
criminal thing like this is always true if you steal money you need some way of sort of an endpoint. But this is a common criminal thing. Like, this is always true.
If you steal money, you need some way of sort of spending the money without being noticed
and being able to move the money around without being tracked.
Or else people can figure out that you committed some crime.
You know, they can put two and two together.
And Bitcoin, it's not my opinion that it really, the pseonymous thing is is sort of useful there but it isn't
like this is fundamentally going to ruin the fbi or whatever investigative agency you have
in your country like it's not going to ruin their ability to find criminals um it does facilitate
you know sort of along with some other technologies it can make it harder but it doesn't seem to me as long as
if people end up if they can't live their whole life you know solely on digital goods and services
then you know eventually they'll try to spend the money and you can catch them at that point
yeah i mean it does require like an international effort it can yeah um and so and i think it's just that the i think what will happen
is that more businesses that do goods and services in bitcoin will probably get more regulation
that they already have on dollars and i don't but i don't think that's a bad thing for bitcoin
that's just a sign that you know sort of bitcoin is growing up or ethereum is growing up like all
of these will begin to be regulated. And right now it's just,
it's a sort of temporary loophole is I guess what I see.
I don't long-term,
you know,
it's not a big deal.
The same thing like,
you know,
in the U S gambling is illegal.
And so there's a threat.
If I send dollars to,
I don't know where the,
you know,
online gambling sites are,
but some,
some other country,
then somehow when I get dollars back,
that gets recorded
and I have to sort of explain where it came from.
But if I sort of send it in Bitcoin,
do some transactions and get the Bitcoin back,
like no one has to know that those Bitcoins
that I got back were from gambling winnings.
And so it's actually, you know,
in some ways it's easier to convert it back to US currency.
But again, same thing as I said before.
I think eventually the regulations will sort of catch up on this more.
It just seems like a continuous thing on the Internet,
that cat and mouse game.
So yeah, it'll probably make things harder,
but don't do bad things.
You'll get caught.
Yeah, exactly.
So this technology in and of itself is really amazing.
And one thing that's kind of amazing is Ethereum in particular created this thing called the Ethereum Virtual Machine.
And basically, you can use the Ethereum messaging platform and all of that to do other things like for example
um you could make your own uh set of currency like let's say for example i want uh
um what's i'm trying to get like a good example for this like uh let's say i want to do some type
of votes so um i want to go and people can do a certain amount of work.
They can get one of these tokens and they can use that token to give it to different accounts.
And each account represents voting for a different person.
So you can kind of do pseudonymous voting.
You could do all sorts of donations and fundraising and all of that.
That's a little bit more direct application um in other
words you could set up little credits and people can exchange uh you know bitcoin or let's say
ether for for these credits and then in in exchange you're going to look at whoever has
those credits and give them like some part of your company or some some like yeah this is how
the you'll get something back this is how the dao i
don't a dow i don't and that's how you're supposed to say because this sounds like dow jones but the
dao and ethereum was supposed to work you sent money to the dao and they gave you a dao token
which was different than the ethereum you sent but it allowed you to cast votes like you got a unique
token based on how much you contributed and then they would put
up measures for voting and the system would count how many unique tokens it saw for any given measure
to decide if it passed or failed right yep um so yeah it's it's it's pretty amazing it's pretty
early on um also ethereum is totally open source i don't know about bitcoin if it's open source or not yes
it is okay yeah so so you could like uh especially if you're on a company like if you're doing this
enterprise you could install your own fork of ethereum on all your machines and then you could
use it for like an anonymous message board like complain about your boss and you can't know it's
you or something i don't know um but you could could set up a blockchain and have sort of pseudonymous, you know, voting
and messaging and things like that, which is kind of cool. So I expect a lot of cool things to come
out of this technology. And that's probably a good point to sort of wrap it up. So I want to make one
thing. I said log replicated search storage but that if you are going to
go search on it's log structured um databases sorry log structured yeah if you search up the
other thing no results come up it's log structured oh cool log structured storage yeah i've never
even heard of this all right um well till next time have a good one. This is a bit of a long episode, but we had a lot of cool stuff to talk about with this.
It's super interesting. It's hard to wrap your head around, but I think it's amazing.
And hopefully you guys could bear with our 90 minute show or however long it's going to be.
Thanks a lot for all of your support.
Thanks for liking
our posts on on all the different social media uh and thanks for your emails uh we've gotten some
really good suggestions we'll definitely take advantage of that um and and and cover them in
future episodes so uh have a good one the intro music is axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution Sharealike 2.0 license.
You're free to share, copy, distribute, transmit the work, to remix, adapt the work,
but you must provide attribution to Patrick and I and sharealike in kind.