A proof of concept: reading a handwritten seed on a SeedSigner fork
Changelog
- The reading engine is published: Haller-1, its weights, training recipe and evaluation (Haller-1 release), and the SeedSigner fork that runs it (haller-project/seedsigner-haller).
- Risk scale: bar for the fingerprint combined with the 6-letter check code (about 1 in 17 trillion per photo, the code read exactly), explained in the check code section.
- Check code: new alphabet of 16 capitals (G H J K M N P Q R S T U W X Y Z), example code SJZ GJX. Recommendations: mockup of a seed card variant with FINGERPRINT and CHECK CODE fields below the last word, blank and filled.
- “How strong is the fingerprint check?” rewritten step by step (problem, idea, check, why a misreading does not pass, demonstration, SeedQR), with a flow diagram of the check and a risk scale; figures moved to the details.
- Fingerprint check: plain explanation of the probability and the threshold, with the arithmetic of the bound. Fingerprint strength: measured collisions added (birthday pairs, neighbours 1, 2 and 3 words away, look-alike words).
- Check code section: the sentence on the fingerprint now follows the convention of the page (fingerprint of the words alone, without passphrase).
- Updated to the production engine 130393e: every reading, image, screen and figure redone (new word detector, fingerprint line read on three crops). Torture photos 07 and 08 added (Verified). New sections: “How strong is the fingerprint check?” and “A proposal: a 6-letter check code”.
- First published.
This is a proposal, open to discussion. It describes a prototype that runs on a fork of SeedSigner. It is not part of SeedSigner and it is not integrated. Its reading engine, Haller-1, is open source (MIT): weights, training recipe and evaluation in haller-project/haller (Haller-1 release), the SeedSigner fork in haller-project/seedsigner-haller.
The page follows one real photo through the prototype's reading engine. Four small neural networks and deterministic code turn a photo of 12 or 24 handwritten BIP39 words into a seed. When a BIP32 master key fingerprint is written with the words, the prototype also checks the seed against it. Everything runs offline, on a Raspberry Pi Zero.
- 1The photoinput
- 2The detector finds the writingmodel
- 3Lines, numbers and reading ordercode
- 4Each word is cut out and normalizedcode
- 5The word readers2 models
- 6The search for the seedcode
- 7The fingerprint checkmodel + code
- 8The result and the confidence gaugescreen
- 9When it does not verifyexamples
- 10Layouts it has readexamples
- 11Torture testresults
- 12The whole engine at a glancesummary
- 13How strong is the fingerprint check?comparison
- 14A proposal: a 6-letter check codeproposal
- 15Recommendations, if this were integratedproposal
The photo
In the prototype, the user photographs the paper with the SeedSigner camera. The photo below was taken with a phone and sent to a public test site; the same engine reads it. It shows a test seed: 12 words in a numbered list, with the BIP32 master key fingerprint of the seed written above.
More detail
- The seed is a test seed generated by the test site. It holds no funds. The person who took the photo agreed to its publication.
- The engine works on the grayscale image. Like SeedSigner, the prototype has no network connection.
- Every image and figure of sections 1 to 8 comes from the engine reading this photo at full resolution (3024 × 4032).
- The fingerprint is optional. Section 7 explains how it is used.
The detector finds the writing
A small fully convolutional network, the detector, processes the whole photo in one pass, reduced to 288 × 384 pixels in grayscale. It outputs 11 output maps of 144 × 192 (per-pixel logits): where the words are, where the line numbers are, and which number belongs to which word.
~224,000 parameters
459 KB
Tap the buttons to overlay the sigmoid of the real output logits on the input.
On this photo, the detector found 13 lines of writing and 13 line numbers.
The same detector also finds printed cards. Below, a SeedSigner card photographed with the camera of a Raspberry Pi Zero running the prototype: the card map covers the inside of the card, and the words inside it are assigned to that card.
More detail
- Architecture: an encoder of 3 × 3 convolutions with 2 × 2 max pooling, then a decoder with nearest-neighbour ×2 upsampling and U-Net skip connections by concatenation. About 224,000 parameters.
- The 11 output maps: word kernel (central band of each word box); the same for line numbers; inner area of a printed card; the four card corners (not used); height of the word or number box (regression output, not a logit); card kernel, which separates cards lying side by side; link from each number to the start of its word; cut or hidden word (not used).
- One detector for every kind of backup: the SeedSigner card, other printed cards, and free lists on any paper. There is no separate rule-based search.
- When the document covers less than 50 % of the photo, the detector runs a second time on that region, at a higher resolution.
- Arithmetic: int16 weights, int32 biases and accumulators, ReLU activations requantized to 12-bit integers; the output layer applies a float scale and bias. A small C library computes it (SMLAD instructions on ARM). One pass takes about 1.2 s on a Raspberry Pi Zero.
Lines, numbers and reading order
Deterministic code turns the output maps into boxes: each connected component of a kernel map becomes a box, with its height from the height map. The code groups the boxes into lines and columns and decides the reading order. When line numbers are written, they set the order.
The detector took the first character of the fingerprint, e, for a line number (the 13th orange box). There are 13 lines for 12 words: the extra line is scored both as a BIP39 word and as 8 hexadecimal characters, scores far better as hexadecimal, and is set aside as a candidate fingerprint line. A number found just before a line tried as the fingerprint is put back into its crop, so the crop starts with the e.
More detail
- With six line numbers or more, each number gets one slot, and each word goes into the slot of its number. A missed word can then be recovered in an empty slot.
- Without numbers, the order comes from the geometry: column by column, row by row for words written in rows, and band by band when the columns are split by a wide gap (1-3 beside 4-6, then 7-9 beside 10-12).
- Two columns of equal length without numbers can be read in several orders. Every order the geometry allows is scored. If more than one gives a valid seed and no number or fingerprint tells them apart, the order on paper is unknown: every word is marked uncertain and the gauge shows Low.
- An extra line is a candidate fingerprint only if it is the first line, or the last line of a column, and if its log-likelihood as 8 hexadecimal characters exceeds that of its best BIP39 word by at least 17 (mean of both word readers).
- Completeness checks: a word that touches the edge of the photo, or a column that may continue beyond it, means that no word can be certain. A handwritten word found but left out of the list makes every word uncertain.
Each word is cut out and normalized
Each word box is cut out of the full-resolution photo with a perspective rectification. The code then separates the ink from the paper. The result is an ink map (0 = paper, 255 = ink), 32 pixels high and at most 256 pixels wide: the input of the readers.
The crops below are the exact images the engine gave to the readers on this photo (first crop variant).
More detail
- The crop keeps a margin around the box: 0.6 box heights on each side, 0.85 above and 0.75 below. It often includes the end of the line number. The readers are trained on crops with random margins and optional line numbers, and learn to ignore them; the decoder also accepts a number before the word.
- Two other crop variants exist (a taller band, and a wider band of 1.2 box heights on each side). While the seed is not valid, the least probable words are read again on them.
- Long horizontal runs of ink are removed: ruled and printed lines are much longer than the strokes of a letter. Pieces of the lines above and below are removed too.
- The same normalization code builds the training images, so the readers always see the same kind of input.
The word readers
A second network, the word reader, reads each ink map. It is a CTC model: for every slice of 4 pixel columns, it outputs a probability distribution over 37 classes (blank, a–z, 0–9). A decoder constrained to the BIP39 lexicon turns these distributions into a log-likelihood for each of the 2,048 BIP39 words.
~164,000 parameters
335 KB
Below, the real output for word 5: the most probable class of each slice. A dot is the blank class; a darker cell has a higher probability.
The 12 words of the photo, with the calibrated probability of the best word. Tap a word to see its crop and the next candidates.
1
label100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: label 99.8 %, fade < 0.1 %, lake < 0.1 %.
2
tape99.5 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: tape 99.8 %, top < 0.1 %, tag < 0.1 %.
3
idea100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: idea 100 %, index < 0.1 %, video < 0.1 %.
4
brand99.9 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: brand 99.9 %, grant < 0.1 %, sand < 0.1 %.
5
robot100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: robot 100 %, robust < 0.1 %, rose < 0.1 %.
6
gloom100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: gloom 100 %, loan < 0.1 %, glory < 0.1 %.
7
tell97.7 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: tell 96.8 %, ten 1.2 %, tent < 1 %.
8
diagram100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: diagram 100 %, dragon < 0.1 %, abandon < 0.1 %.
9
notable100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: notable 100 %, table < 0.1 %, stable < 0.1 %.
10
believe99.9 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: believe 100 %, behave < 0.1 %, derive < 0.1 %.
11
together100 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: together 100 %, abandon < 0.1 %, ability < 0.1 %.
12
state80.3 %
As cut from the photo:
Three most probable words, first word reader:
Second word reader, for comparison: state 90.5 %, skate 5.8 %, seat 1.1 %.
Word 12 is the least certain: state at 80.3 %, with seat (12.8 %) and skate (3.1 %) behind. The checksum and the fingerprint settle it in the next steps.
More detail
- Architecture: four 3 × 3 convolutions with max pooling, then 1-D convolutions along the columns (one of them dilated), with one output per 4 columns. No recurrent layer. Same int16 arithmetic as the detector.
- The decoder computes the CTC likelihood of each word over a prefix tree of the 2,048 BIP39 words, with beam pruning. It accepts a line number before the word, so that “5. robot” scores as “robot”.
- Two word readers share the same architecture. The first one reads every photo. The second one, trained with more lowercase and cursive writing, reads again only when the first one gives no valid seed; a weighted blend of both (0.65 / 0.35) is also tried. On this photo, the first reader was enough.
- Calibration: log-likelihoods are divided by a temperature of 2.2, chosen on simulated pages kept apart from the tests. For capitals, the probability of the best word then matches its accuracy within about 1 %.
The search for the seed
The code combines the word log-likelihoods, enumerates the most probable sequences, and keeps those with a valid BIP39 checksum. The posterior probability of a seed is its probability divided by the total of all valid seeds.
The three most probable sequences on this photo (the changed word in yellow):
Among the sequences with a valid checksum, the first one has a posterior probability of 95.8 %. The third one, with skate, also passes the checksum: the checksum alone cannot rule it out (section 13).
More detail
- A wrong 12-word sequence passes the checksum about 1 time in 16; a wrong 24-word sequence, about 1 time in 256. A valid checksum is evidence, not proof. This is why the fingerprint check exists.
- The search follows at most 512 sequences, with at most 4 readings per word. The probability mass left out counts as valid by chance, so the posterior is not overestimated.
- A word is marked uncertain when the posterior probability of that word, given the checksum, is low. Every word is uncertain when the seed itself is improbable.
- While no valid seed is found, the least probable words are read again on their other crops, then the second word reader is tried.
- The three most probable valid seeds are kept as candidates for the fingerprint check.
The fingerprint check
A third network of the same architecture, the fingerprint reader, reads the line set aside. A forward–backward pass over its CTC output, constrained to 8 hexadecimal characters, gives the posterior probability of each of the 16 characters (0–9, a–f) at each of the 8 positions. The code computes the BIP32 master key fingerprint of each candidate seed and evaluates the probability that the line reads exactly that string.
~164,000 parameters
335 KB
The engine reads the line on 3 crops (as cut, 2 % of its height less at the top, 2 % less at the bottom) and averages the probabilities. The strip above is the crop as cut, where the second character alone would read f (eff2474c). The most probable character at each position, averaged over the 3 crops:
The probability that the line reads e5f2474c is 0.49, against a threshold of 7 × 10⁻⁴. The fingerprint matches.
✔ Verified: the seed read is the seed written.
More detail
- BIP32 master key fingerprint: the first 4 bytes of HASH160 of the master public key. Computing it takes about 0.07 s on a Pi Zero, mostly the PBKDF2-HMAC-SHA512 of BIP39 (2,048 rounds).
- The probability is not a confidence in the seed. It is the probability of one exact string among the 2³² = 4,294,967,296 strings of 8 hexadecimal characters. Ambiguous handwriting splits the probability between neighbouring strings (5 / f on this photo, 1 / 7), so even a right fingerprint rarely gets close to 1.
- A wrong seed has an unrelated fingerprint, which lands on a given string with a chance of 1 in 4.3 billion (2.3 × 10⁻¹⁰). A probability of 7 × 10⁻⁴ is about 3 million times that: the match with the fingerprint computed from the words is what makes the proof.
- Bound: the probabilities of all strings sum to 1, so at most 1,428 strings can reach 7 × 10⁻⁴ on one line. The fingerprint of a wrong seed falls on one of them with a probability of at most 1,428 / 2³² ≈ 3.3 × 10⁻⁷. With at most 3 candidate seeds, that is about 4,300 chances in 4.3 billion: at most 10⁻⁶ per photo.
- The threshold is the lowest whose bound is at most 10⁻⁶ per photo, for the number of candidates that verified the most right seeds on the tuning pages. A higher threshold would lose right verifications of poorly written fingerprints without a useful gain in safety.
- The probability here is well below 1 because the second character is less certain (53 %). The check only needs this exact string to be far more probable than chance.
- If no candidate matches, the seed is never called wrong (a word or a character may be misread): the reading gets the lowest confidence level, and every word is marked uncertain.
- Measured: on simulated pages with a fingerprint, 1,216 seeds verified, none wrong; on real development photos, 24 verified, none wrong.
- The fingerprint reader was fine-tuned from the first word reader on simulated lines, half of them fingerprints.
The result and the confidence gauge
In the prototype, the user always sees the words and compares them with the paper. When the fingerprint matches, the screen says Verified. Without a matching fingerprint, the reading is never called verified: a gauge shows a proposed confidence level.
Screens of the prototype, rendered by the SeedSigner screenshot generator from the real reading of this photo.
These levels and thresholds are a proposal. We would like your opinion on them.
More detail
- The rates were set on 2,757 simulated pages used for tuning only. There, 96.1 % of “high” seeds and 56.2 % of “medium” seeds were fully right; the announced rates (90 % and 40 %) are below the 95 % Wilson lower bounds (94.7 % and 50.7 %).
- On adversarial simulated pages built to fool the engine, some levels fall below these rates. The gauge describes ordinary pages, not every trap.
- In the prototype, after an unverified seed is loaded, the device shows its fingerprint and suggests writing it next to the words, so that the next reading can be verified.
- If the user changes a word on the review screen, the reading is no longer verified.
When it does not verify
Most backups have no fingerprint written. The prototype then never says Verified. It shows a confidence level, marks the uncertain words, and asks the user to compare every word with the paper. Below, real readings of publishable photos by the same engine, with the prototype's real screens.
No fingerprint, no uncertain word: High
A SeedSigner card photographed with the camera of a Raspberry Pi Zero running the prototype. All 12 words were right and none was uncertain.
Full text of the notice (it scrolls)
No fingerprint was found with your words to verify them.
Compare every word with your paper.
Unmarked words can be wrong too. Never use this seed without checking it.
No fingerprint, some words uncertain: Medium
Lowercase writing in one numbered column, photographed with the camera of a Pi Zero running the prototype. All 12 words were right, but the engine marked 5 of them as uncertain (orange boxes).
Full text of the notice (it scrolls)
No fingerprint was found with your words to verify them.
Compare every word with your paper.
The least sure words are marked like this: open each one, then confirm or correct it.
Unmarked words can be wrong too. Never use this seed without checking it.
Right words, low confidence: Low
Two columns in two bands, numbered. All 12 words were right, but the posterior probability of the seed was only 33.6 %: the level is Low and 8 words are marked. The gauge is conservative: a Low reading can be right, and the comparison with the paper decides.
Full text of the notice (it scrolls)
No fingerprint was found with your words to verify them.
Compare every word with your paper.
The least sure words are marked like this: open each one, then confirm or correct it.
Unmarked words can be wrong too. Never use this seed without checking it.
Wrong words: Low
Lowercase writing, numbered in rows of three, photographed with the camera of a Pi Zero running the prototype. The engine found a seed with a valid checksum, but 4 of its 12 words were wrong (red boxes: the word read is in the label). Its posterior probability was only 17.7 %: the level is Low, and 8 words are marked.
Full text of the notice (it scrolls)
No fingerprint was found with your words to verify them.
Compare every word with your paper.
The least sure words are marked like this: open each one, then confirm or correct it.
Unmarked words can be wrong too. Never use this seed without checking it.
Same seed, written in two long rows without numbers: a valid seed again, with 5 wrong words and a posterior probability of 3.7 %; Low, every word marked.
These are the cases the gauge is for: the checksum was valid, yet the seed was wrong. The Low level and the comparison with the paper are the protection here. A fingerprint written with the words would have flagged the mismatch.
No layout found
The same seed in text far too small for the photo: one line found, and the prototype's real failure screen.
Not shown yet
A fingerprint that does not match (Low). No publishable photo yet. The notice would read: “The fingerprint read, …, does not match these words. The fingerprint must be the one of the words alone.”
More detail
- The full notice scrolls on the 240 × 240 screen; its complete text, as built by the prototype for each reading, is given under each pair of screens.
- The list in two bands was sent by a participant of the public test site with a test seed. The SeedSigner card and the other photos were taken with the camera of a Raspberry Pi Zero running the prototype. All hold test seeds and were shared for publication.
Layouts it has read
The same engine reads several ways of writing a seed. Each photo below was read by the engine, and every word was right. The green numbers show the reading order.
Examples read right, not a rate. They show what the engine can do, not how often it succeeds.
12/12 words right · High
12/12 words right · High
12/12 words right · High
12/12 words right · High
12/12 words right · Low: 8 words marked
12/12 words right · Medium: 1 word marked
12/12 words right · Medium: 4 words marked
24/24 words right · High
More detail
- All these photos hold test seeds and were shared for publication. The lists were sent by participants of the public test site.
- Two of these layouts, the two bands and the words in rows, were added to the engine after earlier versions failed on these very photos. They show what the engine does now, not how it does on new photos.
- The SeedSigner card was photographed with the camera of a Raspberry Pi Zero running the prototype.
- Not shown here, for lack of a publishable photo: other printed cards, the 24-word SeedSigner card, cursive writing, and three columns or more.
Torture test
The torture test is a bench of 10 test seeds of 12 words. Each seed holds at least three pairs of BIP39 words that look alike in handwriting (for example car / can, come / core, hunt / hurt). Each has a valid BIP39 checksum, and its BIP32 master key fingerprint (words alone, without passphrase) is given with it.
These pairs are the worst case for a reader: a confusion between two such words can keep the checksum valid, and only the fingerprint would catch it.
1change / charge, theme / there, wear / year9cd79e5d
2can / car, come / core, hand / hard637d6d16
3oven / over, project / protect, wine / wire672217d0
4fine / fire, hunt / hurt, main / rain, night / right20594d19
5aim / air, claw / clay, come / coref01eba0a
6aim / air, fine / fire, hunt / hurt7a46b2d3
7claw / clay, come / core, hunt / hurt30faafcd
8bind / bird, come / core, hunt / hurt6b9bc8af
9hand / hard, nose / rose, oven / overef79f286
10aim / air, can / car, claw / clay, project / protect22f535cb
Checked with the engine code: all 10 checksums are valid, and all 10 fingerprints match their words. Tap a row to see the 12 words.
Real results
10 photos of three of these seeds, written by hand and photographed with the camera of a Raspberry Pi Zero running the prototype, read by the same engine.
Verified · 12/12 words right
Medium · 12/12 words right, 5 marked
Scan failed · 1 lines found: no layout
Low · 7/12 words right, 12 marked
Low · 8/12 words right, 8 marked
High · 12/12 words right
Verified · 12/12 words right
Verified · 12/12 words right
High · 12/12 words right
Verified · 12/12 words right
Examples, not a rate. Green boxes: words read right; orange: marked uncertain; red: misread.
To come. The other seeds of the test have not been photographed yet.
The whole engine at a glance
- About 1.5 MB of weights in total: int16 weights, int32 biases and accumulators, 12-bit activations, computed by a small C library.
- On a Raspberry Pi Zero, with this engine: 13.0 s measured for a 12-word list with a fingerprint line (application running). An earlier build measured a median of 5.8 s on 9 photos without a fingerprint line.
- Everything runs offline, on the device.
This is a proof of concept on a fork of SeedSigner: not part of SeedSigner, not integrated, and open to discussion. Its engine, Haller-1, is published: haller-project/haller and haller-project/seedsigner-haller. Figures measured on simulated pages are labelled as such; the others come from real photos.
How strong is the fingerprint check?
The problem
The BIP39 checksum catches most reading mistakes, but not all. About 1 misread 12-word seed in 16 still has a valid checksum. The device cannot tell it from the right seed.
The idea
The user writes the fingerprint of the words, without passphrase, below the seed. It is a second check, independent of the checksum. A seed is accepted only if the words read and the written fingerprint agree.
What the prototype does
It computes the fingerprint of the words it has read. Then the network that reads the handwritten fingerprint line answers one question: how probable is it that the line says exactly this string?
Here the network gives the string e5f2474c a probability of 49 %. The threshold is only 0.07 %. Handwriting spreads the probability over similar strings, so even a right fingerprint rarely scores near 100 %. A low threshold is still safe, for the reason below.
Why a misreading does not pass
There are 4.3 billion possible fingerprints. With a threshold of 0.07 %, at most about 1,400 of them can pass on a given line. If a word is misread, the fingerprint of the words changes completely: it lands on a random one of the 4.3 billion. The chance that it falls among the accepted ones is at most 1 in a million per photo. Retaking photos adds up: 10 photos, at most 10 in a million.
The demonstration
For one test seed, every seed with 1 or 2 words changed was computed, and every mix of look-alike words: none has the same fingerprint. A seed with the same fingerprint was found 3 words away. It took 17.8 billion tries on a GPU, and its words look nothing like the original.
Look-alike words have no special link to the fingerprint: a seed with look-alike words is as unlikely to match as any other wrong seed. The fingerprint confirms a seed; it does not identify it.
And the SeedQR?
Per image, the SeedQR is safer still. It is made for a machine: even a damaged code almost never decodes to a wrong seed. Scanning an unreadable CompactSeedQR for a minute brings its risk to the order of the fingerprint check.
More detail
- Checksum: 4 bits for 12 words, so a random wrong 12-word seed is valid with a probability of 1/16; 8 bits and 1/256 for 24 words.
- Fingerprint: the first 4 bytes of HASH160 of the BIP32 master public key, derived from the words alone through PBKDF2-HMAC-SHA512. 2³² = 4,294,967,296 values.
- Threshold: the probabilities of all strings sum to 1, so at most 1,428 strings can reach 7 × 10⁻⁴ on one line. A wrong seed lands on one of them with a probability of at most 1,428 / 2³² ≈ 3.3 × 10⁻⁷, assuming HASH160 behaves as a random function. The prototype checks at most 3 candidate seeds, chosen from the words without using the fingerprint line: at most 10⁻⁶ per photo, and at most N × 10⁻⁶ over N photos. The threshold is the lowest with this bound; a higher one would lose right verifications of poorly written fingerprints.
- On this photo, the third most probable sequence replaces state with skate and also passes the checksum. Its fingerprint is 1bd36128; the probability that the line reads it is 1.1 × 10-34, against 0.49 for e5f2474c.
- Collisions measured on a GPU, each result checked with two independent CPU implementations. Random valid seeds: 132 pairs sharing a fingerprint among 1,048,576 (128 expected by the birthday bound). Torture seed 1: none of the 1,555 seeds 1 word away, the 17.3 million seeds 2 words away, or the 705,352 combinations of words at edit distance 1. First collision 3 words away after 17,779,518,951 valid seeds (3 h 26 on an RTX 4090).
- SeedQR, per image of a code damaged beyond its correction capacity, conservative estimates (exact Reed-Solomon calculation × filter rates measured at their 95 % upper limit, worst damage pattern tested): CompactSeedQR 12 words 1 in 5.1 billion, 24 words 1 in 2.4 billion; SeedQR 12 words 1 in 1.5 trillion, 24 words 1 in 26 trillion. A SeedQR whose damage stays within its correction capacity is always decoded correctly. On 9.2 million damaged images decoded with zbar, the decoder of SeedSigner, no wrong seed was accepted: by the rule of three, less than 2 × 10⁻⁶ per image not read right. zxing, which corrects beyond the detection reserve of the standard, is about 2,000 times riskier per correction attempt, before filters. One minute of persistent scanning of an unreadable CompactSeedQR of 24 words at an assumed 10 images per second gives about 2.5 × 10⁻⁷, the order of the fingerprint bound per photo. The CompactSeedQR has no checksum.
- The fingerprint bound is a bound on verification, not an estimate of an error rate.
A proposal: a 6-letter check code
The BIP39 checksum is short: 4 bits for 12 words, so one wrong word passes it once in 16. The fingerprint is only meaningful as the fingerprint of the words alone (without passphrase), costs a PBKDF2 per candidate, and does not say which word is wrong. This page also proposes a short check code, written with the words. It is a proposal, not an existing BIP: a draft specification, a reference implementation and test vectors exist, nothing more.
- What it is: a systematic Reed-Solomon code over GF(4096) on the indices of the words, with 2 parity symbols, written as 6 letters in two groups of 3. Alphabet of 16 capitals without hexadecimal digits: G H J K M N P Q R S T U W X Y Z.
- Verification mode: detects with certainty 1 or 2 wrong words and two swapped words; a missing or extra word with probability 1 − 2⁻²⁴. Independent of the passphrase; computed in microseconds without tables.
- Correction mode: locates one wrong word and proposes the right one, or reconstructs 2 words marked unreadable. A correction is a suggestion, confirmed word by word by the user. Here, a reading with skate would be flagged, and the code would point to word 12: state.
- Capital letters: the code is displayed and written in capitals, SJZ GJX. The alphabet was chosen for handwritten capitals: no V beside U, no I, L or O.
Combined with the fingerprint
A wrong seed would have to pass both checks. The code always detects 1 or 2 wrong words: exactly the plausible reading mistakes. Any other wrong seed matches the code with a chance of 1 in 16.8 million.
With the code read exactly, the fingerprint and the code together give a bound of about 1 in 17 trillion per photo, instead of 1 in a million with the fingerprint alone.
More detail
- Bound: at most 3 candidate seeds × 3.3 × 10⁻⁷ for the fingerprint × 2⁻²⁴ for the code ≈ 5.9 × 10⁻¹⁴ per photo. The fingerprint comes from PBKDF2 and HASH160, the code is a linear function of the word indices: for a wrong seed, they are treated as independent.
- “Read exactly” means the 6 letters are known without error: typed or confirmed by the user, or read with no ambiguity. No reader for the handwritten code exists yet. If a network read it with a probability threshold of 7 × 10⁻⁴, as for the fingerprint, the code alone would let a wrong candidate pass with a probability of at most 1 / (7 × 10⁻⁴ × 2²⁴) ≈ 8.5 × 10⁻⁵, and the combined bound would be about 1 in 12 billion per photo.
- Detection of 1 or 2 wrong words is certain only in verification mode, with the code read exactly. In correction mode, the words rebuilt from the code agree with it by construction: they are checked by the fingerprint and by the user, not by the code.
Simulated gain on the reader (production engine, 93 real photos read with the right number of words, code assumed read right): exact seeds 71 → 79; seeds with a posterior of at least 0.99, 49 → 78, none wrong. The gain is on pages without a fingerprint. Reading 6 handwritten letters has not been measured yet; it would need a reader trained like the fingerprint reader.
Recommendations, if this were integrated
If handwritten seed reading were integrated into SeedSigner, a few changes outside the engine would make it more reliable.
1. Fingerprint and check code fields on the official card
A variant of the official seed card could carry two fields on the words side, below the last word: FINGERPRINT, 8 boxes for the 8 hexadecimal characters, and CHECK CODE, two groups of 3 boxes for the 6 capital letters of the proposed check code (section 14). A 24-word card would have the same two fields below its 24 lines.
Mockup, not an official template. The check code is as secret as the words. The fingerprint can also appear on the SeedQR side.
2. Capital letters
The instructions would keep recommending capital letters, even as the models improve. Capitals are easier to read, for a person and for the engine, and the measured rates are higher.
Share of seeds read exactly. Simulated benches read by the production engine. On real photos sent to the test site and read by the same engine (writing declared by the participant), the samples are still too small to compare: capitals 20 of 20, lowercase 6 of 8, cursive 3 of 3 exact.
3. The fingerprint, every time
The fingerprint field would be filled every time: it is the only path to Verified. After the review of a seed that is not verified, the prototype shows the fingerprint of the words alone and suggests writing it next to them.
4. Without an official template
- A thick pen or a fine marker, for contrast.
- The number before each word.
- The fingerprint above or below the words.
- Nothing else on the sheet: no date, no name, no derivation path.