The bitcoin bible gold edition all you need to know about bitcoins and more
A transaction is a transfer of value between Bitcoin wallets that gets included in the block chain. Bitcoin wallets keep a secret piece of data called a private key or seed, which is used to sign transactions, providing a mathematical proof that they have come from the owner of the wallet.
The signature also prevents the transaction from being altered by anybody once it has been issued. All transactions are broadcast between users and usually begin to be confirmed by the network in the following 10 minutes, through a process called mining.
Mining is a distributed consensus system that is used to confirm waiting transactions by including them in the block chain. It enforces a chronological order in the block chain, protects the neutrality of the network, and allows different computers to agree on the state of the system.
To be confirmed, transactions must be packed in a block that fits very strict cryptographic rules that will be verified by the network. These rules prevent previous blocks from being modified because doing so would invalidate all following blocks. Mining also creates the equivalent of a competitive lottery that prevents any individual from easily adding new blocks consecutively in the block chain.
This way, no individuals can control what is included in the block chain or replace parts of the block chain to roll back their own spends.
This is only a very short and concise summary of the system. If you want to get into the details, you can read the original paper that describes the system's design, read the developer documentation , and explore the Bitcoin wiki.
How does Bitcoin work? This is a question that often causes confusion. In a very real sense, there is no such thing as a bitcoin account. And that keeps users anonymous. Say Alice wants to transfer one bitcoin to Bob. That transaction record is sent to every bitcoin miner—i. Now, say Bob wants to pay Carol one bitcoin. Carol of course sets up an address and a key. And then Bob essentially takes the bitcoin Alice gave him and uses his address and key from that transfer to sign the bitcoin over to Carol:.
After validating the transfer, each miner will then send a message to all of the other miners, giving her blessing. The ledger tracks the coins, but it does not track people, at least not explicitly. The first thing that bitcoin does to secure the ledger is decentralize it. There is no huge spreadsheet being stored on a server somewhere. There is no master document at all.
Instead, the ledger is broken up into blocks: Every block includes a reference to the block that came before it, and you can follow the links backward from the most recent block to the very first block, when bitcoin creator Satoshi Nakamoto conjured the first bitcoins into existence. Every 10 minutes miners add a new block, growing the chain like an expanding pearl necklace.
Generally speaking, every bitcoin miner has a copy of the entire block chain on her computer. If she shuts her computer down and stops mining for a while, when she starts back up, her machine will send a message to other miners requesting the blocks that were created in her absence.
No one person or computer has responsibility for these block chain updates; no miner has special status. The updates, like the authentication of new blocks, are provided by the network of bitcoin miners at large. Bitcoin also relies on cryptography.
The computational problem is different for every block in the chain, and it involves a particular kind of algorithm called a hash function. Like any function, a cryptographic hash function takes an input—a string of numbers and letters—and produces an output.
But there are three things that set cryptographic hash functions apart:. The hash function that bitcoin relies on—called SHA, and developed by the US National Security Agency—always produces a string that is 64 characters long.
You could run your name through that hash function, or the entire King James Bible. Think of it like mixing paint. If you substitute light pink paint for regular pink paint in the example above, the result is still going to be pretty much the same purple , just a little lighter.
But with hashes, a slight variation in the input results in a completely different output:. The proof-of-work problem that miners have to solve involves taking a hash of the contents of the block that they are working on—all of the transactions, some meta-data like a timestamp , and the reference to the previous block—plus a random number called a nonce.
Their goal is to find a hash that has at least a certain number of leading zeroes. That constraint is what makes the problem more or less difficult. More leading zeroes means fewer possible solutions, and more time required to solve the problem. Every 2, blocks roughly two weeks , that difficulty is reset. If it took miners less than 10 minutes on average to solve those 2, blocks, then the difficulty is automatically increased. If it took longer, then the difficulty is decreased.
Miners search for an acceptable hash by choosing a nonce, running the hash function, and checking. When a miner is finally lucky enough to find a nonce that works, and wins the block, that nonce gets appended to the end of the block, along with the resulting hash. Her first step would be to go in and change the record for that transaction. Then, because she had modified the block, she would have to solve a new proof-of-work problem—find a new nonce—and do all of that computational work, all over again.
Again, due to the unpredictable nature of hash functions, making the slightest change to the original block means starting the proof of work from scratch. But unless the hacker has more computing power at her disposal than all other bitcoin miners combined, she could never catch up. She would always be at least six blocks behind, and her alternative chain would obviously be a counterfeit.
She has to find a new one. The code that makes bitcoin mining possible is completely open-source, and developed by volunteers.