Difference between revisions of "Bitcoin"

From ArchWiki
Jump to: navigation, search
(cgminer has removed support for GPU mining. Updated the description to reflect this.)
(Bitcoin software: move #Thin clients to top of software (unchanged); section now goes from simplest to complex methods. arguably follows reader interest better)
 
(340 intermediate revisions by 31 users not shown)
Line 1: Line 1:
[[Category:Internet Applications]]
+
[[Category:Internet applications]]
{{Stub}}
+
[[ja:Bitcoin]]
[[Wikipedia:Bitcoin|Bitcoin]] is a decentralized P2P electronic cash system without a central server or trusted parties. Users hold the cryptographic keys to their own money and make transactions directly with each other, with the help of the network to check for double-spending. Bitcoins, usually denoted by BTC (i.e. '144 BTC'), can also be exchanged for traditional currencies like US dollars.
+
{{Related articles start}}
 +
{{Related|Vcash}}
 +
{{Related articles end}}
 +
[[Wikipedia:Bitcoin|Bitcoin]] is a decentralized P2P electronic cash system without a central server or trusted parties. Users hold the cryptographic keys to their own money and make transactions directly with each other, with the help of the network to check for double-spending. Bitcoins, usually denoted by BTC (e.g. 0.1 BTC), can also be exchanged for traditional currencies like US dollars.
  
 
== Introduction ==
 
== Introduction ==
  
The Bitcoin network runs on peer-to-peer networking, digital signatures and cryptographic proof to make and verify transactions. Nodes broadcast transactions to the network, which records them in a public record of all transactions, called the block chain. A '''block''' is a record of some or all of the most recent Bitcoin transactions that have not yet been recorded in any prior blocks. In order to preserve the integrity of the block chain, each block in the chain confirms the integrity of the previous one, all the way back to the first one, using hashing.
+
The Bitcoin network runs on peer-to-peer networking, digital signatures and cryptographic proof to make and verify transactions. Nodes broadcast transactions to the network, which records them in a public record of all transactions, called the blockchain. A '''block''' is a record of some or all of the most recent Bitcoin transactions that have not yet been recorded in any prior blocks. In order to preserve the integrity of the blockchain, each block in the chain confirms the integrity of the previous one, all the way back to the first one, using hashing.
  
New bitcoins are generated by the network through the process of [[#Mining|mining]]. Mining involves inserting a new block into the current block chain, this is difficult because it requires generating a valid hash (in this case a large integer).
+
New bitcoins are generated by the network through the process of [[#Mining|mining]]. Mining involves inserting a new block into the current blockchain, this is difficult because it requires generating a valid hash (in this case a large integer).
  
 
A variation in difficulty is achieved by requiring that this integer is below a certain threshold - the data in the block is perturbed by a [[Wikipedia:Cryptographic nonce|nonce value]], until the data in the block hashes to produce an integer below the threshold - which takes a lot of processing power. The threshold is set by the number of people currently mining for bitcoins so as to achieve a general speed of about 1 block every 10 minutes.
 
A variation in difficulty is achieved by requiring that this integer is below a certain threshold - the data in the block is perturbed by a [[Wikipedia:Cryptographic nonce|nonce value]], until the data in the block hashes to produce an integer below the threshold - which takes a lot of processing power. The threshold is set by the number of people currently mining for bitcoins so as to achieve a general speed of about 1 block every 10 minutes.
  
== Installation ==
+
== Consensus ==
  
The official Bitcoin application can be installed with the {{Pkg|bitcoin-qt}} and {{Pkg|bitcoin-daemon}} packages, available in the [[official repositories]].
+
{{Accuracy|Contested section, see [[Talk:Bitcoin#Consensus_changes]]}}
 +
 
 +
From [https://en.bitcoin.it/wiki/Consensus Bitcoin.it wiki]:
 +
:The consensus rules are the specific set of rules that all Bitcoin full nodes will unfailingly enforce when considering the validity of a block and its transactions. For example, the Bitcoin consensus rules require that blocks only create a certain number of bitcoins. If a block creates more bitcoins than is allowed, all full nodes will reject this block, even if every other node and miner in the world accepts it. Adding new consensus rules can generally be done as a softfork, while removing any consensus rule requires a hardfork. Rules regarding the behavior of the mere network protocol are not consensus rules, even if a change to the network protocol behavior breaks backward-compatibility. The consensus rules are only concerned with the validity of blocks and transactions.
 +
 
 +
:These rules are called consensus rules because Bitcoin requires that all participants in the Bitcoin economy have consensus (with the meaning of the next definition) as to the consensus rules. If the economy disagrees about the consensus rules, then the currency and economy splits into two or more totally-independent pieces.
 +
 
 +
{{Warning|It is ''integral'' to understand that you are only capable of transacting with parties with which you are in consensus, should your personal consensus with the network be broken, or consensus of the network at large be broken, you will only be able to transact with those parties with which you are in consensus.}}
 +
 
 +
=== Nature of consensus failure ===
 +
 
 +
The nature of consensus is a very strict yet completely voluntary uncoordinated interaction of many independent users. It is both a requirement of the networks correct operation, and a facilitator of its correct operation at the same time. You can be considered to be in consensus with any other node that will accept any data structure relevant to consensus as valid that you have accepted as valid (ignoring of course an instance where two different miners both find valid blocks at the same time and each relay theirs to part of the network, the next valid block will decide which preceding block was valid based on which one it extends from). Consensus can be broken violating explicit consensus rules (violating a rule explicitly spelled out as a consensus rule, i.e. the cap of 21 million bitcoin, rate at which they are issued, the maximum size of a block, that a transaction is only valid if citing a valid unspent coin, etc.) or violating unexplicit rules (due to a bug or unintended consequence of design, i.e. a valid structure erroneously being invalidated due to software bug/improper format/etc., or the use of an attack avenue to overstress the node with load due to a bug or bad design). Both types of consensus failures could potentially come to be intentionally or unintentionally.
 +
 
 +
A discussion of two consensus breaks in Bitcoin Core's history, one explicit, one unexplicit: https://bitcointalk.org/index.php?topic=702755.0
 +
 
 +
A discussion of design flaw on reddit (with citation links to official developers discussion): https://www.reddit.com/r/Bitcoin/comments/5h70s3/bitcoin_unlimited_bu_the_developers_have_realized/
  
 
== How to get Bitcoins? ==
 
== How to get Bitcoins? ==
 +
 +
{{Warning|Your private keys are what allows you to spend your Bitcoin under valid consensus rules. They also allow '''anyone''' else possessing them to spend your Bitcoin. Keeping your private keys safe is the equivalent of keeping your Bitcoin safe, the two are inseparable. Here is a link to the Bitcoin Wiki article on wallet security: [https://en.bitcoin.it/wiki/Securing_your_wallet Wallet Security.]}}
  
 
There are a variety of ways to acquire bitcoins:
 
There are a variety of ways to acquire bitcoins:
 
* Accept bitcoins as payment for goods or services.
 
* Accept bitcoins as payment for goods or services.
 
* There are several services where you can trade them for [https://en.bitcoin.it/wiki/Buying_bitcoins traditional currency].
 
* There are several services where you can trade them for [https://en.bitcoin.it/wiki/Buying_bitcoins traditional currency].
* Find someone to trade cash for bitcoins in-person through a local directory. To find traders near you, you can use [http://www.tradebitcoin.com/ bitcoin.local] or a [http://www.bitcoinmap.com/ bitcoin map].
+
* Find someone to trade cash for bitcoins in-person through a local directory. To find traders near you, you can use [https://localbitcoins.com/ LocalBitcoins] or a [https://coinmap.org/ bitcoin map].
 
* Participate in a [https://en.bitcoin.it/wiki/Pooled_mining mining pool].
 
* Participate in a [https://en.bitcoin.it/wiki/Pooled_mining mining pool].
* If you have very good hardware, you can solo mine and attempt to create a new block (currently yields 25 bitcoins).
+
* If you have very good hardware, you can solo mine and attempt to create a new block (currently yields 12.5 BTC plus fees). See [[#Mining]].
  
For those who are just getting started, you can visit the [https://freebitcoins.appspot.com/ Bitcoin Faucet] to get some free coins. For more details and other ways of making Bitcoins see [http://www.weusecoins.com/getting-started.php We Use Coins].
+
== Bitcoin software ==
  
=== Mining ===
+
Some good practices to consider:
  
{{Note|Mining is only really commercially viable with decent hardware, for a comparison of hardware and their performance see the  [https://en.bitcoin.it/wiki/Mining_hardware_comparison bitcoin.it wiki]. To see if your setup is viable use a [http://bitcoinx.com/profit/ Profit Calculator].}}
+
# Encrypt your wallet with a strong password.
 +
# Backup your keys and transactions (Bitcoin Core stores them {{ic|wallet.dat}}).
  
The basic concept of Bitcoin mining is that there's a little chunk of each block that contains meaningless random data. Bitcoin miners take all the data in the current top block, shuffle up that random chunk and calculate the hash of the whole thing, repeating this until they obtain a valid block. While hashes are easy to reproduce, they're impossible to predict and they seem to function completely randomly, so the miner has no way of predicting what chunk of random data will produce what hash.
+
=== Thin clients ===
  
Mining requires the use of a ''miner'', which is program used compute the required hashes and thus to create Bitcoins. To learn more about mining please read this [http://www.weusecoins.com/mining-guide.php article].
+
Thin clients do not fully validate the blockchain or compute a full UTXO set. They derive their security in proxy by connecting to a fullnode and downloading the blockheaders. They are still able to guarantee the Proof of Work behind a block is valid, and each blockheader contains a merkle root of all the transactions in the block. This allows them to query full node clients for the blockheaders and the data to prove their transaction is in the merkle root in the blockheader. They however must trust that miners are mining valid blocks, and have no way to make sure rules like the issuance rate or cap of Bitcoins are being followed.  
  
There are several Bitcoin miners in the [[AUR]]:
+
{{Warning|In the event of a consensus failure at large on the network, or one affecting the node(s) an SPV client is connected to, the SPV client is incapable of detecting which partition of the network it is on, or communicating to, or being sent information by. It is extremely insecure to send or receive money with an SPV client in the event of such a consensus failure occurring.}}
* {{App|Bitcoin CUDA|Version of the official Bitcoin daemon with CUDA support (for Nvidia GPUs).|http://www.bitcoin.org/|{{AUR|bitcoin-daemon-cuda}}}}
+
* {{App|CGMiner|Multi-threaded multi-pool CPU miner.|https://github.com/ckolivas/cgminer|{{Pkg|cgminer}}}}
+
{{Tip|you need corresponding opencl package to enable GPU mining, {{Pkg|opencl-nvidia}} for Nvidia, {{Pkg|opencl-catalyst}} for AMD, and {{AUR|intel-opencl-sdk}} in AUR for Intel.}}
+
* {{App|cpuminer|Multi-threaded CPU Miner.|http://yyz.us/bitcoin/|{{AUR|cpuminer-git}}}}
+
* {{App|Phoenix Miner|Efficient, fast, modular, python-based, OpenCL GPU miner.|https://github.com/jedi95/Phoenix-Miner|{{AUR|phoenix-miner-svn}}}}
+
  
== Sample config file ==
+
* {{App|Electrum|Lightweight Bitcoin wallet.|https://electrum.org/|{{pkg|electrum}}}}
 +
* {{App|Multibit HD|Lightweight Bitcoin desktop client powered by the BitCoinJ library.|https://multibit.org/|{{pkg|multibit}}}}
  
An example of a configuration file for '''bitcoin-qt''' can be seen below. Make sure to set the mode of the file to {{ic|600}} using:
+
=== Full nodes ===
# chmod 600 ~/.bitcoin/bitcoin.conf
+
  
{{hc|~/.bitcoin/bitcoin.conf|<nowiki>
+
A full node is a bitcoin client which starts with the initial genesis block of the blockchain, and sequentially validates the signature chain of every historical Bitcoin transaction and validity of each historical block to construct upon arriving at the tip of the chain the current Unspent Transaction Output Set (UTXO). This is the current set of unspent coins, and which private keys they are encumbered to. It is called a full node because it obviously verifies the cryptographic integrity of the UTXO set itself. A full node client may or may not also participate in relaying unconfirmed transactions around the network and operate a mempool of all unconfirmed transactions, and may or may not participate in serving the full historical blockchain to new full node clients bootstrapping themselves.
# bitcoin.conf configuration file. Lines beginning with # are comments.
+
  
# Network-related settings:
+
It is possible to run a full node that deletes almost all historical blocks, only keeping the recent history to a certain threshold, but only after having downloaded (97GB as of November 2016) and verified them (which is CPU intensive) in sequence to arrive at the present period it retains. This is to ensure the same guarantee of the cryptographic integrity of the UTXO set.
  
# Run on the test network instead of the real bitcoin network.
+
Initial download of the blockchain can be sped up by increasing the database cache as much as your RAM allows, add {{ic|1=dbcache=M}} to {{ic|~/.bitcoin/bitcoin.conf}} where M is the number of megabytes of RAM to allocate.
#testnet=1
+
  
# Connect via a socks4 proxy
+
See [https://bitcoin.org/en/ bitcoin.org] on how to:
#proxy=127.0.0.1:9050
+
* [https://bitcoin.org/en/full-node#reduce-storage reduce storage] and
 +
* [https://bitcoin.org/en/full-node#reduce-traffic bandwith]
 +
requirements for a full-node.
  
# Use as many addnode= settings as you like to connect to specific peers
+
{{Warning|In order to transact or interact with other clients you must be running compatible software. This is currently a complicated and contentious matter in the Bitcoin community, it is advised you thoroughly research your clients compatibility with others. See [[#Consensus]].}}
#addnode=69.164.218.197
+
#addnode=10.0.0.2:8333
+
  
# … or use as many connect= settings as you like to connect ONLY
+
==== Bitcoin Core ====
# to specific peers:
+
#connect=69.164.218.197
+
#connect=10.0.0.1:8333
+
  
# Do not use Internet Relay Chat (irc.lfnet.org #bitcoin channel) to
+
Currently the dominant standard being used by most Bitcoin nodes. Has the vast majority of bitcoin developers, resources and bitcoin economy behind it.
# find other peers.
+
#noirc=1
+
  
# Maximum number of inbound+outbound connections.
+
[[w:Bitcoin Core]] is the initially published client for Bitcoin. Version {{ic|0.13.1}} introduced signalling for [https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segregated Witness (segwit)].
#maxconnections=
+
  
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
+
[[Install]] the {{Pkg|bitcoin-qt}}, {{Pkg|bitcoin-daemon}}, {{Pkg|bitcoin-cli}} and {{Pkg|bitcoin-tx}} packages.
  
# server=1 tells Bitcoin to accept JSON-RPC commands.
+
You can use this '''systemd service file''' for {{Pkg|bitcoin-daemon}} (You will probably need to change {{ic|1=User=}} or create a bitcoin user):
#server=1
+
  
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
+
{{hc|/etc/systemd/system/bitcoind.service|<nowiki>
#rpcuser=user
+
[Unit]
#rpcpassword=password
+
Description=Bitcoin daemon service
 +
After=network.target
 +
 +
[Service]
 +
Type=simple
 +
User=bitcoin
 +
ExecStart=/usr/bin/bitcoind
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
</nowiki>}}
  
# How many seconds bitcoin will wait for a complete RPC HTTP request.
+
'''bitcoind''' and '''bitcoin-qt''' should run fine with minimal or no configuration file. For a list of configuration parameters that can be added to your {{ic|~/.bitcoin/bitcoin.conf}}, see: {{ic|bitcoind --help}}.
# after the HTTP connection is established.
+
rpctimeout=30
+
  
# By default, only RPC connections from localhost are allowed. Specify
+
[https://bitcoincore.org/ Official Website]''
# as many rpcallowip= settings as you like to allow connections from
+
# other hosts (and you may use * as a wildcard character):
+
#rpcallowip=10.1.1.34
+
#rpcallowip=192.168.1.*
+
  
# Listen for RPC connections on this TCP port:
+
==== Diverging implementations ====
rpcport=8332
+
  
# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind
+
{{Note|These clients have been forked away from the Bitcoin Core codebase, with many different modifications made to [[#Consensus]] related and non consensus related code. Depending on the activation conditions laid out by each client this may initiate a break in consensus to continue a new diverging fork under different consensus rules than currently enforced by the network. While no client has a viable interest to activate rules without some sort of majority support, the final outcome of such an event for the blockchain is highly disputed in the Bitcoin community.}}
# running on another host using this option:
+
rpcconnect=127.0.0.1
+
  
# Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate
+
===== Bitcoin Classic =====
# with Bitcoin -server or bitcoind
+
#rpcssl=1
+
  
# OpenSSL settings used when rpcssl=1
+
[[w:Bitcoin Classic]] is a fork of Bitcoin Core aiming to increase the transaction processing capacity of Bitcoin by increasing its block size limit. [https://bitcoinclassic.com/devel/Blocksize.html]
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH
+
rpcsslcertificatechainfile=server.cert
+
rpcsslprivatekeyfile=server.pem
+
  
# Miscellaneous options
+
[[Install]] the {{Aur|bitcoin-classic}} package or the {{Aur|bitcoin-classic-daemon}} headless one. Bitcoin Classic ships with a [[systemd]] unit {{ic|bitcoind.service}}. More details on the packages can be found [https://bitcoinclassic.com/linuxbuilds.html here].
  
# Set gen=1 to attempt to generate bitcoins
+
This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.
gen=0
+
  
# Use SSE instructions to try to generate bitcoins faster. For muliple core processors.
+
===== Bitcoin Unlimited =====
#4way=1
+
  
# Pre-generate this many public/private key pairs, so wallet backups will be valid for
+
[https://www.bitcoinunlimited.info/ Bitcoin Unlimited] is a fork of Bitcoin Core which removes the block size limit. [https://www.bitcoinunlimited.info/faq]
# both prior transactions and several dozen future transactions.
+
keypool=100
+
  
# Pay an optional transaction fee every time you send bitcoins. Transactions with fees
+
[[Install]] the {{AUR|bitcoind-unlimited-git}} package.
# are more likely than free transactions to be included in generated blocks, so may
+
# be validated sooner.
+
paytxfee=0.00
+
  
# Allow direct connections for the ‘pay via IP address’ feature.
+
{{Accuracy|The other fork sections have a more nuanced "This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.", particularly due to the lack of references (see [[Talk:Bitcoin#Consensus_changes]]) and there is no reference as to why the "unlimited" client should be treated differently}}
#allowreceivebyip=1
+
  
# User interface options
+
Consensus-incompatible implementation.
  
# Start Bitcoin minimized
+
===== Bitcoin XT =====
#min=1
+
  
# Minimize to the system tray
+
[[w:Bitcoin XT]] is a fork of the Bitcoin Core reference client. [[Install]] the {{AUR|bitcoinxt-gui-git}} package.
#minimizetotray=1
+
</nowiki>}}
+
  
== Other clients ==
+
Implementation similar to Bitcoin Classic which also implements [https://bitcoinxt.software/patches.html multiple patches] aimed at improving the network's throughput. This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.
  
There are other clients available for BitCoin.
+
[https://bitcoinxt.software/ Official Website]
  
* {{App|Armory|Client with features for advanced users. It uses information from the satoshi client (bitcoin-qt) for communication with the bitcoin network.|https://bitcoinarmory.com/|{{AUR|armory}}}}
+
=== Mining ===
* {{App|MultiBit|Light-weight client that focusses on being fast and easy to use.|https://multibit.org|{{AUR|multibit}}}}
+
 
* {{App|Electrum|Light-weight client that relies on cloud servers to scan the blockchain.|http://electrum.org/|{{AUR|electrum}}}}
+
{{Note|Mining is only really commercially viable with decent hardware, for a comparison of hardware and their performance see the [https://en.bitcoin.it/wiki/Mining_hardware_comparison bitcoin.it wiki]. To see if your setup is viable use a [https://en.bitcoin.it/wiki/Profitability_Calculator Profit Calculator].}}
 +
 
 +
The concept of Bitcoin mining is based on searching for an input that is hard to find but easy to prove the existence of.  Bitcoin miners construct blocks that consist of a set of transactions users are trying to make and link them to the previously solved block.  Miners add a random piece of data to this, and hash a summary of the block.  If the hash of this summary is below the desired target of the network, the block is considered valid.  Since it is easy to reproduce any individual hash, they are impossible to predict, so the miner does not know which piece of data will create a desirable hash.
 +
 
 +
Mining requires the use of a ''miner'', which is a program used to compute the required hashes and thus create Bitcoins. To learn more about mining please read this [https://en.bitcoin.it/wiki/Mining article].
 +
 
 +
There are several Bitcoin miners in the [[official repositories]] as well as in the [[AUR]].
  
 
== See also ==
 
== See also ==
  
* [http://www.bitcoin.org/ Official Bitcoin website]
+
==== Informational sites ====
* [https://en.bitcoin.it/wiki/Main_Page Bitcoin.it wiki]
+
 
* [http://forum.bitcoin.org/ Bitcoin forum]
+
* [https://bitcoin.org/bitcoin.pdf Bitcoin Whitepaper] - The original whitepaper published by Satoshi Nakamoto before the launch of the live Bitcoin network.
* IRC Channels on Freenode :
+
* [https://www.bitcoin.org/ bitcoin.org] - Today the site is an independent open source project with contributors from around the world. Final publication authority is held by the co-owners, but all regular activity is organized through the public pull request process and managed by the site co-maintainers.
** '''#bitcoin''' - (General Bitcoin-related)
+
* [https://en.bitcoin.it/wiki/Main_Page bitcoin.it Wiki] - Bitcoin Wikipedia.
** '''#bitcoin-dev''' - (Development and technical)
+
* [http://satoshi.nakamotoinstitute.org/ Satoshi Nakamoto Institute] - Thoughts and quotes from the designer.
** '''#bitcoin-otc''' - (Over The Counter exchange)
+
* [https://coin.dance/ Coin Dance] - Broad purpose network statistics.
** '''#bitcoin-market''' - (Live quotes from markets)
+
* [https://21.co/learn/introduction-to-bitcoin-concepts/#introduction-to-bitcoin-concepts Introduction to Bitcoin concepts]. - at 21.co
** '''#bitcoin-mining''' - (GPU mining related)
+
 
 +
==== Discussion groups ====
 +
 
 +
* [https://bitcointalk.org/ bitcointalk.org] - Forum.
 +
* IRC Channels on Freenode:
 +
** '''#bitcoin''' - General Bitcoin-related.
 +
** '''##bitcoin''' - Price talk discussion, etc.
 +
** '''#bitcoin-otc''' - Over The Counter exchange.
 +
** '''#bitcoin-market''' - Live quotes from markets.
 +
** '''#bitcoin-mining''' - Mining discussion.
 +
 
 +
==== Blockchain explorers ====
 +
 
 +
* [https://blockchain.info/ Blockchain.info] - Blockchain explorer/Webwallet.
 +
* [https://btc.blockr.io/ Blockr.io] - Blockchain explorer.
 +
* [https://github.com/znort987/blockparser blockparser] - Fast, quick and dirty bitcoin blockchain parser.
 +
* [https://tradeblock.com/bitcoin/ Tradeblock] - Blockchain explorer with graphical real-time tools.
 +
* [https://live.blockcypher.com/ Blockcypher] - Blockchain explorer.
 +
* [http://bitlox2twvzwbzpk.onion/ BitLox (bitlox2twvzwbzpk.onion)] - [[Tor]] based blockchain explorer.

Latest revision as of 22:02, 16 January 2017

Related articles

Bitcoin is a decentralized P2P electronic cash system without a central server or trusted parties. Users hold the cryptographic keys to their own money and make transactions directly with each other, with the help of the network to check for double-spending. Bitcoins, usually denoted by BTC (e.g. 0.1 BTC), can also be exchanged for traditional currencies like US dollars.

Introduction

The Bitcoin network runs on peer-to-peer networking, digital signatures and cryptographic proof to make and verify transactions. Nodes broadcast transactions to the network, which records them in a public record of all transactions, called the blockchain. A block is a record of some or all of the most recent Bitcoin transactions that have not yet been recorded in any prior blocks. In order to preserve the integrity of the blockchain, each block in the chain confirms the integrity of the previous one, all the way back to the first one, using hashing.

New bitcoins are generated by the network through the process of mining. Mining involves inserting a new block into the current blockchain, this is difficult because it requires generating a valid hash (in this case a large integer).

A variation in difficulty is achieved by requiring that this integer is below a certain threshold - the data in the block is perturbed by a nonce value, until the data in the block hashes to produce an integer below the threshold - which takes a lot of processing power. The threshold is set by the number of people currently mining for bitcoins so as to achieve a general speed of about 1 block every 10 minutes.

Consensus

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Contested section, see Talk:Bitcoin#Consensus_changes (Discuss in Talk:Bitcoin#)

From Bitcoin.it wiki:

The consensus rules are the specific set of rules that all Bitcoin full nodes will unfailingly enforce when considering the validity of a block and its transactions. For example, the Bitcoin consensus rules require that blocks only create a certain number of bitcoins. If a block creates more bitcoins than is allowed, all full nodes will reject this block, even if every other node and miner in the world accepts it. Adding new consensus rules can generally be done as a softfork, while removing any consensus rule requires a hardfork. Rules regarding the behavior of the mere network protocol are not consensus rules, even if a change to the network protocol behavior breaks backward-compatibility. The consensus rules are only concerned with the validity of blocks and transactions.
These rules are called consensus rules because Bitcoin requires that all participants in the Bitcoin economy have consensus (with the meaning of the next definition) as to the consensus rules. If the economy disagrees about the consensus rules, then the currency and economy splits into two or more totally-independent pieces.
Warning: It is integral to understand that you are only capable of transacting with parties with which you are in consensus, should your personal consensus with the network be broken, or consensus of the network at large be broken, you will only be able to transact with those parties with which you are in consensus.

Nature of consensus failure

The nature of consensus is a very strict yet completely voluntary uncoordinated interaction of many independent users. It is both a requirement of the networks correct operation, and a facilitator of its correct operation at the same time. You can be considered to be in consensus with any other node that will accept any data structure relevant to consensus as valid that you have accepted as valid (ignoring of course an instance where two different miners both find valid blocks at the same time and each relay theirs to part of the network, the next valid block will decide which preceding block was valid based on which one it extends from). Consensus can be broken violating explicit consensus rules (violating a rule explicitly spelled out as a consensus rule, i.e. the cap of 21 million bitcoin, rate at which they are issued, the maximum size of a block, that a transaction is only valid if citing a valid unspent coin, etc.) or violating unexplicit rules (due to a bug or unintended consequence of design, i.e. a valid structure erroneously being invalidated due to software bug/improper format/etc., or the use of an attack avenue to overstress the node with load due to a bug or bad design). Both types of consensus failures could potentially come to be intentionally or unintentionally.

A discussion of two consensus breaks in Bitcoin Core's history, one explicit, one unexplicit: https://bitcointalk.org/index.php?topic=702755.0

A discussion of design flaw on reddit (with citation links to official developers discussion): https://www.reddit.com/r/Bitcoin/comments/5h70s3/bitcoin_unlimited_bu_the_developers_have_realized/

How to get Bitcoins?

Warning: Your private keys are what allows you to spend your Bitcoin under valid consensus rules. They also allow anyone else possessing them to spend your Bitcoin. Keeping your private keys safe is the equivalent of keeping your Bitcoin safe, the two are inseparable. Here is a link to the Bitcoin Wiki article on wallet security: Wallet Security.

There are a variety of ways to acquire bitcoins:

  • Accept bitcoins as payment for goods or services.
  • There are several services where you can trade them for traditional currency.
  • Find someone to trade cash for bitcoins in-person through a local directory. To find traders near you, you can use LocalBitcoins or a bitcoin map.
  • Participate in a mining pool.
  • If you have very good hardware, you can solo mine and attempt to create a new block (currently yields 12.5 BTC plus fees). See #Mining.

Bitcoin software

Some good practices to consider:

  1. Encrypt your wallet with a strong password.
  2. Backup your keys and transactions (Bitcoin Core stores them wallet.dat).

Thin clients

Thin clients do not fully validate the blockchain or compute a full UTXO set. They derive their security in proxy by connecting to a fullnode and downloading the blockheaders. They are still able to guarantee the Proof of Work behind a block is valid, and each blockheader contains a merkle root of all the transactions in the block. This allows them to query full node clients for the blockheaders and the data to prove their transaction is in the merkle root in the blockheader. They however must trust that miners are mining valid blocks, and have no way to make sure rules like the issuance rate or cap of Bitcoins are being followed.

Warning: In the event of a consensus failure at large on the network, or one affecting the node(s) an SPV client is connected to, the SPV client is incapable of detecting which partition of the network it is on, or communicating to, or being sent information by. It is extremely insecure to send or receive money with an SPV client in the event of such a consensus failure occurring.
  • Electrum — Lightweight Bitcoin wallet.
https://electrum.org/ || electrum
  • Multibit HD — Lightweight Bitcoin desktop client powered by the BitCoinJ library.
https://multibit.org/ || multibit

Full nodes

A full node is a bitcoin client which starts with the initial genesis block of the blockchain, and sequentially validates the signature chain of every historical Bitcoin transaction and validity of each historical block to construct upon arriving at the tip of the chain the current Unspent Transaction Output Set (UTXO). This is the current set of unspent coins, and which private keys they are encumbered to. It is called a full node because it obviously verifies the cryptographic integrity of the UTXO set itself. A full node client may or may not also participate in relaying unconfirmed transactions around the network and operate a mempool of all unconfirmed transactions, and may or may not participate in serving the full historical blockchain to new full node clients bootstrapping themselves.

It is possible to run a full node that deletes almost all historical blocks, only keeping the recent history to a certain threshold, but only after having downloaded (97GB as of November 2016) and verified them (which is CPU intensive) in sequence to arrive at the present period it retains. This is to ensure the same guarantee of the cryptographic integrity of the UTXO set.

Initial download of the blockchain can be sped up by increasing the database cache as much as your RAM allows, add dbcache=M to ~/.bitcoin/bitcoin.conf where M is the number of megabytes of RAM to allocate.

See bitcoin.org on how to:

requirements for a full-node.

Warning: In order to transact or interact with other clients you must be running compatible software. This is currently a complicated and contentious matter in the Bitcoin community, it is advised you thoroughly research your clients compatibility with others. See #Consensus.

Bitcoin Core

Currently the dominant standard being used by most Bitcoin nodes. Has the vast majority of bitcoin developers, resources and bitcoin economy behind it.

w:Bitcoin Core is the initially published client for Bitcoin. Version 0.13.1 introduced signalling for Segregated Witness (segwit).

Install the bitcoin-qt, bitcoin-daemon, bitcoin-cli and bitcoin-tx packages.

You can use this systemd service file for bitcoin-daemon (You will probably need to change User= or create a bitcoin user):

/etc/systemd/system/bitcoind.service
[Unit]
Description=Bitcoin daemon service
After=network.target
 
[Service]
Type=simple
User=bitcoin
ExecStart=/usr/bin/bitcoind
 
[Install]
WantedBy=multi-user.target

bitcoind and bitcoin-qt should run fine with minimal or no configuration file. For a list of configuration parameters that can be added to your ~/.bitcoin/bitcoin.conf, see: bitcoind --help.

Official Website

Diverging implementations

Note: These clients have been forked away from the Bitcoin Core codebase, with many different modifications made to #Consensus related and non consensus related code. Depending on the activation conditions laid out by each client this may initiate a break in consensus to continue a new diverging fork under different consensus rules than currently enforced by the network. While no client has a viable interest to activate rules without some sort of majority support, the final outcome of such an event for the blockchain is highly disputed in the Bitcoin community.
Bitcoin Classic

w:Bitcoin Classic is a fork of Bitcoin Core aiming to increase the transaction processing capacity of Bitcoin by increasing its block size limit. [1]

Install the bitcoin-classicAUR package or the bitcoin-classic-daemonAUR headless one. Bitcoin Classic ships with a systemd unit bitcoind.service. More details on the packages can be found here.

This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.

Bitcoin Unlimited

Bitcoin Unlimited is a fork of Bitcoin Core which removes the block size limit. [2]

Install the bitcoind-unlimited-gitAUR package.

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: The other fork sections have a more nuanced "This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.", particularly due to the lack of references (see Talk:Bitcoin#Consensus_changes) and there is no reference as to why the "unlimited" client should be treated differently (Discuss in Talk:Bitcoin#)

Consensus-incompatible implementation.

Bitcoin XT

w:Bitcoin XT is a fork of the Bitcoin Core reference client. Install the bitcoinxt-gui-gitAUR package.

Implementation similar to Bitcoin Classic which also implements multiple patches aimed at improving the network's throughput. This client is potentially consensus-incompatible with the rest of the network, and upon conditions being met will fork away from the previous chain and consensus rules.

Official Website

Mining

Note: Mining is only really commercially viable with decent hardware, for a comparison of hardware and their performance see the bitcoin.it wiki. To see if your setup is viable use a Profit Calculator.

The concept of Bitcoin mining is based on searching for an input that is hard to find but easy to prove the existence of. Bitcoin miners construct blocks that consist of a set of transactions users are trying to make and link them to the previously solved block. Miners add a random piece of data to this, and hash a summary of the block. If the hash of this summary is below the desired target of the network, the block is considered valid. Since it is easy to reproduce any individual hash, they are impossible to predict, so the miner does not know which piece of data will create a desirable hash.

Mining requires the use of a miner, which is a program used to compute the required hashes and thus create Bitcoins. To learn more about mining please read this article.

There are several Bitcoin miners in the official repositories as well as in the AUR.

See also

Informational sites

  • Bitcoin Whitepaper - The original whitepaper published by Satoshi Nakamoto before the launch of the live Bitcoin network.
  • bitcoin.org - Today the site is an independent open source project with contributors from around the world. Final publication authority is held by the co-owners, but all regular activity is organized through the public pull request process and managed by the site co-maintainers.
  • bitcoin.it Wiki - Bitcoin Wikipedia.
  • Satoshi Nakamoto Institute - Thoughts and quotes from the designer.
  • Coin Dance - Broad purpose network statistics.
  • Introduction to Bitcoin concepts. - at 21.co

Discussion groups

  • bitcointalk.org - Forum.
  • IRC Channels on Freenode:
    • #bitcoin - General Bitcoin-related.
    • ##bitcoin - Price talk discussion, etc.
    • #bitcoin-otc - Over The Counter exchange.
    • #bitcoin-market - Live quotes from markets.
    • #bitcoin-mining - Mining discussion.

Blockchain explorers