今更ですが、クソ安い ASIC で BTC のマイニングプールに参入してみました。
ASIC
皆さんが想像されると思われる ASIC。これは Antminer S9k というもの。3万円。4.5kg。1389W。13.5TH/s。ゴツい。
今回使った ASIC。これは TTBIT Bitcoin SHA256 USB Stick Miner というもの。7千円(もっと安く買えるところもあるはず)。60g。5W。12GH/s。小さい。
USB ハブ
USB タイプの ASIC はマシンに直挿しでも良いが、電力対策としてセルフパワーの USB ハブを利用したほうが良いと思う。
設置
見た目からは想像できない騒音が鳴り響く。割とやばい。ちょっとした質の悪い換気扇より煩いかも。
イヤホンで適当な音楽聴きながら作業すると騒音は気にならなくなります。冗談じゃなくて本当に。
ドライバとソフトウェア
cgminer を使う。一言で cgminer といってもいろんな派生があるが、今回は TTBIT の デバイスを使うのでコレを選定。
github.com
自分が試したときは cgminer 5.4.2 TTBIT BTC Beta Driver Release (2018-09-04) が一番新しかったので、これを利用する。
zadig-2.3.exe と new.ttbit.cgminer.windows.zip を入手。
ドライバ書き換え
zadig-2.3.exe を起動。たぶん最初はデバイスが選択できない。
Options - List All Devices で全デバイスを選択できるようにする。
TTbit Bitcoin Miner を選択。
Driver は WinUSB を選択。
Install Driver (or Reinstall Driver) ボタンを押してドライバをインストール。
cgminger 作業
new.ttbit.cgminer.windows.zip を適当な場所に解凍して、コマンドプロンプトで作業を行う。
まずはバージョン確認。
> cgminer --version cgminer 4.9.1
「cgminer 5.4.2 TTBIT BTC Beta Driver Release」を持ってきたはずだが、バージョン表示が違う。気にしないでおく。マイニング界はけっこう雑なので。
認識されているデバイスの確認
> cgminer --ndevs [2019-08-25 18:15:36] USB all: found 9 devices - listing known devices .USB dev 0: Bus 1 Device 5 ID: 10c4:ea60 Manufacturer: 'Silicon Labs' Product: 'TTbit Bitcoin Miner' [2019-08-25 18:15:36] 1 known USB devices > cgminer -T --usb-dump 0 [2019-08-25 18:26:33] Started cgminer 4.9.1 [2019-08-25 18:26:33] USB all: found 9 devices - listing known devices .USB dev 0: Bus 1 Device 5 ID: 10c4:ea60 Manufacturer: 'Silicon Labs' Product: 'TTbit Bitcoin Miner' [2019-08-25 18:26:33] 1 known USB devices [2019-08-25 18:26:34] No devices detected! [2019-08-25 18:26:34] Waiting for USB hotplug devices or press q to quit [2019-08-25 18:26:34] Need to specify at least one pool server. [2019-08-25 18:26:34] Pool setup failed > cgminer -T --usb-dump 1 [2019-08-25 18:19:41] Started cgminer 4.9.1 [2019-08-25 18:19:41] USB all: found 9 devices - listing known devices .USB dev 0: Bus 1 Device 5 Device Descriptor: Length: 18 Descriptor Type: Device USB: 0110 DeviceClass: 0 DeviceSubClass: 0 DeviceProtocol: 0 MaxPacketSize0: 64 idVendor: 10c4 idProduct: ea60 DeviceRelease: 100 NumConfigurations: 1 dev 0: Active Config: DescriptorType: Config NumInterfaces: 1 ConfigurationValue: 0 Attributes: 128 MaxPower: 250 _dev 0: Interface Descriptor 0: DescriptorType: Interface InterfaceNumber: 0 NumEndpoints: 2 InterfaceClass: 255 InterfaceSubClass: 0 InterfaceProtocol: 0 __dev 0: Interface 0 Endpoint 0: DescriptorType: Endpoint EndpointAddress: In: 0x81 Attributes: Bulk MaxPacketSize: 64 Interval: 0 Refresh: 0 __dev 0: Interface 0 Endpoint 1: DescriptorType: Endpoint EndpointAddress: Out: 0x1 Attributes: Bulk MaxPacketSize: 64 Interval: 0 Refresh: 0 dev 0: More Info: Manufacturer: 'Silicon Labs' Product: 'TTbit Bitcoin Miner' Serial 'GS-10015179' [2019-08-25 18:19:41] 1 known USB devices [2019-08-25 18:19:41] Need to specify at least one pool server. [2019-08-25 18:19:41] Pool setup failed
とりあえず何かしら認識できていることは分かる。
マイニングプール選定・アカウント登録
Pool Stats - BTC.com このあたりで各マイニングプールのシェアが分かる。
しょぼいハッシュパワーで参入するので、あまり規模の大きいプールは避けたい。とはいえあまりにもマイナーすぎるプールでは情報量少なくて辛くなると思う。
自分は SlushPool を選んだ。
アカウント作成、ワーカー設定の方法は割愛。(忘れてしまった)
とにかく https://slushpool.com/dashboard/?c=btc ここを開いて自分のアカウントの状態が見えるようになっていれば OK。
マイニング開始
マイニングを開始する時点で分かっているべきもの
- マイニングプールのアカウント名 (今回は tanaka とします)
- マイニングプールのワーカー名 (今回は worker1 とします)
- マイニングプールの stratum アドレス (今回は stratum+tcp://stratum.slushpool.com:3333 とします)
cgminer をプールに向けて実行。
> cgminer -o stratum+tcp://stratum.slushpool.com:3333 -u tanaka.worker1 cgminer version 4.9.1 - Started: [2019-08-25 19:13:22] -------------------------------------------------------------------------------- (5s):15.66G (1m):8.676G (5m):2.507G (15m):894.3M (avg):13.95Gh/s A:0 R:0 HW:0 WU:191.6/m Connected to stratum.slushpool.com diff 1.64K with stratum as user tanaka.worker1 Block: 1746676e... Diff:10.2T Started: [19:13:22] Best share: 117 -------------------------------------------------------------------------------- [U]SB management [P]ool management [S]ettings [D]isplay options [Q]uit 0: TTBIT 10015179: COMPAC-2 100.00MHz HW:0 | 13.86G / 13.71Gh/s WU:191.6/m -------------------------------------------------------------------------------- [2019-08-25 19:13:20] Started cgminer 4.9.1 [2019-08-25 19:13:21] Probing for an alive pool [2019-08-25 19:13:21] Found 2 chip(s) on TTBIT 0 [2019-08-25 19:13:21] Pool 0 difficulty changed to 8192 [2019-08-25 19:13:22] Network diff set to 10.2T [2019-08-25 19:13:59] Pool 0 difficulty changed to 1638 [2019-08-25 19:13:59] Stratum from pool 0 requested work restart
あまり画面に変化は無いが、ときどき追加のログが下部に出力される。
罫線で囲まれた上部の表示は固定で、値はリアルタイムに変動する。上の例ではハッシュレートが 13.71Gh/s 出ていることが分かる。
実は操作はこれだけで良くて、後は放置していれば良い。マイニングプールのウェブサイト側のダッシュボードを眺めていれば何かしら変化が現れる。(うまく設定できていれば)
cgminger 詳細ログ
cgminer 実行時のログの流れはあまりにも少ないので、もっと「動いている感」を味わいたければ「--verbose」引数を付けると良い。
> cgminer -o stratum+tcp://stratum.slushpool.com:3333 -u tanaka.worker1 --verbose cgminer version 4.9.1 - Started: [2019-08-25 20:28:08] -------------------------------------------------------------------------------- (5s):0.000 (1m):0.000 (5m):0.000 (15m):0.000 (avg):0.000h/s A:0 R:0 HW:0 WU:100.9/m Connected to stratum.slushpool.com diff 8.19K with stratum as user tanaka.worker1 Block: 64c83b5c... Diff:10.2T Started: [20:28:08] Best share: 9 -------------------------------------------------------------------------------- [U]SB management [P]ool management [S]ettings [D]isplay options [Q]uit 0: TTBIT 10015179: COMPAC-2 100.00MHz (1/120/390/0) | 3.755G / 7.220Gh/s WU:100.9/m -------------------------------------------------------------------------------- [2019-08-25 20:28:07] Started cgminer 4.9.1 [2019-08-25 20:28:07] TTBIT 0: Found at 1:17 [2019-08-25 20:28:07] TTBIT 0 TX: 84 00 00 11 [2019-08-25 20:28:07] TTBIT 0 RX: 13 82 90 ff 0f [2019-08-25 20:28:07] TTBIT 0 RX: 13 82 90 ff 0f [2019-08-25 20:28:07] TTBIT 0 RX bytes(0): [2019-08-25 20:28:07] Probing for an alive pool [2019-08-25 20:28:07] Testing pool stratum+tcp://stratum.slushpool.com:3333 [2019-08-25 20:28:07] TTBIT 0 TX: 84 00 00 11 [2019-08-25 20:28:07] TTBIT 0 RX: 13 82 90 ff 0f [2019-08-25 20:28:07] TTBIT 0 RX: 13 82 90 ff 0f [2019-08-25 20:28:07] TTBIT 0 RX bytes(0): [2019-08-25 20:28:07] Found 2 chip(s) on TTBIT 0 [2019-08-25 20:28:07] TTBIT 0: set frequency: 100.00 [07 83] [2019-08-25 20:28:07] TTBIT 0: Ticket mask set to 1 [2019-08-25 20:28:07] TTBIT 0 TX: 82 07 83 1c [2019-08-25 20:28:07] TTBIT 0: sending chain inactive for 2 chips [2019-08-25 20:28:07] TTBIT 0 TX: 85 00 00 0f [2019-08-25 20:28:07] TTBIT 0 TX: 01 00 00 19 [2019-08-25 20:28:07] TTBIT 0 TX: 01 80 00 16 [2019-08-25 20:28:07] Pool 0 difficulty changed to 8192 [2019-08-25 20:28:08] Stratum authorisation success for pool 0 [2019-08-25 20:28:08] Pool 0 stratum+tcp://stratum.slushpool.com:3333 alive [2019-08-25 20:28:08] Work update message received [2019-08-25 20:28:08] Network diff set to 10.2T [2019-08-25 20:28:08] New block: 000000000000000000064c83b5c4d9c7974ad2e1b3615194c0d6de9cdfe2ee50... diff 10.2T [2019-08-25 20:28:08] (5s):0.000 (1m):0.000 (5m):0.000 (15m):0.000 (avg):0.000h/s [2019-08-25 20:28:11] Device reported nonce: 39e8f9ee @ 9a [2019-08-25 20:28:11] New best share: 9 [2019-08-25 20:28:11] TTBIT 0: Share above target [2019-08-25 20:28:11] Device reported nonce: af8d0dc5 @ 80 [2019-08-25 20:28:11] TTBIT 0: Share above target [2019-08-25 20:28:11] Device reported nonce: b533232d @ 80 [2019-08-25 20:28:11] TTBIT 0: Share above target .... .... [2019-08-25 20:33:04] Device reported nonce: 2db6776c @ 89 [2019-08-25 20:33:04] TTBIT 0: Share above target [2019-08-25 20:33:06] (5s):11.52G (1m):11.31G (5m):7.095G (15m):3.170G (avg):11.25Gh/s [2019-08-25 20:33:07] Device reported nonce: 8c64b72e @ 9c [2019-08-25 20:33:07] TTBIT 0: Share above target .... .... [2019-08-25 20:40:18] TTBIT 0: Share above target [2019-08-25 20:40:18] Device reported nonce: 8af86051 @ 94 [2019-08-25 20:40:18] TTBIT 0: Share above target [2019-08-25 20:40:18] Work update message received [2019-08-25 20:40:20] (5s):9.559G (1m):13.21G (5m):11.09G (15m):6.589G (avg):11.69Gh/s [2019-08-25 20:40:21] New block: 00000000000000000015c5c6d5c2947935c4345ed1d0698c328d6bdd7fea2f9e... diff 10.2T [2019-08-25 20:40:21] Stratum from pool 0 detected new block [2019-08-25 20:40:21] Work update message received [2019-08-25 20:40:22] Work update message received [2019-08-25 20:40:23] Device reported nonce: 1e3ddf95 @ 94 [2019-08-25 20:40:23] TTBIT 0: Share above target [2019-08-25 20:40:24] Device reported nonce: 3b7ee3cd @ 9a [2019-08-25 20:40:24] TTBIT 0: Share above target [2019-08-25 20:40:25] Device reported nonce: 0e284fd2 @ 81 [2019-08-25 20:40:25] TTBIT 0: Share above target [2019-08-25 20:40:25] (5s):8.295G (1m):12.75G (5m):11.02G (15m):6.587G (avg):11.66Gh/s [2019-08-25 20:40:25] Device reported nonce: 19ff71d3 @ 86 [2019-08-25 20:40:25] TTBIT 0: Share above target [2019-08-25 20:40:26] Device reported nonce: a3ce6959 @ 89 [2019-08-25 20:40:26] TTBIT 0: Share above target [2019-08-25 20:40:26] Device reported nonce: acf72752 @ 89 [2019-08-25 20:40:26] TTBIT 0: Share above target [2019-08-25 20:40:27] Device reported nonce: b7786d1e @ 8d [2019-08-25 20:40:27] TTBIT 0: Share above target [2019-08-25 20:40:27] Device reported nonce: 2af353af @ 8e [2019-08-25 20:40:27] TTBIT 0: Share above target ... ... [2019-08-25 20:41:18] TTBIT 0: Share above target [2019-08-25 20:41:18] Device reported nonce: 1dee86dc @ 96 [2019-08-25 20:41:18] TTBIT 0: Share above target [2019-08-25 20:41:19] Device reported nonce: 14dc5774 @ 98 [2019-08-25 20:41:19] TTBIT 0: Share above target [2019-08-25 20:41:21] (5s):7.758G (1m):11.14G (5m):10.92G (15m):6.825G (avg):11.58Gh/s [2019-08-25 20:41:21] Device reported nonce: 37203915 @ 86 [2019-08-25 20:41:21] TTBIT 0: Share above target [2019-08-25 20:41:22] Device reported nonce: abbeb855 @ 8b [2019-08-25 20:41:22] TTBIT 0: Share above target [2019-08-25 20:41:22] Device reported nonce: 106eb58b @ 8d [2019-08-25 20:41:22] TTBIT 0: Share above target [2019-08-25 20:41:22] Device reported nonce: ae982183 @ 8f [2019-08-25 20:41:22] TTBIT 0: Share above target [2019-08-25 20:41:23] Work update message received [2019-08-25 20:41:23] Device reported nonce: 1ce6f886 @ 96 [2019-08-25 20:41:23] TTBIT 0: Share above target [2019-08-25 20:41:24] Device reported nonce: 1ab89d13 @ 97 [2019-08-25 20:41:24] TTBIT 0: Share above target [2019-08-25 20:41:24] Device reported nonce: 25b87f32 @ 9a [2019-08-25 20:41:24] Pool 0 stale share detected, submitting as user requested [2019-08-25 20:41:24] Submitting share 00616471 to pool 0 [2019-08-25 20:41:24] Rejected 61647116 Diff 673/512 TTBIT 0 (Stale share) [2019-08-25 20:41:24] Device reported nonce: 99c54311 @ 9d [2019-08-25 20:41:24] TTBIT 0: Share above target [2019-08-25 20:41:25] Device reported nonce: a7b6d4c8 @ 82 [2019-08-25 20:41:25] TTBIT 0: Share above target [2019-08-25 20:41:25] Device reported nonce: 8405fc55 @ 84 [2019-08-25 20:41:25] TTBIT 0: Share above target
見るべきポイントは、以下のあたり。
デバイスの調子が悪いときのログ
[2019-08-25 20:26:11] Device serial GS-10015179 not responding [2019-08-25 20:26:11] No devices detected! [2019-08-25 20:26:11] Waiting for USB hotplug devices or press q to quit
- 「Device serial GS-10015179 not responding」… デバイスが応答を返してくれない
- 「No devices detected!」… 有効なデバイスを検知できない
- 「Waiting for USB hotplug devices or press q to quit」… USB 機器が検知されるのを待つのもいいけど、「q」キー押して諦めてもええやで
今回はこの問題が高頻度で起こった。初動は問題なくてもしばらく放置しているとこのエラーが出始める。
どうすればいいかというと、USB 抜いてちょっと冷やして挿し直してあげたりとか、あとは、なんか放置してると勝手に復旧してたりする。
プールの接続先は地域ごとに用意されていたりする
Help Center – slushpool.com ここを見ると分かるんだけど、例えば SlushPool では stratum のアドレスが地域毎に複数用意されていたりする。
例えば今回は「stratum+tcp://stratum.slushpool.com:3333」を利用したけど、日本からの接続であれば「stratum+tcp://jp.stratum.slushpool.com:3333」のようなものもある。こちらのほうがネットワーク距離的に有利に働いてくれることが期待できる。
……という思惑は分かるのだが、経験則的には「jp.stratum.slushpool.com」よりも「stratum.slushpool.com」のほうが繋がりやすい。よりたくさんのユーザが利用するエンドポイントのほうがよりよくメンテナンスされていて安定しているような気がする。あくまでも経験則と憶測によるものだけど。
SlushPool による通知機能
ワーカーの状態をモニタリングしてメール通知してくれたりする。
この例では14分前にワーカーが落ちて、4分前にワーカーが復旧したことが分かる。(ちなみに今回の TTBIT のデバイスはめちゃくちゃ不安定で一日に何十回も勝手に落ちたり復旧したりしている)
オーバークロック・アンダークロック
cgminer の引数でクロックは調整できる。
標準設定だとあまりにもデバイスが落ちるので自分はアンダークロックして様子を見ている。
> cgminger --gekko-2pac-freq 100 .... 標準 > cgminger --gekko-2pac-freq 175 .... たぶん限界ギリギリのオーバークロック > cgminger --gekko-2pac-freq 50 .... アンダークロック(当然ハッシュレートは落ちる)
引数それぞれの詳細には触れないが、結局のところ自分は以下の設定に落ち着いている。(アカウント名、ワーカー名は仮名)
cgminer --gekko-terminus-freq 100 --gekko-2pac-freq 50 --gekko-compac-freq 75 -o stratum+tcp://stratum.slushpool.com:3333 -u tanaka.worker1 --verbose --hotplug 1 --suggest-diff 128
これでも1日に何度も落ちるのだけど。
お金
2日間くらい回していたら 0.00000030 BTC の報酬額になりました。1BTC を 100万円とすると、だいたい 0.3 円くらいの価値です。
以下、使ったお金
- TTBIT Bitcoin SHA256 USB Stick Miner … 7千円。もっと安いショップもあったけど慣れている Amazon で買った。
- セルフパワーの USB ハブ ORICO A3H4 … 2700円。USB ハブ自体を普段使わないので選定に迷った。別にこれが良いかというと微妙。分からない。
cgminer を動かすマシンは家に余ってる適当なラップトップを使っている。65W電源なので電気代はそれほどかかっていないと信じたい。
夜
綺麗といえば綺麗だが、とにかくうるさい。
総括
- とりあえず ASIC というものが動くということは分かった。
- 騒音が激しく、居住空間に置くものではない。
- 既にお気づきだとは思うが、これで儲けようなんて考えないほうが良い。
- ただし体験は貴重である。手を動かしログを眺めた者にしか見えない景色がある。
今後
そこそこ痛い目は見ているものの、もっと良い ASIC、Antminer S9k を試したい気持ちがある。数十万円じゃなくて3万円だからな……買えちゃうんだよな……。電気代と騒音やばそうだけど……。どちらにしろ居住空間に置くものではない。あと収益とかもあんまり考えないほうが良い。純粋にスコアアタックとして楽しむのが良いと思う。
何故いまさらこれをやったのか
「え、この業界にいて、マイニングやったことないんですか!?(プークスクス)」って言われないためです。