Difference between revisions of "Bitcoin"

From ArchWiki
Jump to: navigation, search
m (Corrected dichotomy between "real" and "not-real" currencies. :-))
(Spelling fixes)
 
(123 intermediate revisions by 25 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.
+
{{Style}}
 +
 
 +
{{Related articles start}}
 +
{{Related|List of applications/Internet#Bitcoin}}
 +
{{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. 150 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 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.
  
Line 11: Line 18:
  
 
== Installation ==
 
== Installation ==
The official Bitcoin application can be installed with the {{Pkg|bitcoin-qt}} and {{Pkg|bitcoin-daemon}} packages, available in the [[official repositories]].
 
  
== How to get Bitcoins? ==
+
Install {{Pkg|bitcoin-qt}}, {{Pkg|bitcoin-daemon}} and {{Pkg|bitcoin-cli}}.
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 [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].
+
* 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).
+
  
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].
+
{{Note|Bitcoin Core requires syncing the blockchain (current size is about 90GB as of Sept. 2016); each transaction in a block gets verified by verifying the ECDSA signatures that spend each transaction, which is a time-consuming mathematical operation, so having a good CPU, sufficient storage and bandwidth is highly recommended.}}
  
=== 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].}}
+
  
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.
+
# Encrypt your wallet with a strong password.
 +
# Backup your wallet.dat file using bitcoin-qt.
 +
# See the [https://en.bitcoin.it/wiki/Main_Page official Bitcoin wiki] for additional guidance.
  
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].
+
Lighter software includes {{Pkg|multibit}} and {{Pkg|electrum}}, available in the [[official repositories]] too.
  
There are several Bitcoin miners in the [[AUR]]:
+
You can use this '''systemd service file''' for {{Pkg|bitcoin-daemon}}
* {{App|Bitcoin CUDA|A version of the official Bitcoin daemon with CUDA support (for Nvidia GPUs).|http://www.bitcoin.org/|{{AUR|bitcoin-daemon-cuda}}}}
+
* {{App|CGMiner|A multi-threaded multi-pool CPU and GPU 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|A multi-threaded CPU Miner.|http://yyz.us/bitcoin/|{{AUR|cpuminer-git}}}}
+
* {{App|Phoenix Miner|An efficient, fast, modular, python-based, OpenCL GPU miner.|https://github.com/jedi95/Phoenix-Miner|{{AUR|phoenix-miner-svn}}}}
+
  
== Sample config file ==
+
(You will probably need to change {{ic|1=User=}} or create a bitcoin user.)
An example of a configuration file for {{Pkg|bitcoin-qt}} can be seen below. Make sure to set the mode of the file to {{ic|600}} using:
+
# chmod 600 ~/.bitcoin/bitcoin.conf
+
  
{{hc|~/.bitcoin/bitcoin.conf|<nowiki>
+
{{hc|/etc/systemd/system/bitcoind.service|<nowiki>
# bitcoin.conf configuration file. Lines beginning with # are comments.
+
[Unit]
 +
Description=Bitcoin daemon service
 +
After=network.target
 +
 +
[Service]
 +
Type=simple
 +
User=bitcoin
 +
ExecStart=/usr/bin/bitcoind
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
</nowiki>}}
  
# Network-related settings:
+
== How to get Bitcoins? ==
  
# Run on the test network instead of the real bitcoin network.
+
There are a variety of ways to acquire bitcoins:
#testnet=1
+
* 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].
 +
* 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].
 +
* If you have very good hardware, you can solo mine and attempt to create a new block (currently yields 12.5 BTC plus fees).
  
# Connect via a socks4 proxy
+
=== Mining ===
#proxy=127.0.0.1:9050
+
  
# Use as many addnode= settings as you like to connect to specific peers
+
{{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].}}
#addnode=69.164.218.197
+
#addnode=10.0.0.2:8333
+
  
# … or use as many connect= settings as you like to connect ONLY
+
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.
# 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
+
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].
# find other peers.
+
#noirc=1
+
  
# Maximum number of inbound+outbound connections.
+
There are several Bitcoin miners in the [[official repositories]] as well as in the [[AUR]]:
#maxconnections=
+
  
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
+
* {{App|bfgminer|Bitcoin miner featuring overclocking, monitoring, fan speed control and remote management. For FPGA/GPU/CPU Bitcoin mining.|http://bfgminer.org/|{{Pkg|bfgminer}}}}
  
# server=1 tells Bitcoin to accept JSON-RPC commands.
+
* {{App|CGMiner|Multi-threaded multi-pool CPU miner.|https://github.com/ckolivas/cgminer|{{Pkg|cgminer}}}} (Note: use {{AUR|cgminer-gpu}} for GPU mining as its version was the last to support it).
#server=1
+
  
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
+
== Configuration ==
#rpcuser=user
+
#rpcpassword=password
+
  
# How many seconds bitcoin will wait for a complete RPC HTTP request.
+
'''bitcoin-qt''' should run fine with minimal or no configuration file; however, 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
+
== See also ==
# 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:
+
rpcport=8332
+
 
+
# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind
+
# running on another host using this option:
+
rpcconnect=127.0.0.1
+
 
+
# Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate
+
# with Bitcoin -server or bitcoind
+
#rpcssl=1
+
 
+
# OpenSSL settings used when rpcssl=1
+
rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH
+
rpcsslcertificatechainfile=server.cert
+
rpcsslprivatekeyfile=server.pem
+
 
+
# Miscellaneous options
+
 
+
# Set gen=1 to attempt to generate bitcoins
+
gen=0
+
 
+
# Use SSE instructions to try to generate bitcoins faster. For muliple core processors.
+
#4way=1
+
 
+
# Pre-generate this many public/private key pairs, so wallet backups will be valid for
+
# both prior transactions and several dozen future transactions.
+
keypool=100
+
 
+
# Pay an optional transaction fee every time you send bitcoins. Transactions with fees
+
# 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.
+
#allowreceivebyip=1
+
 
+
# User interface options
+
 
+
# Start Bitcoin minimized
+
#min=1
+
 
+
# Minimize to the system tray
+
#minimizetotray=1
+
</nowiki>}}
+
  
== External Links ==
+
* [http://www.bitcoin.org/ Official Bitcoin website]
* [http://www.bitcoin.org/ Official Bitcoin Website]
+
* [https://en.bitcoin.it/wiki/Main_Page Bitcoin.it wiki]
* [https://en.bitcoin.it/wiki/Main_Page Bitcoin.it Wiki]
+
* [https://bitcointalk.org/ Bitcoin forum]
* [http://forum.bitcoin.org/ Bitcoin Forum]
+
* IRC Channels on Freenode:
* IRC Channels on Freenode :
+
** '''#bitcoin''' - General Bitcoin-related.
** '''#bitcoin''' (General Bitcoin-related)
+
** '''##bitcoin''' - Price talk discussion, etc.
** '''#bitcoin-dev''' (Development and technical)
+
** '''#bitcoin-dev''' - Development and technical.
** '''#bitcoin-otc''' (Over The Counter exchange)
+
** '''#bitcoin-otc''' - Over The Counter exchange.
** '''#bitcoin-market''' (Live quotes from markets)
+
** '''#bitcoin-market''' - Live quotes from markets.
** '''#bitcoin-mining''' (GPU mining related)
+
** '''#bitcoin-mining''' - Mining discussion.
 +
* [https://github.com/znort987/blockparser blockparser] — Fast, quick and dirty bitcoin blockchain parser.

Latest revision as of 14:24, 26 September 2016

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk: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. 150 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 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.

New bitcoins are generated by the network through the process of 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).

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.

Installation

Install bitcoin-qt, bitcoin-daemon and bitcoin-cli.

Note: Bitcoin Core requires syncing the blockchain (current size is about 90GB as of Sept. 2016); each transaction in a block gets verified by verifying the ECDSA signatures that spend each transaction, which is a time-consuming mathematical operation, so having a good CPU, sufficient storage and bandwidth is highly recommended.

Some good practices to consider:

  1. Encrypt your wallet with a strong password.
  2. Backup your wallet.dat file using bitcoin-qt.
  3. See the official Bitcoin wiki for additional guidance.

Lighter software includes multibit and electrum, available in the official repositories too.

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

How to get Bitcoins?

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).

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:

  • bfgminer — Bitcoin miner featuring overclocking, monitoring, fan speed control and remote management. For FPGA/GPU/CPU Bitcoin mining.
http://bfgminer.org/ || bfgminer
  • CGMiner — Multi-threaded multi-pool CPU miner.
https://github.com/ckolivas/cgminer || cgminer (Note: use cgminer-gpuAUR for GPU mining as its version was the last to support it).

Configuration

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

See also

  • Official Bitcoin website
  • Bitcoin.it wiki
  • Bitcoin forum
  • IRC Channels on Freenode:
    • #bitcoin - General Bitcoin-related.
    • ##bitcoin - Price talk discussion, etc.
    • #bitcoin-dev - Development and technical.
    • #bitcoin-otc - Over The Counter exchange.
    • #bitcoin-market - Live quotes from markets.
    • #bitcoin-mining - Mining discussion.
  • blockparser — Fast, quick and dirty bitcoin blockchain parser.