
Bitcoin mining on a 55 year old IBM 1401 mainframe: 80 seconds per hash - dezgeg
http://www.righto.com/2015/05/bitcoin-mining-on-55-year-old-ibm-1401.html
======
userbinator
_I ended up using one character per bit. A 32-bit value is stored as 32
characters, either "0" or "1"._

Bitslice DES does the same thing, although it uses the other bits too to
execute multiple operations in parallel. Perhaps it could be possible to do
much better than 80 seconds/hash on the same hardware.

Also, a missed opportunity to hash block #1401. :-)

------
kristopolous
Still quite a bit faster then the old "pen and paper" method this machine was
a replacement for.

~~~
VLM
Unit record equipment, more likely. Running a bitcoin hash on that would be an
interesting piece of performance art.

Unit record equipment is mechanical enhanced manual processes using punch
cards. They're "almost computers" but missing some key components. So you get
a radix sorter in a big box. And a totalizer in a big box (more or less an
adder). And a selector in a big box. And humans configure the machines by hand
and carry stacks of cards between the machines. They were high tech perhaps a
generation or three before the 1401 in the article.

------
gregwtmtno
Imagine if he solved a block with that thing? That's like douglas adams-level
unlikely.

------
rasur
I'd be curious to know what a modern day IBM mainframe can do, just out of
idle interest.

~~~
aus_
Modern mainframes have an optional cryptographic coprocessor addon. The
hardware, or cryptocard [1], is specialized to provide high-throughput for
common cryptographic functions, including SHA-256. (It does lots more than
that too.)

The latest cryptocard available is the Crypto Express5S [2] and is compatible
with z13s.

And since modern mainframes can run Linux natively (s390x), you could probably
get popular CPU miners to run. Albeit, you'd have to recompile for s390x and
provide patches to utilize CPACF [3].

I could never find any SHA-256 hash rates for the Crypto Express5S, but if you
really wanted to mine bitcoins on a mainframe, this would be the way to go.

[1]:
[http://www-03.ibm.com/security/cryptocards/pciecc/overview.s...](http://www-03.ibm.com/security/cryptocards/pciecc/overview.shtml)

[2]:
[http://www-03.ibm.com/systems/z/hardware/z13_specs.html](http://www-03.ibm.com/systems/z/hardware/z13_specs.html)

[3]:
[https://www-01.ibm.com/support/knowledgecenter/linuxonibm/co...](https://www-01.ibm.com/support/knowledgecenter/linuxonibm/com.ibm.linux.z.wskc.doc/wskc_c_s02cpacf.html)

~~~
TylerE
CPU mining hasn't been relevant for years.

~~~
joshu
You didn't really understand what he said.

------
zokier
Attempting to optimize that sounds like an interesting challenge. If you'd
manage to actually use the BCDesque encoding somehow then that sounds like it
would give nice perf boost.

~~~
LanceH
Failing that, we just need trillions of vintage mainframes.

------
stevewepay
_Most of the time the hash isn 't successful, so you modify the block slightly
and try again, over and over billions of times._

Question: What exactly gets modified over and over again? Is it the nonce that
gets tweaked through every iteration? And is it correct to assume that for a
fixed number of transactions that are added to a block, that there may not be
a hash that works?

~~~
kens
The nonce is the expected thing to tweak, but given current difficulty, it's
pretty likely that trying all the nonces will fail. The timestamp can also be
tweaked, and the transaction list changed. But miners usually change the
"coinbase" transaction (which is the transaction that grants bitcoins to the
miners) by putting an extra nonce in there, since there's extra room and the
transaction can be modified without messing anything up. This is important in
mining pool so miners can do a lot of hashes without constantly contacting the
server to request a new block. See my blog post on mining for details of how
the coinbase transaction is built by concatenation:
[http://www.righto.com/2014/02/bitcoin-mining-hard-way-
algori...](http://www.righto.com/2014/02/bitcoin-mining-hard-way-
algorithms.html)

------
jonjacky
Great! It might be interesting to code this in FORTRAN for the 63-phase
compiler for the 1401 [1]. I wonder how the generated code would compare?

[1] [http://ibm-1401.info/1401-FORTRAN-
Illustrated.html](http://ibm-1401.info/1401-FORTRAN-Illustrated.html)

------
jdub
Beautiful. Lots of fascinating details and photos… especially the status panel
GIF. 😍

~~~
kens
Thanks. It was a bit of a pain to make the status panel GIF; I hadn't kept the
camera stationary, so I had to do a lot of image correction. So I'm glad to
hear someone liked it.

~~~
hberg
....and Google Drive stopped showing the image because "Too many users have
viewed or downloaded this file recently". Is there a cached version somewhere?

~~~
kens
Thanks for letting me know. I've switched the image to a different host, which
hopefully won't hit a bandwidth limit.

What does HN recommend as a high-bandwidth, preferably free way to serve files
such as animated gifs?

~~~
hberg
Thanks for re-hosting it :-) I'm a sucker for "do modern things on old
hardware".

Just saw a great project at Maker Faire where some guys re-purposed old WWII
radar tubes to make playable video games, one of which was flappy bird.

[http://tubetime.us/](http://tubetime.us/) and
[http://www.labguysworld.com/Project_ESCRTs_001.htm](http://www.labguysworld.com/Project_ESCRTs_001.htm)

------
afandian
How long does a hash take on a modern PC?

~~~
Vilkku
Towards the end of the article:

"The IBM 1401 can compute a double SHA-256 hash in 80 seconds. It requires
about 3000 Watts of power, roughly the same as an oven or clothes dryer. A
basic IBM 1401 system sold for $125,600, which is about a million dollars in
2015 dollars. On the other hand, today you can spend $50 and get a USB stick
miner with a custom ASIC integrated circuit. This USB miner performs 3.6
billion hashes per second and uses about 4 watts."

------
markbnj
This is awesome. Well done.

