Skip to content

feat(utxo-core): PayGo Attestation util functions #6155

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

davidkaplanbitgo
Copy link
Contributor

TICKET: BTC-2047

Copy link
Contributor Author

@davidkaplanbitgo davidkaplanbitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start!

Copy link
Contributor Author

@davidkaplanbitgo davidkaplanbitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@christopher-fong christopher-fong changed the title chore: WIP paygo util functions feat(utxo-lib): PayGo Attestation util functions Jun 5, 2025
@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch from 77feb80 to 9f4929b Compare June 6, 2025 19:01
@christopher-fong christopher-fong changed the title feat(utxo-lib): PayGo Attestation util functions feat(utxo-core): PayGo Attestation util functions Jun 11, 2025
@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch 3 times, most recently from da229ae to 914a1aa Compare June 11, 2025 19:23
@christopher-fong christopher-fong marked this pull request as ready for review June 13, 2025 15:44
@christopher-fong christopher-fong requested a review from a team as a code owner June 13, 2025 15:44
@OttoAllmendinger OttoAllmendinger requested a review from Copilot June 13, 2025 16:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds PayGo attestation support for PSBTs and updates Zcash address assertions.

  • Replace assert(...) with assert.ok(...) for Zcash address functions
  • Introduce PAYGO_ADDRESS_ATTESTATION_PROOF subtype and implement PayGo PSBT utilities and tests
  • Export new PSBT utilities and add bitcoinjs-message dependency

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/utxo-lib/src/bitgo/zcash/address.ts Switched to assert.ok(isZcash(network)) for outputScript/address validation
modules/utxo-lib/src/bitgo/PsbtUtil.ts Added PAYGO_ADDRESS_ATTESTATION_PROOF = 0x04 to ProprietaryKeySubtype
modules/utxo-core/src/paygo/psbt/PayGoUtils.ts Implemented addPaygoAddressProof, verifyPaygoAddressProof, index lookup, and inclusion check
modules/utxo-core/test/paygo/psbt/PayGoUtils.ts Added unit tests covering PayGo attestation proof addition, verification, and error cases
modules/utxo-core/src/paygo/index.ts Exported PSBT utilities
modules/utxo-core/package.json Added bitcoinjs-message dependency
Comments suppressed due to low confidence (3)

modules/utxo-core/src/paygo/psbt/PayGoUtils.ts:36

  • [nitpick] Update the JSDoc for verifyPaygoAddressProof to match the actual signature: swap @param pub and @param message, and rename pub to attestationPubKey to align with the code.
@param pub - The public key that we want to verify the proof with

modules/utxo-core/test/paygo/psbt/PayGoUtils.ts:70

  • [nitpick] Add a test case where the PSBT contains a mismatched public key to ensure verifyPaygoAddressProof throws the expected 'The public key in the PSBT does not match the provided public key.' error.
it("should fail a proof verification if the proof isn't valid", () => {

modules/utxo-core/test/paygo/psbt/PayGoUtils.ts:117

  • [nitpick] The describe title uses 'getPaygoAddressProofIndex' but the function is named getPaygoAddressProofOutputIndex. Update the test title for clarity and consistency.
describe('getPaygoAddressProofIndex', () => {

@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch from ba75327 to a520165 Compare June 18, 2025 18:38
@davidkaplanbitgo davidkaplanbitgo marked this pull request as draft June 18, 2025 20:24
TICKET: BTC-2047

chore: wip adding tests for paygo address proof util functions

TICKET: BTC-2047

chore: added testing and functions to get proprietary key vals from output

TICKET: BTC-2047

chore: wip added functions and tests

TICKET: BTC-2047
…her pr

TICKET: BTC-2047

chore: determined msg to sign and verify

Issue: BTC-2047

TICKET: BTC-2047

chore(utxo-lib): modified verify function and tests

Issue: BTC-2047

TICKET: BTC-2047

chore(utxo-core): moved util functions to uxto-core

TICKET: BTC-2047

chore: got tests to work

BTC-2047

TICKET: BTC-2047

feat(utxo-core): cleaned up comments

TICKET: BTC-2047

chore(utxo-core): added bitcoinjs-message to deps and fixed import

TICKET: BTC-2047

chore(utxo-core): used new helper functions for prop kv func and removed old

TICKET: BTC-2047
@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch from 54cced0 to 9232556 Compare June 19, 2025 00:42
@christopher-fong christopher-fong marked this pull request as ready for review June 19, 2025 01:24
@christopher-fong christopher-fong marked this pull request as draft June 20, 2025 06:28
TICKET: BTC-2047

chore(utxo-core): renamed functions consistent and error prototypes

TICKET: BTC-2047

chore(utxo-core): bip32utils to sign and verify message

TICKET: BTC-2047

chore(utxo-core): added bitcoinjs-message back to package.json

TICKET: BTC-2047

chore(utxo-core): refactored functions and debug tests

TICKET: BTC-2047

chore(utxo-core): update verify function

TICKET: BTC-2047

chore(utxo-core): updated test and verify

TICKET: BTC-2047

chore(utxo-core): clean up rebase conflicts

TICKET: BTC-2047

chore(utxo-core): added helper function to create attestation

TICKET: BTC-2047
@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch from 4670b45 to e933da1 Compare June 20, 2025 06:54
TICKET: BTC-2047

chore(utxo-core): updated index.ts

TICKET: BTC-2047
@christopher-fong christopher-fong force-pushed the BTC-2047.adding-paygoinfo branch from e706219 to a5a81f9 Compare June 20, 2025 13:33
@christopher-fong christopher-fong marked this pull request as ready for review June 20, 2025 14:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants