feat: verify the Tari payout address checksum host-side, both forms - #882
Merged
Conversation
The Monero half of this gate shipped earlier: a well-shaped but checksum-invalid address is rejected before anything launches. The Tari payout address still had no equivalent — one mistyped character sailed through, and the first honest verdict came from the Tari node at merge-mine time, or never visibly at all. tari_address_type mirrors tari's own from_bytes: Bitcoin base58 (network and features bytes each encoded alone, then the rest) or the 256-emoji alphabet, then length (35 single / 67..323 dual with payment id), the 1-byte DammSum checksum, the mainnet network byte, and the feature bits. The algorithm, layouts, alphabet, and every test vector come from the tari repository's own source and test suite; the alphabet was extracted programmatically, never transcribed. A checksum-valid address for a Tari testnet gets its own verdict and message. No usable python3 degrades to "unchecked" — accepted, never a false reject. One gate, all surfaces: parse_and_validate_config (setup/apply, the wizard spool, the control runner all route through it), an inline retry in the interactive wizard, and a doctor verdict. Suite fixtures that used placeholder Tari addresses now use the reference-blessed vector. Verified additionally against the bench appliance's live payout-proven mainnet address (accepted; one flipped character fails as checksum) — the address itself stays out of the repo. Closes #845 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #845
What broke
The Monero half of this gate shipped in #846;
tari.wallet_addressstill had no equivalent. A well-formed Tari address with one mistyped character sailed through setup, the wizard, and the control channel — and the first honest verdict came from the Tari node at merge-mine time, or never visibly at all. Merge-mine rewards silently lost.The fix — one gate, all surfaces (the #846 pattern)
tari_address_typeverifies the address the way the Tari node does: both forms (base58 with the network and features bytes each encoded alone, then the rest; the 256-emoji alphabet), both layouts (35-byte single, 67-byte dual plus up to 256 payment-id bytes), the 1-byte DammSum checksum, the mainnet network byte, and the feature bits — mirroringfrom_bytesin tari's own source. A checksum-valid address for a Tari testnet gets its own verdict and message (a real address from the wrong wallet is not "invalid", it's the wrong network). No usable python3 degrades tounchecked— accepted, the pre-gate behaviour, never a false reject.Every config path already routes through
parse_and_validate_config, so one implementation covers setup/apply, the appliance wizard spool, and the dashboard control runner. The interactive wizard additionally gets the same inline retry the Monero question has, anddoctorgets the verdict.Provenance — nothing invented
tari-project/tarisource (dammsum.rs, tari_address/mod.rs, dual_address.rs, single_address.rs, network.rs).unchecked.)checksum). The address itself stays out of the repo.Tests (stack suite, owning tier)
11 new
tari_address_typeunit assertions covering every verdict, plusapply-abort tests for the checksum and wrong-network cases. Suite fixtures that used placeholder Tari addresses ("T",TARITARI…, wizard answers) now use the reference-blessed vectors — the same swap #846 made for the Monero dummies. Full suite: 2130 passed, 0 failed;make testgreen end-to-end;make lintgreen. Patch coverage is vacuous by construction (bash — the stack suite owns it).Adversarially verified in a fresh context: DammSum mask cross-checked (a wrong mask fails the reference vectors), fail-open path exercised with python3 removed, gate ordering (whitespace → placeholder → checksum) confirmed, no remaining placeholder fixtures on parse paths.
🤖 Generated with Claude Code