Skip to content

odudex/Kern

Repository files navigation

KERN

Kern is an experimental project that explores the capabilities of the ESP32-P4 as a platform to perform air-gapped Bitcoin signatures and cryptography.

Hardware

Early development uses the Waveshare ESP32-P4-WiFi6-Touch-LCD-4B.

ESP32-P4 does not contain radio (WiFi, BLE), but this board has a radio in a secondary chip (ESP32-C6 mini). Later the project will migrate to use radio-less, simpler and cheaper boards with ESP32-P4 only.

An OV5647 camera module is also required.

Prerequisites

Build

Cloning the Repository

This project uses git submodules. You have two options:

Option 1: Clone with submodules (Recommended)

When cloning the project for the first time, make sure to clone it recursively to include all submodules:

git clone --recursive https://github.com/odudex/Kern.git

Option 2: Initialize submodules after cloning

If you've already cloned the repository without the --recursive flag, you can initialize and update the submodules with:

git submodule update --init --recursive

Building the Project

Build the project from the root directory with:

idf.py build

or flash the project to the device with:

idf.py flash

and if you are debugging you may want to run monitor too:

idf.py monitor

Optional: Using just

If you have just installed, you can use the provided .justfile:

just build   # Build the project
just flash   # Flash to device
just clean   # Clean build artifacts

Build Options

Enable/disable Auto-focus

To enable camera auto-focus, enable camera focus motor on menuconfig:

CONFIG_CAM_MOTOR_DW9714=y
CONFIG_CAMERA_OV5647_ENABLE_MOTOR_BY_GPIO0=y

Flashing Pre-releases

Pre-release firmware is provided for testing purposes only. Do not use pre-release builds as a signer for real savings.

Requirements

  • Python 3
  • USB cable connected to the Waveshare board

Steps

  1. Download the firmware binary from the Releases page.

  2. Create a Python virtual environment and install esptool:

python3 -m venv venv
source venv/bin/activate
pip install esptool
  1. Flash the firmware:
esptool --chip esp32p4 --baud 460800 write-flash 0x0 kern-<version>.bin

Note: Flashing the merged binary from offset 0x0 erases the entire flash range it covers, including the NVS partition where PIN and settings are stored. To preserve NVS data when updating, flash the individual binaries instead:

esptool --chip esp32p4 --baud 460800 write-flash \
  0x2000 bootloader.bin \
  0x8000 partition-table.bin \
  0x10000 firmware.bin

References

Kern is strongly inspired by Krux, sharing similar but simplified UI elements and flow.

Blockstream Jade was a strong inspiration for the decision to use C language for efficient use of the hardware. Additionally, Kern's core library, libwally, is shared with Jade.

The simplicity and UI polish of SeedSigner and the security focus of the pioneering Specter-DIY were also strong inspirations.

License

MIT

About

Experimental project to explore ESP32-P4 as a C-based, air-gapped Bitcoin signer

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages