« Floating Mug | Home | joe's Favorite Thing: RHA MA-350 Earphones »

December 19, 2012

The Mystery of Bitcoin


Bitcoin cryptocurrency is a neverending source of fascination to me.


Because at its heart, a single man created something — money — out of nothing.

If that's not magic I don't know what is.

And if you think it's just for propellerheads, take another look: turns out that in Iran right now, bitcoin is providing a lifeline to a populace caught behind a rock-hard ruling cadre and an increasingly insecure, unstable life where money loses value on a daily basis.

Below, excerpts from a Security Now! show explaining and exploring Bitcoin.


We're going to be talking a little bit about a virtual crypto currency?

I'm really impressed by what they've done and by the fact that this thing really looks like it's the first solution to the concept of a distributed, non-central server, no central clearinghouse. I mean, it's like it's currency, it's Internet currency, which can work and is working. And there's just lots to talk about. Lots of cool technology in there, which of course is our angle from the crypto side.

About two years ago [2009] the project was registered, a little over two years ago, by a Japanese cryptographer, Satoshi Nakamoto. And it's an open source project on SourceForge, so none of this is black art stuff.

The goal is to really solve, I mean, to offer an honest-to-god, non-hobby-level, 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, where does the currency come from? 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 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 in some very clever and very new ways. Which is really what captivated my attention on this.

So wait a minute. So we have currencies. We have euros and yen and dollars. How can you invent a currency? What makes that work?

Well, okay. So, think about it, a currency is nothing really but an agreement among the parties that this synthetic thing has value. Once upon a time, when the dollar was anchored to a gold standard, the idea was that there was gold backing up dollars. And so when you had a so-called "promissory note," it was equivalent to X amount of gold. 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, in the case of U.S. dollars, we had to disconnect U.S. dollars from gold because we literally needed to create more money than we had gold to back it up.

It's kind of that incredible innovation in human society, when you think about it, that this works at all. Because it started out you would carry around your chickens because you just wanted to trade what you had of value for what the blacksmith had. That got inconvenient, so gold became a good standard because everybody valued gold, and everybody kind of had the same value of gold. But we've gone from that to this sort of agreement that, well, I'm going to agree that a dollar's worth of work is worth a dollar's worth of merchandise, and it doesn't have to be backed by anything. We'll all agree that that's the way to pay stuff. So I guess that's all they have to do is get enough people to agree that this currency is valuable?

Correct. Well, and notice also that we chose gold because it was scarce. We didn't use water, for example, because you'd just go over to a stream and dip your bucket in. And the problem is, of course, anybody could go do that. So water....

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, so, yeah.

Right, exactly.

And so we chose gold because it was scarce. And famously in the days of individual gold miners, they'd go out and try to find it because they would - basically they were creating more currency to put into the system at a controlled rate. And initially, when there was lots of gold around, we were digging it up and turning it into bars and coins and so forth. And over time, it became increasingly difficult for us to find more gold, so it became increasingly scarce, and its value has increased. So....

And in some ways we have a virtual currency with the dollar and the euro and all of these. And in some ways 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 guess. But, you know, you can't just go digging in the hills and luck into a bunch of money. It has to be earned in some manner.

Right. So what has been created with BitCoin has all of these attributes. There is this concept of bitcoins, the currency — in the same way that the abbreviation for U.S. dollars is USD, and euros is EUR, BitCoin's abbreviation is BTC, bitcoin, BTC. And 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, just by being a member? I mean, how does this — this just sounds like some sort of BitTorrent situation.

I know. It sounds wacky, but....

So you are making money. The way you make money is by processing transactions within the bitcoin system. So, and this is complicated, but unfortunately it needs to be complicated in order to be robustly secure, which it really is. In the FAQ at BitCoin.org, in the FAQ there's a link to the original PDF that Satoshi wrote that describes in greater detail how this works. But the idea is that 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 websites that will trade real currencies for bitcoins. At this point in time, about two years after it was launched, the current currency trade of U.S. dollars for bitcoins is about 1:1. I think it's, like, 93 cents for a bitcoin. And there are organizations which accept bitcoin payments. The EFF, the Electronic Frontier Foundation, accepts donations in bitcoin currency. There are programmers who will work and accept payment in bitcoins. There's a, I think it's called Trade, a trade link at BitCoin.org that shows a page of lists of all the currency exchanges that exist now, and then a growing number of organizations and companies that will accept bitcoin currency as real. So I know I....

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?

Yes, except that it's all controlled. 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, this is really very clever the way this works because it prevents people from being able to create currency at will.

So here's the way it works. So imagine that there are, among all these peers, there are people exchanging value. They're exchanging bitcoins. A bitcoin exchange is somebody wants to send somebody else some bitcoinage. So the whole system works with an 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 put their public key, sort of associate or include their public key in the transaction, also the public key of the person it is being sent to. And then they sign it with their private key.

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 verify the signature. So that allows them to verify the transaction. Now what we have to do is we need to prevent that person, who's just depleted their bitcoinage by giving some away, from giving the same bitcoins away again. And so that's clearly one of the hard things to solve about this.

So the way we do this is, every so often, all of the transactions which have occurred since, 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 this notion of blocks. A block is a collection of transactions which have been sort of adopted by the network. 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 create this special hash for email headers, 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 a block is chained to all the previous blocks by taking the hash of the previous block as part of the next block. Which means that essentially you have a forward-moving chain of blocks which are linked by the hash of the previous block. There is a genesis, what's called the "genesis block," which was created on January 3rd of 2009. So just a little over two years ago, when the system began, there was an anchor block which is embedded into all of these nodes, into the code in the nodes. When someone downloads the program and turns it on, they go to an IRC chatroom, that is, the code autonomously goes to an IRC chatroom, joins the room, and that's how it learns about all the other nodes or many of the other nodes on the network. It then interconnects to them and receives the entire history of all previous blocks, that is, this block chain, anchored by the genesis block, all the way to the most recent block that anyone has created. So, and....

That sounds like it could become computationally extensive over time, though; right?

Yes, except that there's another clever thing. It turns out there's a way to compress these 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 need the transaction details long enough to make sure that nobody — so that the transactions details are available in the network so that no one is able to reissue the same bitcoins again. But at some point then it becomes impossible for them to 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.2MB 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 what happens is there is 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 essentially create the next block that earns 50 bitcoins. And this all sort of scales in the right way. I'll explain in a second.

So all of the nodes are cranking away. They are taking all the transactions which have not yet been encased in a block, and they hash all of that along with the hash of the previous block, which that anchors them together and means that you're not able to create a block that isn't linked to the prior one, hash it all together, and then there's a certain amount of difficulty which is of finding a block that functions by exactly, as we were talking, having a hash with some number of zeroes from the left end going down. And at the moment, I think that number is 12 at this point in time. So all the nodes are tweaking a little fudge factor in the hash, trying to build a block which has 12 zeroes at the leading part of this 256-bit SHA-256 hash. As soon as the node finds it, it declares success, broadcasts that to the network.

Remember that, while it's extremely difficult to find the pattern that makes the hash, it's incredibly easy to verify it. Verifying the hash just requires doing the hash of the block and seeing that, oh, look, somebody did create a block that's got all those zeroes. And the first transaction in any block is paying yourself 50 bitcoins. But it's only 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....

Now, is this a worry, that all of your finances are now going to be in public? Can people look at this and figure how much money you're spending and who you're giving it to?

Well, that's one of the other beauties is that the only thing which is known — this is a completely anonymous currency system. I mean, like more anonymous than anything else. The only thing that is known is your public key. So 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 there are various other organizations that accept bitcoin. They show their public key.

So when you look at the history of transactions, all you're seeing is this random ASCII gibberish, which is the public key converted into ASCII. And people keep their private key private. But there's no way of knowing who is behind any public key. And the bitcoin client will happily produce key pairs till the cows come home. You can make more key pairs anytime you want. So you're not even — there's 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 — essentially the public key is a temporary, pure binary representation of you, which you're free to retire and create a new one anytime you want.

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. The way the system works is — and I need to get this right — is the coin creation rate is 300 coins per hour within the entire system. And 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 creating one of these blocks. So it's estimated, for example, that at this point, I think it was December 2010, so about two months ago there were enough nodes actively cranking away that it would take you about a year to generate 50 bitcoins. That is, so you're not going to see it happen quickly.

The immediate response to the bitcoin network of the presence of massive bitcoin computation power, which essentially allowed the people who had these machines to be printing money, minting bitcoins with a much greater probability than somebody who just had a CPU running along, the system automatically changes and changed 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. The way this works is that the difficulty of this problem that is being solved, that is, this hashing problem where you're trying to find leading zeroes in the hash, 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 half of that total number of bitcoins will be created, that is, 10,500,000 bitcoins will be created in the first four years. In the second four years, half again, that is, only 5,250,000 in years four through eight. In years eight through 12, that is the next four years, again that amount is halved. And so the rate of coinage creation will be decreasing exponentially, leveling off so that, in the far future, only 21 million will ever be created.

So we have a controlled and known rate of inflation within the system. And it makes sense because, initially, as the system is coming online, 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, and there comes a much greater demand for this, the tendency is to want more. Well, the solution is that you're not forced to trade in integer amounts of bitcoins. That is, the UI right now gives you two decimal digits of coinage. So you're able to create, for example, you could exchange 0.01 of a bitcoin, but the technology supports eight decimal digits, although right now we're only using two. So that allows for deflation over time because we're absolutely capping 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. The system adapts so that the problems being solved scale — the difficulty scales up to balance the amount of processing power in the entire network.

There's an online buyer and seller escrow service, so that two people are able to agree that they're each happy with the exchange of whatever it is they exchanged. For example, in the real world, in order to allow a bitcoin transaction to occur, there are a number of online exchanges where you're able to buy and sell bitcoins. There's online charts where you can look at the rate at which bitcoins are being bought and sold, and their relative currencies. This is available in a huge number of currencies and a whole bunch of languages.

And essentially it is extremely cool crypto which, I mean, this has been pounded on and looked at. And it looks to me like the guy has solved the problems and has created a virtual currency that floats all by itself, that is completely private, that, I mean, obviously you need somebody who's going to agree with you that you want to exchange this coinage. But this thing exists, and it's taking off, and I wanted our listeners to know about it. It's just very cool.

So this whole system is designed to scale correctly and basically create a secure, stable currency with real-world value, which it has now. I mean, you can buy and sell bitcoins. If you wanted to, you could take a hundred dollars and go buy some bitcoins. And they're 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, like, bulletproof. And the PDF explains they've really thought through what bad guys can do. The only attack which is known on the system would involve somebody with massive computational power spoofing the chain because 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 with massive computational power to spoof the chain.

There's bitcoins in them thar Internets. Or something.

Anyway, just really, really fascinating. And, I mean, it works. We have a state-free, crypto-secure, anonymous real currency now that exists.

Check it out at bitcoin.org.

Yeah. There's no piracy in the bitcoin world.


[via my quasi-L.A. correspondent]

December 19, 2012 at 12:01 PM | Permalink


TrackBack URL for this entry:

Listed below are links to weblogs that reference The Mystery of Bitcoin:


The comments to this entry are closed.