Google-Apps
Hauptmenü

Post a Comment On: Ken Shirriff's blog

"Bitcoin mining on a 55 year old IBM 1401 mainframe: 80 seconds per hash"

36 Comments -

1 – 36 of 36
Blogger Dogzilla said...

I learned Fortran in 1977 using punch cards, I feel your pain.

How many cards did you have to throw away before you had the complete program?

May 23, 2015 at 9:35 AM

Blogger Ken Shirriff said...

Hi Dogzilla! I developed the program on the ROPE 1401 simulator, so I only needed to punch it once. The card with the Bitcoin logo, on the other hand: that took about 20 tries

May 23, 2015 at 10:01 AM

Blogger Dogzilla said...

Lucky you!

MY first computer experience was programming a Honeywell computer using cards punched on an IBM punch card machine. I had never used a keyboard before, so errors were very common, plus, the character sets weren't 100% matches (I think the IBM punch card machine was EBCDIC). I will live forever knowing that I had to punch an '&' character for the compiler to see a '(' character. I had to type '&x+3)' if I wanted '(x+3)'.

Add to this, we were supposed to write and debug the program on paper, computer time was expensive, so we lost 5 points credit for every time we ran the deck of cards after the first.

I really enjoy your writing, especially on the Z80, since I worked on the Z80 and the 68000 while at Mostek in the early 80s.

May 23, 2015 at 11:32 AM

Blogger Dogzilla said...

I just finished a great book you might like. Its called "Digital Apollo - Human and Machine in Spaceflight", by D. Mindell. It covers a lot of ground about the Apollo computer and control systems, at a technical level, but you don't need to understand Control Theory to follow it. I'd call it management level.

May 23, 2015 at 11:42 AM

Blogger Kaos said...

Very cool!

Small note: In the second to last sentence of the first paragraph:

"[...]the 1401 takes 80 seconds for a single block"

I think you meant "for a single HASH"

May 23, 2015 at 11:52 AM

Anonymous Randy Bush said...

i loved the 1401, and wished you had described it in more depth, variable length instrs, A, B, and M bits, combined op-codes (read, write, punch, and branch!), ... but i guess that is not the point of your story. good hack!

May 23, 2015 at 2:00 PM

Blogger Ken Shirriff said...

Dogzilla: thanks for the book recommendation; I plan to look at the Apollo Guidance Computer in more detail at some point.

Kaos: I've update the text to make it clearer.

Randy: my previous article on the 1401 went into much more technical detail, so I didn't repeat the details here.

May 23, 2015 at 2:45 PM

Anonymous Anonymous said...

12 minute mandelbrot? You and your high-end hardware. With a Casio programmable calculator from around 2010, it took almost an hour to fill the screen (written in pseudo-BASIC, ran at about 3 instructions per second).

I'll let you know if I manage to get it doing SHA-256 hashes.

May 23, 2015 at 4:58 PM

Anonymous Geoff Ellis said...

Why are you attributing the increase in computational power over the ladr few decades to moores law? Moores law was an observation and prediction. Nothing else. It was the sustained effort of many engineers over thag period. It would have happened with or without moores prediction.

May 23, 2015 at 10:49 PM

Blogger Ken Shirriff said...

Geoff: there's a strong argument that the existence of Moore's law in fact has driven semiconductor planning and roadmaps to stay on the curve. In other words, while Moore's law was originally an observation, now it is actually driving progress.

In any case, I've changed the wording to avoid confusion.

May 24, 2015 at 9:19 AM

Anonymous Anonymous said...

Hi,

My first permanent full time job was programming a 1401. This does bring back memories :-)

Peter

May 24, 2015 at 10:55 PM

Anonymous Anonymous said...

Very interesting. But for those of us of a certain age, the 1410/7010 system was much easier to understand and much more powerful. Do any working 1410s exist anywhere?

May 25, 2015 at 1:12 AM

Blogger Seba said...

Do you think that if you were implementing this in the sixties, you could mine an entire block, giving that difficulty at that time should be very low, or it actually depends on different factors?

May 25, 2015 at 2:29 PM

Anonymous Anonymous said...

I started on 360's but the 1403 printer lived on right until the 380's when lasers took over. And punch cards lived on too with the 2540. IIRC the 1403 shared the controller with the 2540 and that still used SMS cards.
And, of course, the 360's have 1401 emulation mode which was used to encourage upgrading to 360.

May 25, 2015 at 6:38 PM

Blogger ggm said...

A 1960s hashing function would have been implemented in 1960s technology. SHA1/256 is not a 1960s hash function.

Cryptographic hash functions date from the 1970s. So what we'd have in the 1960s would be a simple CRC protection and then a bit more maybe.

A 1960s blockchain would have set the computability bar at the level of technology within grasp. Maybe a 1970s hash function would run faster? some kind of HMAC from the early days?

May 26, 2015 at 9:57 AM

Blogger Sorrel Jakins said...

1401 assembly looks like SAMOS that I had to use in Computer Science 101 in the '60's

May 26, 2015 at 11:35 AM

Blogger Tcat said...

http://www.amazon.com/Digital-Apollo-Human-Machine-Spaceflight/dp/0262516101

May 26, 2015 at 12:46 PM

Blogger Unknown said...

I have very fond memories of this computer (in the guise of a 1720 that had all sorts of D/A stuff connected to the basic 1401. I remember picking up a text book on it for a class, and I had read 10+ chapters before the first class. Was a bit "greek" to me, but by the second lecture, I was hooked and WAY AHEAD of the rest of the class. This and the Physics Dept. pdp-8 became my "friends", and I have been an avid computer "hobiest" for nearly 40 years. Really glad they have two working examples of such a milestone computer!

May 26, 2015 at 1:37 PM

Blogger Unknown said...

Ken, great blog post which is rightly getting a lot of attention. I work for IBM in the mainframe team and would love to discuss this with you further. Please Tweet me @StevenDickens3 and we can share contact details and hopefully have a chat about how we can potentially collaborate on this interesting topic.

May 26, 2015 at 3:24 PM

Blogger Asterix said...

You should have tried this on a Model I 1620 (CADET). Does all of its arithmetic by table lookup in memory.

May 28, 2015 at 11:04 AM

Anonymous Anonymous said...

Fantastic achievement, I have had a similar idea simmering for a long time that I'd attempt to mine a bitcoin on my PDP-11/05. But that's not worth doing now, as yours trumps everything! :)

By the way are there really thousands of SMS cards in a 1401? I would have thought hundreds?

May 28, 2015 at 7:15 PM

Anonymous Anonymous said...

I remember hearing about the CADET years ago. My recollection is that CADET was actually an acronym as well as a code name:

Can't
Add
Doesn't
Even
Try

I don't know if the history is right, or just a later embellishment of the CADET name. I wrote 2 simple programs for the 1401 back in 1970-71 when I befriended one of the programmers at the High School district office.

May 28, 2015 at 10:09 PM

Blogger David Galloway said...

So when can we expect the SMS card based hardwired Bitcoin computer?

June 10, 2015 at 6:08 PM

Anonymous Anonymous said...

I love your posts! Fantastic

June 8, 2016 at 5:31 AM

Anonymous benwest said...

this question is about pool extranonce? and prof of work related to the pool?
Does the pool give every pool's miner a set of the possible values of the nonce to run through ?
if we suppose a poole contain only 2 miners miner1 and miner2;
and V1,V2, ..., Vn, Vn+1, ..., Vmax are the possible values of the nonce;
does miner1 work with nonce values in V1, ..., Vn
and miner2 work with values in Vn+1, ..., Vmax
??
( I think the pool is like a single node of the bitcoin peer to peer network and the bitcoin-core code doesn't include a subroutine or class program about pool ????)

January 11, 2017 at 12:38 PM

Blogger StefanV said...

Hi Ken: Just came across your post while reading your newer one about mining with the Alto. Do you remember that Selectric printer I had back in first year at UW (the one we used to type out our entry in the shortest APL program contest)? The interface between that and my TRS-80 used a handful of SMS cards (solenoid driver cards), interfaced to some homebrew TTL logic.

July 14, 2017 at 9:39 AM

Blogger Unknown said...

Hello Ken,

You have a really great informative blog with technology related topics, especially regarding vintage computing. Your articles are very descriptive and explain things in details, so I am able to understand them and get some insight to learn about new things. I used to collect much of the older hardware many years ago from Sparc (Sparcstations 4,5, SUN E450), PaRISC (HP 9000 712), VAX (9000 series), SGI (Indigo 2, Indy) workstations and servers, but never really managed to get good in restoring those. So I still have some of these hardware waiting for better days. In my country there are no clubs or computer museums that would connect such people with similar interests, which is a pity, because I couldn't get anyone to assist me. I also like your Bitcoin related articles, the thing about mining bitcoins on a 55-year old mainframe is just amazing, and mining them with a pencil and a paper is probably the best "magic trick" to learn after the Rubik's Cube assembly procedure to impress people, very interesting. :)

Kind regards,
Jan

January 6, 2018 at 2:11 AM

Anonymous Anonymous said...

Hola! I've been reading your blog for a while now
and finally got the bravery to go ahead and give you a
shout out from Austin Texas! Just wanted to say keep up the great job!

February 12, 2018 at 12:04 PM

Blogger George Leroy Tyrebyter said...

Hi Ken, it was actually the case that the 1401 had subroutines. Sure, not a stack like today for return addresses, but one did it like this:

SUBROUTINE SBR RETURN+3 Store the "B" Register

... code
RETURN B 0 The 0 would be overwritten by the return address.

The 'B-Reg' held the next instruction; by storing it immediately after taking the branch that 'calls' the subroutine, as shown here, the branch at the end of the subroutine is effectively converted into a Return-From-Subroutine instruction.

June 8, 2018 at 3:40 PM

Blogger Stephanus said...

Just when I tought I'm and old guy (born in 1970), I find you guys.

June 9, 2018 at 5:55 AM

Anonymous gmorg said...

Big big up from Italy! Your blog is awesome!

June 16, 2018 at 1:52 PM

Blogger John Cowan said...

"Can't Add, Doesn't Even Try" is almost certainly a backronym, where the word came first and the expansion second. But yes, there were addition and multiplication tables in low memory, exactly like the ones we learned (or used to learn) in primary school, and since there was no memory protection you could easily overwrite them and corrupt the math operations to produce the wrong answers.

November 8, 2018 at 9:41 AM

Blogger Veli KAYA ( fearless ) said...

Interesting, great job Ken.
Thank you for your sharing.

November 10, 2018 at 11:31 PM

Blogger Unknown said...

The 1401 was the first mainframe I had physical access to as a teenager learning Shelly & Cashman Structured COBOL Programming on an IBM 029 keypunch. Wonderful walk down memory lane reading this.

One issue with the article:

In the code example, this appears everywhere: "@[email protected]" (see below)

.
.
.
* Initialize a-h from h0-h7
mcw @[email protected], x1
ilp mcw h0+31&x1, a+31&x1
ma @[email protected], x1
c x1, @[email protected]
bu ilp
.
.
.

Sadly, you and I know that it's NOT an e-mail address, it's similar to how double quotes work in BASIC, i.e.:

finished dcw @Hello World!@

Is there anything you can do to fix this in your blog?

Thanks!

- Chaz

July 18, 2019 at 5:58 PM

Anonymous Anonymous said...

Any plans to run the algorithm on the Babbage Difference Engine next?

October 24, 2019 at 1:05 PM

Anonymous Anonymous said...

Just out of curiosity and also since I'm learning to program the 1401, what is the assembly code you have presented? I don't recognise the formatting and it's probably something more advanced than what I'm currently working on, but it seems useful to know.

November 28, 2022 at 3:59 PM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot