iCreatAI News
Skip to content
Trending storyUpdating

AI plus Lean 4 Rewrites Ledger Bitcoin App POC

1 reports1 sources56 min agoUpdated

Understand this story

AI overview

Author r0ze-at-hn used AI agents together with Lean 4 to rewrite the shared logic of the Ledger Bitcoin app, completing formal verification and integration within one day and releasing a proof of concept (POC). They claim this is enough to show that rewriting existing software in Lean 4 to obtain smaller, faster, formally proven binaries is feasible. The author emphasizes that this is only a one-day POC: the specification is incomplete, other important properties are worth formally verifying, and more review and validation of modeling choices are needed. All measurements were done on the Speculos emulator rather than on hardware. The Vanadium side saw a 14.6% reduction in executed instructions; the reductions in memory and file size come mainly from build settings rather than the code itself. The size and latency data for the BOLOS side come from two different builds, and the author says they are rerunning the full benchmark to eliminate ambiguity. The report also mentions that the POC found 11 defects.

AI overview based on source reports · Updated 19 min ago

Coverage timeline

Follow the coverage to explore different perspectives.

Nov 25
  1. Hacker News AI
    Using AI+Lean to optimize and improve existing code

    A one-day proof of concept rewrote shared Bitcoin app logic from Ledger's C (app-bitcoin) and Rust (vanadium) apps in Lean 4, compiling a single kernel to thumbv6m, thumbv8m.main and riscv32imac via turbo-lean and LLVM IR, with a 12-statement spec checked by Lean (0 sorryAx) covering 17 of 45 kernel functions. On Vanadium the patched build showed 14.6% fewer executed RV32 instructions and 14.61% lower PSBT signing latency, while on BOLOS latency was unchanged on Nano S+ and 6.34% higher on Nano X; the authors note measurements were taken under the Speculos emulator, not on hardware. Formalizing both implementations surfaced 11 bugs or spec divergences, all on the Vanadium side, including a BIP-379 andor branch-ordering error (VND-01) and a missing witness_utxo amount/script check (VND-03).

Activity for this story

Not enough continuous observations to show a trend yet.