Skip to content

Style guide

This page is for checking the design system. It is not in the sidebar or the search index, and it asks search engines not to index it. Switch the theme with the toggle in the header to see both palettes.

Colour tokens (src/styles/theme.css)
SwatchTokenDarkLight
Accent (links, highlights)
--site-accent
#F7931A#A15700
Accent fill (buttons, badges)
--site-accent-fill
#F7931A#F7931A
Text on accent fills
--site-on-accent
#0E0E10#0E0E10
Accent tint
--site-accent-tint
#3A2408#FDECD6
Background
--site-bg
#0E0E10#FAFAF7
Panel / card
--site-panel
#18181B#FFFFFF
Border
--site-border
#2A2A2F#E4E2DC
Text
--site-text
#F4F4F5#18181B
Muted text
--site-muted
#A1A1AA#52525B
Status: done
--site-status-done
#22C55E#15803D
Status: in progress
--site-status-progress
#F59E0B#B45309
Status: planned
--site-status-planned
#A1A1AA#52525B
Danger
--site-danger
#F87171#B91C1C
Danger tint
--site-danger-tint
#2B1214#FDECEC

Body text is Inter 400. Headings are Inter 700, with page titles and section headings at 800. Code, pin names and GPIO labels use JetBrains Mono, for example GPIO14 and 3V3. Bold text uses 600–700. A link looks like this.

The page title above is the only level 1 heading. Every other level follows.

A long paragraph shows the prose measure. Lines stop at about 70 characters, so they stay easy to read on a wide screen. This sentence is here only to make the paragraph long enough to wrap across more than one line.

Sketch uses 1234567 bytes (37%) of program storage space.

Compact variant:

DoneIn progressPlannedPlanned

The last badge is a phase with the status todo, which is shown as “Planned”.

Empty, waiting for a photo:

With a photo and caption:

A drawn sample image of a QR code on a dark panel
A caption under the photo.

All fields:

Time
20 min
Difficulty
Easy

What you'll learn

  • Which parts you need
  • Why the camera board only sends data one way

Medium difficulty, no list:

Time
45 min
Difficulty
Medium

Hard, with a list and no time:

Difficulty
Hard

What you'll learn

  • How to patch a library file
Product photo of the ESP32 DevKit (ESP32-WROOM-32)

ESP32 DevKit (ESP32-WROOM-32)

The signer. Holds the seed in memory, checks the transaction and signs it.

Quantity
1
Cost
~$10

A classic ESP32 board with 520 KB of RAM and 4 MB of flash. It drives the touchscreen and receives scanned data from the camera board.

Resistors, 1 kΩ and 2 kΩOptional

Bring the adapter's 5V signal down to about 3.3V for the camera board.

Quantity
1 of each
Cost
~$0.02 each

Recommended, but not fitted on the tested build. Adapter TX → 1 kΩ → CAM U0R, with 2 kΩ from CAM U0R to GND. At minimum, one 1–2.2 kΩ series resistor.

A card without its photo slot:

ESP32-CAM (AI-Thinker, OV2640 camera)

The QR scanner. Reads QR codes and sends what it reads to the signer over one wire.

Quantity
1
Cost
~$11.50

It has no USB port, so you program it through a USB-TTL adapter.

8 of 11 phases done.

  1. Phase 0Setup and baselineDone

    The tools and libraries are installed and checked. Nothing is wired yet.

  2. Phase 1DisplayDone

    The touch shield shows graphics, driven by the ESP32 DevKit.

  3. Phase 2Touch input and on-screen controlsDone

    Accurate touch, plus reusable on-screen buttons and a keyboard.

  4. Phase 3QR scanner on the camera boardDone

    The ESP32-CAM decodes QR codes and sends them out on one pin. Two test criteria were waived, not passed: a QR code of 300 or more characters, and 2 minutes of continuous scanning.

  5. Phase 4One-way camera linkDone

    The signer receives what the camera scans over a single one-way wire, and survives a flood of random data without crashing.

  6. Phase 5Keys (stateless seed)Done

    Generate, back up, load and use a seed without ever storing it, and export a watch-only wallet to Sparrow.

  7. Phase 6Address check screenDone

    You can check receive and change addresses on the device itself.

  8. Phase 7Reading and checking transactionsDone

    The device receives an unsigned transaction by animated QR, checks it independently and shows it for approval.

  9. Phase 8Signing and returning the transactionIn progress

    The device signs after approval and shows the signed transaction as a QR code for Sparrow to broadcast. Two signet transactions have confirmed, one with two inputs. The exit criterion asks for three.

  10. Phase 9HardeningPlanned

    Close the obvious prototype gaps and write down the threat model.

  11. Phase 10Path to the final hardwarePlanned

    A written plan for moving to a security-oriented chip with a secure element. Planning only, not building.

Without summaries:

8 of 11 phases done.

  1. Phase 0Setup and baselineDone

  2. Phase 1DisplayDone

  3. Phase 2Touch input and on-screen controlsDone

  4. Phase 3QR scanner on the camera boardDone

  5. Phase 4One-way camera linkDone

  6. Phase 5Keys (stateless seed)Done

  7. Phase 6Address check screenDone

  8. Phase 7Reading and checking transactionsDone

  9. Phase 8Signing and returning the transactionIn progress

  10. Phase 9HardeningPlanned

  11. Phase 10Path to the final hardwarePlanned

PlannedNot built, not yet researched

ESP32-S3 camera board

Espressif lists a camera interface, PSRAM, secure boot and flash encryption for the ESP32-S3. The idea to explore is whether one board could do the job of the current two, with protections this prototype doesn't have yet.

Like the current boards, the ESP32-S3 has Wi-Fi and Bluetooth radios.

PlannedNot built, not yet researched

Raspberry Pi Pico 2 (RP2350)

Raspberry Pi lists boot signing with the key fingerprint in one-time-programmable memory, and Arm TrustZone, for the RP2350. The plain Pico 2 has no radio; only the Pico 2 W does.

Its product page doesn't mention a camera interface, so how it would scan QR codes is an open question.

Every wire in wiring.yaml, with the group filter (it appears when more than one group is shown):

Wiring diagram (schematic). The table below lists every wire.TFT shieldESP32 DevKitESP32-CAMUSB-TTL adapterLCD_D0 (D8)GPIO22LCD_D1 (D9)GPIO13LCD_D2 (D2)GPIO26LCD_D3 (D3)GPIO25LCD_D4 (D4)GPIO17LCD_D5 (D5)GPIO16LCD_D6 (D6)GPIO27LCD_D7 (D7)GPIO14LCD_RD (A0)GPIO21LCD_WR (A1)GPIO4LCD_RS (A2)GPIO15LCD_CS (A3)GPIO33LCD_RST (A4)GPIO325V5V / VIN3V33V3GNDGNDGPIO34GPIO14 (IO14)GNDGND5V / VIN5V5V5VGNDGNDU0R (GPIO3)TXU0T (GPIO1)RX

Schematic only: each board shows just the pins in use, not in their physical order. Always match the labels printed on your board. Dashed wires are not yet tested.

Every wire in wiring.yaml
FromToSignalNotes
TFT shieldLCD_D0 (D8)ESP32 DevKitGPIO22Data bit 0 / touch YMMoved from GPIO12, a strapping pin that caused boot loops. Needs library patch 3.
TFT shieldLCD_D1 (D9)ESP32 DevKitGPIO13Data bit 1 / touch XP
TFT shieldLCD_D2 (D2)ESP32 DevKitGPIO26Data bit 2
TFT shieldLCD_D3 (D3)ESP32 DevKitGPIO25Data bit 3
TFT shieldLCD_D4 (D4)ESP32 DevKitGPIO17Data bit 4
TFT shieldLCD_D5 (D5)ESP32 DevKitGPIO16Data bit 5
TFT shieldLCD_D6 (D6)ESP32 DevKitGPIO27Data bit 6
TFT shieldLCD_D7 (D7)ESP32 DevKitGPIO14Data bit 7
TFT shieldLCD_RD (A0)ESP32 DevKitGPIO21Read strobeMoved from GPIO2, a strapping pin that blocked upload mode. Needs library patch 2.
TFT shieldLCD_WR (A1)ESP32 DevKitGPIO4Write strobe
TFT shieldLCD_RS (A2)ESP32 DevKitGPIO15Command/data select / touch YP (analog)An analog-capable pin (ADC2_CH3). Also a strapping pin.
TFT shieldLCD_CS (A3)ESP32 DevKitGPIO33Chip select / touch XM (analog)An analog-capable pin (ADC1_CH5).
TFT shieldLCD_RST (A4)ESP32 DevKitGPIO32Reset
TFT shield5VESP32 DevKit5V / VINPower (5V)The shield's regulator and backlight need 5V.
TFT shield3V3ESP32 DevKit3V3Power (3.3V logic)
TFT shieldGNDESP32 DevKitGNDGround
USB-TTL adapter5VESP32-CAM5VPower (5V)In the tested setup this is the CAM's only power supply. The DevKit's 5V is not connected to the CAM.
USB-TTL adapterGNDESP32-CAMGNDGround
USB-TTL adapterTXESP32-CAMU0R (GPIO3)Data to the CAM (uploads and console commands)With the adapter set to 5V, this line carries 5V logic, above the ESP32's rating. A 1 kΩ / 2 kΩ divider is recommended; not fitted on the tested build.
ESP32-CAMU0T (GPIO1)USB-TTL adapterRXData from the CAM (debug console)