Skip to content

Make --anonymous cards show only the group name - #38

Open
fdegros wants to merge 2 commits into
pjkundert:masterfrom
fdegros:anonymous-cards
Open

fdegros wants to merge 2 commits into
pjkundert:masterfrom
fdegros:anonymous-cards

Conversation

@fdegros

@fdegros fdegros commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #11 (see my comment there).

--anonymous only removes the cryptocurrency addresses and QR codes. Each card still prints the name passed to the tool (SLIP39 First(1/1) for: Alice, on the front and the back), the requirements of all the groups (Recover w/ 2 of 4: First(1), Second(1), Fam(2/4), Frens(3/6), which tells whoever holds a single card the names, thresholds and sizes of the other groups), and a diagonal group name and card number across the card.

The first commit makes an anonymous card show only its group name (centered at the top, as before) and the mnemonic words, which stay the large ones. Cards without --anonymous are unchanged. Anonymous cards deliberately show no card number: the words identify each card. It also makes anonymous default to ANONYMOUS instead of None, which removes the repeated ANONYMOUS if anonymous is None else anonymous.

The second commit is independent and easy to drop: it simplifies the title of the cards that are not anonymous, from SLIP39 Fam(2/4) for: Alice to SLIP39 Fam 2 for Alice (the card number only if the group has several cards, and the name only if there is one), so that the size of the group isn't printed twice and there's no dangling for: .

  • Tests (slip39/output_test.py): test_cards and test_anonymous_cards record the texts rendered on every card, front and back, with and without --anonymous. The anonymous test fails on current master and passes with this change.
  • pytest (without the invoice/communications tests, which need optional packages): 44 passed, 4 skipped.

--anonymous only removed the cryptocurrency addresses and QR codes.  Each card still
printed the name passed to the tool ("SLIP39 First(1/1) for: Alice", on the front and
on the back), the requirements of all of the groups ("Recover w/ 2 of 4: First(1),
Second(1), Fam(2/4), Frens(3/6)", which tells whoever holds a single card the names,
thresholds and sizes of the other groups), and a diagonal group label.

With --anonymous, the title of a card is now just its group name, and none of the above
is printed; the mnemonic words remain the large ones.  Cards without --anonymous are
unchanged.

The `anonymous` argument defaults to ANONYMOUS (False) instead of None, which removes
the repeated `ANONYMOUS if anonymous is None else anonymous`.

Add tests of the texts rendered on the cards, with and without --anonymous.

See pjkundert#11.
Print the title of a card as "SLIP39 Fam 2 for Alice", instead of "SLIP39 Fam(2/4) for:
Alice": the number of the card within its group, only if the group has several cards,
and the name only if there is one.  This avoids printing the size of the group (and a
trailing "for: " with no name), and repeats less of what the "Recover w/ ..." line and
the mnemonics already show.

Only changes the title of cards that are not anonymous.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant