top | item 20383561

Bitcoin mining on an Apollo Guidance Computer

217 points| sashk | 6 years ago |righto.com | reply

127 comments

order
[+] segfaultbuserr|6 years ago|reply
The author, Ken Shirriff, is an important personality in the retrocomputing scene, who has involved in the restoration of multiple vintage computers. As a programming exercise and entertainment (mainly, it's just about the implementation of SHA-256), he has attempted to mine Bitcoin on various platforms, including pencil-and-paper (7.75e-6 H/s) [0], IBM 1401 (0.012 H/s) [1], and Xerox Alto (1.5 H/s) [2].

And now it's the Apollo Guidance Computer (0.097 H/s)! I think it's particularly hilarious, as the slogan says, Bitcoin to the Moon!

[0] https://www.youtube.com/watch?v=y3dqhixzGVo

[1] https://www.righto.com/2015/05/bitcoin-mining-on-55-year-old...

[2] https://www.righto.com/2017/07/bitcoin-mining-on-vintage-xer...

Edit: fixed all incorrect H/s numbers, thanks for spotting that.

[+] Nextgrid|6 years ago|reply
I'd also suggest checking out CuriousMarc's channel who is involved in restoring what I believe is the same AGC and has a bunch of very interesting videos about it (among other antique computing gear like teletypes and a Xerox Alto): https://www.youtube.com/user/mverdiell/videos.

Speaking of AGCs, he just recently uploaded a video where they used a restored AGC to dump prototype core rope memory modules from the Computer History Museum's (non-functional) AGC.

[+] SilasX|6 years ago|reply
That human pencil/paper figure is for one person doing the whole SHA-256 computation, right? Has anyone run the numbers for what it would be if you divode up the work, assembly-line style?
[+] hinkley|6 years ago|reply
This article reminded me of the hashing video (your first link). Somewhere else he claims 2/3 hash per day with paper and pencil.

I wonder if you can do these on that old HP calculator everybody loved (the 48, I think?) and how fast.

[+] __lm__|6 years ago|reply
Wasn’t the speed of the IBM 1401 only one hash every 80 seconds (1/80 H/s)?
[+] aswanson|6 years ago|reply
That green lcd interface is so beautiful.
[+] timonoko|6 years ago|reply
Rope memory is so fascinating and economical. Just wires and only one metal rings for each word, which can be hundreds of bits longs. My question is: is it possible to construct a finite state machine only with rope memory and mechanical relays and maybe capacitors. You can perhaps raise reading voltages so high, that the signal is detectable with relay coil. This would be the first real steam-punk, post-apocalyptic computer that people with early iron age technology can construct themselves.
[+] kens|6 years ago|reply
Relay computers were a thing in the 1940s, for example Zuse's computers, Stibitz's machines at Bell Labs, the Harvard Mark I and IBM's SSEC. Vacuum tubes were orders of magnitude faster and killed them off, though.

As far as using core rope with relays, you'd probably need to wrap each wire around the core many times (transformer-style) to get enough voltage to trip a relay. The raw signals from cores are really small and hard to detect even with ICs.

https://en.wikichip.org/wiki/relay_computer

[+] WorldMaker|6 years ago|reply
Since the post the other day on the rope memory I've been toying with "Loompunk" story ideas.

Relatedly, Jacquard Looms were some of the earliest punch card-based "computers" as well.

There's probably some set of interesting bootstrap paths to general computing entirely from the textile world.

[+] throwaway2048|6 years ago|reply
Arguably, a finite state machine is not a computer, its logically equivalent to clockwork, which has been around for thousands of years.

Although I do like the sound of your idea...

[+] canada_dry|6 years ago|reply
> the AGC results in a hash rate of 10.3 seconds per Bitcoin hash VS a relatively slow USB hash device that performs at 130 billion hashes per second.

> it would take the AGC 4×10^23 seconds on average to find a block. Since the universe is only 4.3×10^17 seconds old, it would take the AGC about a billion times the age of the universe to successfully mine a block.

Pretty mind boggling stuff.

[+] jrockway|6 years ago|reply
I also did this calculation and got a different result.

According to Google, one block requires 2,440,643 * 2^32 hashes. Multiply that by 10 seconds per hash, and you get 3.32176901e9 years. The Universe has been around for longer than that, about 13e9 years.

[+] ngcazz|6 years ago|reply
> Trying to mine Bitcoin on this 1960s computer seemed both pointless and anachronistic, so I had to give it a shot.

Brilliant.

[+] cgh|6 years ago|reply
From the notes at the end of the article:

"The AGC that we're restoring belongs to a private owner who picked it up at a scrap yard in the 1970s after NASA scrapped it. For simplicity, I refer to the AGC we're restoring as "our AGC"."

How much other fantastic equipment of historical significance have we lost, I wonder?

[+] cr0sh|6 years ago|reply
Not quite as rare, and certainly nothing like this, but several years ago I picked up an Altair from a local electronics junk yard.

Crazy thing was, I must have walked by where it was stored hundreds of times over the years since I first started to go to this place back in 1991 (Apache Reclamation and Electronics, here in Phoenix). Apparently it was kept in a trailer that was outside. I never saw the Altair in there, but it was stuffed full of junk and hard to "wander" around inside (the few times I went in, I was lucky not to be bit or stung by any number of things, to be honest).

So one day I was out in the yard wandering around; I turned around - and saw it sitting on a chair (I must have walked right past it). I walked over to it, thinking "No way - just, no way" - but yes, there it was. Very dirty, missing it's top cover, but otherwise all there with a ton of peripheral cards slotted in place.

I went over to one of the owners of the place; he was up on a forklift - I pointed over at it, and said "I'll give you $100 for that thing over there". Yeah, I knew what it was worth, but this same guy had sold me 100 meters of multimodal fiber cable for the cost of copper, back when that stuff ran you 25 dollars a foot - so I thought "maybe he has no clue what it is".

He looked, turned to me and said "Nope - can't do that. Some guy a week ago pulled it out of that trailer there and told me it was an antique. Can't go any lower than $250.00". I dropped my smile, hemmed and hawed, grumbled a bit - you know, put on a show. Then I looked up, and said "Danny (that's his name) - you drive a hard bargain, but that's a deal."

15 minutes later I had it in the back of my pickup and was driving home as quick as I could before anyone changed their minds. A sale's a sale! I went back the next week, dug around some more, and came up with a ton of S-100 bus cards - and got those for nothing as well. Every now and then I go back and look for other cards, but other than a stash of NOS S-100 edge connectors - I couldn't find anything else.

I later went online on to an Altair message group, posted what I had, and was told mine was rather unique, as mine had flat handle toggles, and the later versions all used round handled toggles. I was offered close to a grand for it in as-is sight unseen condition, but I turned it down. My ultimate goal is to restore it to operating condition. I have not plugged it in (beer can capacitor would probably explode and catch fire if I did). It needs a ton of TLC.

It has a full amount of RAM, and the 8080 card was replaced with a Z-80 card (common upgrade of the time); there's enough RAM to run CP/M if I wanted to. Various serial and parallel I/O cards, plus a fixed-sector floppy drive card (good luck finding a drive, let alone media, for anything short of a fortune). I later had others donate to me other cards and parts (including an interesting unpopulated 6502 processor card - but I don't know if the pinout is the same as what the Altair used, or if it's meant for some other S-100 bus computer - despite the S-100 bus supposedly being a standard, there were a few variations of it - as it goes).

I figure if I can get it working to some extent, and get the test program from the manual toggled in and working, I'll consider that a success. But what I'd like to do is take it further, getting my VT-100 terminal hooked up to it, and using some kind of method to boot either BASIC or CP/M from a flash drive or something (I know this can be done).

Sadly, I contacted the case manufacturer about getting a top cover, and had no luck. The company (I don't recall their name), used to make that case as an enclosure that tons of companies used for their equipment. They made it for decades, long after the Altair ceased to be a thing, long after MITS went under. I told them what I needed, and they told me they no longer made that enclosure since a couple of years prior, and no longer had the engineering drawings, either.

So - if I want that part fixed, I'll either have to custom make something myself, try to find the part other ways (maybe visit and talk to people at a vintage computer fest?), or pray I run across one somewhere. Another possibility, though it wouldn't be cheap, would be to have a machine shop make me a one-off of a top that'd fit. Honestly, something tells me the first option might be the best, and in spirit with the machine itself. I doubt it would hurt it's value any.

[+] bdcravens|6 years ago|reply
This has to be the best description of how Bitcoin mining works that I have ever read (easy to understand and none of the usual ideology you find in usual Bitcoin writing)
[+] lordleft|6 years ago|reply
Agreed - I'll use this as a primer to how mining works going forward!
[+] cr0sh|6 years ago|reply
I found this story interesting, but unsurprising knowing the author. I'm amazed he got that thing to work - but if there were anyone who could do it, it's him.

Unfortunately, I didn't find an answer to something I suspect, but I don't know for certain? Maybe someone here could shed light on it?

He mentions that the AGC was the first computer to use integrated circuits, in the form of 5600 NOR gates, built into custom "logic modules", each set then wired together using a backplane or something like that. But take a look at those ICs - are they thru-hole, or SMT?

I seem to recall seeing pictures of the AGC - of other parts of it - and that it used a form of SMT in its construction; does anyone know if this is true? If so, would that also make it the first time SMT was used in a computer? Or were there other prior examples.

It seems also curious that if it was SMT being used - that such a thing was chosen for this critical piece of hardware, mounted on a rocket undergoing tremendous strain and vibration. I would think in that case DIP would be the better solution, ideally with extended pins for wire-wrap, then everything embedded in conformal coating after test - but while the DIP vs SMT question is up in the air, I've never seen any pictures that suggest wire wrapping was used, and nothing that showed anything like conformal coating.

So - can anyone shed any light on this?

[+] kens|6 years ago|reply
To answer some of your questions. The AGC was a very early integrated circuit computer, but probably not the first.

The ICs were surface-mount flat packs onto boards in the modules. They were welded, not soldered. The modules plugged into the backplane connectors, which were wire-wrapped. The modules and backplane were encapsulated in plastic (epoxy or polyurethane) for flight. (This AGC was for ground testing, so it was not encapsulated.)

The non-logic circuitry was built with cordwood construction, i.e. the components were inserted into holes in the module. Point-to-point wires were welded onto the components on either side. These were also encapsulated in plastic.

I don't know if DIP integrated circuits would have been more reliable, but the DIP wasn't invented until 1964, too late for the AGC.

The Saturn V rocket contained a Launch Vehicle Digital Computer (LVDC), which was completely different and built by IBM. It also used surface-mount modules, but IBM's hybrid modules, not integrated circuits. So the AGC wasn't the only surface mount computer at the time. (Does anyone have a good history of surface mount?)

> if there were anyone who could do it, it's him

Honestly, Mike Stewart is the AGC super-expert who made the restoration possible. He knows way, way more about the AGC than I do.

[+] _7fvc|6 years ago|reply
Super cool. I got mining to work on my forked bitcoin. I've got 5-8 GH/s using a usb miner. It was a lot of work. It's also a good way to learn about cryptocurrency. My effort is trivial compared to this.
[+] Piezoid|6 years ago|reply
> For instance, the AGC (like many 1960s computers) didn't have a stack, so you had to keep track of the return address for each subroutine call.

> I managed to get everything to fit in one bank by reusing these 16 words for multiple purposes, but I spent a lot of time debugging problems when a variable clobbered a location still in use.

It could be fun to make a slightly higher level ad-hoc assembly language for solving these problems. For example SSA with basic blocks.

[+] atribecalledqst|6 years ago|reply
Always happy to see another writeup from Ken Sherriff. I think he has an account here, so if you're reading this, thanks.

The estimate of the amount of electricity Bitcoin consumes (from a footnote) is distressing -- on the order of a small country...

This is one of the big reasons why I personally will never buy into a cryptocurrency (and especially bitcoin) -- too much wasted energy. If I want to engage in speculative trading, I'll do it in the stock market.

[+] kens|6 years ago|reply
Glad you liked the article! P.s. it's Shirriff not Sherriff.
[+] pazimzadeh|6 years ago|reply
Ethereum is replacing proof-of-work with proof-of-stake in 2020, which should help with this.

But what are you comparing the cost of running Bitcoin to, the entire world's banking infrastructure? Does this take into account all of money that has slipped through the cracks over the years?

i.e. https://www.thenation.com/article/pentagon-audit-budget-frau...

> "there were no ledger entries or receipts to back up how that $6.5 trillion supposedly was spent"

> "In all, at least a mind-boggling $21 trillion of Pentagon financial transactions between 1998 and 2015 could not be traced, documented, or explained"

[+] pepijndevos|6 years ago|reply
I can highly recommend the curiousmarc AGC restoration series on youtube, which also feature Ken.
[+] AmericanFTM|6 years ago|reply
Could he post responses on the internet to people wondering more about this weird piece of history and how he came across with that thing. If you can surf the web then it is useful!
[+] jonny_eh|6 years ago|reply
It'd be cool if this was hooked up to the internet, with a camera pointed at it, and people could rent it for an hour at a time to play with.
[+] beamatronic|6 years ago|reply
In my opinion this person seems like one of those 10x people. Amazing job.
[+] cr0sh|6 years ago|reply
Gotta agree with you there - IIRC, he's also working on an Alto, plus a Symbolics LISP machine - and I think, IIRC, he helped to get the IBM 1401 transistor mainframe at the Mountain View Computer History Museum working, too.

Just looked that last one up - yep.

http://www.righto.com/2018/09/the-printer-that-wouldnt-print...

The other two:

http://www.righto.com/2018/03/a-1970s-disk-drive-that-wouldn...

But I seem to be wrong on the Lisp machine? I couldn't find anything on it, but I could have sworn somebody has been working on getting one into operating condition for a while now (it's been a slow process)...

Anybody know?

[+] kens|6 years ago|reply
10x kind of implies that they are doing something actually useful. :-)
[+] sbassi|6 years ago|reply
I wonder if this can be done in a C64 and what would be the hashrate.
[+] DenisM|6 years ago|reply
The irony is strong here - the most productive computer computer in the world, the one that's taken us to the moon, has been tasked with the most un-productive activity, that is burning energy for the sake of maintaining a ledger of fictional possessions.
[+] josu|6 years ago|reply
The irony is only there if you look at the tree instead of the whole forest. That's like looking at one human in a deserted island and criticizing humanity for being useless. That same human, working in cooperation with other humans could be capable of walking on the moon. But even then, there would be some snarky comment on HN criticizing the un-productiveness of humans walking on the moon.

This is a cool project that shows how far we've come. The Bitcoin network (wasteful or not) is currently capable of calculating 74.5 exahashes per second. You would need 10x74.5x10^18 Apollo Guidance Computers for that, you would probably need to build the equivalent of the Death Star to fit them all in the same place.

[+] RodgerTheGreat|6 years ago|reply
Remember when computer nerds the world over pooled their spare compute resources for Folding@Home and Seti@Home, in exchange for nothing but leaderboard positions and bragging rights?

The real tragedy of the cryptocurrency gold rush is that by providing a profit motive it decimated these kinds of collaborative computing projects.

[+] ASalazarMX|6 years ago|reply
The worst aspect of ecoins is mining, followed closely by scamming and speculation.

I think the ecoin concept by itself is a step forward for the progress of humanity, and without mining, the blockchain needs a lot less resources. How would you fairly distribute ecoins if mining is excised? No idea.

[+] Sschellbach|6 years ago|reply
maybe maintaining that ledger is more productive than you suggest
[+] ChainOfFools|6 years ago|reply
sort of a meta question: would you consider your (or anyone's) past a fictional posession, or a real one? Though I'm highly skeptical of blockchainism (see username) I don't know if I'd be able to buy into this particular criticism of it.

Essentially a blockchain is a database of time and energy booked to a contrived measurable $particularActivity. This activity correlates to some past opportunity cost expense (and presumably a counterpart defensive loss aversion behavior expected in the future) on the part of the person burning time and resources to support that activity. A kind of rube goldberg electricity meter with a public log, that functions as a record of someone's ante in a super simple long running casino game.

The more you spend on/invest in this activity, the less inclined you are to forfeit your recorded proof of doing it for less than whatever you consider a fair return on that sunk cost.

This mechanism is fairly universal and applies to everything from hobbies to friendships to careers. What bitcoin (any blockchain really) does is just strip the commitment-payoff mechanic present in almost all human endeavors down to a cartoonishly simplified model and tie a bunch of charts and metrics to it, and use these to collectively goose our animal chase instincts into overdrive.

[+] fredfoobar|6 years ago|reply
I don't understand this "unproductive activity" sentiment at all. It's as if we're taking away compute from "productive" processes that are in a dire need of compute! If there are productive processes that desperately need compute, there is absolutely nothing stopping them from getting it.

I can argue that every form of money is fictional, it's only in the minds of people, it's a social construct. In fact, I can go further and say that there is absolutely nothing "physical" in this world, what is physical? just some sensations you're perceiving in your brain? Your brain is making up all the meaning.

There's another (weak) argument: somehow, building all that crazy tech and going to the moon is more important than taking care of humans who're suffering here on Earth. Why is going to the moon more productive?? who benefited from it?

I suspect this is just an intellectual circle jerk.

[+] TomMckenny|6 years ago|reply
Indeed, the author found a project both hilarious and difficult.

Also funny is the implication that the astronauts would have had to be careful of malware in addition to the occasional unaccounted for floating bolt.

[+] kinghajj|6 years ago|reply
They're not fictional possessions--millions of people have them, in the real world. They can be transacted, and exchanged for real-world goods and services.
[+] dclowd9901|6 years ago|reply
He should make it an art installation.