
How Bitcoin Works - kam
https://en.bitcoin.it/wiki/How_bitcoin_works
======
Corrado
I'm still a bit unclear as to what prevents someone (government, IBM, Amazone
EC2, ...) from setting up shop and throwing CPUs at mining. I know that it
will slow everyone down but surly the NSA has enough horsepower to drown
almost everyone else out. Right?

~~~
dekz
They have to get ahead of the chain and then out compute the rest of the grid
of "honest" nodes. I believe currently all clients will just accept the
current block chain with the most amount of work on it. So if they can drown
out everyone they can spawn off their own chain, take a look at the thesis by
Satoshi (<http://www.bitcoin.org/sites/default/files/bitcoin.pdf>) where he
talks about this under Calculations.

~~~
mshron
I believe OP is not concerned about bogus chains, but imbalances in computing
power. This is not a serious problem but it looks like one on the face of it.
If a massive amount of computation suddenly went into computing bitcoins there
are two issues you could be worried about.

The first is that it isn't very fair. The reply to this is that the current
balance of money isn't fair either, we just didn't get to watch it happen. And
as people have said elsewhere, it's not reasonable to expect a currency to
solve social inequality.

The second is that, if the cost of mining a bitcoin goes through the roof but
there is not enough economy to make money on transaction fees, then people
will drop out of mining. However: difficulty is not automatically increasing,
it's proportionally increased or decreased relative to the difficulty of the
past two weeks. If it becomes prohibitively expensive for Amazon to mine for
bitcoins and they drop out, the threshold will fall again. Either way there's
always an incentive to keep it running, until the system is out of coins.

(edit for clarity)

~~~
Groxx
> _until the system is out of coins._

Which won't happen. They exponentially decrease in value per block as time
goes on. And to offset this, as fewer are created, they will be worth more,
because by that point there will be far more people using Bitcoin (if it
doesn't bust, first).

~~~
euccastro
As currently designed, the system has an absolute cap at ~21 million coins.

~~~
delinka
But if coins are [infinitely?] divisible, then the currency just undergoes
deflation.

~~~
weavejester
Not infinitely, but divisible to 8 decimal places IIRC.

------
gojomo
What's the easiest way to accept BTC as payment on the web?

For example, are there drop-in examples for common web-app frameworks? Would
it involve the customer cutting & pasting a few long BTC strings between the
browser and some separate wallet app?

Would the web-app keep polling a separate Bitcoin service to achieve
confirmation/confidence that a payment has gone through?

~~~
weavejester
The process goes something like this.

1\. A user clicks on a link to buy an item

2\. Web application generates a new bitcoin address. This can be done by
sending a command to the official BitCoin daemon, or by calling a method on
the BitCoinJ Java library.

3\. The web application asks the user to send a sum of money to the recently
generated address. If the user is using the official Bitcoin client, they'd do
this by clicking "Send Coins", then copy-pasting the address and the correct
amount of money into the dialog box.

4\. The web application then either polls the Bitcoin daemon to see if the
transaction has come through yet, or sets up an event handler if the web app
is using BitcoinJ. The transaction must obviously be sent to the right address
with the right amount of bitcoins.

5\. When the transaction has come through, you can now deliver the product to
the user. If there's no particular hurry, or if the product is high-value, you
may want to wait until a certain number of Bitcoin nodes have confirmed the
transaction.

As far as I'm aware, there aren't yet any drop-in plugins for common web
frameworks, but it wouldn't be hard to make one.

~~~
ericflo
Does step three involve copy-pasting by design, or can that experience be
improved?

~~~
weavejester
It could be improved with a browser plugin, or perhaps by registering a URL
protocol with the browser.

For instance, there could be a link like:

    
    
      bitcoin://1MvtfpuCtfDb2EfbevDB1Ep6Z2X1h5nskf?amount=10.00
    

This could open up your Bitcoin client with the "Send Coins" dialog box open
with the address and amount already filled out. Then the user could just hit
the "Send" button to confirm the transaction.

However, this is just an example, and nothing like this has been implemented
yet to my knowledge.

------
StavrosK
What I've never heard mentioned or answered is "how well does it scale?"... It
seems to me that, after a few million nodes enter the network, it will take
more time to process the transactions that are created than to create them,
and gigabytes of space to store them.

Not to mention that new clients will basically never catch up with all this
history. How do they solve this?

~~~
mike_esspe
There will be a light client, which doesn't need to download blockchain. Only
miners will be using the full chain. How it will work is explained in the
author's paper: <http://www.bitcoin.org/sites/default/files/bitcoin.pdf>

BTW google's implementations (<http://code.google.com/p/bitcoinj/>) works in
this mode.

~~~
richardw
When mining starts slowing down because it's too expensive or we hit the 21m
limit, who takes up the ongoing work?

I guess the benefits of contributing will move mainly towards commissions.
What else?

~~~
mike_esspe
Commission. Plus we won't hit 21m until the middle of 22th century. Probably
there will be a post-scarcity (<http://en.wikipedia.org/wiki/Post_scarcity>)
by that time, so money will be only of historical interest :)

~~~
mkramlich
I think Bitcoin's plans for the 22nd century should be revised to reflect the
highly accurate predictions made by Hari Seldon using his psychohistory
method. ;)

------
ced
_The last block that will generate coins will be block #6,929,999. This should
be generated around year 2140._

Isn't that entirely dependent on the rate of technical progress? Furthermore,
what happens when the crypto algorithms are broken?

~~~
kgo
They only release the next 50 coins every ten minutes so that's constant. And
then they adjust the work factor based on recent history so it's always
reasonably hard.

~~~
joe_the_user
Who's they? Isn't the system supposed to be decentralized?

What if "they" change their minds?

~~~
dekz
There is no they who release new blocks, every X number of blocks (2 weeks on
average) all nodes recalculate the difficulty level of the next stint to
attempt to keep the growth around the expected curve (a new block every 10
minutes). So if some hot new Amazon GPU cloud grid joined and churned out
block after block, after the certain X block is reached the difficulty is
increased.

~~~
lutorm
So what prevents me from changing the code I'm running so that the difficulty
level is lower? Is this another instance of "if it's accepted by most nodes
then it's the truth" mechanism.

~~~
rfugger
If you lowered your difficulty, other nodes who follow the prescribed
convention for setting the difficulty will reject your blocks and any further
chain built on them as invalid. Agreement on the formula for computing
difficulty is required to have a unified block chain. If a bunch of nodes pick
a different difficulty formula, it will fork the block chain, and there will
be two different incompatible transaction records.

------
markkat
I think a flattr like service that uses Bitcoins would be great. It might be a
good way to increase circulation too.

~~~
hendi_
There is one service, at least similar to flattr: www.youtipit.org

------
bufo
Yeah, it's a very nice way to get around this well known problem. However what
surprises me most is that if they ever want to be adopted on a large scale the
clients ought to be better than this. ALL TRACE of your money is stored in a
single file (wallet.dat) and there is no way with the default clients to back
it up and encrypt it (very easy to do with dropbox etc). In real life we never
carry all our money with us and we can block our credit cards should these be
lost...

~~~
epscylonb
A large scale bitcoin economy would not look too different to the average user
than the current economy does.

An average joe would not run bitcoin themselves, they would use a bitcoin
bank, check out mybitcoin for an early example of such a service.

------
fourstar
This is still the best explanation of bitcoin:
<http://www.youtube.com/watch?v=XQPSwA2Itbs#t=2516s>

~~~
jedaro
hi, you had a comment that you have code for a site similar to launchrock,
could you send to @ jedarogroup@gmail.com

------
newgrad
I might be missing something here, but it seems to make the future computers
to be really power hungry. Are we sure this is not a waste of electricity?

~~~
gyom
I know. That bothers me too, to think that we'd have all these computers
churning bitcoins instead of computing gene-folding and whatnot.

However, you could argue that mining for gold or diamonds is even worse. You
ruin the land with strip mining, you get "conflict diamonds" responsible for a
lot of human suffering and at the end of the day you just have more precious
useless metal that you store in a vault.

------
ww520
What happen to the transactions in the block chains that lose out? Let's say a
payer paid me by creating a transaction and broadcast it. That transaction got
lumped into the current leading block chain. Somehow another block chain gains
and wins. The block chain containing the transaction is discarded. What
happened to the transaction? Is it discarded as well? Do I just got unpaid?

~~~
wmf
You'd resend the transaction and it would get included in a later block.

------
malloreon
Do they at least look like tulips?

~~~
daniel1980fl
ok, so is it only me, or this is NO difference for having your own money-
printing machine??

I respect the idea and execution and OK it is secure and everything, but if
you can use your hands/brain to create work and get paid for that work in
currency X, and then use that currency X to sustain yourself (pay bills, food,
gas, etc), then the entire government become obsolete!! I am not arguing here
whether a mature society needs government or not, I rather say here that there
is a government in place (at least US) and this will be taken as a treason and
a pure act of terrorism! (terrorism is any attempt to derail a government
entity).

I am sure feds/FBI is in it by now! There was a lesson learnt for music
industry when P2P blown out and basically the law lost and it is so easy even
today to obtain copyrighted music/audio materials. I am SURE federal
government will not let entire country economy to be at stake by some P2P
currency.

~~~
usedtolurk
That's a bit of an exaggeration. Many countries do not have their own currency
and still manage their own economies.

Still, I take your point that it's not something they would let go of without
a fight.

