Bitcoin generator: android-bitcoin-generator — npm

Содержание

Mining Bitcoin with pencil and paper: 0.67 hashes per day

This article is now available in Japanese: 紙と鉛筆でビットコインをマイニング:1日に0.67ハッシュ and Russian: Майним Bitcoin с помощью бумаги и ручки.

I decided to see how practical it would be to mine Bitcoin with pencil and paper.
It turns out that the SHA-256 algorithm used for mining is pretty simple and can in fact be done by hand. Not surprisingly, the process is extremely slow compared to hardware mining and is entirely impractical. But performing the algorithm manually is a good way to understand exactly how it works.

A pencil-and-paper round of SHA-256

The mining process

Bitcoin mining is a key part of the security of the Bitcoin system. The idea is that Bitcoin miners group a bunch of Bitcoin transactions into a block, then repeatedly perform a cryptographic operation called hashing zillions of times until someone finds a special extremely rare hash value. At this point, the block has been mined and becomes part of the Bitcoin block chain. The hashing task itself doesn’t accomplish anything useful in itself, but because finding a successful block is so difficult, it ensures that no individual has the resources to take over the Bitcoin system. For more details on mining, see my Bitcoin mining article.

A cryptographic hash function takes a block of input data and creates a smaller, unpredictable output. The hash function is designed so there’s no «short cut» to get the desired output — you just have to keep hashing blocks until you find one by brute force that works. For Bitcoin, the hash function is a function called SHA-256. To provide additional security, Bitcoin applies the SHA-256 function twice, a process known as double-SHA-256.

In Bitcoin, a successful hash is one that starts with enough zeros.[1] Just as it is rare to find a phone number or license plate ending in multiple zeros, it is rare to find a hash starting with multiple zeros. But Bitcoin is exponentially harder.
Currently, a successful hash must start with approximately 17 zeros, so only one out of 1.4×1020 hashes will be successful. In other words, finding a successful hash is harder than finding a particular grain of sand out of all the grains of sand on Earth.

The following diagram shows a block in the Bitcoin blockchain along with its hash. The yellow bytes are hashed to generate the block hash. In this case, the resulting hash starts with enough zeros so mining was successful. However, the hash will almost always be unsuccessful. In that case, the miner changes the nonce value or other block contents and tries again.

Structure of a Bitcoin block

The SHA-256 hash algorithm used by Bitcoin

The SHA-256 hash algorithm takes input blocks of 512 bits (i.e. 64 bytes), combines the data cryptographically, and generates a 256-bit (32 byte) output.
The SHA-256 algorithm consists of a relatively simple round repeated 64 times. The diagram below shows one round, which takes eight 4-byte inputs, A through H, performs a few operations, and generates new values of A through H.

One round of the SHA-256 algorithm showing the 8 input blocks A-H, the processing steps, and the new blocks.
Diagram created by kockmeyer, CC BY-SA 3.0.

The blue boxes mix up the values in non-linear ways that are hard to analyze cryptographically. Since the algorithm uses several different functions, discovering an attack is harder. (If you could figure out a mathematical shortcut to generate successful hashes, you could take over Bitcoin mining.)

The Ma majority box looks at the bits of A, B, and C. For each position, if the majority of the bits are 0, it outputs 0. Otherwise it outputs 1. That is, for each position in A, B, and C, look at the number of 1 bits. If it is zero or one, output 0. If it is two or three, output 1.

The Σ0 box rotates the bits of A to form three rotated versions, and then sums them together modulo 2. In other words, if the number of 1 bits is odd, the sum is 1; otherwise, it is 0. The three values in the sum are A rotated right by 2 bits, 13 bits, and 22 bits.

The Ch «choose» box chooses output bits based on the value of input E. If a bit of E is 1, the output bit is the corresponding bit of F. If a bit of E is 0, the output bit is the corresponding bit of G. In this way, the bits of F and G are shuffled together based on the value of E.

The next box Σ1 rotates and sums the bits of E, similar to Σ0 except the shifts are 6, 11, and 25 bits.

The red boxes perform 32-bit addition, generating new values for A and E.
The input Wt is based on the input data, slightly processed. (This is where the input block gets fed into the algorithm.)
The input Kt is a constant defined for each round.[2]

As can be seen from the diagram above, only A and E are changed in a round. The other values pass through unchanged, with the old A value becoming the new B value, the old B value becoming the new C value and so forth.
Although each round of SHA-256 doesn’t change the data much, after 64 rounds the input data will be completely scrambled.[3]

Manual mining

The video below shows how the SHA-256 hashing steps described above can be performed with pencil and paper. I perform the first round of hashing to mine a block. Completing this round took me 16 minutes, 45 seconds.

To explain what’s on the paper:
I’ve written each block A through H in hex on a separate row and put the binary value below. The maj operation appears below C, and the shifts and Σ0 appear above row A.
Likewise, the choose operation appears below G, and the shifts and Σ1 above E. In the lower right, a bunch of terms are added together, corresponding to the first three red sum boxes. In the upper right, this sum is used to generate the new A value, and in the middle right, this sum is used to generate the new E value. These steps all correspond to the diagram and discussion above.

I also manually performed another hash round, the last round to finish hashing the Bitcoin block. In the image below, the hash result is highlighted in yellow. The zeroes in this hash show that it is a successful hash. Note that the zeroes are at the end of the hash. The reason is that Bitcoin inconveniently reverses all the bytes generated by SHA-256.[4]

Last pencil-and-paper round of SHA-256, showing a successfully-mined Bitcoin block.

What this means for mining hardware

Each step of SHA-256 is very easy to implement in digital logic — simple Boolean operations and 32-bit addition.
(If you’ve studied electronics, you can probably visualize the circuits already.)
For this reason, custom ASIC chips can implement the SHA-256 algorithm very efficiently in hardware, putting hundreds of rounds on a chip in parallel. The image below shows a mining chip that runs at 2-3 billion hashes/second; Zeptobars has more photos.

The silicon die inside a Bitfury ASIC chip. This chip mines Bitcoin at 2-3 Ghash/second. Image from Zeptobars. (CC BY 3.0)

In contrast, Litecoin, Dogecoin, and similar altcoins use the scrypt hash algorithm, which is intentionally designed to be difficult to implement in hardware. It stores 1024 different hash values into memory, and then combines them in unpredictable ways to get the final result. As a result, much more circuitry and memory is required for scrypt than for SHA-256 hashes. You can see the impact by looking at mining hardware, which is thousands of times slower for scrypt (Litecoin, etc) than for SHA-256 (Bitcoin).

Conclusion

The SHA-256 algorithm is surprisingly simple, easy enough to do by hand. (The elliptic curve algorithm for
signing Bitcoin transactions would be very painful to do by hand since it has lots of multiplication of 32-byte integers.)
Doing one round of SHA-256 by hand took me 16 minutes, 45 seconds. 16, or 10 quadrillion.
The next question is the energy cost. A cheap source of food energy is donuts at $0.23 for 200 kcalories. Electricity here is $0.15/kilowatt-hour, which is cheaper by a factor of 6.7 — closer than I expected. Thus my energy cost per hash is about 67 quadrillion times that of mining hardware. It’s clear I’m not going to make my fortune off manual mining, and I haven’t even included the cost of all the paper and pencils I’ll need.

2017 edit: My Bitcoin mining on paper system is part of the book The Objects That Power the Global Economy, so take a look.

Follow me on Twitter
to find out about my latest blog posts.

Notes

[1]
It’s not exactly the number of zeros at the start of the hash that matters. To be precise, the hash must be less than a particular value that depends on the current Bitcoin difficulty level.

[2]
The source of the constants used in SHA-256 is interesting. The NSA designed the SHA-256 algorithm and picked the values for these constants, so how do you know they didn’t pick special values that let them break the hash? To avoid suspicion, the initial hash values come from the square roots of the first 8 primes, and the Kt values come from the cube roots of the first 64 primes. Since these constants come from a simple formula, you can trust that the NSA didn’t do anything shady (at least with the constants).

[3]
Unfortunately the SHA-256 hash works on a block of 512 bits, but the Bitcoin block header is more than 512 bits. Thus, a second set of 64 SHA-256 hash rounds is required on the second half of the Bitcoin block. Next, Bitcoin uses double-SHA-256, so a second application of SHA-256 (64 rounds) is done to the result.
Adding this up, hashing an arbitrary Bitcoin block takes 192 rounds in total. However there is a shortcut. Mining involves hashing the same block over and over, just changing the nonce which appears in the second half of the block. Thus, mining can reuse the result of hashing the first 512 bits, and hashing a Bitcoin block typically only requires 128 rounds.

[4]
Obviously I didn’t just have incredible good fortune to end up with a successful hash.
I started the hashing process with a block that had already been successfully mined. In particular I used the one displayed earlier in this article, #286819.

[5]
Another problem with manual mining is new blocks are mined about every 10 minutes, so even if I did succeed in mining a block, it would be totally obsolete (orphaned) by the time I finished.

Майнинг биткойнов — CoinDesk

Бизнес

Майнинг биткойнов

Core Scientific снова повышает тарифы на хостинг для майнинга биткойнов

Компания ожидает, что затраты на электроэнергию в будущем снизятся, что отразится на тарифах на хостинг.

Автор: Элиза Гкрици

21 октября 2022 г., 21:00. UTC

21 октября 2022 г.

Добыча биткойнов Mining CentersCore ScientificExclusive

Business

Добыча биткойнов

Аналитик с Уолл-стрит «выключил» майнеров биткойнов из-за проблем с медвежьим рынком

Аналитик DA Davidson Крис Брендлер понизил рейтинг Core Scientific и Argo Blockchain с «покупать» до «нейтрального» и заявил, что банк «все больше беспокоится» о майнерах.

Аойон Ашраф

21 октября 2022 г., 13:35. UTC

21 октября 2022 г.0004

Майнинг биткойнов

Майнер биткойнов Sphere3D заключает сделку по покупке машин с помощью BitFuFu

Sphere 3D — последняя компания по добыче биткойнов, пытающаяся сократить капитальные затраты на фоне медвежьего рынка криптовалют.

Элиза Гкрици

20 октября 2022 г., 16:19. UTC

20 октября 2022 г.

Центры майнинга биткойнов

Бизнес

Майнинг биткойнов

Binance запустит бизнес по облачному майнингу 9 ноября0004

Пул хешрейта криптобиржи вторгается в проблемную индустрию крипто-майнинга.

Элиза Гкрици

17 октября 2022 г., 18:22. UTC

17 октября 2022 г.

Bitcoin MiningBitmainBinancemining pool

Business

Bitcoin mining

Огромный переизбыток установок для майнинга биткойнов сидит неиспользованным в ящиках для экономики

4 9 низкие цены на криптовалюту и высокие затраты на электроэнергию.

Автор Элиза Гкрици

14 октября 2022 г., 17:09. UTC

14 октября, 2022

Bitcoin Miningminingmining Centresasasicsbitmain

Business

Опорные цифровые

Bitcoin Miner Stronghlold Blainglest до 25 миллионов долларов прибыли компании Northern Data после завершения сделки по размещению буровой установки для майнинга биткойнов.

Элиза Гкрици

14 октября, 2022 в 11:02 утра UTC

, 1422, 2022

Странг, цифровыемингингинбиткоин Miningdebt

Бизнес

Binance

Binance начинается 500 миллионов долларов США для поддержки Bitcoin Mining

. присоединиться к растущим рядам альтернативных кредиторов, стремящихся предоставить капитал проблемной горнодобывающей промышленности.

Сэм Рейнольдс

14 октября 2022 г., 5:20 утра по всемирному координированному времени0005

BinanceBitcoin MiningRiot BlockchainMarathon DigitalLending

Бизнес

Финансирование

Производитель криптооборудования Fabric Systems привлек $13 млн начального финансирования

Сооснователь Skype Яан Таллинн, компания Metaplanet, была среди инвесторов.

Аойон Ашраф

13 октября 2022 г., 16:08. 13 октября 2022 г.0004

BitNile, возможно, также хочет диверсифицировать свой бизнес, отказавшись от майнинга биткойнов, учитывая снижение маржи в отрасли в последние месяцы.

от Джейми Кроули

13 октября, 2022 года в 11:19 утра UTC

13 октября 2022 г.

Биткойн-майндж. Использование в Техасе

Семь демократов из Сената и Палаты представителей спрашивают техасского сетевого оператора ERCOT, как добыча биткойнов влияет на штат.

Автор Элиза Гкрици

12 октября 2022 г., 16:55. UTC

12 октября 2022 г.

TexasBitcoin MiningDemocratsRegulationElizabeth WarrenUS

Bitcoin Mining — Greenidge Generation Holdings Inc.

Безопасный

Greenidge помогает обеспечить безопасность, стабильность и децентрализацию блокчейна биткойнов, обеспечивая более дешевые, быстрые и эффективные платежи по всему миру.

Vital

Greenidge поддерживает глобальную цепочку блоков, помогая обеспечить новое, инновационное финансовое и экологически чистое энергетическое будущее, которое стимулирует экономический рост во всем мире.

Carbon Neutral

Greenidge — это 100% углеродно-нейтральная компания по добыче биткойнов, которая вложила значительные средства в надежные, полностью аккредитованные кредиты на компенсацию выбросов углерода, чтобы обеспечить нулевые выбросы углерода на предприятии. Каждый проект был рассмотрен и сертифицирован одним из трех общепризнанных реестров компенсационных проектов — Американским углеродным реестром (ACR), Запасом климатических действий (CAR) или Verra — что гарантирует, что любые проекты, финансируемые Greenidge, сокращают выбросы или увеличивают поглощение парниковых газов. газа реальным, постоянным и поддающимся проверке способом.

Надежный

Репутация Greenidge — это устойчивая забота об окружающей среде и обществе. Нам полностью разрешено работать как в качестве предприятия по производству электроэнергии, так и в качестве центра обработки данных, который занимается добычей биткойнов, с профессиональной командой как экспертов индустрии криптовалюты, так и ветеранов управления электростанциями с многолетним опытом работы.

Биткойн — первая глобальная децентрализованная криптовалюта, разработанная в 2009 году в соответствии с идеями, изложенными в официальном документе Сатоши Накамото под псевдонимом. Валюта использует одноранговую технологию для облегчения мгновенных платежей, а балансы хранятся в публичной книге с прозрачным доступом для всех.

Биткойн создается, распространяется, торгуется и хранится в децентрализованной системе учета, известной как биткойн-блокчейн. Блокчейн — это официальная запись каждой биткойн-транзакции, которая когда-либо была обработана.

Майнинг биткойнов — это процесс проверки транзакций биткойнов и добавления этих транзакций в блокчейн биткойнов. Биткойн-майнеры, такие как Greenidge, являются неотъемлемой частью сети биткойнов, помогая обеспечить безопасность, стабильность и децентрализацию блокчейна.

Каждая транзакция биткойнов со всего мира должна быть проверена перед добавлением в блокчейн биткойнов. Биткойн-майнеры обрабатывают транзакции и записывают эти транзакции в биткойн-блокчейн.