Skip to content

Rev 2303-1: Module 1 Share Booklet row data misaligned after R #77

Description

@stutxo

Rev 2303-1: Module 1 Share Booklet row data misaligned after R

Hello Bitcoin Wizards,

The Module 1 Share Booklet in the printed book, revision 2303-1-8822ef51 (2023-03-07--color.pdf / --bw.pdf on secretcodex32.com), has its row data shifted by one starting at row T.

Column C is the identity column, so it should always return the row's own C-share character. On every booklet page:

row label column C shows should show
R R ✓ R
T S T
U T U
V U V

The row labels correctly skip S because S is the secret index, but the row-data lookup still includes the S entry. As a result, every row after R uses the previous entry's data, and the final row's data is dropped.

Cause

The public branches don't seem to have this bug (they use a different, older booklet generator), so I'm not sure where the 2303-1 source on the site came from, but the fix for it would be the following:

showShareTable draws row labels from permNoS (31 values, excluding S) but computes the row data from perm (32 values, including S) at line 2748:

-      page exch perm 3 index get exch makeShare code exch get glyphshow
+      page exch permNoS 3 index get exch makeShare code exch get glyphshow

Rendering the patched source with Ghostscript produces a correct booklet: the identity-column invariant holds for every row, and Page A matches an independent BIP 93 Lagrange computation for all 31 rows.

Reproduce

Using the BIP 93 NAME, k=2 test vectors:

  • Share A: MS12NAMEA320ZYXWVUTSRQPNMLKJHGFEDCAXRPP870HKKQRM
  • Share C: MS12NAMECACDEFGHJKLMNPQRSTUVWXYZ023FTR2GDZMPY6PN
  • True share D: MS12NAMEDLL4F8JLH4E5VDVULDLFXU2JHDNLSM97XVENRXEG

Deriving share D with the printed booklet instead yields:

6NAMEDLL4F8JLH4E?VDVU?X6XU0S45ACLMM47XTENEJEG

That gives 16 incorrect data characters out of 26, with another 2 positions that cannot be looked up.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions