• Published on | Sep 19, 2016 | by FozzTexx

Making the CauzCoin Challenge

Because of how uncommon the Cauzin Softstrip reader was, I thought it would make a great starting point for another retro computing challenge. I don't think too many people still have them around. It also seemed like combining ancient 2D barcode technology with Bitcoin might be kind of interesting too.

Encoding the private key directly into a Cauzin Softstrip was too obvious. I wanted to obscure the key in the barcode in some way that it could be solved, not necessarily with some kind of encryption where guessing the key would be required. I thought about putting it in a file and then using an obsolete archive format, and then putting that archive into another obsolete archive format, and repeating that a couple of times. But that didn't seem all that interesting either (although I will probably do that at some point for another challenge).

Another thought was to put the Bitcoin private key into a graphic, and use some long forgotten graphics format or direct memory dump from some computer. I have a feeling it would be pretty easy to figure out an older graphics file format, and a memory dump may be way too difficult.

Since BASIC Month had just ended I also had a nifty little vector graphics program that used a command set that I had invented. Filling the barcode with the turtle drawing commands didn't seem like it would be too terribly difficult, and I thought that anyone who has been following me for a while would immediately recognize the turtle commands.

Converting the letters in the Bitcoin private key into turtle graphics turned out to be a little more work than I expected. First I had to design my own font. I wanted each character to be as simple as possible with the minimum number of commands. I started by firing up Illustrator and making a small grid and then snapping lines down for each character, trying my best to keep end points connected and use as few lines as possible.

Once I had a character set defined I saved out the file as SVG. I then wrote a program that would parse through the SVG and do any scaling necessary and convert the SVG lines into pen up, pen down, turn, and move commands. This was slightly tricky because I didn't pay much attention to how the lines were layered in Illustrator so sometimes characters were split up as I parsed through the SVG file. I had to manually go through the SVG file and move things around, count up how many lines were used for each character, and hard code that into my conversion program.

Once I had the turtle commands I slapped together another program that would take a string and then output all the drawing commands. It also took a little bit of hand tweaking to make sure each line would end up on-screen on the Apple II that I was testing on even with all the cumulative floating point errors that happened as the turtle did so much drawing.

The next problem I ran into was that the turtle commands were far more than would fit on a single low-density Cauzin Softstrip. My program for creating the barcodes doesn't handle splitting files across multiple strips, and I didn't want to go to a higher density because so far I've only been able to successfully read low-density strips from my laser printer. I decided to use compression to see if I could make it fit and went with bzip2 since it did a far better job than any retro compression methods. I wasn't sure if the compression would be obvious so I made sure the .bz2 extension was left on the filename inside the barcode. I have a feeling that probably wasn't necessary.

@mikeymikey and Will Sowerbutts took up my challenge and were able to solve it (Will's solution here). In both cases though they ended up cobbling together their own turtle graphics program! I thought for sure everyone would have known about the Terraspin program from BASIC month. Oh well, that just made the challenge even harder!

I think the challenge went pretty well. I've also got some other ideas for another Cauzin Softstrip challenge, so be sure to check back or follow me on Twitter! And if you're interested in the font I made, I've uploaded the SVG file and the program to github.

 

 

Join The Discussion