Skip to content

Instantly share code, notes, and snippets.

@kdmukai
kdmukai / README.md
Last active December 6, 2025 18:49
2025 Holiday Donation Drive

Fund Keith Mukai's FOSS Work

I am the volunteer Lead Dev for SeedSigner. We are NOT a company. The FOSS project makes no profit whatsoever from our work.

Your support to help fund my open-source dev work would be hugely appreciated!


Holiday Donation Drive

@kdmukai
kdmukai / screensaver.py
Created November 10, 2025 23:45
Early draft of animated screensaver for Krux
def start(self):
"""Displays a screensaver until user presses a button or touch"""
anim_frame = 0
initial_offset = (TOTAL_LINES - len(SPLASH)) // 2
fg_color = theme.fg_color
bg_color = theme.bg_color
self.ctx.display.clear()
button_press = None
min_distance = 5 # fixed chars or rows
@kdmukai
kdmukai / ST7789.py
Last active October 28, 2025 15:07
Various utility functions to render calibration patterns to an ST7789 when running in a REPL on the Pi Zero
"""
Copy-paste of various mods to the ST7789 driver to facilitate testing.
"""
# Gamma curve constants for ST7789 display
# Each tuple contains (positive_gamma_values, negative_gamma_values)
GAMMA_CURVES = [
# Original SeedSigner gamma curve for the Waveshare display hat
(
[0xD0, 0x04, 0x0D, 0x11, 0x13, 0x2B, 0x3F, 0x54, 0x4C, 0x18, 0x0D, 0x0B, 0x1F, 0x23],
@kdmukai
kdmukai / power_law.py
Last active December 2, 2025 16:04
Power Law & Power Law Floor calculations
"""
Bitcoin Power Law:
1.0117e-17 * (days since genesis block)^5.82
Bitcoin Power Law Floor:
(power law) * 0.42
Note: Model projections said to be invalid beyond 2040.
"""
import argparse
@kdmukai
kdmukai / build_all.sh
Created July 15, 2025 17:05
Build all targets for SeedSigner OS
#!/bin/bash
# Requires: apt install time
export APP_REPO = https://github.com/kdmukai/seedsigner.git
export APP_BRANCH = 0.8.6
touch results.txt
for device in pi0 pi02w pi2 pi4
do
ccache -d /root/.buildroot-ccache --zero-stats
@kdmukai
kdmukai / README.md
Last active July 31, 2025 14:19
SeedSigner MicroPython progress / checklist

lvgl

TODO:

Live camera integration

  • Basic pure MicroPython camera driver / bindings tests.
  • Integration with lvgl overlay.
@kdmukai
kdmukai / backup_raspi_sd_card.md
Last active October 26, 2025 15:30
Make a disk image from a Raspi SD card

Backup and Restore a Raspi SD Card

Only works on linux. I've repeatedly tried to find a sequence that works on macOS but haven't had any success.

Set up PiShrink

This script will remove empty space from the backup img which ensures that you'll be able to write the img back out to an SD card that's the same size as the source SD card.

git clone https://github.com/Drewsif/PiShrink.git
@kdmukai
kdmukai / mnemonic_generation.py
Last active April 15, 2025 15:21
Using coin flips as 11-bit bip39 wordlist indices
def get_mnemonic_from_coin_flip_indices(coin_flips: str, wordlist_language_code: str = SettingsConstants.WORDLIST_LANGUAGE__ENGLISH) -> list[str]:
"""
Interprets a string of 128 or 256 0s and 1s as 11-bit bip39 wordlist indices and
returns the 12- or 24-word mnemonic.
Indices are 0-based (i.e. b'00000000000' == 0000 == "abandon")
Verify with iancoleman.io/bip39 using:
* "Binary" mode
* "Mnemonic Length" = "Use raw entropy"
@kdmukai
kdmukai / welcome.md
Created March 28, 2025 13:11
Summer of Bitcoin welcome letter

Greetings to all the new Summer of Bitcoin future contributors!

As you all probably already know, SeedSigner is a 100% volunteer, completely open source project. There is no company. We have no VC funding. We have no advertising budget. If people share info about SeedSigner with others it's because they love what we've been building.

However, we have a ton in place that rivals what you'd expect to see from a well-funded corporation. Our overall code quality and code organization/structure, our INCREDIBLE UX designed by @easyuxd, our test suite and screenshot generator, github automations, internal code review processes, etc.

Some FOSS projects are more on the YOLO hacker side of things; nerds building complex, hard to use software meant for other super nerds, often with big messy late night code sprints.

Instead, we try to maintain tight professional standards as much as possible (though since we're all just volunteers, often that rigor comes with the tradeoff that we're SLOW).

@kdmukai
kdmukai / README.md
Created January 9, 2025 15:10
SeedSigner OS `ccache` performance scripts

These test scripts demonstrate the step-by-step speed ups that the various ccaches provide.

Scripted test sequence:

  • Start a build w/totally empty cache(s).
  • Rebuild the same target with the now populated cache(s).
  • Change to a new target and get some speedup via the populated cache(s).
  • Rebuild that target to get the full speedup.
  • ...repeat for the remaining two targets.

The first script is for a SeedSigner OS builder that only has the built-in BuildRoot ccache.