Tuesday, May 27, 2025

Andragogy with AI

:: testing some Python code in Spyder ::

In the mood to be a teacher, of self and others, I asked Perplexity.ai to remind me how Bitcoin adds to its blockchain. In case just that sentence rings no bells: imagine a tower of blocks, they can be cubes although I've argued a tetrahelix for marketing purposes, with multiple children competing to add the next block. One gets payment for adding a next block. People make a living adding next blocks.

Prompt:  In the bitcoin schema, the mining computers compete to solve a problem and the winner gets to add to the blockchain. What is the nature of this problem and can you write some Python code to simulate setting up and solving this problem?

In the initial prompt, I asked for some Python code to simulate setting up the problem and solving it. 

In the above screenshot, I've copied the code it gave me to Spyder and hit the run button, without any modifications. 

I notice it doesn't include a timer. It stops when the hash code is below a specific size, using an algorithm anyone should be able to rerun and verify.

At that point I wondered if I could get Perplexity to rewrite the Python in Hoon, the Urbit language, as it's really Nockchain that I'm looking into. I got some Hoon code back, and asked where I could run it in the cloud. Perplexity suggested I fire up my own moon or planet. 

:: running my moon ::

My planet is pretty crashed out these days, so I accessed the Dojo (Hoon prompt) through my moon instead, by pressing the Terminal button on the dashboard.

:: moon dashboard | Urbit ::

Although the Dojo appeared to digest the Hoon code for running a bitcoin style hash puzzle, I was unable to get it to actually run. The second code block returned by Perplexity was indigestible as provided, perhaps in part because of spacing issues?

:: in the dojo ::