How do Bitcoin works?

so our big topic today is bitcoin you call this a crypto currency well it's really really clever you know the reason that i just i sort of fell in love with this for the moment is as i plowed in i i just got a big kick out of the way that the many problems associated with a with a sort of a floating currency meaning a currency that doesn't it isn't anchored by any central bank there's no state sponsorship for it it's it's i mean it and it's a it's a real thing anyone who's interested and and i would encourage our listeners if if this podcast and what they hear about it makes

them curious go check it out you just put bitcoin into google and you'll start seeing pages of stuff um and uh about two years ago um the project was registered um a little over two years ago by a japanese cryptographer satoshi nakamoto um and it's it's an open source project on sourceforge so none of this is you know black art stuff um the the goal is to really solve i mean to offer it an honest-to-god you know non-hobby level but but industrial strength internet based peer-to-peer currency where real value can be exchanged between two parties without any intermediary

being involved and that's one of the trickiest things because you've got all kinds of problems first of all um where does the currency come from you know what creates the currency how much currency is flowing through the system how do you monitor that and regulate it how do you prevent it from being inflated how do you pee how do you keep people from fraudulently creating currency how do you keep someone from if they have some from reusing the same currency all of that has been solved with this system um in in some very clever and and very new ways which is what which is real

ly what captivated my attention on this so there was no wait a minute so we have currencies we have euros and yens and dollars uh how can you invent a currency what makes that work well okay so think about it a currency is is nothing really but an agreement among the parties that this synthetic thing has value you know once upon a time you know when we when when the dog when the dollar was anchored to a gold standard the idea was that there was gold backing up dollars and and and so when you had a so-called promissory note it was a you know it was equivalent to x amount of g

old and we were of course famously taken off of the gold standard the problem was we needed more money than we had gold so we had to disconnect the in the in the case of us dollars you had to disconnect us dollars from gold because we needed to we literally needed to create more money than then we had gold to back it up it's kind of an incredible innovation in human society when you think about it that this works at all because you know because it started out you were carrying around your chickens because you just wanted to trade what you had a value for you know what the b

lacksmith had that got inconvenient so gold became a good standard because everybody valued gold and everybody had kind of had the same value of gold but we've gone from that to this sort of agreement that well i'm gonna i'm gonna agree that a dollar's worth of work is worth a dollars worth of merchandise and and we it doesn't have to be backed by anything we'll just we'll all agree that that's the way to pay stuff so i guess that's what all they have to do is get enough people to agree that this currency is valuable correct one notice also that we chose gold because it was s

carce we didn't use water for example right you know because you just go over to a stream and dip your bucket in and now and the problem of course anybody could go do that so so there's a famous scene in one of the douglas adams novels where they decide leaves will be their currency and it has the same problem well of course money grows on trees right now so exactly and so um so we chose gold because it was scarce and you know famously in the in in in the days of of you know individual gold miners they'd go out and try to find it because they would basically they were creati

ng more currency to put into the system at a at a controlled rate and initially when there was lots of gold around we were digging it up and and and turning it into bars and and coins and so forth and over time it became increasingly difficult for us to to find more gold so it became increasingly scarce and it's its value has increased in some ways a a virtual we have a virtual currency with the dollar and the euro and all of these and in some ways that that is a little more fair because someone can't just go out and find a bunch of money unless they're robbing a bank i gue

ss but you know you can't just go digging in the hills and lock into a bunch of money it has to be earned in some manner right so what we what has been created with bitcoin has all of these attributes there there is this concept of a of bitcoins the currency in in in the same way that the abbreviation for us dollars is is usd and euros is eur bitcoin's abbreviation is is um uh bc uh btc bitcoin btc and this so this network of computers exists now on the internet peer-to-peer you can go to bitcoin.org and download a program for windows mac and linux which is open source and

install it on your computer and tell it to start generating bitcoins that is literally start making money so you are making money out of nothing well just by being a member i mean how how does this this sounds like some sort of uh bittorrent situation sounds wacky but yes so so you are making money the way you make money is by is by processing transactions within the bitcoin system so and this is this is complicated but unfortunately it needs to be complicated in order to be robustly secure which it really is there is a in the faq at bitcoin.org or org in the faq there's

a link to the original pdf that uh that satoshi wrote that describes in greater detail how this works but the idea is that you want a you want a transaction trail of every single transaction between two parties that has ever occurred and they're occurring all the time now this is not just this currency is virtual but it has been anchored now to real currencies there are there are websites that that will trade real currencies for bitcoins um they they at this point in time about two years after it was it was launched um the current the the the current um uh currency trade of

us dollars for bitcoins is about one to one i think it's like 93 cents for a bitcoin and there are organizations which accept bitcoin payments uh the eff the electronic frontier foundation um uh accepts donations in bitcoin currency there are there are programmers who will work and and accept payment in bitcoins there's a there's a i think it's called trade a trade link at bitcoin.org that is shows a page of lists of of all the of the currency exchanges that exist now and then a growing number of organizations and and companies that will that will accept bitcoin currency a

s real so i know i this still sounds like that okay let's back up a little bit here if i can just create by running the program money aren't we running into the leaves and water problem where we just get runaway inflation and the currency is valueless so yes except that it's all controlled it is the the way it functions is that new coins new bitcoins are generated on the network when a node and for example if you're running the program you are one node when a node finds the solution to a hard problem now the the this is really very clever the way this works because it it

prevents people from being able to create currency at will um back in 97 i think it was 1997 um um someone named adam back came up with a concept for anti-spam which he called proof of work the idea was that spammers function because they're able to just spew out email at virtually zero cost it doesn't cost them anything to send out email so as a consequence we're all being deluged with email which it's expensive for us to receive not expensive for them to send so so adam said what if we come up with a way of making it expensive for someone to send email and the way we do

that is we we create a computational burden which we don't have the technology to short circuit where they have to do a substantial amount of work in order to sort of validate an email and and on this show we've talked about hashing a lot hashing of course is a is a is a valuable technique that takes an arbitrary length input and turns it into hashes it down into a so-called a digest of a fixed length so imagine like take sha-256 which is the uh is the secure hashing algorithm which produces a 256 bit result imagine if in order to qualify for sending email you have to h

ash the email header such that some number of the first bits out of the 256 bits are all all zero so if you if you just hash a a an email header at random the most significant bit has a 50 chance of being a one or a zero so so you increment a sort of a fudge factor and then hash it again and until you get that that that first bit that's a zero but say that your work so say that to qualify the the header has to have a hash where the first 20 bits for example are all zero well it's going to take two to the 20 operations to guarantee that so an average um half that number of o

f hashes have to be tried so the idea is this forces someone to do a huge amount of work trying to uh fudging the header in order to get all like the first x number of bits of the hash to be zero so in practice you could set the difficulty so that it might take somebody two seconds to do the work on a one gigahertz pc but that would mean that it takes a spammer two seconds per email which is vastly more computation time than it takes them now and so this was on an individual basis you don't notice that that much exactly but if you are trying to send you know vast amounts of

you know which i guess could negatively impact legitimate bulk email like newsletters and things like that too and actually that's exactly why the idea did not take off was that it was still while yes it would be burdensome for spammers exactly as you said there are legitimate mass mailers and if we if we you know if we did anything to allow them through then the spammers would come through too so it had to be all or nothing and it was too much work for for legitimate mass mailers but it was a really interesting concept and and satoshi borrowed that concept from from um th

at adam back proposed back in 97 for this so here's the way it works the the system is so imagine that there are among all these peers there are people exchanging value they're exchanging bitcoins um a bitcoin exchange is somebody wants to send somebody else some bitcoinage so they have a the whole system works with a um asymmetric key system a public key system where they have both a public key and a private key they take some amount of bitcoinage and and put their public key and sort of associate their um or include their public key in the transaction also the public key

of the person it is it is being sent to and then they sign it with their private key so so what that creates is that creates a transaction that only they could have originated because they're the only ones who have their private key which they keep secret that transaction is broadcast into this peer-to-peer network to all the nodes in the network and everyone's transactions are broadcast now it's easy for anyone to verify that transaction because they know the public key of the signer and that allows them to verify the signature they can't sign it themselves but they can ve

rify the signature so so that allows them to verify the transaction now what we have to to do is we need to prevent that the person who's just depleted their bitcoinage by giving some away from giving the same bitcoins away again so and that so that's clearly one of the hard things to solve about this so the way we do this is oh every so often all of the all of the transactions which have occurred since the okay there's sort of a problem of chicken and egg here because i have to explain multiple things at once for this thing to hang together there is there's this notion of b

locks a block is a collection of transactions which have been which have been sort of adopted by the network um the and the block which is this collection of transactions is the thing which work is done to create in the same way that i was talking about work being done to to to to create this special hash for email headers a the the work being done to create this block is what all the nodes on the network are busy doing so all the nodes receive transactions and the the a block is chained to all the previous blocks by taking the the hash of the previous block as as part of t

he next block which means that essentially you have a forward moving chain of of blocks which are which are linked by the by the by the hash of the previous block there is a genesis what's called the genesis block which was created on january third of 2009 so just a little over two years ago when the system began there was an anchor block which is embedded into the um all of these nodes in in into the code in the nodes when a when when someone downloads the program and turns it on they they they go to an irc chat room that is the the the code autonomously goes to an irc cha

t room joins the room and that's how it learns about all the other nodes or many of the other nodes on the network it it then interconnects to them and receives the entire history of all previous blocks that is this this in this blockchain anchored by the genesis block all the way to the most recent block that anyone has created so and in yeah that sounds like it could become computational computationally extensive over time though right um yes except that there's another clever thing that it turns out there's a way to compress these so that so that once the blocks are old

enough and no one cares about the individual transaction details then you no longer really need to care about them the idea is you you need the transaction details long enough to to make sure that nobody so so that the transaction details are available in the network so that no one is able to reissue the same bitcoins again but but at some point then it becomes impossible for them to because it because the blocks become old enough and you do not need to it turns out you're able to compress these blocks and make them a lot smaller so and i think the growth rate is estimated

at something like 4.2 megabytes per year would be the maximum amount of storage that this architecture requires so it ends up really not being very much over time so so what happens is there there's this this sort of chain of blocks now all the nodes in the network are competing with each other to create the next block and it's the node which wins the node which first does the amount of work required to to essentially create the next block that that earns 50 bitcoins and so and and and this all sort of scales in the right way i'll explain in a second so so all of the nodes

are cranking away there they are taking all the transactions which have not yet been encased in a block and and they hash all of that along with the hash of the previous block which that that anchors them together and means that you're not able to to to to create a block that isn't linked to the prior one hash it all together and then and then the there's a certain amount of difficulty which is of finding the a block that functions by by exactly um as we were talking having a hash with some number of of zeros from the left end going down and at the moment i think that nu

mber is 12 at this point in time you have to you so so all the nodes are are are are tweaking a little fudge factor in the hash trying to find trying to build a block which has 12 zeros um at the leading part of this 256-bit sha-256 hash as soon as a node finds it it declares success broadcasts that to the network remember that while it's extremely difficult to to find the the the um the pattern that makes the hash it's incredibly easy to verify it you know verifying the hash just requires you know doing the hash of the block and seeing that oh look somebody did create a bl

ock that's got all those zeros and the first transaction in every in any block is paying yourself 50 bitcoins but it's only but if you can make that block valid that then that transaction in the block of paying yourself 50 bitcoins is validated by the network so so so though we've actually had two blocks created since we started explaining what blocks are by the way for a little estimate of how there are people out there using this yes um in fact there is a there there's a site called i think it's block track block explorer is the one that i'm at that's and that's where i'm

keeping track of this yep block explorer allows you it's a website that is participating in this peer peer-to-peer network which allows you to go look at the history of all the blocks that have been created so far now is this is this a worry that all of your finances are now going to be in public can people look at this and figure out how much money you're spending and who you're giving it to well that's one of the other beauties is that the the only thing which is known this is a completely anonymous currency system the i mean like more anonymous than anything else the only

thing that is known is a is is your public key so when when you when you download this software and fire it up on your machine and start it running the first thing it does is to create a key pair and so you will see for example if you find the eff bitcoin donation they show their public key and um and um the various other organizations that accept bitcoin they show their public key so so when you look at the at the history of transactions all you're seeing is this random ascii gibberish which is you know the the public he converted into ascii and and people keep their priv

ate key private but there's no way of knowing who anyone who who who is behind any public key and you the the the big the bitcoin client will happily produce key pairs till the cows come home you can make more key pairs any time you want so you're not even there's no not even any way to track somebody by like oh look there's the same guy who did a transaction here he did it here only if you did not create another public key would that be the case but you are free to create new as you know essentially the public key is a represent is a temporary pure binary representation of yo

u which you're free to retire and create a new one anytime you want i i just i just downloaded it and started it it's not creating it says i'm not connected it's not creating anything is that because i'm not in idle time it has to be idle to start generating those coins automatically well yes and okay so many things have happened in the last two years first of all this began to get traction and people began having fun with this um the way the system works is um and i need to get this right is the the the coin creation rate is um [Music] is 300 coins per hour within the en

tire system and your cpu your cpu speed the ratio of your cpu speed over the total cpu speed within the entire bitcoin network determines the probability that you will be able to solve the puzzle of of of creating one of these blocks so it's estimated for example that it would that at this point i think it was december 2010 so about two months ago there was there were enough nodes actively cranking away that it would take you about a year to generate 50 bitcoins that is so so you're not going to see it happen quickly now what happened is as these things started getting val

uable sort of big started becoming worth something where you mean you can actually trade if if you happen to get lucky and your node solved one of these solve the most recent block that everybody was working on before anybody else you'd get 50 bitcoins today there is a an exchange that will transfer that in us dollars for example into your paypal account so you you actually can make money now you can imagine then that people said wait a minute uh this seems like a good idea well there's something that's much more powerful than even multi-core cpus and that's gpus graphics p

rocessing units now google bit bitcoin space miner m-i-n-e-r as in a gold miner what's happened is that there are people on the net that have built bitcoin creating boxes with as many graphics processing units as they can get with fans cooling them they're overclocked they're pouring freon over them these things are running 24 7 like oil derricks [Laughter] so they're drilling for bitcoin they really are they're they're literally they're literally creating bitcoinage now the cool thing is all of this was anticipated in the original system because the immediate response to

the bitcoin network of the presence of of massive bitcoin computation power which essentially allowed the people who had these machines to to be printing money you know minting bitcoins with a much greater probability than you know that somebody who just had a cpu running along the system automatically changes and changed the the problem difficulty in order to stabilize the rate at which coins are coming into the system and here's the deal there will never ever ever be more than 21 million bitcoins created um the way this works is that the difficulty of this problem [Mus

ic] that is being solved that is this hashing problem where you're trying to find leading zeros in the hash it's it's adjusted continuously by the network so that in the first four years of the bitcoin network and we're two years in now in the first four years um half of that total number of bitcoins will be created that is 10 million 500 000 bitcoins will be created in the first four years in the second four years half again that is for only five million two hundred fifty thousand in years four through eight in years eight through twelve that is the next four years again t

hat amount is halved and so it the the rate of of coinage creation will be decreasing exponentially leveling off so that it it so that in the far future only 21 million will ever be created so we have a we have a a controlled and known in rate of inflation within the system it's and it makes sense because initially as the system is coming online as as goods and services are being made available and are trading within the system you want to have more currency being pumped into the network so that you have bitcoins to trade but you don't want it to go forever now the problem

would be of course if we absolutely cap the total number of coinage at 21 million then and there there comes you know a a you know much greater demand for this we we the tendency is to want more well the solution is that you you do you're not forced to trade in integer amounts of bitcoins that is the the ui right now gives you two decimal um digits of of coinage so you're able to create for example you you you could exchange 0.01 of a bitcoin and the but the technology supports eight decimal digits although right now we're only using two so so that allows for deflation ove

r time um because we're absolutely capping the the total number of coinage at this 21 million mark and we know that it's going to be declining over time and it doesn't matter how much gpu power is put into the system this system adapts so that the the problems being solved scale the difficulty scales up to balance the amount of processing power in the entire network and some people have commented that the the question then becomes are you spending more money on electricity and cooling for these crazy bitcoin generating engines than the money you produce and over time it loo

ks like that will be the limiting factor you know it's like yay i i've you know created this insane work machine to create bitcoins but gee you know my electric bill went up more than the money that i'm making and pg e isn't taking bitcoins yet for my rates so um if there's also a cool site that i got a kick out of uh called the bitcoin faucet the bitcoin just trying to use that they uh the rate limit has been exceeded i think everybody's going to get there explain what it is um it is it is just a fun way that somebody can get some free bitcoins um people who have them can do

nate them to the site and you know the guy thanks you very much and as long as he's got enough supply um he'll give you some bitcoins at the moment when i looked before the podcast he was giving 0.05 bitcoins per visitor um if he when his balance of available bitcoins that he's able to distribute for free is high enough he increases that but if he falls below a certain mark he he decreases it in order to conserve his supply there is a there's an online buyer and seller escrow service where so that two people are able to agree that they're each happy with the exchange of wha

tever it is they they they exchange for example in the real world in order to allow a a bitcoin transaction to occur there are a number of of online um exchanges you're able to where you're able to buy and sell bitcoins uh there's there's online charts where you could look at at the at the rate at which bitcoins are being bought and sold and their and their relative currencies this is available in a huge number of currencies and a whole bunch of languages and and essentially it is extremely cool crypto which um i mean this has been pounded on and looked at and it looks to me

like the guy has has solved the problems and has created a virtual currency that floats all by itself that is completely private that i mean you know obviously you you need somebody who's going to agree with you that you want to you know exchange this coinage but this thing exists and it's taking off and i wanted our listeners to know about it oh yeah very cool really fascinating stuff uh i've been playing with it while we've been talking too uh i i have no balance though and i can't the faucet is off right now but at least i'm connected finally so i i hope so so it did you

you did find your network yeah i finally found the network i have no connections yet though one of the things they recommend if our listeners want to play with this um is you need you you'll get much better connectivity if you do port forwarding of port 8333 um from from through your router which typically most people have or your firewall to the application yeah okay that way other nodes that are that are informed about you are able to make incoming connections to you and it's not just you making outgoing connections to them and that'll allow you to participate in in the n

etwork but i'm i i would encourage our listeners to poke around as you have been tom there are pictures of these people's you know gpu boxes that they've made with you know with all these fans all over them and and discussions about the giga let's see giga hashes per second in the network um i'm trying to think i made some notes about it somewhere about the oh uh the average rate of block creation uh oh yeah one 186 gigahashes per second is the total network hashing strength that is there are one point 186 billion hash operations being performed within the entire network t

rying to solve the problem of the next block creation the one who does gets 50 bitcoins oh and that all that that number also decreases over time um so that um it's for the first 210 000 blocks the value is 50 bitcoins per block that if your computer solves the puzzle before somebody else's then for the next 210 blocks that's cut in half to 25 bitcoins then for the next um 210 000 blocks to 12.5 bitcoins and a six and a quarter bitcoins and so forth on down so this whole system is designed to to scale correctly and basically create i mean create a secure stable currency with

with you know real world value which it has now i mean you can sell you can buy and sell bitcoins you know if you were if you wanted to you could take a hundred dollars and go buy some bitcoins and they know their their electronic currency you could then send those anonymously to someone else and they could cash them in to their own currency or back into dollars or whatever they wanted i mean this exists now and it looks like it's it's like bulletproof and the the the pdf explains the they've really thought through what bad guys can do the only the only attack which is known

on the system would involve somebody with massive computational power spoofing the chain because this it's this chain of blocks which provides the integrity for the system but the longer the chain gets and the more good nodes there are the more impossible it becomes for anyone to for anyone with massive computational power to spoof the chain so um the other thing that has happened is there's this notion of pooling individuals have become a little disenchanted with the fact that you know they've got their quad core i7 cranking away 24 7. they haven't made any money yet the

y like the idea of printing money the fact is over time this is not going to be feasible that is the way to get rich is is is not to print money this is it's like gold miners you know like during the gold rush you ran out and you you hope to go strike it rich and find a vein of gold and make money over time that just became less and less feasible because the ground had been picked over and there just wasn't gold to be found similarly ultimately that this will be you know it's when the the coinage enters the currency and begins to flow you know people will be using it as a st

ore of value but anyway what i was saying was that people who have been disenchanted they're joining pools of users where they'll all be working together on um and and pooling their cpu resources and then sharing the proceeds appropriately so you may not get 50 bitcoins but you may get two and a half because you are one two and a half out of fiftieth of the cpu resource in a pool that that collectively solved a block so it it so it's a way for people to you know see some you know have some of the fun of of of creating coinage out of thin air by by doing the work that makes

the whole network go and uh anyway it is it is the it is the the work that has to be done the difficulty of doing the work that keeps bad guys from being able to spoof the system because they're just this isn't any there isn't any way to shortcut this hashing of the blocks it's just brute force work and as more as more good um like you know gpu-based systems come online that hugely raises the bar that bad guys would would have to scale in order to in order to spoof because now as a consequence of sort of this phenomenon of using gpus to to create bitcoins you know the the

network is scaled so the rate of coin creation has has is still tracking exactly what it should but um but the amount of processing time being required to make that happen has just gone through the roof there's no bitcoins in them that are internet anyway just really really fascinating and i mean it works we have we have a a state free crypto secure anonymous real currency now that that exists check it out at bitcoin.org it's really fun to play uh dot org yeah there's no piracy in the bitcoin world thank you steve so much uh for explaining that that was real

ly fascinating i i can't wait to to poke around with this a little more i think i'm gonna have to do the port forwarding that you were talking about uh to get it well no i've got one connection now so it seems to be slowly i guess that's what i'd say to new people if you're looking at this be patient give it some time to connect you might try the port forwarding trick what port was it again uh eight three three three eight three three three all this is documented in the faq at uh bitcoin.org and um the other the other thing that happens is when you connect the first thing th

at happens is your node needs to download the history of prior blocks so that'll take a while but you'll see progress things and so forth and there is a on on the ui there's an option to say you know start making bitcoins yeah start making money all right folks don't forget to uh visit grc.com steve's got some excellent products up there of course we talked about spin right uh i've i've used shields up over and over throughout my uh years since you created it to make sure that there's not any ports open that i don't want open and all that stuff also it makes you feel really

good when you are when you are locked down because you you have this great i don't remember exactly how you phrase it but you have this like that's impressive i couldn't see a single port so uh check it out grc.com anything else you want to talk about before we head out of here steve we got it covered we'll do a q a next week so i encourage as always our listeners to swing by grc.com feedback and if you've got if you play with bitcoin you have questions um i'd love to hear and maybe we'll answer them next week for free we won't charge any bitcoins to answer no charge

Post a Comment

0 Comments