「Bitcoin」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎イントロダクション: 英語版より転載)
10行目: 10行目:
   
 
検証を行うにはこの整数を一定の閾値以下にする必要があります。ブロックのデータは[[Wikipedia:ja:ノンス|ノンス値]]によって撹拌されています。ブロックのデータが閾値以下の整数になるまで大量の処理能力が費やされます。閾値はビットコインのマイニングを行っている人の数によって決まるため、1ブロックを処理するのに大体10分ほどかかります。
 
検証を行うにはこの整数を一定の閾値以下にする必要があります。ブロックのデータは[[Wikipedia:ja:ノンス|ノンス値]]によって撹拌されています。ブロックのデータが閾値以下の整数になるまで大量の処理能力が費やされます。閾値はビットコインのマイニングを行っている人の数によって決まるため、1ブロックを処理するのに大体10分ほどかかります。
  +
  +
=== Consensus ===
  +
  +
The ''Consensus'' is a Bitcoin specific term to describe P2P network participants' compatibility, with the ''Consensus rules'' describing implementation details of the protocol to adhere to.
  +
  +
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 a bitcoin software you may use is only capable of transacting with parties with which it is in consensus with, i.e. implements the same rules (algorithms) to come to the same result. Should the software's consensus with the network be broken, or consensus of the network at large be broken, the software will only be able to transact with those parties with which it is still 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/
   
 
== インストール ==
 
== インストール ==

2020年12月9日 (水) 17:14時点における版

Bitcoin は中央サーバーや信用機関を必要としない分散型の P2P の電子通貨システムです。ユーザーは貨幣として暗号鍵を保有して互いに直接取り引きを行い、ネットワークの力を借りて二重使用をチェックします。しばしば BTC と表記される (例: '144 BTC') Bitcoin は、米ドルなどの伝統的な通貨に交換することもできます。

イントロダクション

Bitcoin ネットワークはピアツーピアネットワーク上で稼働し、電子署名と暗号証明によって取引を作成・確認します。ノードは取引をネットワークに流すため、全ての取引は公に記録されます。これはブロックチェインと呼ばれます。ブロックとは先行するブロックに記録されていない一部または全ての Bitcoin の最新取引の記録です。ブロックチェインの整合性を保持するため、チェインの各ブロックは一つ前のブロックの整合性を確認し、ハッシュを使うことで最終的に一番最初のブロックまで遡ります。

新しい Bitcoin はマイニングによってネットワークから生成されます。マイニングでは新しいブロックを最新のブロックチェインに追加することが行われますが、有効なハッシュ (この場合巨大な整数) を生成する必要があるため、マイニングには計算力を必要とします。

検証を行うにはこの整数を一定の閾値以下にする必要があります。ブロックのデータはノンス値によって撹拌されています。ブロックのデータが閾値以下の整数になるまで大量の処理能力が費やされます。閾値はビットコインのマイニングを行っている人の数によって決まるため、1ブロックを処理するのに大体10分ほどかかります。

Consensus

The Consensus is a Bitcoin specific term to describe P2P network participants' compatibility, with the Consensus rules describing implementation details of the protocol to adhere to.

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.
警告: It is integral to understand that a bitcoin software you may use is only capable of transacting with parties with which it is in consensus with, i.e. implements the same rules (algorithms) to come to the same result. Should the software's consensus with the network be broken, or consensus of the network at large be broken, the software will only be able to transact with those parties with which it is still 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/

インストール

bitcoin.org から出されている公式の Bitcoin アプリケーションは現在 "Bitcoin Core" と呼ばれており (元は "bitcoin-qt" と呼称されていました) Arch の公式リポジトリからインストールすることができます: (a) bitcoin-qt または (b) bitcoin-daemon bitcoin-cli パッケージ。Bitcoin Core のバージョン 0.10 までは、bitcoin-daemon の bitcoind は RPC サーバーと RPC クライアント 両方の働きをしていました。しかし、バージョン 0.10 から、Bitcoin Core の RPC クライアントは別のバイナリに分けられています (bitcoin-cli) 。bitcoin-qt と bitcoind はどちらも RPC サーバーとして機能するため、bitcoin-cli はどちらのサーバーも使うことができます。マシンに Bitcoin Core のパッケージを3つともインストールしても問題ありませんが、一度に実行できるのは bitcoind または bitcoin-qt のどちらか 片方だけ です。

ソフトウェアをコンピュータにインストールしても、それだけで Bitcoin は使えません。それはあくまですぐ終わることです。Bitcoin Core を使うにあたって時間がかかるのは BTC ブロックチェインの取得で、現在 (Feb 02015) は 22GB のデータファイルをマシンにダウンロードする必要があります。bitcoin-qt や bitcoind を起動すると、まず最初にソフトウェアは BTC ブロックチェインを全てダウンロードします。

軽量ソフトウェアとして公式リポジトリには multibit[リンク切れ: アーカイブ: aur-mirror]electrum があります。

以下の systemd サービスファイルで bitcoin-daemon を使うことができます ('User=' は変更するか bitcoin ユーザーを作成する必要があります):

/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

Bitcoin の入手方法

ビットコインを入手する方法はいくつかあります:

  • 商品やサービスの対価としてビットコインを受け取る。
  • 伝統的な通貨 とビットコインを交換できるサービスが複数存在しています。
  • 直接会って現金とビットコインを交換してくれる人が近くにいないか探す。あなたの近所にいるトレーダーは bitcoin.localbitcoin map で見つけられます。
  • マイニングプール に参加する。
  • 高機能なハードウェアを持っている場合、単独で採掘を行って新しいブロックを作成することもできます (25 BTC 産出されます)。

初めてビットコインを触る場合、BitcoinReward にアクセスすることで無料のコインが貰えます。Bitcoin を手に入れる方法の詳細は We Use Coins を見て下さい。

マイニング

ノート: マイニングで本当に稼ぐには専用のハードウェアが必須です。ハードウェアとパフォーマンスの比較は bitcoin.it wiki を見て下さい。Profit Calculator を使ってあなたのセットアップで利益が出るか確認することができます。

Bitcoin マイニングの基本概念は各ブロックには意味のないランダムなデータが含まれているということです。Bitcoin マイナーは最新のブロックから全てのデータを取得して、ランダムなデータを混ぜ合わせて全体のハッシュを計算します。有効なブロックが見つかるまでとにかく計算し続けます。ハッシュの複製は簡単ですが、ハッシュの予測は不可能であり、完全にランダムな値が生成されるため、マイナーはハッシュを生成するランダムなデータが何なのか予測するすべがありません。

マイニングするにはマイナーを使う必要があります。マイナーはハッシュを計算して Bitcoin を作成するプログラムです。マイニングに関してはこちらの 記事 が詳しく記述しています。

AUR には Bitcoin マイナーがいくつか存在します:

  • CGMiner — マルチスレッドのマルチプール CPU マイナー。
https://github.com/ckolivas/cgminer || cgminer (ノート: GPU マイニングを行う場合は cgminer-gpuAUR を使って下さい)
ヒント: GPU マイニングを行う場合は適切な opencl パッケージが必要になります。Nvidia ならば opencl-nvidia、Intel ならば AUR の intel-opencl-sdkAUR が必要です。
  • cpuminer — マルチスレッドの CPU マイナー。
http://yyz.us/bitcoin/ || cpuminerAUR
  • MiningBeast — マルチプラットフォームのマイニングソフトウェア。
http://miningbeast.com/ || パッケージが存在しないか AUR で検索
  • Phoenix Miner — 効率的、高速、モジュール式、Python ベースの OpenCL GPU マイナー。
https://github.com/jedi95/Phoenix-Miner || phoenix-miner-svnAUR[リンク切れ: アーカイブ: aur-mirror]

サンプル設定ファイル

以下は bitcoin-qt の設定ファイルの例です。次のコマンドを使ってファイルのモードを 600 に設定してください:

# chmod 600 ~/.bitcoin/bitcoin.conf
~/.bitcoin/bitcoin.conf
# bitcoin.conf configuration file. Lines beginning with # are comments.

# Network-related settings:

# Run on the test network instead of the real bitcoin network.
#testnet=1

# Connect via a socks4 proxy
#proxy=127.0.0.1:9050

# Use as many addnode= settings as you like to connect to specific peers
#addnode=69.164.218.197
#addnode=10.0.0.2:8333

# … or use as many connect= settings as you like to connect ONLY
# 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
# find other peers.
#noirc=1

# Maximum number of inbound+outbound connections.
#maxconnections=

# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)

# server=1 tells Bitcoin to accept JSON-RPC commands.
#server=1

# You must set rpcuser and rpcpassword to secure the JSON-RPC api
#rpcuser=user
#rpcpassword=password

# How many seconds bitcoin will wait for a complete RPC HTTP request.
# after the HTTP connection is established.
rpctimeout=30

# By default, only RPC connections from localhost are allowed. Specify
# 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

参照