Fix/ltc and doge check paypro - #4225
Open
MichaelAJay wants to merge 15 commits into
Open
Conversation
leolambo
reviewed
Aug 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens Verifier.checkPaypro in bitcore-wallet-client so PayPro verification fails closed for all supported multisig/UTXO chains (BTC, BCH, DOGE, LTC) by validating the full, order-independent output set (destination + atomic amount) against PayPro instructions, using chain-specific address canonicalization.
Changes:
- Canonicalize and compare PayPro instructions vs proposal outputs for BTC/BCH/DOGE/LTC, including output count and totals, rejecting malformed/unsupported inputs without throwing.
- Add detailed warning logs on PayPro verification failures (including TXP id when available).
- Add extensive unit and boundary tests covering matching, substitution attacks, address equivalence forms, malformed inputs, and multi-output ordering/duplication.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/bitcore-wallet-client/src/lib/verifier.ts | Expands PayPro verification to DOGE/LTC and to full output-set matching with chain-specific address parsing and stricter validation. |
| packages/bitcore-wallet-client/test/verifier.test.ts | Adds comprehensive PayPro verification and checkTxProposal boundary regression coverage across chains and edge cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…tc-and-doge-check-paypro
…ed output calldata - prior tests GREEN
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.
Description
Fixes IS-1413.
Verifier.checkPaypropreviously verified destination addresses only for BTC and BCH. LTC and DOGE PayPro proposals could therefore substitute a different destination while preserving the invoiced amount and still pass co-signer verification.This change makes PayPro verification fail closed for all supported multisig/UTXO chains: BTC, BCH, DOGE, and LTC. It compares the complete, order-independent set of transaction outputs against the PayPro instructions, including both destination and amount.
Addresses are parsed and canonicalized with each chain’s own bitcore library. This preserves equivalent address representations while ensuring malformed addresses cannot pass merely because their raw strings match.
Changelog
3...and modernM...P2SH representations.Testing Notes
Verified from
packages/bitcore-wallet-client, with a local MongoDB instancealready running and reachable at
localhost:27017(Docker containermongodb, imagemongo:7.0, running since 2026-07-13 — not started for thischange, just already part of the local dev environment):
npm run compile— passed, no errors.../../node_modules/.bin/mocha ts_build/test/verifier.test.js --grep 'checkPaypro|checkTxProposal'— 47 passing, 0 failing.npm run lint— passed, no errors.git diff --check— passed, no whitespace errors.npm test(full package suite, including the MongoDB-backed integration tests) — 589 passing, 12 pending, 0 failing, exit code 0. Coverage: Statements 75.29%, Branches 62.03%, Functions 72.58%, Lines 76.99%; all thresholds met, no database-related failures.The focused coverage includes:
3...and modernM...P2SH equivalence.Verifier.checkTxProposal.For manual verification:
SERVER_COMPROMISED.Checklist