[ Open source · On-device vision model ]

Reads handwritten seed backups.
Never leaves the device.

bitcoin-vision is a small set of vision models and a Rust library. It turns a photo of a BIP39 recovery phrase or a Penlock share into words you can check, with a confidence score for every one.

Size
24.7 MB
Network
None
Reads
BIP39 words · Penlock shares
Scores
2048 words · 29 symbols
Library
Rust
License
MIT or Apache-2.0
Tested on
Passport Prime simulator

01 · Playground

Run it on a practice backup.

Press Run to replay the pipeline on a sample page, step by step. Or use your own practice photo: the real models run right here in your browser, and the photo stays on your device unless you choose to share it.

  1. Find
  2. Read
  3. Match
  4. Check

INPUT · sample-recovery-page.jpg

Practice words only. Never photograph a real backup on a connected device.

Nothing read yet.

Press Run to find, read, match and check the 12 words.

Or use your own practice photo: the real models run in this tab.

02 · Model card

Four small models. One job each.

No general-purpose AI, no cloud. Each model does one narrow step, and every step’s output is kept so you can show the user why a word was chosen.

Model filePipelineJobOutput
word-detector.onnxBIP39Finds each handwritten word on the pageA box per word
text-recogniser.onnxBIP39Reads the letters in each word, with its dictionaryRaw text, e.g. “absert”
word-reference.onnxBIP39Scores each crop against all 2048 seed words, then calibratesProbabilities over 2048 words
cell-reference.onnxPenlockClassifies each of the 72 cells on a share stripProbabilities over 29 symbols
24.7 MB

All models together, bundled with the crate

0

Network calls. No logs, no uploads

2048

BIP39 words scored for every handwritten word

29

Penlock symbols scored for every one of 72 cells

03 · How it reads

Two pipelines. Both end with you.

PIPELINE A · BIP39

Recovery phrase

  1. 01Find. Straighten the page and box every word.
  2. 02Read. Read each word letter by letter.
  3. 03Match. Score the crop against all 2048 seed words.
  4. 04Check. Test the phrase checksum.
  5. 05You confirm. Pick any unsure word, then Reveal or Forget.

PIPELINE B · PENLOCK

Penlock share

  1. 01Find. Locate the strip and cut out its 72 cells.
  2. 02Read. Score each cell against 29 symbols.
  3. 03Check. Run each row’s built-in error check.
  4. 04Combine. Any 2 of 3 shares rebuild the 12 words.
  5. 05You confirm. Fix any smudged symbol, then Reveal or Forget.

04 · Integrate

A Rust library. One call per photo.

Build a Scanner once, then scan each image. You get every word’s box, crop, raw text and probabilities, plus the checksum result.

use bitcoin_vision::words::{ScanOptions, Scanner};

// feature "bundled-models" embeds the ~24.7 MB of models
let scanner = Scanner::bundled()?; // load once, reuse

let photo = std::fs::read("practice-page.jpg")?;
let document = scanner.scan(&photo, ScanOptions::default())?.document();

for &i in &document.ordered_observations {
    let word = &document.observations[i];
    // word.selected, word.quad, word.candidates
}
  • Hardware wallets

    Ship the models with firmware and scan on the device. Tested in a Penlock app on the Passport Prime simulator.

  • Mobile wallets

    Replace typing 12 words with one photo and a review step. Start from the Android example.

  • Penlock tools

    Read paper shares back without retyping 72 symbols, then recombine any 2 of 3.

  • Read the integration guide →

05 · In a hardware wallet

Tested on the Passport Prime simulator.

A Penlock app for Passport Prime, built at a hackathon, uses bitcoin-vision to read shares. So far it has run on the Passport Prime simulator, not yet on a real device. Small models and zero network access are what make it a fit.

STORAGE

About 24.7 MB of models

NETWORK

None, ever

UPDATES

Signed, through firmware

UX

Review, reveal, forget

06 · Limits

An honest prototype.

WHAT IT CAN’T DO YET

  • English seed words only
  • Faint writing, low contrast and odd layouts cause misreads
  • About 1 in 16 wrong 12-word phrases still pass the checksum
  • Not published to crates.io yet

WHAT INTEGRATORS MUST DO

  • Ask the user to confirm every unsure word
  • Keep photos, crops and results in memory only
  • Hide words until Reveal; wipe them on Forget
  • Tell Penlock users to store shares apart