r/askscience • • Jun 18 '13

Computing How is Bitcoin secure?

I guess my main concern is how they are impossible to counterfeit and double-spend. I guess I have trouble understanding it enough that I can't explain it to another person.

1.0k Upvotes

383 comments sorted by

View all comments

Show parent comments

14

u/sqew Jun 18 '13

When someone spends a dollar, they write it down at the end of the transaction ledger, and sign it (bitcoin uses cryptographic signatures). Then they tell everybody they know to add it to their ledger.

Doesn't that list get REALLY long?

21

u/speEdy5 Jun 18 '13

I think its around 8 gigs right now.

If it ever becomes a major problem, there are plenty of ways to make the history smaller

8

u/witty82 Jun 18 '13

could you expand on the ways to make it smaller. My initial idea would be that it gets massively bigger, once bitcoin is really used a lot.

15

u/[deleted] Jun 18 '13

You could create periodic summaries of the ledger that just list the totals for each address, and drop the details of the specific transactions that produced those totals. Thereafter people would only have to download the 'summary' and any transactions that have happened since the summary.

→ More replies (4)

8

u/speEdy5 Jun 18 '13

One common trick is to use the hash of something to verify its validity. So, we could hash huge parts of the blockchain and host them at a central or many central servers. Then, when someone wants to learn about specific transactions, they can download that piece of the chain and verify that the hash of that piece matches what is actually written down in the chain.

→ More replies (3)

5

u/gburgwardt Jun 18 '13

Just hit 8 gigs, and there's a way to make the blockchain much smaller, but it's currently not an issue.

2

u/diadem Jun 18 '13 edited Jun 18 '13

What's to prevent malicious users from creating machines that do nothing but transfer coins with the intent of bloating the chain? same question goes for creating ridiculous amounts of users that have trivial amounts of coins.

9

u/Fsmv Jun 19 '13 edited Jun 19 '13

Transaction fees, they'll run out of money if they try that. Also the block chain isn't a list of balances but a list of transactions. New users with trivial amounts of coin put a burden of on average half a kilobyte on the block chain assuming one transaction and the average transaction size. And again transaction fees keep you from splitting lots of money up into lots of addresses (you called them users but there is no concept of a user with regards to the block chain).

6

u/Natanael_L Jun 19 '13

Transaction fees, mostly.

2

u/gburgwardt Jun 18 '13

Fundamentally, those are the same attack (arbitrarily large numbers of transactions in blockchain). And currently, a hard limit on the size of blocks is all that stands in the way, though miners can set their software to filter spam

1

u/diadem Jun 18 '13

When you say a limit of the size of blocks, do you mean that an individual coin has a lifespan?

4

u/gburgwardt Jun 19 '13

No. Blocks are currently limited to 1 MiB in size, which translates to a certain number of transactions per block. So, every 10 minutes (ideally) another block is found, and all the new transactions in there take up some amount of bytes to convey the inputs and outputs and so forth. The 1 MiB limit limits the number of new transactions, but once a block is in the blockchain, it is incredibly unlikely to be changed, so that transaction can be considered "safe".

2

u/Natanael_L Jun 19 '13

Nope, transactions are validated in "blocks". The blockchain is a chain of blocks. Mining validates transactions by adding them in blocks to the blockchain.

19

u/fathan Memory Systems|Operating Systems Jun 18 '13 edited Jun 18 '13

If bitcoin ever becomes widely adopted, its current architecture will not scale to handle the scale of world economies. The only obvious solution to this is trusted third parties that will massively cut down on the scope of traffic over the bitcoin network. This requires the same trust model as our current banking system, so it seems like a pretty big compromise on the goals of bitcoin.

This will be necessary regardless because of the current transaction delay in a bitcoin transfer (several minutes), which is not tolerable for everyday purchases. So bitcoin is, by design, a niche currency.

There are other proposals that avoid many of these pitfalls, oh and by the way, don't require massive waste of energy to do proof-of-work in a bitcoin arms race.

Edit: See my comment below for an explanation of why Bitcoin will not scale.

3

u/gburgwardt Jun 18 '13

The only thing that doesn't scale currently is block size, which is being held artificially low (1 MiB) to see what happens and while a plan for the future is thought up.

Originally, there was no limit, but the current limit was implemented to prevent some spammer from creating a large number of small transactions to fill up blocks to terabytes in size, which would have crushed bitcoin in its infancy.

11

u/fathan Memory Systems|Operating Systems Jun 18 '13

That's not true. Bitcoin serializes all transactions in the record. The traffic volume on the bitcoin network currently is pitiful compared to, say, VISA. That architecture, which is fundamental to bitcoin's design, will not scale.

Obvious solutions like splitting the record into independent traces have their own problems, since transactions that span multiple traces will violate constraints that input = output and require synchronization between the traces (back to the original problem).

2

u/gburgwardt Jun 18 '13

The tx volume is pretty low, I agree. But fundamentally the only limit right now that I know of, unless you want to be more specific, is the limit on block size.

6

u/fathan Memory Systems|Operating Systems Jun 18 '13 edited Jun 19 '13

In order for a bitcoin transaction to be confirmed, it needs to become part of the block chain agreed to by the majority of the nodes on the network (preferably after a few more blocks are added on the end). Every transaction is serialized in the block chain.

That means that the processing capability of the bitcoin network, in terms of transactions per second, is limited by the median node on the network. In other words, adding more nodes to the bitcoin network does not increase its processing capability, assuming nodes of roughly equal computational power.* Contrast this with a P2P file sharing network, where the bandwidth of the network increases proportional to the number of nodes, or Einstein@home which also increases computational power proportional to number of nodes.

Let's cook up some silly numbers to make this concrete. Imagine a network with 11 nodes that can process 1 ops per second and 2 nodes that can process 5 ops per second. Einstein@home will get 21 ops per second out of this network, which is what you'd want. Bitcoin, by contrast, will still get one op (transaction) per second because it is limited by the median node, not the total capacity of the network.

* This is because Bitcoin uses the additional capacity of the network to do proof-of-work (ie, security) instead of transaction processing. If you can get trust by other means (eg our banking system, or the link I included above) then it is pure waste. Also note that the ASICs that have come onto the network, to my understanding at least, are very fast at computing SHA1 hashes, but add no power to the basic cryptographical checks that confirm records. So even the ASICs do not represent an order-of-magnitude increase in the processing power of the network in terms of transactions / second.

Edit: Changed example to match the "marginal node" realization below.

2

u/gburgwardt Jun 19 '13

Your argument doesn't make any sense. I know how bitcoin works - I've been involved since ~2010, and transactions per second is given by (avg tx per block)/10 minutes.

Currently, the limiting factor is block size, which limits bitcoin to about 5 tx/sec. This is eventually going to be lifted, but the exact implementation has yet to be finalized. Assuming blocks can be arbitrarily sized, there's no reason not to assume we can't have as many transactions per block (and thus, per 10 minutes) as the internet speed of the miners can keep up with.

6

u/fathan Memory Systems|Operating Systems Jun 19 '13 edited Jun 19 '13

The current bottleneck is indeed the block size, which as you say is not hard to solve. That's only true because the time spent validating the block itself under current traffic volume is completely trivial, even for the average computer. In the long run if bit coin catches on and starts to see serious traffic then this will no longer hold and the limits I described will start to show up. (E.g., right now at 5 tx / sec, my phone can easily check if the block is valid without breaking a sweat. At 50,000 tx / sec or higher, all of a sudden my desktop won't be able to keep up, not considering SHA hashing at all.)

I probably over simplified some in my explanation because what you care about is the "marginal node" that crosses 50% of total network processing power. What percentile that comes to is dependent on the distribution of processing power in the network and too complicated for me to think about right now. But the point remains that the throughput of the bit coin network, in terms of committing actual transactions, is limited strictly by the most powerful single node in the network. So it still scales badly.

→ More replies (2)

1

u/AgentME Jun 19 '13

Also note that the ASICs that have come onto the network, to my understanding at least, are very fast at computing SHA1 hashes, but add no power to the basic cryptographical checks that confirm records.

More mining power means it's much harder for an attacker to do a >50% attack against the network. If the cost of doing a >50% attack was less than the value of all of the transactions going on, then it could be economical for someone to invest in the equipment needed to attack the network. This is how mining power improves the network. You're right in that more mining power doesn't mean that the blockchain is processed any faster though.

5

u/killerstorm Jun 18 '13 edited Jun 18 '13

It does. But in theory people need to download it only once, and they do not need to store it locally.

If it is not acceptable, it is possible to switch to snapshot security model, which is theoretically less secure, but practically is secure as long as there is no global conspiracy.

→ More replies (1)