2026-10-11

Weekly open source: the laws of sixty countries in git, and a hardware wallet under the probe

The week had two threads, plus steady work on the toolchain. On Sunday, a new GitHub organisation, LawCodex, got 61 repositories at once: legislation as plain Markdown in git, one repository per jurisdiction. Before that, most of the week went into hardware research on a Ledger Nano X. The board was mapped and reconstructed in KiCad (ledger_nano_x_pads), a new logic-analyzer driver was written to decode its buses (visgrok), and reticle, the from-scratch HDL toolchain, built FPGA designs that stand in for the device's MCU. Alongside, puressh and Lode each finished a large block of work.

LawCodex: legislation as Markdown, one repository per country

LawCodex collects "the laws of every country as Markdown in git." Each repository is named by its ISO 3166-1 code (fr, de, jp, …, plus eu). It holds the constitution, codes and laws in force, one file per text with YAML front matter for the title, official identifier, dates and source URL, and a scripts/ directory of re-runnable fetch-and-convert code. Every README states what is covered, what is missing and why, and what licence the source texts carry. Sixty-one repositories were created on Sunday, and together they took about 470 commits, more than any other project this week.

Two of them show what the work involves:

  • be (40 commits) is Belgium from the Justel database of the Belgian Official Gazette. It holds the consolidated texts in force in both French (fr/) and Dutch (nl/), from the Constitution and the codes down to the decrees of each region and community. After a first commit with the scripts and the Constitution, the import came in as half-hourly batches of several hundred files each.
  • ua (12 commits) is Ukraine from the Verkhovna Rada's legislation database, retrieved through its official open-data API: the Constitution, the codes, then the laws in batches. Part of the week was spent on conversion. Text quoted inside amending laws no longer turns into headings, and deep hierarchies are fitted into Markdown's six heading levels. The fetcher identifies itself as LawCodex and never follows redirects.

The texts are reproduced faithfully, but they are not an official publication. The READMEs send readers back to the cited source.

A Ledger Nano X, pad by pad

ledger_nano_x_pads (new, 57 commits) is "an interactive map of the Ledger Nano X main board: its 40 test pads, the copper traces between them and the chips, and a KiCad reconstruction of the whole board," published on GitHub Pages. It started as a photo flip-viewer with a trace overlay that could be edited. The log then traces nets one by one: USB, supply, Bluetooth RF, the OLED's SPI lines, the crystals, SWD and I²C, the STUSB4500L USB-PD controller and the charger. Once the nets were traced, the board was rebuilt in KiCad with ground pours, stitching vias, 3D models and chip markings, behind a three.js viewer. The README is explicit that this is a reconstruction from photos, not the manufacturer's design, and that a ? marks a likely but unconfirmed name. It also notes that the SWD pads are legacy, since the STM32 now ships locked. Late in the week the 3D viewer gained an overlay of two implant specimens, A and B, with their outlines and solder joints matched to close-ups from Tibane Labs.

visgrok (new, 47 commits, v0.1.1) is the instrument used for this. It is a from-scratch Rust driver for Sipeed SLogic logic analyzers, built on rawusb, with streaming to disk, a TUI and a browser UI. It has its own compressed .vgk format and converts to and from sigrok's .sr, VCD and raw dumps. Its decoders were written for the signals this board carries: auto-baud UART, SPI with D/C and an SSD1306 display decoder, an SD card bus decoder, ISO 7816-3, and finally Ledger's SEPROXYHAL protocol over ISO 7816, including the authentication handshake. Its query commands are meant "for people and agents" analysing a capture from scripts.

reticle: an FPGA in the MCU's seat

reticle was again the busiest repository (222 commits, v0.0.5 and v0.0.6), and much of it pointed the same way. On a Basys 3 board (Xilinx 7-series), reticle now places, routes and configures CARRY4 chains, RAMB18E1 block RAM with its contents, PLLE2_BASE, DSP48E1 multiplies and tristate pads. With that, it built a set of IP blocks: an ISO 7816-3 character layer and a terminal that talks to a real card, an SSD1306-compatible display slave that receives what a part draws, and seph_mcu, "the MCU's end of Ledger's SEPROXYHAL link." Put together in one bitstream behind a 2 Mbaud console, with the device's buttons pressable from that console, the FPGA "runs the secure element to its PIN screen" and reads the screen back.

The same week also brought an UltraScale+ fabric model (uray) that writes a bitstream and runs it on a ZCU104, a single-port USB 2.0 hub and a USB transaction proxy that the kernel's own drivers bind, SHA-256 and ChaCha20 cores behind a Cynthion's USB serial port, ECP5 carry chains and DP16KD block RAM, and an inflate block that will be checked against the compcol corpus.

puressh: an OpenSSH drop-in

puressh, the pure-Rust SSH suite on purecrypto (65 commits), spent the week closing the remaining gaps with OpenSSH so it can replace it on a real system. It now reads any OpenSSH ssh_config, including Include, Match, tokens, -o for every option and connection sharing for sftp/scp. sshd gained OpenSSH's logging (syslog and its auth.log lines), utmp/wtmp/lastlog, every authorized_keys option, AuthorizedKeysCommand and AuthorizedPrincipalsCommand, and the SSH_CLIENT/SSH_TTY environment. ssh-keygen handles more key formats, KRLs and SSHFP records, and scp and sftp are now drop-ins that run over ssh. There is a puressh-client Debian package that diverts OpenSSH's client programs, Ansible interop runs in CI, and a perf: change removed per-round-trip latency from both client and server.

Lode: allocation, destruction and arenas

Lode, the language started the week before (41 commits), completed milestone M8, which covers allocation. Resource types with deinit are destroyed at every scope exit, and use after a move is an error on every path. Allocation is declared in the signature (uses alloc throws(AllocError)), and a function without uses alloc cannot call one that allocates. Box, List and String come through an allocator context, and the root heap allocator is itself written in Lode. Arenas and an out-of-memory policy (@oom(abort)) complete the milestone. Under the abort policy, a try on an allocation compiles to nothing. Refinements, which are facts carried in signatures and struct fields, now let the standard library skip re-checking bounds. Underneath, latticefoundry added bulk-memory operations, SROA, struct returns in registers and a size-aware inliner.

Also this week

  • rustygo — the Go-to-Rust compiler got goroutines on worker threads (an M:N scheduler with stop-the-world). It shipped at one worker by default while races were tracked down. It also gained HTTP/2 over TLS, reflect.MakeFunc, 127 of Go's own tests passing, and gRPC, protobuf, Prometheus and pgx compiling.
  • catcard — a TSS wallet can now be the wallet in force on the device. It signs transactions and BIP-322 messages together with the other members, and session codes travel by SD card or QR (BC-UR or BBQr).
  • rsasm — x86 APX, 32-bit Mach-O objects, macOS compact unwind, CodeView line info for PE/COFF, and the newest AArch64 families (MOPS, CMPBR).
  • dnsbox — TKEY key agreement, draft record types, and BIND 9 interop in CI (signing, zone tools, named, dig, nsupdate).
  • mcptk (new) — an MCP server toolkit that implements the protocol itself on tokio. It supports revision 2026-07-28 alongside the handshake-based revisions, over stdio, Streamable HTTP with OAuth, and WebSocket, and implements the tasks extension and MCP Apps.
  • teamclaude — 1.1.24, with OAuth tokens kept in step across installs.

Next week

LawCodex widens from its first sixty jurisdictions toward the rest, with Belgium and Ukraine being completed. The Ledger work goes on: the board map and visgrok's decoders on one side, reticle's FPGA stand-in on the other. Lode moves past M8, and puressh keeps replacing OpenSSH piece by piece.