This is a Bitcoin mining software for C64. This proof of concept works inside VICE x64 emulator and uses RS232 connection, exposed by emulator over TCP, to a mining software (ngbtminer) that handles communication between C64 and bitcoind.
It wouldn't be too difficult to replace communication part to a simple UART and try mining on all sorts of microcontrollers - from ATmega8 to ESP32.
The example that you see in the images section show a successfully mined block with nonce value 0x8a07bc5a. A C64 does one hashing round every 4.6s. To reach this result starting from nonce value 0 would take about 337 years and 10 months.
Computing SHA256 is a challenge for 6502 CPU inside C64. The main problem is that this 8-bit CPU has only three 8-bit registers while 32-bit arithmetic is required. You need at least 4 instructions (one for every byte) for each 32-bit operation. In practice it will be closer to twelve: 4 times (load, change, store).
Even though C64 has only 64KB of RAM, the primary way of speeding up programs is using more memory: unrolling loops and heavy use of lookup tables. For example for drawing pixels on the screen you could sacrifice some RAM to precalculate lookup tables for the memory address of every line of the screen.
If you look on SHA256 pseudocode in Wikipedia there are only few basic operations needed: NOT, AND, XOR, addition and circular right bit shift rotation with varying shift length.
Using lookup tables won't get us anywhere for anything except bit rotation. There is no benefit of using lookup tables for AND or XOR - it would take more time than the built in instructions.
The right shift case is different because it depends on the shift length. The naïve and memory-conserving approach is to use a loop. This is what CC65 runtime does in the arithmetic shift to the right built-in function.
But we need a circular shift - bits that fall out on the right end have to appear on the left side. So the actual operation is: